Documentation ¶
Index ¶
- Variables
- func AppendValidatorsToGenesisBlock(genesis *core.Genesis, validators []istanbul.ValidatorData)
- func DecryptFn(key *ecdsa.PrivateKey) istanbul.DecryptFn
- func New(config *istanbul.Config, db ethdb.Database) consensus.Istanbul
- func SignBLSFn(key *ecdsa.PrivateKey) istanbul.BLSSignerFn
- func SignFn(key *ecdsa.PrivateKey) istanbul.SignerFn
- func SignHashFn(key *ecdsa.PrivateKey) istanbul.HashSignerFn
- type API
- func (api *API) AddProxy(url, externalUrl string) (bool, error)
- func (api *API) ForceRoundChange() (bool, error)
- func (api *API) GetCurrentReplicaState() (*replica.ReplicaStateSummary, error)
- func (api *API) GetCurrentRoundChangeSet() (*core.RoundChangeSetSummary, error)
- func (api *API) GetCurrentRoundState() (*core.RoundStateSummary, error)
- func (api *API) GetLookbackWindow(number *rpc.BlockNumber) (uint64, error)
- func (api *API) GetProposer(sequence *rpc.BlockNumber, round *uint64) (common.Address, error)
- func (api *API) GetProxiedValidators() ([]*proxy.ProxiedValidatorInfo, error)
- func (api *API) GetProxiesInfo() ([]*proxy.ProxyInfo, error)
- func (api *API) GetSnapshot(number *rpc.BlockNumber) (*Snapshot, error)
- func (api *API) GetValEnodeTable() (map[string]*announce.ValEnodeEntryInfo, error)
- func (api *API) GetValidators(number *rpc.BlockNumber) ([]common.Address, error)
- func (api *API) GetValidatorsBLSPublicKeys(number *rpc.BlockNumber) ([]blscrypto.SerializedPublicKey, error)
- func (api *API) GetVersionCertificateTableInfo() (map[string]*announce.VersionCertificateEntryInfo, error)
- func (api *API) GossipCommits() error
- func (api *API) GossipPrepares() error
- func (api *API) IsValidating() bool
- func (api *API) RemoveProxy(url string) (bool, error)
- func (api *API) ResendPreprepare() error
- func (api *API) StartValidating() error
- func (api *API) StartValidatingAtBlock(blockNumber int64) error
- func (api *API) StopValidating() error
- func (api *API) StopValidatingAtBlock(blockNumber int64) error
- type Backend
- func (sb *Backend) APIs(chain consensus.ChainHeaderReader) []rpc.API
- func (sb *Backend) AddPeer(node *enode.Node, purpose p2p.PurposeFlag)
- func (sb *Backend) AddProxy(node, externalNode *enode.Node) error
- func (sb *Backend) Address() common.Address
- func (sb *Backend) Author(header *types.Header) (common.Address, error)
- func (sb *Backend) AuthorForBlock(number uint64) common.Address
- func (sb *Backend) Authorize(ecdsaAddress, blsAddress common.Address, publicKey *ecdsa.PublicKey, ...)
- func (sb *Backend) ChainConfig() *params.ChainConfig
- func (sb *Backend) CheckSignature(data []byte, address common.Address, sig []byte) error
- func (sb *Backend) Close() error
- func (sb *Backend) Commit(proposal istanbul.Proposal, aggregatedSeal types.IstanbulAggregatedSeal, ...) error
- func (sb *Backend) EpochSize() uint64
- func (sb *Backend) EventMux() *event.TypeMux
- func (sb *Backend) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, ...)
- func (sb *Backend) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, ...) (*types.Block, error)
- func (sb *Backend) GenerateRandomness(parentHash common.Hash) (common.Hash, common.Hash, error)
- func (sb *Backend) GetAnnounceVersion() uint
- func (sb *Backend) GetCurrentHeadBlock() istanbul.Proposal
- func (sb *Backend) GetCurrentHeadBlockAndAuthor() (istanbul.Proposal, common.Address)
- func (sb *Backend) GetProxiedValidatorEngine() proxy.ProxiedValidatorEngine
- func (sb *Backend) GetProxyEngine() proxy.ProxyEngine
- func (sb *Backend) GetValEnodeTableEntries(valAddresses []common.Address) (map[common.Address]*istanbul.AddressEntry, error)
- func (sb *Backend) GetValidators(blockNumber *big.Int, headerHash common.Hash) []istanbul.Validator
- func (sb *Backend) Gossip(payload []byte, ethMsgCode uint64) error
- func (sb *Backend) HandleMsg(addr common.Address, msg p2p.Msg, peer consensus.Peer) (bool, error)
- func (sb *Backend) Handshake(peer consensus.Peer) (bool, error)
- func (sb *Backend) HasBlock(hash common.Hash, number *big.Int) bool
- func (sb *Backend) HashForBlock(number uint64) common.Hash
- func (sb *Backend) IsLastBlockOfEpoch(header *types.Header) bool
- func (sb *Backend) IsPrimary() bool
- func (sb *Backend) IsPrimaryForSeq(seq *big.Int) bool
- func (sb *Backend) IsProxiedValidator() bool
- func (sb *Backend) IsProxy() bool
- func (sb *Backend) IsValidating() bool
- func (sb *Backend) IsValidator() bool
- func (sb *Backend) LastSubject() (istanbul.Subject, error)
- func (sb *Backend) LookbackWindow(header *types.Header, state *state.StateDB) uint64
- func (sb *Backend) MakePrimary() error
- func (sb *Backend) MakeReplica() error
- func (sb *Backend) Multicast(destAddresses []common.Address, payload []byte, ethMsgCode uint64, ...) error
- func (sb *Backend) NewWork() error
- func (sb *Backend) NextBlockValidators(proposal istanbul.Proposal) (istanbul.ValidatorSet, error)
- func (sb *Backend) OnBlockInsertion(header *types.Header, state *state.StateDB) error
- func (sb *Backend) ParentBlockValidators(proposal istanbul.Proposal) istanbul.ValidatorSet
- func (sb *Backend) Prepare(chain consensus.ChainHeaderReader, header *types.Header) error
- func (sb *Backend) RefreshValPeers() error
- func (sb *Backend) RegisterPeer(peer consensus.Peer, isProxiedPeer bool) error
- func (sb *Backend) RemovePeer(node *enode.Node, purpose p2p.PurposeFlag)
- func (sb *Backend) RemoveProxy(node *enode.Node) error
- func (sb *Backend) RetrieveEnodeCertificateMsgMap() map[enode.ID]*istanbul.EnodeCertMsg
- func (sb *Backend) RetrieveValidatorConnSet() (map[common.Address]bool, error)
- func (sb *Backend) RewriteValEnodeTableEntries(entries map[common.Address]*istanbul.AddressEntry) error
- func (sb *Backend) Seal(chain consensus.ChainHeaderReader, block *types.Block) error
- func (sb *Backend) SelfNode() *enode.Node
- func (sb *Backend) SendDelegateSignMsgToProxiedValidator(msg []byte) error
- func (sb *Backend) SendDelegateSignMsgToProxy(msg []byte, peerID enode.ID) error
- func (sb *Backend) SetBroadcaster(broadcaster consensus.Broadcaster)
- func (sb *Backend) SetCallBacks(hasBadBlock func(common.Hash) bool, ...) error
- func (sb *Backend) SetChain(chain consensus.ChainContext, currentBlock func() *types.Block, ...)
- func (sb *Backend) SetEnodeCertificateMsgMap(enodeCertMsgMap map[enode.ID]*istanbul.EnodeCertMsg) error
- func (sb *Backend) SetP2PServer(p2pserver consensus.P2PServer)
- func (sb *Backend) SetStartValidatingBlock(blockNumber *big.Int) error
- func (sb *Backend) SetStopValidatingBlock(blockNumber *big.Int) error
- func (sb *Backend) Sign(data []byte) ([]byte, error)
- func (sb *Backend) SignBLS(data []byte, extra []byte, useComposite, cip22 bool) (blscrypto.SerializedSignature, error)
- func (sb *Backend) StartAnnouncing() error
- func (sb *Backend) StartProxiedValidatorEngine() error
- func (sb *Backend) StartValidating() error
- func (sb *Backend) StopAnnouncing() error
- func (sb *Backend) StopProxiedValidatorEngine() error
- func (sb *Backend) StopValidating() error
- func (sb *Backend) SubscribeNewDelegateSignEvent(ch chan<- istanbul.MessageWithPeerIDEvent) event.Subscription
- func (sb *Backend) Unicast(peer consensus.Peer, payload []byte, ethMsgCode uint64)
- func (sb *Backend) UnregisterPeer(peer consensus.Peer, isProxiedPeer bool)
- func (sb *Backend) UpdateAnnounceVersion()
- func (sb *Backend) UpdateMetricsForParentOfBlock(child *types.Block)
- func (sb *Backend) UpdateReplicaState(seq *big.Int)
- func (sb *Backend) UpdateValSetDiff(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB) error
- func (sb *Backend) ValidatorAddress() common.Address
- func (sb *Backend) Validators(proposal istanbul.Proposal) istanbul.ValidatorSet
- func (sb *Backend) Verify(proposal istanbul.Proposal) (*istanbulCore.StateProcessResult, time.Duration, error)
- func (sb *Backend) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header, seal bool) error
- func (sb *Backend) VerifyHeaders(chain consensus.ChainHeaderReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
- func (sb *Backend) VerifyPendingBlockValidatorSignature(data []byte, sig []byte) (common.Address, error)
- func (sb *Backend) VerifySeal(header *types.Header) error
- func (sb *Backend) VerifyValidatorConnectionSetSignature(data []byte, sig []byte) (common.Address, error)
- type Keys
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
var TestBackendFactory backendtest.TestBackendFactory = testBackendFactoryImpl{}
TestBackendFactory can be passed to backendtest.InitTestBackendFactory
Functions ¶
func AppendValidatorsToGenesisBlock ¶
func AppendValidatorsToGenesisBlock(genesis *core.Genesis, validators []istanbul.ValidatorData)
func SignBLSFn ¶
func SignBLSFn(key *ecdsa.PrivateKey) istanbul.BLSSignerFn
func SignHashFn ¶
func SignHashFn(key *ecdsa.PrivateKey) istanbul.HashSignerFn
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is a user facing RPC API to dump Istanbul state
func (*API) AddProxy ¶
AddProxy peers with a remote node that acts as a proxy, even if slots are full
func (*API) ForceRoundChange ¶
func (*API) GetCurrentReplicaState ¶
func (api *API) GetCurrentReplicaState() (*replica.ReplicaStateSummary, error)
GetCurrentReplicaState retrieves the current replica state
func (*API) GetCurrentRoundChangeSet ¶ added in v1.6.0
func (api *API) GetCurrentRoundChangeSet() (*core.RoundChangeSetSummary, error)
GetCurrentRoundChangeSet retrieves the current round change set
func (*API) GetCurrentRoundState ¶
func (api *API) GetCurrentRoundState() (*core.RoundStateSummary, error)
GetCurrentRoundState retrieves the current IBFT RoundState
func (*API) GetLookbackWindow ¶
func (api *API) GetLookbackWindow(number *rpc.BlockNumber) (uint64, error)
GetLookbackWindow retrieves the current replica state
func (*API) GetProposer ¶
GetProposer retrieves the proposer for a given block number (i.e. sequence) and round.
func (*API) GetProxiedValidators ¶
func (api *API) GetProxiedValidators() ([]*proxy.ProxiedValidatorInfo, error)
ProxiedValidators retrieves all of the proxies connected proxied validators. Note that we plan to support validators per proxy in the future, so this function is plural and returns an array of proxied validators. This is to prevent future backwards compatibility issues.
func (*API) GetProxiesInfo ¶
GetProxiesInfo retrieves all the proxied validator's proxies' info
func (*API) GetSnapshot ¶
func (api *API) GetSnapshot(number *rpc.BlockNumber) (*Snapshot, error)
GetSnapshot retrieves the state snapshot at a given block.
func (*API) GetValEnodeTable ¶
func (api *API) GetValEnodeTable() (map[string]*announce.ValEnodeEntryInfo, error)
Retrieve the Validator Enode Table
func (*API) GetValidators ¶
GetValidators retrieves the list validators that must sign a given block.
func (*API) GetValidatorsBLSPublicKeys ¶
func (api *API) GetValidatorsBLSPublicKeys(number *rpc.BlockNumber) ([]blscrypto.SerializedPublicKey, error)
GetValidatorsBLSPublicKeys retrieves the list of validators BLS public keys that must sign a given block.
func (*API) GetVersionCertificateTableInfo ¶
func (api *API) GetVersionCertificateTableInfo() (map[string]*announce.VersionCertificateEntryInfo, error)
func (*API) GossipCommits ¶ added in v1.6.0
GossipCommits gossips the commit messages
func (*API) GossipPrepares ¶ added in v1.6.0
GossipPrepares gossips the prepare messages
func (*API) IsValidating ¶
IsValidating returns true if this node is participating in the consensus protocol
func (*API) RemoveProxy ¶
RemoveProxy removes a node from acting as a proxy
func (*API) ResendPreprepare ¶ added in v1.6.0
ResendPreprepare sends again the preprepare message
func (*API) StartValidating ¶
StartValidating starts the consensus engine
func (*API) StartValidatingAtBlock ¶
StartValidatingAtBlock starts the consensus engine on the given block number.
func (*API) StopValidating ¶
StopValidating stops the consensus engine from participating in consensus
func (*API) StopValidatingAtBlock ¶
StopValidatingAtBlock stops the consensus engine from participating in consensus on the given block number.
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
func (*Backend) APIs ¶
func (sb *Backend) APIs(chain consensus.ChainHeaderReader) []rpc.API
APIs returns the RPC APIs this consensus engine provides.
func (*Backend) Author ¶
Author retrieves the Ethereum address of the account that minted the given block, which may be different from the header's coinbase if a consensus engine is based on signatures.
func (*Backend) AuthorForBlock ¶
AuthorForBlock returns the address of the block offer from a given number.
func (*Backend) Authorize ¶
func (sb *Backend) Authorize(ecdsaAddress, blsAddress common.Address, publicKey *ecdsa.PublicKey, decryptFn istanbul.DecryptFn, signFn istanbul.SignerFn, signBLSFn istanbul.BLSSignerFn, signHashFn istanbul.HashSignerFn)
Authorize implements istanbul.Backend.Authorize
func (*Backend) ChainConfig ¶
func (sb *Backend) ChainConfig() *params.ChainConfig
ChainConfig returns the configuration from the embedded blockchain reader.
func (*Backend) CheckSignature ¶
CheckSignature implements istanbul.Backend.CheckSignature
func (*Backend) Commit ¶
func (sb *Backend) Commit(proposal istanbul.Proposal, aggregatedSeal types.IstanbulAggregatedSeal, aggregatedEpochValidatorSetSeal types.IstanbulEpochValidatorSetSeal, result *istanbulCore.StateProcessResult) error
Commit implements istanbul.Backend.Commit
func (*Backend) Finalize ¶
func (sb *Backend) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction)
Finalize runs any post-transaction state modifications (e.g. block rewards) but does not assemble the block.
Note: The block header and state database might be updated to reflect any consensus rules that happen at finalization (e.g. block rewards).
func (*Backend) FinalizeAndAssemble ¶
func (sb *Backend) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, receipts []*types.Receipt, randomness *types.Randomness) (*types.Block, error)
FinalizeAndAssemble runs any post-transaction state modifications (e.g. block rewards) and assembles the final block.
Note: The block header and state database might be updated to reflect any consensus rules that happen at finalization (e.g. block rewards).
func (*Backend) GenerateRandomness ¶
GenerateRandomness will generate the random beacon randomness
func (*Backend) GetAnnounceVersion ¶
GetAnnounceVersion will retrieve the current announce version.
func (*Backend) GetCurrentHeadBlock ¶
GetCurrentHeadBlock retrieves the last block
func (*Backend) GetCurrentHeadBlockAndAuthor ¶
GetCurrentHeadBlockAndAuthor retrieves the last block alongside the coinbase address for it
func (*Backend) GetProxiedValidatorEngine ¶
func (sb *Backend) GetProxiedValidatorEngine() proxy.ProxiedValidatorEngine
GetProxiedValidatorEngine returns the proxied validator engine object
func (*Backend) GetProxyEngine ¶
func (sb *Backend) GetProxyEngine() proxy.ProxyEngine
GetProxyEngine returns the proxy engine object
func (*Backend) GetValEnodeTableEntries ¶
func (*Backend) GetValidators ¶
func (*Backend) Gossip ¶
Gossip implements istanbul.Backend.Gossip Gossip will gossip the eth message to all connected peers
func (*Backend) HashForBlock ¶
HashForBlock returns the block hash from the canonical chain for the given number.
func (*Backend) IsLastBlockOfEpoch ¶
IsLastBlockOfEpoch returns whether or not a particular header represents the last block in the epoch.
func (*Backend) IsProxiedValidator ¶
IsProxiedValidator returns true if instance has proxied validator flag
func (*Backend) IsValidating ¶
IsValidating return true if instance is validating
func (*Backend) IsValidator ¶
IsValidator return if instance is a validator (either proxied or standalone)
func (*Backend) LookbackWindow ¶
LookbackWindow returns the size of the lookback window for calculating uptime (in blocks) Value is constant during an epoch
func (*Backend) MakePrimary ¶
MakePrimary clears the start/stop state & makes this node participate in consensus
func (*Backend) MakeReplica ¶
MakeReplica clears the start/stop state & stops this node from participating in consensus
func (*Backend) Multicast ¶
func (sb *Backend) Multicast(destAddresses []common.Address, payload []byte, ethMsgCode uint64, sendToSelf bool) error
Multicast implements istanbul.Backend.Multicast Multicast will send the eth message (with the message's payload and msgCode field set to the params payload and ethMsgCode respectively) to the nodes with the signing address in the destAddresses param. If this node is proxied and destAddresses is not nil, the message will be wrapped in an istanbul.ForwardMessage to ensure the proxy sends it to the correct destAddresses.
func (*Backend) NewWork ¶
NewWork is called by miner/worker.go whenever it's mainLoop gets a newWork event.
func (*Backend) NextBlockValidators ¶
func (*Backend) OnBlockInsertion ¶ added in v1.6.0
func (*Backend) ParentBlockValidators ¶
func (sb *Backend) ParentBlockValidators(proposal istanbul.Proposal) istanbul.ValidatorSet
ParentBlockValidators implements istanbul.Backend.ParentBlockValidators
func (*Backend) Prepare ¶
Prepare initializes the consensus fields of a block header according to the rules of a particular engine. The changes are executed inline. The parent seal is not included when the node is not validating.
func (*Backend) RefreshValPeers ¶
RefreshValPeers will create 'validator' type peers to all the valset validators, and disconnect from the peers that are not part of the valset. It will also disconnect all validator connections if this node is not a validator. Note that adding and removing validators are idempotent operations. If the validator being added or removed is already added or removed, then a no-op will be done.
func (*Backend) RegisterPeer ¶
func (*Backend) RemovePeer ¶
func (sb *Backend) RemovePeer(node *enode.Node, purpose p2p.PurposeFlag)
func (*Backend) RetrieveEnodeCertificateMsgMap ¶
func (sb *Backend) RetrieveEnodeCertificateMsgMap() map[enode.ID]*istanbul.EnodeCertMsg
RetrieveEnodeCertificateMsgMap gets the most recent enode certificate messages. May be nil if no message was generated as a result of the core not being started, or if a proxy has not received a message from its proxied validator
func (*Backend) RetrieveValidatorConnSet ¶
RetrieveValidatorConnSet returns the cached validator conn set if the cache is younger than 20 blocks, younger than 1 minute, or if an epoch transition didn't occur since the last cached entry. In the event of a cache miss, this may block for a couple seconds while retrieving the uncached set.
func (*Backend) RewriteValEnodeTableEntries ¶
func (*Backend) Seal ¶
Seal generates a new block for the given input block with the local miner's seal place on top and submits it the the consensus engine.
func (*Backend) SelfNode ¶
SelfNode returns the owner's node (if this is a proxy, it will return the external node)
func (*Backend) SendDelegateSignMsgToProxiedValidator ¶
SendDelegateSignMsgToProxiedValidator sends an istanbulDelegateSign message to a proxied validator if one exists
func (*Backend) SendDelegateSignMsgToProxy ¶
SendDelegateSignMsgToProxy sends an istanbulDelegateSign message to a proxy if one exists
func (*Backend) SetBroadcaster ¶
func (sb *Backend) SetBroadcaster(broadcaster consensus.Broadcaster)
SetBroadcaster implements consensus.Handler.SetBroadcaster
func (*Backend) SetCallBacks ¶ added in v1.4.0
func (sb *Backend) SetCallBacks(hasBadBlock func(common.Hash) bool, processBlock func(*types.Block, *state.StateDB) (types.Receipts, []*types.Log, uint64, error), validateState func(*types.Block, *state.StateDB, types.Receipts, uint64) error, onNewConsensusBlock func(block *types.Block, receipts []*types.Receipt, logs []*types.Log, state *state.StateDB)) error
SetCallBacks implements consensus.Istanbul.SetCallBacks
func (*Backend) SetEnodeCertificateMsgMap ¶
func (sb *Backend) SetEnodeCertificateMsgMap(enodeCertMsgMap map[enode.ID]*istanbul.EnodeCertMsg) error
SetEnodeCertificateMsgMap will verify the given enode certificate message map, then update it on this struct.
func (*Backend) SetP2PServer ¶
SetP2PServer implements consensus.Handler.SetP2PServer
func (*Backend) SetStartValidatingBlock ¶
SetStartValidatingBlock sets block that the validator will start validating on (inclusive)
func (*Backend) SetStopValidatingBlock ¶
SetStopValidatingBlock sets the block that the validator will stop just before (exclusive range)
func (*Backend) SignBLS ¶
func (sb *Backend) SignBLS(data []byte, extra []byte, useComposite, cip22 bool) (blscrypto.SerializedSignature, error)
Sign implements istanbul.Backend.SignBLS
func (*Backend) StartAnnouncing ¶
StartAnnouncing implements consensus.Istanbul.StartAnnouncing
func (*Backend) StartProxiedValidatorEngine ¶
StartProxiedValidatorEngine implements consensus.Istanbul.StartProxiedValidatorEngine
func (*Backend) StartValidating ¶
StartValidating implements consensus.Istanbul.StartValidating
func (*Backend) StopAnnouncing ¶
StopAnnouncing implements consensus.Istanbul.StopAnnouncing
func (*Backend) StopProxiedValidatorEngine ¶
StopProxiedValidatorEngine implements consensus.Istanbul.StopProxiedValidatorEngine
func (*Backend) StopValidating ¶
StopValidating implements consensus.Istanbul.StopValidating
func (*Backend) SubscribeNewDelegateSignEvent ¶
func (sb *Backend) SubscribeNewDelegateSignEvent(ch chan<- istanbul.MessageWithPeerIDEvent) event.Subscription
SubscribeNewDelegateSignEvent subscribes a channel to any new delegate sign messages
func (*Backend) UnregisterPeer ¶
func (*Backend) UpdateAnnounceVersion ¶
func (sb *Backend) UpdateAnnounceVersion()
UpdateAnnounceVersion will asynchronously update the announce version.
func (*Backend) UpdateMetricsForParentOfBlock ¶
UpdateMetricsForParentOfBlock maintains metrics around the *parent* of the supplied block. To figure out if this validator signed the parent block: * First check the grandparent's validator set. If not elected, it didn't. * Then, check the parent seal on the supplied (child) block. We cannot determine any specific info from the validators in the seal of the parent block, because different nodes circulate different versions. The bitmap of signed validators only becomes canonical when the child block is proposed.
func (*Backend) UpdateReplicaState ¶
UpdateReplicaState updates the replica state with the latest seq.
func (*Backend) UpdateValSetDiff ¶
func (sb *Backend) UpdateValSetDiff(chain consensus.ChainHeaderReader, header *types.Header, state *state.StateDB) error
UpdateValSetDiff will update the validator set diff in the header, if the mined header is the last block of the epoch
func (*Backend) ValidatorAddress ¶
func (*Backend) Validators ¶
func (sb *Backend) Validators(proposal istanbul.Proposal) istanbul.ValidatorSet
Validators implements istanbul.Backend.Validators
func (*Backend) Verify ¶
func (sb *Backend) Verify(proposal istanbul.Proposal) (*istanbulCore.StateProcessResult, time.Duration, error)
Verify implements istanbul.Backend.Verify
func (*Backend) VerifyHeader ¶
func (sb *Backend) VerifyHeader(chain consensus.ChainHeaderReader, header *types.Header, seal bool) error
VerifyHeader checks whether a header conforms to the consensus rules of a given engine. Verifies the seal regardless of given "seal" argument.
func (*Backend) VerifyHeaders ¶
func (sb *Backend) VerifyHeaders(chain consensus.ChainHeaderReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)
VerifyHeaders is similar to VerifyHeader, but verifies a batch of headers concurrently. The method returns a quit channel to abort the operations and a results channel to retrieve the async verifications (the order is that of the input slice).
func (*Backend) VerifyPendingBlockValidatorSignature ¶
func (sb *Backend) VerifyPendingBlockValidatorSignature(data []byte, sig []byte) (common.Address, error)
VerifyPendingBlockValidatorSignature will verify that the message sender is a validator that is responsible for the current pending block (the next block right after the head block).
func (*Backend) VerifySeal ¶
VerifySeal checks whether the crypto seal on a header is valid according to the consensus rules of the given engine.
func (*Backend) VerifyValidatorConnectionSetSignature ¶
func (sb *Backend) VerifyValidatorConnectionSetSignature(data []byte, sig []byte) (common.Address, error)
VerifyValidatorConnectionSetSignature will verify that the message sender is a validator that is responsible for the current pending block (the next block right after the head block).
type Keys ¶
type Keys []*ecdsa.PrivateKey
type Snapshot ¶
type Snapshot struct { Epoch uint64 // The number of blocks for each epoch Number uint64 // Block number where the snapshot was created Hash common.Hash // Block hash where the snapshot was created ValSet istanbul.ValidatorSet // Set of authorized validators at this moment }
Snapshot is the state of the authorization voting at a given point in time.
func (*Snapshot) MarshalJSON ¶
MarshalJSON to a json byte array
func (*Snapshot) UnmarshalJSON ¶
UnmarshalJSON from a json byte array