Documentation ¶
Index ¶
- Variables
- type Service
- func (s *Service) GetMilestoneIDsList() []string
- func (s *Service) GetWhitelistedCheckpoint() (bool, uint64, common.Hash)
- func (s *Service) GetWhitelistedMilestone() (bool, uint64, common.Hash)
- func (s *Service) IsValidChain(currentHeader *types.Header, chain []*types.Header) (bool, error)
- func (s *Service) IsValidPeer(...) (bool, error)
- func (s *Service) ProcessCheckpoint(endBlockNum uint64, endBlockHash common.Hash)
- func (s *Service) ProcessMilestone(endBlockNum uint64, endBlockHash common.Hash)
- func (s *Service) PurgeWhitelistedCheckpoint()
- func (s *Service) PurgeWhitelistedMilestone()
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 (*Service) GetMilestoneIDsList ¶
func (*Service) GetWhitelistedCheckpoint ¶
func (*Service) GetWhitelistedMilestone ¶
func (*Service) IsValidChain ¶
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 (*Service) ProcessMilestone ¶
func (*Service) PurgeWhitelistedCheckpoint ¶
func (s *Service) PurgeWhitelistedCheckpoint()
func (*Service) PurgeWhitelistedMilestone ¶
func (s *Service) PurgeWhitelistedMilestone()
Click to show internal directories.
Click to hide internal directories.