Documentation ¶
Overview ¶
Package forkchoice implements the service to support fork choice for the eth2 beacon chain. This contains the necessary components to track latest validators votes, and balances. Then a store object to be used to calculate head. High level fork choice summary: https://notes.ethereum.org/@vbuterin/rkhCgQteN?type=view#LMD-GHOST-fork-choice-rule
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttestationProcessor ¶
type AttestationProcessor interface {
ProcessAttestation(context.Context, []uint64, [32]byte, types.Epoch)
}
AttestationProcessor processes the attestation that's used for accounting fork choice.
type BlockProcessor ¶
type BlockProcessor interface {
ProcessBlock(context.Context, types.Slot, [32]byte, [32]byte, [32]byte, types.Epoch, types.Epoch) error
}
BlockProcessor processes the block that's used for accounting fork choice.
type ForkChoicer ¶
type ForkChoicer interface { HeadRetriever // to compute head. BlockProcessor // to track new block for fork choice. AttestationProcessor // to track new attestation for fork choice. Pruner // to clean old data for fork choice. Getter // to retrieve fork choice information. }
ForkChoicer represents the full fork choice interface composed of all of the sub-interfaces.
type Getter ¶
type Getter interface { Nodes() []*protoarray.Node Node([32]byte) *protoarray.Node HasNode([32]byte) bool Store() *protoarray.Store HasParent(root [32]byte) bool AncestorRoot(ctx context.Context, root [32]byte, slot types.Slot) ([]byte, error) IsCanonical(root [32]byte) bool }
Getter returns fork choice related information.
Directories ¶
Path | Synopsis |
---|---|
Package protoarray implements proto array fork choice as outlined: https://github.com/protolambda/lmd-ghost#array-based-stateful-dag-proto_array This was motivated by the the original implementation by Sigma Prime here: https://github.com/sigp/lighthouse/pull/804
|
Package protoarray implements proto array fork choice as outlined: https://github.com/protolambda/lmd-ghost#array-based-stateful-dag-proto_array This was motivated by the the original implementation by Sigma Prime here: https://github.com/sigp/lighthouse/pull/804 |