Versions in this module Expand all Collapse all v0 v0.4.0 Mar 25, 2024 v0.3.0 Feb 28, 2024 Changes in this version + var ErrCommitFailed = errors.New("commit failed") + var VoteKey = []byte("vote") + func QcFromGenesisState(partitionRecords []*genesis.GenesisPartitionRecord) *drctypes.QuorumCert + func ReadLastTC(db keyvaluedb.KeyValueDB) (*abtypes.TimeoutCert, error) + func ReadVote(db keyvaluedb.KeyValueDB) (any, error) + func ToRecoveryInputData(data []*InputData) []*abdrc.InputData + func UnicityCertificatesFromGenesis(pg []*genesis.GenesisPartitionRecord) map[types.SystemID]*types.UnicityCertificate + func WriteLastTC(db keyvaluedb.KeyValueDB, tc *abtypes.TimeoutCert) error + func WriteVote(db keyvaluedb.KeyValueDB, vote any) error + type BlockStore struct + func New(hash gocrypto.Hash, pg []*genesis.GenesisPartitionRecord, ...) (block *BlockStore, err error) + func NewFromState(hash gocrypto.Hash, stateMsg *abdrc.StateMsg, db keyvaluedb.KeyValueDB) (*BlockStore, error) + func (x *BlockStore) Add(block *drctypes.BlockData, verifier IRChangeReqVerifier) ([]byte, error) + func (x *BlockStore) Block(round uint64) (*ExecutedBlock, error) + func (x *BlockStore) GetCertificate(id types.SystemID) (*types.UnicityCertificate, error) + func (x *BlockStore) GetCertificates() map[types.SystemID]*types.UnicityCertificate + func (x *BlockStore) GetDB() keyvaluedb.KeyValueDB + func (x *BlockStore) GetHighQc() *drctypes.QuorumCert + func (x *BlockStore) GetLastTC() (*drctypes.TimeoutCert, error) + func (x *BlockStore) GetState() *abdrc.StateMsg + func (x *BlockStore) IsChangeInProgress(sysId types.SystemID) *types.InputRecord + func (x *BlockStore) ProcessQc(qc *drctypes.QuorumCert) (map[types.SystemID]*types.UnicityCertificate, error) + func (x *BlockStore) ProcessTc(tc *drctypes.TimeoutCert) (rErr error) + func (x *BlockStore) ReadLastVote() (any, error) + func (x *BlockStore) StoreLastVote(vote any) error + type BlockTree struct + func NewBlockTree(bDB keyvaluedb.KeyValueDB) (*BlockTree, error) + func NewBlockTreeFromRecovery(block *ExecutedBlock, bDB keyvaluedb.KeyValueDB) (*BlockTree, error) + func (bt *BlockTree) Add(block *ExecutedBlock) error + func (bt *BlockTree) Commit(commitQc *abdrc.QuorumCert) (execBlock *ExecutedBlock, err error) + func (bt *BlockTree) FindBlock(round uint64) (*ExecutedBlock, error) + func (bt *BlockTree) FindPathToRoot(round uint64) []*ExecutedBlock + func (bt *BlockTree) GetAllUncommittedNodes() []*ExecutedBlock + func (bt *BlockTree) HighQc() *abdrc.QuorumCert + func (bt *BlockTree) InsertQc(qc *abdrc.QuorumCert) error + func (bt *BlockTree) RemoveLeaf(round uint64) error + func (bt *BlockTree) Root() *ExecutedBlock + type ExecutedBlock struct + BlockData *drctypes.BlockData + Changed SysIDList + CommitQc *drctypes.QuorumCert + CurrentIR InputRecords + HashAlgo gocrypto.Hash + Qc *drctypes.QuorumCert + RootHash []byte + func NewExecutedBlock(hash gocrypto.Hash, newBlock *drctypes.BlockData, parent *ExecutedBlock, ...) (*ExecutedBlock, error) + func NewGenesisBlock(hash gocrypto.Hash, pg []*genesis.GenesisPartitionRecord) *ExecutedBlock + func NewRootBlock(hash gocrypto.Hash, block *abdrc.CommittedBlock) (*ExecutedBlock, error) + func (x *ExecutedBlock) GenerateCertificates(commitQc *drctypes.QuorumCert) (map[types.SystemID]*types.UnicityCertificate, error) + func (x *ExecutedBlock) GetParentRound() uint64 + func (x *ExecutedBlock) GetRound() uint64 + type IRChangeReqVerifier interface + VerifyIRChangeReq func(round uint64, irChReq *drctypes.IRChangeReq) (*InputData, error) + type InputData struct + IR *types.InputRecord + Sdrh []byte + SysID types.SystemID + type InputRecords []*InputData + func (data InputRecords) Find(sysID types.SystemID) *InputData + func (data InputRecords) Update(newInputData *InputData) error + type SysIDList []types.SystemID + type VoteStore struct + VoteMsg cbor.RawMessage + VoteType VoteType + type VoteType uint8 + const TimeoutVoteMsg + const Unknown + const VoteMsg