validatorsync

package
v0.0.0-...-1b15b10 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: LGPL-3.0 Imports: 16 Imported by: 0

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

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 HeaderByNumberGetter interface {
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
}

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 (db *ValidatorsStore) GetAPKForBlock(block *big.Int, chainID uint8, epochSize uint64) ([]byte, error)

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

Directories

Path Synopsis
Package mock_validatorsync is a generated GoMock package.
Package mock_validatorsync is a generated GoMock package.

Jump to

Keyboard shortcuts

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