Module zksync_consensus_roles::validator
source · Expand description
Validator role implementation.
Modules§
- Test-only utilities.
Structs§
- An aggregate signature from a validator.
- A block header.
- Sequential number of the block.
- Ethereum CHAIN_ID
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md
- A Commit Quorum Certificate. It is an aggregate of signed replica Commit messages. The Quorum Certificate is supposed to be over identical messages, so we only need one message.
- A struct that represents a set of validators. It is used to store the current validator set. We represent each validator by its validator public key.
- A block that has been finalized by the consensus protocol.
- Number of the fork. Newer fork has higher number.
- Genesis with cached hash.
- Hash of the genesis specification.
- Genesis of the blockchain, unique for each blockchain instance.
- A Commit message from a leader.
- A Prepare message from a leader.
- Hash of a message.
- A message broadcasted by a validator over the gossip network announcing its own TCP address. See
schema/proto/roles/validator.proto
. The NetAddress message with highest (version,timestamp) is considered to be the newest (compared lexicographically). - Payload of the block. Consensus algorithm does not interpret the payload (except for imposing a size limit for the payload). Proposing a payload for a new block and interpreting the payload of the finalized blocks should be implemented for the specific application of the consensus algorithm.
- Hash of the Payload.
- A quorum certificate of replica Prepare messages. Since not all Prepare messages are identical (they have different high blocks and high QCs), we need to keep the high blocks and high QCs in a map. We can still aggregate the signatures though.
- Version of the consensus algorithm that the validator is using. It allows to prevent misinterpretation of messages signed by validators using different versions of the binaries.
- A public key for a validator.
- A Commit message from a replica.
- A Prepare message from a replica.
- A secret key for the validator role. SecretKey is put into an Arc, so that we can clone it, without copying the secret all over the RAM.
- A signature from a validator.
- Strongly typed signed message. WARNING: signature is not guaranteed to be valid.
- Struct that represents a bit map of validators. We use it to compactly store which validators signed a given message.
- View specification.
- A struct that represents a view number.
- Validator representation inside a Committee.
Enums§
- Errors that can occur validating a
FinalBlock
received from a node. - Error returned by
CommitQC::add()
. - Error returned by
CommitQc::verify()
. - Consensus messages.
- Error returned by
LeaderPrepare::verify()
. - The mode used for selecting leader for a given view.
- Generic message type for a validator.
- An enum that represents the current phase of the consensus.
- Error returned by
PrepareQC::add()
. - Error returned by
PrepareQC::verify()
. - Error returned by
ReplicaCommit::verify()
. - Error returned by
ReplicaPrepare::verify()
.
Functions§
- Calculate the maximum allowed weight for faulty replicas, for a given total weight.
- Calculate the consensus threshold, the minimum votes’ weight for any consensus action to be valid, for a given committee total weight.
Type Aliases§
- Voting weight;