machine

package
v3.0.0-alpha5.0...-c974331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package machine is the interface for eth2 state transition

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessBlock

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL