Documentation ¶
Index ¶
- Constants
- func ComputeExecutionPayloadFieldRootsCapella(executionPayloadFields *capella.ExecutionPayload) ([]phase0.Root, error)
- func ComputeExecutionPayloadFieldRootsDeneb(executionPayloadFields *deneb.ExecutionPayload) ([]phase0.Root, error)
- func ComputeValidatorTreeLeaves(validators []*phase0.Validator) ([]phase0.Root, error)
- func CreateVersionedSignedBlock(block interface{}) (spec.VersionedSignedBeaconBlock, error)
- func CreateVersionedState(state interface{}) (spec.VersionedBeaconState, error)
- func GetBalanceRoots(balances []phase0.Gwei) ([]phase0.Root, error)
- func GetBlockHeaderFieldRoots(blockHeader *phase0.BeaconBlockHeader) ([]phase0.Root, error)
- func GetBlockRoots(beaconState spec.VersionedBeaconState) ([]phase0.Root, error)
- func GetExecutionPayloadFieldRootsCapella(executionPayloadFields *capella.ExecutionPayload) ([]phase0.Root, error)
- func GetGenesisTime(state *spec.VersionedBeaconState) (uint64, error)
- func GetHistoricalSummaries(state *spec.VersionedBeaconState) ([]*capella.HistoricalSummary, error)
- func MarshalSSZVersionedBeaconState(beaconState spec.VersionedBeaconState) ([]byte, error)
- func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *BeaconStateTopLevelRoots, index uint64) (common.Proof, error)
- func ProveBlockBodyAgainstBlockHeader(blockHeader *phase0.BeaconBlockHeader) (common.Proof, error)
- func ProveBlockRootAgainstBeaconStateViaHistoricalSummaries(beaconStateTopLevelRoots *BeaconStateTopLevelRoots, ...) ([][32]byte, error)
- func ProveBlockRootAgainstBlockRootsList(blockRoots []phase0.Root, blockRootIndex uint64) (common.Proof, error)
- func ProveBlockRootListAgainstHistoricalSummary(historicalSummary *capella.HistoricalSummary) (common.Proof, error)
- func ProveExecutionPayloadAgainstBlockBodyCapella(beaconBlockBody *capella.BeaconBlockBody) (common.Proof, [32]byte, error)
- func ProveExecutionPayloadAgainstBlockBodyDeneb(beaconBlockBody *deneb.BeaconBlockBody) (common.Proof, [32]byte, error)
- func ProveExecutionPayloadAgainstBlockHeaderCapella(blockHeader *phase0.BeaconBlockHeader, ...) ([][32]byte, [32]byte, error)
- func ProveExecutionPayloadAgainstBlockHeaderDeneb(blockHeader *phase0.BeaconBlockHeader, ...) ([][32]byte, [32]byte, error)
- func ProveHistoricalSummaryAgainstHistoricalSummariesList(historicalSummaries []*capella.HistoricalSummary, ...) (common.Proof, error)
- func ProveSlotAgainstBlockHeader(blockHeader *phase0.BeaconBlockHeader) (common.Proof, error)
- func ProveStateRootAgainstBlockHeader(b *phase0.BeaconBlockHeader) (common.Proof, error)
- func ProveTimestampAgainstExecutionPayload(executionPayloadFieldRoots []phase0.Root) (common.Proof, error)
- func ProveValidatorBalanceAgainstValidatorBalanceList(balances []phase0.Gwei, validatorIndex uint64) (common.Proof, error)
- func ProveWithdrawalAgainstExecutionPayload(executionPayloadFieldRoots []phase0.Root, withdrawals []*capella.Withdrawal, ...) ([][32]byte, error)
- func ProveWithdrawalAgainstWithdrawalList(withdrawals []*capella.Withdrawal, withdrawalIndex uint8) (common.Proof, error)
- func ProveWithdrawalListAgainstExecutionPayload(executionPayloadFieldRoots []phase0.Root) (common.Proof, error)
- func UnmarshalSSZVersionedBeaconState(data []byte) (*spec.VersionedBeaconState, error)
- type BeaconStateTopLevelRoots
Constants ¶
View Source
const ( SlotsPerHistoricalRoot = uint64(8192) // Index of the historical summaries in the beacon state HistoricalSummaryListIndex = uint64(27) // Index of validator list in beacon state ValidatorListIndex = uint64(11) // Index of the beacon body root inside the beacon body header BeaconBlockBodyRootIndex = uint64(4) // Index of the execution payload in the BeaconBlockBody container ExecutionPayloadIndex = uint64(9) // Index of the timestamp inside the execution payload TimestampIndex = uint64(9) // Index of the withdrawals inside the execution payload WithdrawalsIndex = uint64(14) // Index of the slot in the beacon block header SlotIndex = uint64(0) // in the historical summary coontainer, the block root summary is at index 0 BlockSummaryRootIndex = uint64(0) )
View Source
const ( BlockBodyMerkleSubtreeNumLayers = uint64(4) // Number of layers for the merkleixation of the Validator List in the Beacon State ValidatorListMerkleSubtreeNumLayers = uint64(40) // Number of layers for the merkleixation of the Historical Summary List in the Beacon State HistoricalSummaryListMerkleSubtreeNumLayers = uint64(24) // Number of layers for the merkleization of the Withdrawal List in the Execution Payload WithdrawalListMerkleSubtreeNumLayers = uint64(4) // Number of layers for the merkleization of the Block Roots in the Beacon State BlockRootsMerkleSubtreeNumLayers = uint64(13) )
Variables ¶
This section is empty.
Functions ¶
func ComputeExecutionPayloadFieldRootsCapella ¶
func ComputeExecutionPayloadFieldRootsCapella(executionPayloadFields *capella.ExecutionPayload) ([]phase0.Root, error)
func ComputeExecutionPayloadFieldRootsDeneb ¶
func ComputeExecutionPayloadFieldRootsDeneb(executionPayloadFields *deneb.ExecutionPayload) ([]phase0.Root, error)
func CreateVersionedSignedBlock ¶
func CreateVersionedSignedBlock(block interface{}) (spec.VersionedSignedBeaconBlock, error)
func CreateVersionedState ¶
func CreateVersionedState(state interface{}) (spec.VersionedBeaconState, error)
func GetBlockHeaderFieldRoots ¶
func GetBlockHeaderFieldRoots(blockHeader *phase0.BeaconBlockHeader) ([]phase0.Root, error)
func GetBlockRoots ¶
func GetBlockRoots(beaconState spec.VersionedBeaconState) ([]phase0.Root, error)
func GetExecutionPayloadFieldRootsCapella ¶
func GetExecutionPayloadFieldRootsCapella(executionPayloadFields *capella.ExecutionPayload) ([]phase0.Root, error)
func GetGenesisTime ¶
func GetGenesisTime(state *spec.VersionedBeaconState) (uint64, error)
func GetHistoricalSummaries ¶
func GetHistoricalSummaries(state *spec.VersionedBeaconState) ([]*capella.HistoricalSummary, error)
func MarshalSSZVersionedBeaconState ¶
func MarshalSSZVersionedBeaconState(beaconState spec.VersionedBeaconState) ([]byte, error)
func ProveBeaconTopLevelRootAgainstBeaconState ¶
func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *BeaconStateTopLevelRoots, index uint64) (common.Proof, error)
func ProveBlockBodyAgainstBlockHeader ¶
func ProveBlockBodyAgainstBlockHeader(blockHeader *phase0.BeaconBlockHeader) (common.Proof, error)
func ProveBlockRootAgainstBeaconStateViaHistoricalSummaries ¶
func ProveBlockRootAgainstBeaconStateViaHistoricalSummaries(beaconStateTopLevelRoots *BeaconStateTopLevelRoots, historicalSummaries []*capella.HistoricalSummary, historicalBlockRoots []phase0.Root, historicalSummaryIndex uint64, blockRootIndex uint64) ([][32]byte, error)
func ProveBlockRootListAgainstHistoricalSummary ¶
func ProveBlockRootListAgainstHistoricalSummary(historicalSummary *capella.HistoricalSummary) (common.Proof, error)
func ProveExecutionPayloadAgainstBlockBodyCapella ¶
func ProveExecutionPayloadAgainstBlockBodyCapella(beaconBlockBody *capella.BeaconBlockBody) (common.Proof, [32]byte, error)
Refer to beaconblockbody.go in go-eth2-client https://github.com/attestantio/go-eth2-client/blob/654ac05b4c534d96562329f988655e49e5743ff5/spec/bellatrix/beaconblockbody_encoding.go
func ProveExecutionPayloadAgainstBlockBodyDeneb ¶
func ProveExecutionPayloadAgainstBlockBodyDeneb(beaconBlockBody *deneb.BeaconBlockBody) (common.Proof, [32]byte, error)
Refer to beaconblockbody.go in go-eth2-client https://github.com/attestantio/go-eth2-client/blob/654ac05b4c534d96562329f988655e49e5743ff5/spec/bellatrix/beaconblockbody_encoding.go
func ProveExecutionPayloadAgainstBlockHeaderCapella ¶
func ProveExecutionPayloadAgainstBlockHeaderCapella( blockHeader *phase0.BeaconBlockHeader, withdrawalBeaconBlockBody *capella.BeaconBlockBody, ) ([][32]byte, [32]byte, error)
func ProveExecutionPayloadAgainstBlockHeaderDeneb ¶
func ProveExecutionPayloadAgainstBlockHeaderDeneb( blockHeader *phase0.BeaconBlockHeader, withdrawalBeaconBlockBody *deneb.BeaconBlockBody, ) ([][32]byte, [32]byte, error)
func ProveSlotAgainstBlockHeader ¶
func ProveSlotAgainstBlockHeader(blockHeader *phase0.BeaconBlockHeader) (common.Proof, error)
func ProveStateRootAgainstBlockHeader ¶
func ProveStateRootAgainstBlockHeader(b *phase0.BeaconBlockHeader) (common.Proof, error)
refer to this: https://github.com/attestantio/go-eth2-client/blob/654ac05b4c534d96562329f988655e49e5743ff5/spec/phase0/beaconblockheader_encoding.go
func UnmarshalSSZVersionedBeaconState ¶
func UnmarshalSSZVersionedBeaconState(data []byte) (*spec.VersionedBeaconState, error)
Types ¶
type BeaconStateTopLevelRoots ¶
type BeaconStateTopLevelRoots struct { GenesisTimeRoot *phase0.Root GenesisValidatorsRoot *phase0.Root SlotRoot *phase0.Root ForkRoot *phase0.Root LatestBlockHeaderRoot *phase0.Root BlockRootsRoot *phase0.Root StateRootsRoot *phase0.Root HistoricalRootsRoot *phase0.Root ETH1DataRoot *phase0.Root ETH1DataVotesRoot *phase0.Root ETH1DepositIndexRoot *phase0.Root ValidatorsRoot *phase0.Root BalancesRoot *phase0.Root RANDAOMixesRoot *phase0.Root SlashingsRoot *phase0.Root PreviousEpochParticipationRoot *phase0.Root CurrentEpochParticipationRoot *phase0.Root JustificationBitsRoot *phase0.Root PreviousJustifiedCheckpointRoot *phase0.Root CurrentJustifiedCheckpointRoot *phase0.Root FinalizedCheckpointRoot *phase0.Root InactivityScoresRoot *phase0.Root CurrentSyncCommitteeRoot *phase0.Root NextSyncCommitteeRoot *phase0.Root LatestExecutionPayloadHeaderRoot *phase0.Root NextWithdrawalIndexRoot *phase0.Root NextWithdrawalValidatorIndexRoot *phase0.Root HistoricalSummariesRoot *phase0.Root }
func ComputeBeaconStateTopLevelRootsCapella ¶
func ComputeBeaconStateTopLevelRootsCapella(b *capella.BeaconState) (*BeaconStateTopLevelRoots, error)
func ComputeBeaconStateTopLevelRootsDeneb ¶
func ComputeBeaconStateTopLevelRootsDeneb(b *deneb.BeaconState) (*BeaconStateTopLevelRoots, error)
Click to show internal directories.
Click to hide internal directories.