Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Replica ¶
type Replica interface {
Init()
Sync(commit block.Commit) bool
Transition(transition state.Transition)
}
func New ¶
func New(dispatcher Dispatcher, signer sig.SignerVerifier, stateMachine state.Machine, transitionBuffer state.TransitionBuffer, shard, previousShard shard.Shard) Replica
type Validator ¶
type Validator interface {
// ValidatePropose validates a state.Propose and returns true if
// the block is valid.
// For a SignedBlock to be valid:
// 1. must not be nil
// 2. have valid blockTime, Round, and Height
// 3. have a valid signature
// 4. signatory belongs to the same shard
// 5. parent header maps to the block at head of the shard's blockchain
ValidatePropose(propose block.SignedPropose) bool
ValidatePreVote(preVote block.SignedPreVote) bool
// ValidatePolka validates a polka and its signatures and returns true if
// the polka is valid.
// For a Polka to be valid:
// 1. must not be nil
// 2. have a non-negative Round and Height
// 3. all the signatures inside the polka must be valid and
// belong to signatories within the same shard
// 4. have a valid block (if block is not nil)
//
// validatePolka assumes that `polka.Signatures` are ordered to match
// the order of `polka.Signatories`.
ValidatePolka(polka block.Polka) bool
ValidatePreCommit(preCommit block.SignedPreCommit) bool
ValidateCommit(commit block.Commit) bool
}
Validator is responsible for handling validation of blocks.
Click to show internal directories.
Click to hide internal directories.