Documentation ¶
Index ¶
- type ForkChoiceTestDef
- type ForkChoiceTestInit
- type ForkChoiceTestTarget
- type OpCanonAtSlot
- type OpCanonicalChain
- type OpClosestToSlot
- type OpFindHead
- type OpGetSlot
- type OpHead
- type OpIsAncestor
- type OpProcessAttestation
- type OpProcessBlock
- type OpProcessSlot
- type OpPruneable
- type OpUpdateJustified
- type Operation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ForkChoiceTestDef ¶
type ForkChoiceTestDef struct { Init ForkChoiceTestInit Operations []Operation }
func LighthouseTestDef ¶
func LighthouseTestDef() *ForkChoiceTestDef
func (*ForkChoiceTestDef) Run ¶
func (fd *ForkChoiceTestDef) Run(prepare func(init *ForkChoiceTestInit, ft *ForkChoiceTestTarget) (forkchoice.Forkchoice, error)) error
type ForkChoiceTestInit ¶
type ForkChoiceTestInit struct { Spec *common.Spec Finalized forkchoice.Checkpoint Justified forkchoice.Checkpoint AnchorRoot forkchoice.Root AnchorSlot forkchoice.Slot AnchorParent forkchoice.Root Balances []forkchoice.Gwei }
type ForkChoiceTestTarget ¶
type ForkChoiceTestTarget struct { // node -> canonical. Presence = pruneable node. // Test should fail if a node is pruned that is not in here. Pruneable map[forkchoice.NodeRef]bool }
type OpCanonAtSlot ¶
type OpCanonAtSlot struct { Anchor forkchoice.Root Slot forkchoice.Slot WithBlock bool At forkchoice.NodeRef Ok bool }
func (*OpCanonAtSlot) Apply ¶
func (op *OpCanonAtSlot) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpCanonicalChain ¶
type OpCanonicalChain struct { AnchorRoot forkchoice.Root AnchorSlot forkchoice.Slot // TODO: simplify to []Root ? Expected []forkchoice.ExtendedNodeRef Ok bool }
func (*OpCanonicalChain) Apply ¶
func (op *OpCanonicalChain) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpClosestToSlot ¶
type OpClosestToSlot struct { Anchor forkchoice.Root Slot forkchoice.Slot Closest forkchoice.NodeRef Ok bool }
func (*OpClosestToSlot) Apply ¶
func (op *OpClosestToSlot) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpFindHead ¶
type OpFindHead struct { AnchorRoot forkchoice.Root AnchorSlot forkchoice.Slot ExpectedHead forkchoice.NodeRef Ok bool }
func (*OpFindHead) Apply ¶
func (op *OpFindHead) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpGetSlot ¶
type OpGetSlot struct { BlockRoot forkchoice.Root Slot forkchoice.Slot Ok bool }
func (*OpGetSlot) Apply ¶
func (op *OpGetSlot) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpHead ¶
type OpHead struct { ExpectedHead forkchoice.NodeRef Ok bool }
func (*OpHead) Apply ¶
func (op *OpHead) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpIsAncestor ¶
type OpIsAncestor struct { Anchor forkchoice.Root Root forkchoice.Root Unknown bool InSubtree bool }
func (*OpIsAncestor) Apply ¶
func (op *OpIsAncestor) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpProcessAttestation ¶
type OpProcessAttestation struct { ValidatorIndex forkchoice.ValidatorIndex BlockRoot forkchoice.Root HeadSlot forkchoice.Slot CanAdd bool }
func (*OpProcessAttestation) Apply ¶
func (op *OpProcessAttestation) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpProcessBlock ¶
type OpProcessBlock struct { Parent forkchoice.Root BlockRoot forkchoice.Root BlockSlot forkchoice.Slot JustifiedEpoch forkchoice.Epoch FinalizedEpoch forkchoice.Epoch }
func (*OpProcessBlock) Apply ¶
func (op *OpProcessBlock) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpProcessSlot ¶
type OpProcessSlot struct { Parent forkchoice.Root Slot forkchoice.Slot JustifiedEpoch forkchoice.Epoch FinalizedEpoch forkchoice.Epoch }
func (*OpProcessSlot) Apply ¶
func (op *OpProcessSlot) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpPruneable ¶
type OpPruneable struct { Pruneable forkchoice.NodeRef Canonical bool }
func (*OpPruneable) Apply ¶
func (op *OpPruneable) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type OpUpdateJustified ¶
type OpUpdateJustified struct { Trigger forkchoice.Root Justified forkchoice.Checkpoint Finalized forkchoice.Checkpoint JustifiedStateBalances func() ([]forkchoice.Gwei, error) Ok bool }
func (*OpUpdateJustified) Apply ¶
func (op *OpUpdateJustified) Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
type Operation ¶
type Operation interface {
Apply(ft *ForkChoiceTestTarget, fc forkchoice.Forkchoice) error
}
Click to show internal directories.
Click to hide internal directories.