whitelist

package
v0.0.0-...-11d2657 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//Metrics for collecting the number of invalid chains received
	CheckpointChainMeter = metrics.NewRegisteredMeter("chain/checkpoint/isvalidchain", nil)

	//Metrics for collecting the number of valid peers received
	CheckpointPeerMeter = metrics.NewRegisteredMeter("chain/checkpoint/isvalidpeer", nil)
)
View Source
var (

	//Metrics for collecting the future milestone number
	FutureMilestoneMeter = metrics.NewRegisteredGauge("chain/milestone/future", nil)

	//Metrics for collecting the length of the MilestoneIds map
	MilestoneIdsLengthMeter = metrics.NewRegisteredGauge("chain/milestone/idslength", nil)

	//Metrics for collecting the number of valid chains received
	MilestoneChainMeter = metrics.NewRegisteredMeter("chain/milestone/isvalidchain", nil)

	//Metrics for collecting the number of valid peers received
	MilestonePeerMeter = metrics.NewRegisteredMeter("chain/milestone/isvalidpeer", nil)
)
View Source
var (
	ErrMismatch = errors.New("mismatch error")
	ErrNoRemote = errors.New("remote peer doesn't have a target block number")

	ErrCheckpointMismatch = errors.New("checkpoint mismatch")
	ErrLongFutureChain    = errors.New("received future chain of unacceptable length")
	ErrNoRemoteCheckpoint = errors.New("remote peer doesn't have a checkpoint")
)

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(db ethdb.Database) *Service

func (*Service) GetMilestoneIDsList

func (s *Service) GetMilestoneIDsList() []string

func (*Service) GetWhitelistedCheckpoint

func (s *Service) GetWhitelistedCheckpoint() (bool, uint64, common.Hash)

func (*Service) GetWhitelistedMilestone

func (s *Service) GetWhitelistedMilestone() (bool, uint64, common.Hash)

func (*Service) IsValidChain

func (s *Service) IsValidChain(currentHeader *types.Header, chain []*types.Header) (bool, error)

func (*Service) IsValidPeer

func (s *Service) IsValidPeer(fetchHeadersByNumber func(number uint64, amount int, skip int, reverse bool) ([]*types.Header, []common.Hash, error)) (bool, error)

IsValidPeer checks if the chain we're about to receive from a peer is valid or not in terms of reorgs. We won't reorg beyond the last bor checkpoint submitted to mainchain and last milestone voted in the heimdall

func (*Service) ProcessCheckpoint

func (s *Service) ProcessCheckpoint(endBlockNum uint64, endBlockHash common.Hash)

func (*Service) ProcessMilestone

func (s *Service) ProcessMilestone(endBlockNum uint64, endBlockHash common.Hash)

func (*Service) PurgeWhitelistedCheckpoint

func (s *Service) PurgeWhitelistedCheckpoint()

func (*Service) PurgeWhitelistedMilestone

func (s *Service) PurgeWhitelistedMilestone()

Jump to

Keyboard shortcuts

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