Documentation ¶
Overview ¶
Copyright 2020 ChainSafe Systems SPDX-License-Identifier: LGPL-3.0-only
Copyright 2020 ChainSafe Systems SPDX-License-Identifier: LGPL-3.0-only
Copyright 2020 ChainSafe Systems SPDX-License-Identifier: LGPL-3.0-only
Index ¶
- Variables
- func SyncBlockValidators(stopChn <-chan struct{}, errChn chan error, c HeaderByNumberGetter, ...)
- type HeaderByNumberGetter
- type ValidatorsStore
- func (db *ValidatorsStore) Close() error
- func (db *ValidatorsStore) GetAPKForBlock(block *big.Int, chainID uint8, epochSize uint64) ([]byte, error)
- func (db *ValidatorsStore) GetLatestKnownEpochLastBlock(chainID uint8) (*big.Int, error)
- func (db *ValidatorsStore) GetValidatorsForBlock(block *big.Int, chainID uint8) ([]*istanbul.ValidatorData, error)
- func (db *ValidatorsStore) SetValidatorsForBlock(block *big.Int, validators []*istanbul.ValidatorData, chainID uint8) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoBlockInStore = errors.New("no corresponding validators for provided block number")
View Source
var (
ErrorWrongInitialValidators = errors.New("wrong initial validators")
)
Functions ¶
func SyncBlockValidators ¶
func SyncBlockValidators(stopChn <-chan struct{}, errChn chan error, c HeaderByNumberGetter, db *ValidatorsStore, chainID uint8, epochSize uint64)
Types ¶
type HeaderByNumberGetter ¶
type ValidatorsStore ¶
type ValidatorsStore struct {
// contains filtered or unexported fields
}
func NewValidatorsStore ¶
func NewValidatorsStore(db *leveldb.DB) *ValidatorsStore
func (*ValidatorsStore) Close ¶
func (db *ValidatorsStore) Close() error
Closes connection to underlying DB backend
func (*ValidatorsStore) GetAPKForBlock ¶
func (*ValidatorsStore) GetLatestKnownEpochLastBlock ¶
func (db *ValidatorsStore) GetLatestKnownEpochLastBlock(chainID uint8) (*big.Int, error)
GetLatestKnownBlock returns block number of latest parsed EpochLastBlock for provided chainID. If DB is empty returns 0. Should always be last block in epoch.
func (*ValidatorsStore) GetValidatorsForBlock ¶
func (db *ValidatorsStore) GetValidatorsForBlock(block *big.Int, chainID uint8) ([]*istanbul.ValidatorData, error)
func (*ValidatorsStore) SetValidatorsForBlock ¶
func (db *ValidatorsStore) SetValidatorsForBlock(block *big.Int, validators []*istanbul.ValidatorData, chainID uint8) error
Atomically sets block and validators as related KV to underlying DB backend
Click to show internal directories.
Click to hide internal directories.