Documentation ¶
Index ¶
- type ChainSegmentInsertionResult
- type ForkGraph
- func (f *ForkGraph) AddChainSegment(signedBlock *cltypes.SignedBeaconBlock) (ChainSegmentInsertionResult, error)
- func (f *ForkGraph) Config() *clparams.BeaconChainConfig
- func (f *ForkGraph) GenesisTime() uint64
- func (f *ForkGraph) GetChildren(parent libcommon.Hash) []libcommon.Hash
- func (f *ForkGraph) GetCurrentJustifiedCheckpoint(blockRoot libcommon.Hash) (*cltypes.Checkpoint, bool)
- func (f *ForkGraph) GetFinalizedCheckpoint(blockRoot libcommon.Hash) (*cltypes.Checkpoint, bool)
- func (f *ForkGraph) GetHeader(blockRoot libcommon.Hash) (*cltypes.BeaconBlockHeader, bool)
- func (f *ForkGraph) GetState(blockRoot libcommon.Hash) (*state.BeaconState, error)
- func (f *ForkGraph) LastState() *state.BeaconState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainSegmentInsertionResult ¶
type ChainSegmentInsertionResult uint
const ( Success ChainSegmentInsertionResult = 0 InvalidBlock ChainSegmentInsertionResult = 1 MissingSegment ChainSegmentInsertionResult = 2 BelowAnchor ChainSegmentInsertionResult = 3 LogisticError ChainSegmentInsertionResult = 4 PreValidated ChainSegmentInsertionResult = 5 )
type ForkGraph ¶
type ForkGraph struct {
// contains filtered or unexported fields
}
ForkGraph is our graph for ETH 2.0 consensus forkchoice. Each node is a (block root, changes) pair and each edge is the path described as (prevBlockRoot, currBlockRoot). if we want to go forward we use blocks.
func New ¶
func New(anchorState *state.BeaconState) *ForkGraph
Initialize fork graph with a new state
func (*ForkGraph) AddChainSegment ¶
func (f *ForkGraph) AddChainSegment(signedBlock *cltypes.SignedBeaconBlock) (ChainSegmentInsertionResult, error)
Add a new node and edge to the graph
func (*ForkGraph) Config ¶
func (f *ForkGraph) Config() *clparams.BeaconChainConfig
func (*ForkGraph) GenesisTime ¶
func (*ForkGraph) GetChildren ¶
GetChildren retrieves the children block root of the given block root.
func (*ForkGraph) GetCurrentJustifiedCheckpoint ¶
func (*ForkGraph) GetFinalizedCheckpoint ¶
func (*ForkGraph) LastState ¶
func (f *ForkGraph) LastState() *state.BeaconState
LastState returns the last state.
Click to show internal directories.
Click to hide internal directories.