4 "github.com/bytom/bytom/protocol/bc"
5 "github.com/bytom/bytom/protocol/bc/types"
6 "github.com/bytom/bytom/protocol/state"
9 // Casper is BFT based proof of stack consensus algorithm, it provides safety and liveness in theory
10 type CasperConsensus interface {
12 // Best chain return the chain containing the justified checkpoint of the largest height
13 BestChain() (uint64, bc.Hash)
15 // LastFinalized return the block height and block hash which is finalized ast last
16 LastFinalized() (uint64, bc.Hash)
18 // AuthVerification verify whether the Verification is legal.
19 AuthVerification(v *Verification) error
21 // ApplyBlock apply block to the consensus module
22 ApplyBlock(block *types.Block) (*Verification, error)
24 // Validators return the validators by specified block hash
25 Validators(blockHash *bc.Hash) ([]*state.Validator, error)