Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStateNotFound = errors.New("state not found")
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 )
func (ChainSegmentInsertionResult) String ¶
func (r ChainSegmentInsertionResult) String() string
type ForkGraph ¶
type ForkGraph interface { AddChainSegment(signedBlock *cltypes.SignedBeaconBlock, fullValidation bool) (*state.CachingBeaconState, ChainSegmentInsertionResult, error) GetHeader(blockRoot libcommon.Hash) (*cltypes.BeaconBlockHeader, bool) GetState(blockRoot libcommon.Hash, alwaysCopy bool) (*state.CachingBeaconState, error) GetCurrentJustifiedCheckpoint(blockRoot libcommon.Hash) (solid.Checkpoint, bool) GetFinalizedCheckpoint(blockRoot libcommon.Hash) (solid.Checkpoint, bool) GetSyncCommittees(period uint64) (*solid.SyncCommittee, *solid.SyncCommittee, bool) MarkHeaderAsInvalid(blockRoot libcommon.Hash) AnchorSlot() uint64 Prune(uint64) error GetBlockRewards(blockRoot libcommon.Hash) (*eth2.BlockRewardsCollector, bool) LowestAvailableSlot() uint64 GetLightClientBootstrap(blockRoot libcommon.Hash) (*cltypes.LightClientBootstrap, bool) NewestLightClientUpdate() *cltypes.LightClientUpdate GetLightClientUpdate(period uint64) (*cltypes.LightClientUpdate, bool) GetBalances(blockRoot libcommon.Hash) (solid.Uint64ListSSZ, error) GetInactivitiesScores(blockRoot libcommon.Hash) (solid.Uint64ListSSZ, error) GetPreviousParticipationIndicies(blockRoot libcommon.Hash) (*solid.ParticipationBitList, error) GetValidatorSet(blockRoot libcommon.Hash) (*solid.ValidatorSet, error) GetCurrentParticipationIndicies(blockRoot libcommon.Hash) (*solid.ParticipationBitList, error) DumpBeaconStateOnDisk(blockRoot libcommon.Hash, state *state.CachingBeaconState, forced bool) error }
* The state store process is related to graph theory in the sense that the Ethereum blockchain can be thought of as a directed graph, * where each block represents a node and the links between blocks represent directed edges. * In this context, rolling back the state of Ethereum to a previous state can be thought of as traversing the graph in reverse, * from the current state to a previous state. * The process of reverting the state involves undoing the changes made in the blocks that have been added to the blockchain since the previous state. * This can be thought of as "reversing the edges" in the graph, effectively undoing the changes made to the state of Ethereum. * By thinking of the Ethereum blockchain as a graph, we can use graph theory concepts, such as traversal algorithms, * to analyze and manipulate the state of the blockchain.
func NewForkGraphDisk ¶
func NewForkGraphDisk(anchorState *state.CachingBeaconState, aferoFs afero.Fs, rcfg beacon_router_configuration.RouterConfiguration, emitter *beaconevents.EventEmitter) ForkGraph
Initialize fork graph with a new state