rawdb_consensus

package
v0.0.0-...-7ece11e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAllShardFinalityProof

func DeleteAllShardFinalityProof(db incdb.Database, shardID byte) error

func DeleteBlackListValidator

func DeleteBlackListValidator(db incdb.KeyValueWriter, validator string) error

func DeleteProposeHistory

func DeleteProposeHistory(db incdb.Database, chainID int, currentTimeSlot int64) error

func DeleteReceiveBlockByHash

func DeleteReceiveBlockByHash(db incdb.Database, chainID int, blockHash string) error

func DeleteShardFinalityProof

func DeleteShardFinalityProof(db incdb.Database, shardID byte, hash common.Hash) error

func DeleteVoteHistory

func DeleteVoteHistory(db incdb.Database, chainID int, height uint64) error

func DeleteVotesByHash

func DeleteVotesByHash(db incdb.Database, hash string) error

func GetAllBlackListValidator

func GetAllBlackListValidator(db incdb.Database) (map[string]*BlackListValidator, error)

func GetAllProposeHistory

func GetAllProposeHistory(db incdb.Database, chainID int) (map[int64]struct{}, error)

func GetAllReceiveBlockByHash

func GetAllReceiveBlockByHash(db incdb.Database, chainID int) (map[string][]byte, error)

func GetAllVoteHistory

func GetAllVoteHistory(db incdb.Database, chainID int) (map[uint64][]byte, error)

func GetByzantineBlackListKey

func GetByzantineBlackListKey(validator string) []byte

func GetByzantineBlackListPrefix

func GetByzantineBlackListPrefix() []byte

func GetConsensusDatabase

func GetConsensusDatabase() incdb.Database

func GetProposeHistoryByKey

func GetProposeHistoryByKey(db incdb.Database, chainID int, currentTimeSlot int64) (interface{}, error)

func GetProposeHistoryKey

func GetProposeHistoryKey(chainID int, timeSlot uint64) []byte

func GetProposeHistoryPrefix

func GetProposeHistoryPrefix(chainID int) []byte

func GetReceiveBlockByHashKey

func GetReceiveBlockByHashKey(chainID int, blockHash string) []byte

func GetReceiveBlockByHashPrefix

func GetReceiveBlockByHashPrefix(chainID int) []byte

func GetShardFinalityProof

func GetShardFinalityProof(db incdb.KeyValueReader, shardID byte, hash common.Hash) (map[string]interface{}, error)

func GetShardFinalityProofKey

func GetShardFinalityProofKey(shardID byte, hash common.Hash) []byte

func GetShardFinalityProofPrefix

func GetShardFinalityProofPrefix(shardID byte) []byte

func GetVoteByBlockHashPrefixKey

func GetVoteByBlockHashPrefixKey(hash string) []byte

func GetVoteHistory

func GetVoteHistory(db incdb.Database, chainID int, height uint64) (interface{}, error)

func GetVoteHistoryKey

func GetVoteHistoryKey(chainID int, height uint64) []byte

func GetVoteHistoryPrefix

func GetVoteHistoryPrefix(chainID int) []byte

func GetVotesByBlockHash

func GetVotesByBlockHash(db incdb.Database, hash string) (map[string][]byte, error)

func SetConsensusDatabase

func SetConsensusDatabase(db incdb.Database)

func StoreBlackListValidator

func StoreBlackListValidator(db incdb.KeyValueWriter, validator string, blackListValidator *BlackListValidator) error

func StoreProposeHistory

func StoreProposeHistory(db incdb.Database, chainID int, currentTimeSlot int64) error

func StoreReceiveBlockByHash

func StoreReceiveBlockByHash(db incdb.Database, chainID int, blockHash string, value []byte) error

func StoreShardFinalityProof

func StoreShardFinalityProof(
	db incdb.KeyValueWriter,
	shardID byte,
	hash common.Hash,
	previousBlockHash common.Hash,
	finalityProof interface{},
	reProposeSig interface{},
	rootHash common.Hash,
	producer string,
	produceTime int64,
	proposer string,
	proposeTime int64,
) error

func StoreVoteByBlockHash

func StoreVoteByBlockHash(db incdb.Database, hash string, validator string, vote []byte) error

func StoreVoteHistory

func StoreVoteHistory(db incdb.Database, chainID int, height uint64, value []byte) error

Types

type BlackListValidator

type BlackListValidator struct {
	Error     string
	StartTime time.Time
	TTL       time.Duration
}

func GetBlackListValidator

func GetBlackListValidator(db incdb.KeyValueReader, validator string) (bool, *BlackListValidator, error)

func NewBlackListValidator

func NewBlackListValidator() *BlackListValidator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL