Documentation ¶
Index ¶
- Variables
- type Service
- func (w *Service) GetCheckpointWhitelist() map[uint64]common.Hash
- func (w *Service) IsValidChain(currentHeader *types.Header, chain []*types.Header) (bool, error)
- func (w *Service) IsValidPeer(remoteHeader *types.Header, ...) (bool, error)
- func (w *Service) ProcessCheckpoint(endBlockNum uint64, endBlockHash common.Hash)
- func (w *Service) PurgeCheckpointWhitelist()
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Checkpoint whitelist
func NewService ¶
func (*Service) GetCheckpointWhitelist ¶
GetCheckpointWhitelist returns the existing whitelisted entries of checkpoint of the form block number -> block hash.
func (*Service) IsValidChain ¶
IsValidChain checks the validity of chain by comparing it against the local checkpoint entries
func (*Service) IsValidPeer ¶
func (w *Service) IsValidPeer(remoteHeader *types.Header, 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.
func (*Service) ProcessCheckpoint ¶
func (*Service) PurgeCheckpointWhitelist ¶
func (w *Service) PurgeCheckpointWhitelist()
PurgeCheckpointWhitelist purges data from checkpoint whitelist map
Click to show internal directories.
Click to hide internal directories.