Documentation ¶
Overview ¶
Package machine is the interface for eth2 state transition
Index ¶
- func ProcessBlock(impl BlockProcessor, s abstract.BeaconState, block cltypes.GenericBeaconBlock) error
- func ProcessOperations(impl BlockOperationProcessor, s abstract.BeaconState, ...) (signatures [][]byte, messages [][]byte, publicKeys [][]byte, err error)
- func TransitionState(impl Interface, s abstract.BeaconState, block *cltypes.SignedBeaconBlock) error
- type BlockHeaderProcessor
- type BlockOperationProcessor
- type BlockProcessor
- type BlockValidator
- type Interface
- type SlotProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessBlock ¶
func ProcessBlock(impl BlockProcessor, s abstract.BeaconState, block cltypes.GenericBeaconBlock) error
ProcessBlock processes a block with the block processor
func ProcessOperations ¶
func ProcessOperations(impl BlockOperationProcessor, s abstract.BeaconState, blockBody cltypes.GenericBeaconBody) (signatures [][]byte, messages [][]byte, publicKeys [][]byte, err error)
ProcessOperations is called by ProcessBlock and prcesses the block body operations
func TransitionState ¶
func TransitionState(impl Interface, s abstract.BeaconState, block *cltypes.SignedBeaconBlock) error
TransitionState will call impl..ProcessSlots, then impl.VerifyBlockSignature, then ProcessBlock, then impl.VerifyTransition
Types ¶
type BlockHeaderProcessor ¶
type BlockHeaderProcessor interface { ProcessBlockHeader(s abstract.BeaconState, slot, proposerIndex uint64, parentRoot common.Hash, bodyRoot [32]byte) error ProcessWithdrawals(s abstract.BeaconState, withdrawals *solid.ListSSZ[*cltypes.Withdrawal]) error ProcessExecutionPayload(s abstract.BeaconState, parentHash, prevRandao common.Hash, time uint64, payloadHeader *cltypes.Eth1Header) error ProcessRandao(s abstract.BeaconState, randao [96]byte, proposerIndex uint64) error ProcessEth1Data(state abstract.BeaconState, eth1Data *cltypes.Eth1Data) error ProcessSyncAggregate(s abstract.BeaconState, sync *cltypes.SyncAggregate) error }
type BlockOperationProcessor ¶
type BlockOperationProcessor interface { ProcessProposerSlashing(s abstract.BeaconState, propSlashing *cltypes.ProposerSlashing) error ProcessAttesterSlashing(s abstract.BeaconState, attSlashing *cltypes.AttesterSlashing) error ProcessAttestations(s abstract.BeaconState, attestations *solid.ListSSZ[*solid.Attestation]) error ProcessDeposit(s abstract.BeaconState, deposit *cltypes.Deposit) error ProcessVoluntaryExit(s abstract.BeaconState, signedVoluntaryExit *cltypes.SignedVoluntaryExit) error ProcessBlsToExecutionChange(state abstract.BeaconState, signedChange *cltypes.SignedBLSToExecutionChange) error FullValidate() bool }
type BlockProcessor ¶
type BlockProcessor interface { BlockHeaderProcessor BlockOperationProcessor }
type BlockValidator ¶
type BlockValidator interface { VerifyBlockSignature(s abstract.BeaconState, block *cltypes.SignedBeaconBlock) error VerifyTransition(s abstract.BeaconState, block *cltypes.BeaconBlock) error }
type Interface ¶
type Interface interface { BlockValidator BlockProcessor SlotProcessor }
type SlotProcessor ¶
type SlotProcessor interface {
ProcessSlots(s abstract.BeaconState, slot uint64) error
}
Click to show internal directories.
Click to hide internal directories.