Documentation
¶
Index ¶
- Constants
- func ComputeValidatorBalancesTreeLeaves(balances []phase0.Gwei) []phase0.Root
- 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 GetGenesisTime(state *spec.VersionedBeaconState) (uint64, error)
- func GetValidatorBalancesProofDepth(numBalances int) uint64
- func MarshalSSZVersionedBeaconState(beaconState spec.VersionedBeaconState) ([]byte, error)
- func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *VersionedBeaconStateTopLevelRoots, index uint64) (common.Proof, error)
- func ProveStateRootAgainstBlockHeader(b *phase0.BeaconBlockHeader) (common.Proof, error)
- func ProveValidatorBalanceAgainstValidatorBalanceList(balances []phase0.Gwei, validatorIndex uint64) (phase0.Root, common.Proof, error)
- func UnmarshalSSZVersionedBeaconState(data []byte) (*spec.VersionedBeaconState, error)
- type BeaconStateTopLevelRootsDeneb
- type BeaconStateTopLevelRootsElectra
- type BeaconStateTopLevelRootsFulu
- type VersionedBeaconStateTopLevelRoots
- func ComputeBeaconStateTopLevelRootsDeneb(b *deneb.BeaconState) (*VersionedBeaconStateTopLevelRoots, error)
- func ComputeBeaconStateTopLevelRootsElectra(b *electra.BeaconState) (*VersionedBeaconStateTopLevelRoots, error)
- func ComputeBeaconStateTopLevelRootsFulu(b *fulu.BeaconState) (*VersionedBeaconStateTopLevelRoots, error)
Constants ¶
View Source
const ( BEACON_BLOCK_HEADER_NUM_FIELDS = uint64(5) BEACON_BLOCK_HEADER_TREE_HEIGHT = uint64(3) BEACON_STATE_TREE_HEIGHT_DENEB = uint64(5) BEACON_STATE_TREE_HEIGHT_ELECTRA = uint64(6) BEACON_STATE_TREE_HEIGHT_FULU = uint64(6) BALANCE_TREE_HEIGHT = uint64(38) VALIDATOR_TREE_HEIGHT = uint64(40) STATE_ROOT_INDEX = uint64(3) VALIDATORS_INDEX = uint64(11) BALANCES_INDEX = uint64(12) VALIDATOR_FIELDS_LENGTH = uint64(8) VALIDATOR_PUBKEY_INDEX = uint64(0) VALIDATOR_WITHDRAWAL_CREDENTIALS_INDEX = uint64(1) VALIDATOR_BALANCE_INDEX = uint64(2) VALIDATOR_SLASHED_INDEX = uint64(3) VALIDATOR_EXIT_EPOCH_INDEX = uint64(6) SECONDS_PER_SLOT = uint64(12) SLOTS_PER_EPOCH = uint64(32) SECONDS_PER_EPOCH = SECONDS_PER_SLOT * SLOTS_PER_EPOCH FAR_FUTURE_EPOCH = ^uint64(0) UINT64_MASK = 0xffffffffffffffff )
Variables ¶
This section is empty.
Functions ¶
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 GetGenesisTime ¶
func GetGenesisTime(state *spec.VersionedBeaconState) (uint64, error)
func MarshalSSZVersionedBeaconState ¶
func MarshalSSZVersionedBeaconState(beaconState spec.VersionedBeaconState) ([]byte, error)
func ProveBeaconTopLevelRootAgainstBeaconState ¶
func ProveBeaconTopLevelRootAgainstBeaconState(beaconTopLevelRoots *VersionedBeaconStateTopLevelRoots, index uint64) (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 BeaconStateTopLevelRootsDeneb ¶ added in v1.5.0
type BeaconStateTopLevelRootsDeneb 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
}
type BeaconStateTopLevelRootsElectra ¶ added in v1.5.0
type BeaconStateTopLevelRootsElectra 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
DepositRequestsStartIndexRoot *phase0.Root
DepositBalanceToConsumeRoot *phase0.Root
ExitBalanceToConsumeRoot *phase0.Root
EarliestExitEpochRoot *phase0.Root
ConsolidationBalanceToConsumeRoot *phase0.Root
EarliestConsolidationEpochRoot *phase0.Root
PendingDepositsRoot *phase0.Root
PendingPartialWithdrawalsRoot *phase0.Root
PendingConsolidationsRoot *phase0.Root
}
type BeaconStateTopLevelRootsFulu ¶ added in v1.6.0
type BeaconStateTopLevelRootsFulu 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
DepositRequestsStartIndexRoot *phase0.Root
DepositBalanceToConsumeRoot *phase0.Root
ExitBalanceToConsumeRoot *phase0.Root
EarliestExitEpochRoot *phase0.Root
ConsolidationBalanceToConsumeRoot *phase0.Root
EarliestConsolidationEpochRoot *phase0.Root
PendingDepositsRoot *phase0.Root
PendingPartialWithdrawalsRoot *phase0.Root
PendingConsolidationsRoot *phase0.Root
ProposerLookaheadRoot *phase0.Root
}
type VersionedBeaconStateTopLevelRoots ¶ added in v1.5.0
type VersionedBeaconStateTopLevelRoots struct {
Version spec.DataVersion
Deneb *BeaconStateTopLevelRootsDeneb
Electra *BeaconStateTopLevelRootsElectra
Fulu *BeaconStateTopLevelRootsFulu
}
func ComputeBeaconStateTopLevelRootsDeneb ¶
func ComputeBeaconStateTopLevelRootsDeneb(b *deneb.BeaconState) (*VersionedBeaconStateTopLevelRoots, error)
func ComputeBeaconStateTopLevelRootsElectra ¶ added in v1.5.0
func ComputeBeaconStateTopLevelRootsElectra(b *electra.BeaconState) (*VersionedBeaconStateTopLevelRoots, error)
func ComputeBeaconStateTopLevelRootsFulu ¶ added in v1.6.0
func ComputeBeaconStateTopLevelRootsFulu(b *fulu.BeaconState) (*VersionedBeaconStateTopLevelRoots, error)
func (*VersionedBeaconStateTopLevelRoots) GetBalancesRoot ¶ added in v1.5.0
func (v *VersionedBeaconStateTopLevelRoots) GetBalancesRoot() (*phase0.Root, error)
Click to show internal directories.
Click to hide internal directories.