Documentation ¶
Index ¶
- Constants
- Variables
- func BlockSignedBLSToExecutionChangesType(spec *Spec) ListTypeDef
- func CommitteeCount(spec *Spec, activeValidators uint64) uint64
- func DecreaseBalance(v BalancesRegistry, index ValidatorIndex, delta Gwei) error
- func ExecutionPayloadType(spec *Spec) *ContainerTypeDef
- func IncreaseBalance(v BalancesRegistry, index ValidatorIndex, delta Gwei) error
- func PayloadTransactionsType(spec *Spec) ListTypeDef
- func PostSlotTransition(ctx context.Context, spec *Spec, epc *EpochsContext, state BeaconState, ...) error
- func PrepareRandao(mixes RandaoMixes, epoch Epoch) error
- func ProcessHeader(ctx context.Context, spec *Spec, state BeaconState, header *BeaconBlockHeader, ...) error
- func ProcessSlot(ctx context.Context, _ *Spec, state BeaconState) error
- func ProcessSlots(ctx context.Context, spec *Spec, epc *EpochsContext, ...) error
- func SetRecentRoots(spec *Spec, state BeaconState, slot Slot, blockRoot Root, stateRoot Root) error
- func ShuffleList(rounds uint8, input []ValidatorIndex, seed Root)
- func StateTransition(ctx context.Context, spec *Spec, epc *EpochsContext, ...) error
- func SyncCommitteePubkeysType(spec *Spec) *ComplexVectorTypeDef
- func SyncCommitteeType(spec *Spec) *ContainerTypeDef
- func TransactionType(spec *Spec) *BasicListTypeDef
- func UnshuffleList(rounds uint8, input []ValidatorIndex, seed Root)
- func UpdateHistoricalRoots(state BeaconState) error
- func WithdrawalsType(spec *Spec) ListTypeDef
- type AltairPreset
- type AttnetBits
- func (ab *AttnetBits) BitLen() uint64
- func (p AttnetBits) ByteLength() uint64
- func (p *AttnetBits) Deserialize(dr *codec.DecodingReader) error
- func (AttnetBits) FixedLength() uint64
- func (p AttnetBits) HashTreeRoot(_ tree.HashFn) (out Root)
- func (p AttnetBits) MarshalText() ([]byte, error)
- func (p AttnetBits) Serialize(w *codec.EncodingWriter) error
- func (p AttnetBits) String() string
- func (p *AttnetBits) UnmarshalText(text []byte) error
- type BLSDomain
- func (a *BLSDomain) ByteLength() uint64
- func (dom *BLSDomain) Deserialize(dr *codec.DecodingReader) error
- func (a *BLSDomain) FixedLength() uint64
- func (dom BLSDomain) HashTreeRoot(hFn tree.HashFn) Root
- func (dom *BLSDomain) Serialize(w *codec.EncodingWriter) error
- func (dom BLSDomain) String() string
- type BLSDomainFn
- type BLSDomainType
- func (dt *BLSDomainType) ByteLength() uint64
- func (dt *BLSDomainType) Deserialize(dr *codec.DecodingReader) error
- func (dt *BLSDomainType) FixedLength() uint64
- func (dt BLSDomainType) HashTreeRoot(hFn tree.HashFn) Root
- func (dt BLSDomainType) MarshalText() ([]byte, error)
- func (dt *BLSDomainType) Serialize(w *codec.EncodingWriter) error
- func (dt BLSDomainType) String() string
- func (dt *BLSDomainType) UnmarshalText(text []byte) error
- type BLSPoint
- type BLSPubkey
- func (BLSPubkey) ByteLength() uint64
- func (p *BLSPubkey) Deserialize(dr *codec.DecodingReader) error
- func (BLSPubkey) FixedLength() uint64
- func (p BLSPubkey) HashTreeRoot(hFn tree.HashFn) tree.Root
- func (p BLSPubkey) MarshalText() ([]byte, error)
- func (p *BLSPubkey) Pubkey() (*blsu.Pubkey, error)
- func (p *BLSPubkey) Serialize(w *codec.EncodingWriter) error
- func (p BLSPubkey) String() string
- func (p *BLSPubkey) UnmarshalText(text []byte) error
- type BLSPubkeyView
- type BLSSignature
- func (BLSSignature) ByteLength() uint64
- func (s *BLSSignature) Deserialize(dr *codec.DecodingReader) error
- func (BLSSignature) FixedLength() uint64
- func (s BLSSignature) HashTreeRoot(hFn tree.HashFn) tree.Root
- func (p BLSSignature) MarshalText() ([]byte, error)
- func (s *BLSSignature) Serialize(w *codec.EncodingWriter) error
- func (p *BLSSignature) Signature() (*blsu.Signature, error)
- func (p BLSSignature) String() string
- func (p *BLSSignature) UnmarshalText(text []byte) error
- type BLSSignatureView
- type BLSToExecutionChange
- func (s *BLSToExecutionChange) ByteLength() uint64
- func (s *BLSToExecutionChange) Deserialize(dr *codec.DecodingReader) error
- func (s *BLSToExecutionChange) FixedLength() uint64
- func (s *BLSToExecutionChange) HashTreeRoot(hFn tree.HashFn) Root
- func (s *BLSToExecutionChange) Serialize(w *codec.EncodingWriter) error
- func (s *BLSToExecutionChange) View() *BLSToExecutionChangeView
- type BLSToExecutionChangeView
- type BalancesRegistry
- type BatchRoots
- type BeaconBlockEnvelope
- type BeaconBlockHeader
- func (s *BeaconBlockHeader) ByteLength() uint64
- func (s *BeaconBlockHeader) Deserialize(dr *codec.DecodingReader) error
- func (b *BeaconBlockHeader) FixedLength() uint64
- func (b *BeaconBlockHeader) HashTreeRoot(hFn tree.HashFn) Root
- func (s *BeaconBlockHeader) Serialize(w *codec.EncodingWriter) error
- func (h *BeaconBlockHeader) View() *BeaconBlockHeaderView
- type BeaconBlockHeaderView
- func (v *BeaconBlockHeaderView) BodyRoot() (Root, error)
- func (v *BeaconBlockHeaderView) ParentRoot() (Root, error)
- func (v *BeaconBlockHeaderView) ProposerIndex() (ValidatorIndex, error)
- func (v *BeaconBlockHeaderView) Raw() (*BeaconBlockHeader, error)
- func (v *BeaconBlockHeaderView) SetStateRoot(root Root) error
- func (v *BeaconBlockHeaderView) Slot() (Slot, error)
- func (v *BeaconBlockHeaderView) StateRoot() (Root, error)
- type BeaconState
- type BellatrixPreset
- type BoundedIndex
- type Builder
- type BuilderBalancesRegistry
- type BuilderBeaconState
- type BuilderIndex
- func (BuilderIndex) ByteLength() uint64
- func (bi *BuilderIndex) Deserialize(dr *codec.DecodingReader) error
- func (BuilderIndex) FixedLength() uint64
- func (bi BuilderIndex) HashTreeRoot(hFn tree.HashFn) Root
- func (bi BuilderIndex) MarshalJSON() ([]byte, error)
- func (bi BuilderIndex) Serialize(w *codec.EncodingWriter) error
- func (bi BuilderIndex) String() string
- func (bi *BuilderIndex) UnmarshalJSON(b []byte) error
- type BuilderPubkeyCache
- type BuilderRegistry
- type Bytes32
- type CachedPubkey
- type CapellaPreset
- type Checkpoint
- func (a *Checkpoint) ByteLength() uint64
- func (c *Checkpoint) Deserialize(dr *codec.DecodingReader) error
- func (g *Checkpoint) FixedLength() uint64
- func (c *Checkpoint) HashTreeRoot(hFn tree.HashFn) Root
- func (a *Checkpoint) Serialize(w *codec.EncodingWriter) error
- func (c *Checkpoint) String() string
- func (c *Checkpoint) View() *CheckpointView
- type CheckpointView
- type CommitteeIndex
- func (CommitteeIndex) ByteLength() uint64
- func (i *CommitteeIndex) Deserialize(dr *codec.DecodingReader) error
- func (CommitteeIndex) FixedLength() uint64
- func (i CommitteeIndex) HashTreeRoot(hFn tree.HashFn) Root
- func (e CommitteeIndex) MarshalJSON() ([]byte, error)
- func (i CommitteeIndex) Serialize(w *codec.EncodingWriter) error
- func (e CommitteeIndex) String() string
- func (e *CommitteeIndex) UnmarshalJSON(b []byte) error
- type CommitteeIndices
- func (a CommitteeIndices) ByteLength(*Spec) uint64
- func (p *CommitteeIndices) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*CommitteeIndices) FixedLength(*Spec) uint64
- func (p CommitteeIndices) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a CommitteeIndices) Serialize(_ *Spec, w *codec.EncodingWriter) error
- type Config
- type Deltas
- func (deltas *Deltas) Add(other *Deltas)
- func (a *Deltas) ByteLength(spec *Spec) uint64
- func (a *Deltas) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *Deltas) FixedLength(*Spec) uint64
- func (a *Deltas) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *Deltas) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type Deposit
- type DepositData
- func (a *DepositData) ByteLength() uint64
- func (d *DepositData) Deserialize(dr *codec.DecodingReader) error
- func (a *DepositData) FixedLength() uint64
- func (d *DepositData) HashTreeRoot(hFn tree.HashFn) Root
- func (d *DepositData) MessageRoot() Root
- func (d *DepositData) Serialize(w *codec.EncodingWriter) error
- func (d *DepositData) ToMessage() *DepositMessage
- type DepositIndex
- func (DepositIndex) ByteLength() uint64
- func (i *DepositIndex) Deserialize(dr *codec.DecodingReader) error
- func (DepositIndex) FixedLength() uint64
- func (i DepositIndex) HashTreeRoot(hFn tree.HashFn) Root
- func (e DepositIndex) MarshalJSON() ([]byte, error)
- func (i DepositIndex) Serialize(w *codec.EncodingWriter) error
- func (e DepositIndex) String() string
- func (e *DepositIndex) UnmarshalJSON(b []byte) error
- type DepositMessage
- type DepositProof
- type EnvelopeBuilder
- type Epoch
- func (Epoch) ByteLength() uint64
- func (a *Epoch) Deserialize(dr *codec.DecodingReader) error
- func (Epoch) FixedLength() uint64
- func (e Epoch) HashTreeRoot(hFn tree.HashFn) Root
- func (e Epoch) MarshalJSON() ([]byte, error)
- func (e Epoch) Previous() Epoch
- func (i Epoch) Serialize(w *codec.EncodingWriter) error
- func (e Epoch) String() string
- func (e *Epoch) UnmarshalJSON(b []byte) error
- type EpochsContext
- func (epc *EpochsContext) Clone() *EpochsContext
- func (epc *EpochsContext) ComputeShardFromCommitteeIndex(slot Slot, index CommitteeIndex) (Shard, error)
- func (epc *EpochsContext) GetBeaconCommittee(slot Slot, index CommitteeIndex) ([]ValidatorIndex, error)
- func (epc *EpochsContext) GetBeaconProposer(slot Slot) (ValidatorIndex, error)
- func (epc *EpochsContext) GetCommitteeCountPerSlot(epoch Epoch) (uint64, error)
- func (epc *EpochsContext) GetShardProposer(slot Slot, shard Shard) (ValidatorIndex, error)
- func (epc *EpochsContext) LoadProposers(state BeaconState) error
- func (epc *EpochsContext) LoadShuffling(state BeaconState) error
- func (epc *EpochsContext) LoadSyncCommittees(state SyncCommitteeBeaconState) error
- func (epc *EpochsContext) RotateEpochs(state BeaconState) error
- func (epc *EpochsContext) StartShard(slot Slot) (Shard, error)
- type Eth1Address
- func (*Eth1Address) ByteLength() uint64
- func (addr *Eth1Address) Deserialize(dr *codec.DecodingReader) error
- func (*Eth1Address) FixedLength() uint64
- func (addr *Eth1Address) HashTreeRoot(hFn tree.HashFn) tree.Root
- func (addr Eth1Address) MarshalText() ([]byte, error)
- func (addr *Eth1Address) Serialize(w *codec.EncodingWriter) error
- func (addr Eth1Address) String() string
- func (addr *Eth1Address) UnmarshalText(text []byte) error
- func (addr Eth1Address) View() SmallByteVecView
- type Eth1Data
- type Eth1DataView
- type Eth1DataVotes
- type Eth2Data
- type ExecutionEngine
- type ExecutionPayload
- func (s *ExecutionPayload) ByteLength(spec *Spec) uint64
- func (s *ExecutionPayload) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *ExecutionPayload) FixedLength(*Spec) uint64
- func (s *ExecutionPayload) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (ep *ExecutionPayload) Header(spec *Spec) *ExecutionPayloadHeader
- func (s *ExecutionPayload) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type ExecutionPayloadHeader
- func (s *ExecutionPayloadHeader) ByteLength() uint64
- func (s *ExecutionPayloadHeader) Deserialize(dr *codec.DecodingReader) error
- func (b *ExecutionPayloadHeader) FixedLength() uint64
- func (s *ExecutionPayloadHeader) HashTreeRoot(hFn tree.HashFn) Root
- func (s *ExecutionPayloadHeader) Serialize(w *codec.EncodingWriter) error
- func (s *ExecutionPayloadHeader) View() *ExecutionPayloadHeaderView
- type ExecutionPayloadHeaderView
- func (v *ExecutionPayloadHeaderView) BaseFeePerGas() (Uint256View, error)
- func (v *ExecutionPayloadHeaderView) BlockHash() (Hash32, error)
- func (v *ExecutionPayloadHeaderView) BlockNumber() (Uint64View, error)
- func (v *ExecutionPayloadHeaderView) FeeRecipient() (Eth1Address, error)
- func (v *ExecutionPayloadHeaderView) GasLimit() (Uint64View, error)
- func (v *ExecutionPayloadHeaderView) GasUsed() (Uint64View, error)
- func (v *ExecutionPayloadHeaderView) LogsBloom() (*LogsBloom, error)
- func (v *ExecutionPayloadHeaderView) ParentHash() (Hash32, error)
- func (v *ExecutionPayloadHeaderView) Random() (Bytes32, error)
- func (v *ExecutionPayloadHeaderView) Raw() (*ExecutionPayloadHeader, error)
- func (v *ExecutionPayloadHeaderView) ReceiptRoot() (Bytes32, error)
- func (v *ExecutionPayloadHeaderView) StateRoot() (Bytes32, error)
- func (v *ExecutionPayloadHeaderView) Timestamp() (Timestamp, error)
- func (v *ExecutionPayloadHeaderView) TransactionsRoot() (Root, error)
- type ExecutionPayloadView
- type ExtendedNodeRef
- type ExtraData
- func (otx ExtraData) ByteLength() (out uint64)
- func (otx *ExtraData) Deserialize(dr *codec.DecodingReader) error
- func (otx *ExtraData) FixedLength() uint64
- func (otx ExtraData) HashTreeRoot(hFn tree.HashFn) Root
- func (otx ExtraData) MarshalText() ([]byte, error)
- func (otx ExtraData) Serialize(w *codec.EncodingWriter) error
- func (otx ExtraData) String() string
- func (otx *ExtraData) UnmarshalText(text []byte) error
- func (otx ExtraData) View() (*ExtraDataView, error)
- type ExtraDataView
- type FlatValidator
- type Fork
- func (a *Fork) ByteLength() uint64
- func (b *Fork) Deserialize(dr *codec.DecodingReader) error
- func (a *Fork) FixedLength() uint64
- func (f *Fork) GetDomain(dom BLSDomainType, genesisValRoot Root, messageEpoch Epoch) (BLSDomain, error)
- func (a *Fork) HashTreeRoot(hFn tree.HashFn) Root
- func (a *Fork) Serialize(w *codec.EncodingWriter) error
- func (f *Fork) View() *ForkView
- type ForkData
- type ForkDigest
- func (p ForkDigest) ByteLength() uint64
- func (p *ForkDigest) Deserialize(dr *codec.DecodingReader) error
- func (ForkDigest) FixedLength() uint64
- func (p ForkDigest) HashTreeRoot(_ tree.HashFn) (out Root)
- func (p ForkDigest) MarshalText() ([]byte, error)
- func (p ForkDigest) Serialize(w *codec.EncodingWriter) error
- func (p ForkDigest) String() string
- func (p *ForkDigest) UnmarshalText(text []byte) error
- type ForkSettings
- type ForkView
- type G1Setup
- type G2Setup
- type Goodbye
- func (Goodbye) ByteLength() uint64
- func (i *Goodbye) Deserialize(dr *codec.DecodingReader) error
- func (Goodbye) FixedLength() uint64
- func (i Goodbye) HashTreeRoot(hFn tree.HashFn) Root
- func (i Goodbye) MarshalJSON() ([]byte, error)
- func (i Goodbye) Serialize(w *codec.EncodingWriter) error
- func (i Goodbye) String() string
- func (i *Goodbye) UnmarshalJSON(b []byte) error
- type Gwei
- func (Gwei) ByteLength() uint64
- func (g *Gwei) Deserialize(dr *codec.DecodingReader) error
- func (g Gwei) FixedLength() uint64
- func (g Gwei) HashTreeRoot(hFn tree.HashFn) Root
- func (e Gwei) MarshalJSON() ([]byte, error)
- func (i Gwei) Serialize(w *codec.EncodingWriter) error
- func (e Gwei) String() string
- func (e *Gwei) UnmarshalJSON(b []byte) error
- type GweiList
- func (a GweiList) ByteLength(spec *Spec) (out uint64)
- func (a *GweiList) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *GweiList) FixedLength(spec *Spec) uint64
- func (li GweiList) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a GweiList) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type Hash32
- type HistoricalRoots
- type IndexedSyncCommittee
- func (isc *IndexedSyncCommittee) InSubnet(spec *Spec, valIndex ValidatorIndex, subnet uint64) bool
- func (isc *IndexedSyncCommittee) Subcommittee(spec *Spec, subnet uint64) (pubs []*CachedPubkey, indices []ValidatorIndex, err error)
- func (isc *IndexedSyncCommittee) Subnets(spec *Spec, valIndex ValidatorIndex) (out []uint64)
- type JustificationBits
- func (jb *JustificationBits) BitLen() uint64
- func (jb JustificationBits) ByteLength() uint64
- func (b *JustificationBits) Deserialize(dr *codec.DecodingReader) error
- func (jb JustificationBits) FixedLength() uint64
- func (jb JustificationBits) HashTreeRoot(hFn tree.HashFn) Root
- func (jb *JustificationBits) IsJustified(epochsAgo ...Epoch) bool
- func (jb JustificationBits) MarshalText() ([]byte, error)
- func (jb *JustificationBits) NextEpoch()
- func (a JustificationBits) Serialize(w *codec.EncodingWriter) error
- func (jb *JustificationBits) String() string
- func (jb *JustificationBits) UnmarshalText(text []byte) error
- func (jb *JustificationBits) View() *JustificationBitsView
- type JustificationBitsView
- type LogsBloom
- func (*LogsBloom) ByteLength() uint64
- func (s *LogsBloom) Deserialize(dr *codec.DecodingReader) error
- func (*LogsBloom) FixedLength() uint64
- func (s *LogsBloom) HashTreeRoot(hFn tree.HashFn) tree.Root
- func (p *LogsBloom) MarshalText() ([]byte, error)
- func (s *LogsBloom) Serialize(w *codec.EncodingWriter) error
- func (p LogsBloom) String() string
- func (p *LogsBloom) UnmarshalText(text []byte) error
- func (s *LogsBloom) View() *LogsBloomView
- type LogsBloomView
- type MetaData
- func (d MetaData) ByteLength() uint64
- func (m *MetaData) Data() map[string]interface{}
- func (d *MetaData) Deserialize(dr *codec.DecodingReader) error
- func (*MetaData) FixedLength() uint64
- func (d *MetaData) HashTreeRoot(hFn tree.HashFn) Root
- func (d *MetaData) Serialize(w *codec.EncodingWriter) error
- func (m *MetaData) String() string
- type NodeRef
- type PayloadTransactions
- func (txs PayloadTransactions) ByteLength(spec *Spec) (out uint64)
- func (txs *PayloadTransactions) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (txs *PayloadTransactions) FixedLength(*Spec) uint64
- func (txs PayloadTransactions) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (txs PayloadTransactions) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type Phase0Preset
- type Ping
- func (Ping) ByteLength() uint64
- func (i *Ping) Deserialize(dr *codec.DecodingReader) error
- func (Ping) FixedLength() uint64
- func (i Ping) HashTreeRoot(hFn tree.HashFn) Root
- func (i Ping) MarshalJSON() ([]byte, error)
- func (i Ping) Serialize(w *codec.EncodingWriter) error
- func (i Ping) String() string
- func (i *Ping) UnmarshalJSON(b []byte) error
- type Pong
- func (Pong) ByteLength() uint64
- func (i *Pong) Deserialize(dr *codec.DecodingReader) error
- func (Pong) FixedLength() uint64
- func (i Pong) HashTreeRoot(hFn tree.HashFn) Root
- func (i Pong) MarshalJSON() ([]byte, error)
- func (i Pong) Serialize(w *codec.EncodingWriter) error
- func (i Pong) String() string
- func (i *Pong) UnmarshalJSON(b []byte) error
- type ProposersEpoch
- type PubkeyCache
- type RandaoMixes
- type Root
- func ComputeForkDataRoot(currentVersion Version, genesisValidatorsRoot Root) Root
- func ComputeSigningRoot(msgRoot Root, dom BLSDomain) Root
- func GetBlockRoot(spec *Spec, state BeaconState, epoch Epoch) (Root, error)
- func GetBlockRootAtSlot(spec *Spec, state BeaconState, slot Slot) (Root, error)
- func GetSeed(spec *Spec, mixes RandaoMixes, epoch Epoch, domainType BLSDomainType) (Root, error)
- type SSZObj
- type SeqNr
- func (SeqNr) ByteLength() uint64
- func (i *SeqNr) Deserialize(dr *codec.DecodingReader) error
- func (SeqNr) FixedLength() uint64
- func (i SeqNr) HashTreeRoot(hFn tree.HashFn) Root
- func (i SeqNr) MarshalJSON() ([]byte, error)
- func (i SeqNr) Serialize(w *codec.EncodingWriter) error
- func (i SeqNr) String() string
- func (i *SeqNr) UnmarshalJSON(b []byte) error
- type Setup
- type Shard
- func (Shard) ByteLength() uint64
- func (a *Shard) Deserialize(dr *codec.DecodingReader) error
- func (Shard) FixedLength() uint64
- func (e Shard) HashTreeRoot(hFn tree.HashFn) Root
- func (e Shard) MarshalJSON() ([]byte, error)
- func (i Shard) Serialize(w *codec.EncodingWriter) error
- func (e Shard) String() string
- func (e *Shard) UnmarshalJSON(b []byte) error
- type ShardingPreset
- type ShufflingEpoch
- type SignedBLSToExecutionChange
- func (s *SignedBLSToExecutionChange) ByteLength() uint64
- func (s *SignedBLSToExecutionChange) Deserialize(dr *codec.DecodingReader) error
- func (s *SignedBLSToExecutionChange) FixedLength() uint64
- func (s *SignedBLSToExecutionChange) HashTreeRoot(hFn tree.HashFn) Root
- func (s *SignedBLSToExecutionChange) Serialize(w *codec.EncodingWriter) error
- func (s *SignedBLSToExecutionChange) View() *SignedBLSToExecutionChangeView
- type SignedBLSToExecutionChangeView
- type SignedBLSToExecutionChanges
- func (li SignedBLSToExecutionChanges) ByteLength(_ *Spec) (out uint64)
- func (li *SignedBLSToExecutionChanges) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*SignedBLSToExecutionChanges) FixedLength(*Spec) uint64
- func (li SignedBLSToExecutionChanges) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (li SignedBLSToExecutionChanges) Serialize(_ *Spec, w *codec.EncodingWriter) error
- type SignedBeaconBlockHeader
- func (s *SignedBeaconBlockHeader) ByteLength() uint64
- func (s *SignedBeaconBlockHeader) Deserialize(dr *codec.DecodingReader) error
- func (b *SignedBeaconBlockHeader) FixedLength() uint64
- func (s *SignedBeaconBlockHeader) HashTreeRoot(hFn tree.HashFn) Root
- func (s *SignedBeaconBlockHeader) Serialize(w *codec.EncodingWriter) error
- type SigningData
- type Slashings
- type Slot
- func (Slot) ByteLength() uint64
- func (a *Slot) Deserialize(dr *codec.DecodingReader) error
- func (Slot) FixedLength() uint64
- func (s Slot) HashTreeRoot(hFn tree.HashFn) Root
- func (e Slot) MarshalJSON() ([]byte, error)
- func (s Slot) Previous() Slot
- func (i Slot) Serialize(w *codec.EncodingWriter) error
- func (e Slot) String() string
- func (e *Slot) UnmarshalJSON(b []byte) error
- type Spec
- func (spec *Spec) ActiveShardCount(epoch Epoch) uint64
- func (spec *Spec) ComputeActivationExitEpoch(e Epoch) Epoch
- func (spec *Spec) ComputeUpdatedSamplePrice(prevSamplePrice Gwei, shardBlockLength uint64, adjustmentQuotient uint64) Gwei
- func (spec *Spec) EpochStartSlot(e Epoch) (Slot, error)
- func (spec *Spec) ForkVersion(slot Slot) Version
- func (spec *Spec) GetChurnLimit(activeValidatorCount uint64) uint64
- func (spec *Spec) SlotToEpoch(s Slot) Epoch
- func (spec *Spec) TimeAtSlot(slot Slot, genesisTime Timestamp) (Timestamp, error)
- func (spec *Spec) TimeToSlot(t Timestamp, genesisTime Timestamp) Slot
- func (spec *Spec) Wrap(des SpecObj) SSZObj
- type SpecObj
- type Status
- func (d Status) ByteLength() uint64
- func (s *Status) Data() map[string]interface{}
- func (d *Status) Deserialize(dr *codec.DecodingReader) error
- func (*Status) FixedLength() uint64
- func (d *Status) HashTreeRoot(hFn tree.HashFn) Root
- func (d *Status) Serialize(w *codec.EncodingWriter) error
- func (s *Status) String() string
- type Step
- type SyncCommittee
- func (a *SyncCommittee) ByteLength(spec *Spec) uint64
- func (a *SyncCommittee) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*SyncCommittee) FixedLength(spec *Spec) uint64
- func (p *SyncCommittee) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *SyncCommittee) Serialize(spec *Spec, w *codec.EncodingWriter) error
- func (p *SyncCommittee) View(spec *Spec) (*SyncCommitteeView, error)
- type SyncCommitteeBeaconState
- type SyncCommitteePubkeys
- func (a SyncCommitteePubkeys) ByteLength(spec *Spec) uint64
- func (li *SyncCommitteePubkeys) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *SyncCommitteePubkeys) FixedLength(spec *Spec) uint64
- func (li SyncCommitteePubkeys) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a SyncCommitteePubkeys) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type SyncCommitteePubkeysView
- type SyncCommitteeView
- type SyncnetBits
- func (ab *SyncnetBits) BitLen() uint64
- func (p SyncnetBits) ByteLength() uint64
- func (p *SyncnetBits) Deserialize(dr *codec.DecodingReader) error
- func (SyncnetBits) FixedLength() uint64
- func (p SyncnetBits) HashTreeRoot(_ tree.HashFn) (out Root)
- func (p SyncnetBits) MarshalText() ([]byte, error)
- func (p SyncnetBits) Serialize(w *codec.EncodingWriter) error
- func (p SyncnetBits) String() string
- func (p *SyncnetBits) UnmarshalText(text []byte) error
- type Timestamp
- func (Timestamp) ByteLength() uint64
- func (a *Timestamp) Deserialize(dr *codec.DecodingReader) error
- func (Timestamp) FixedLength() uint64
- func (t Timestamp) HashTreeRoot(hFn tree.HashFn) Root
- func (e Timestamp) MarshalJSON() ([]byte, error)
- func (i Timestamp) Serialize(w *codec.EncodingWriter) error
- func (e Timestamp) String() string
- func (e *Timestamp) UnmarshalJSON(b []byte) error
- type Transaction
- func (otx Transaction) ByteLength(spec *Spec) (out uint64)
- func (otx *Transaction) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (otx *Transaction) FixedLength(*Spec) uint64
- func (otx Transaction) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (otx Transaction) MarshalText() ([]byte, error)
- func (otx Transaction) Serialize(spec *Spec, w *codec.EncodingWriter) error
- func (otx Transaction) String() string
- func (otx *Transaction) UnmarshalText(text []byte) error
- func (otx Transaction) View(spec *Spec) (*TransactionView, error)
- type TransactionView
- type UpgradeableBeaconState
- type Validator
- type ValidatorIndex
- func ActiveIndices(indicesBounded []BoundedIndex, epoch Epoch) []ValidatorIndex
- func AsValidatorIndex(v View, err error) (ValidatorIndex, error)
- func ComputeProposerIndex(spec *Spec, registry ValidatorRegistry, active []ValidatorIndex, seed Root) (ValidatorIndex, error)
- func ComputeSyncCommitteeIndices(spec *Spec, state BeaconState, baseEpoch Epoch, active []ValidatorIndex) ([]ValidatorIndex, error)
- func PermuteIndex(rounds uint8, index ValidatorIndex, listSize uint64, seed Root) ValidatorIndex
- func UnpermuteIndex(rounds uint8, index ValidatorIndex, listSize uint64, seed Root) ValidatorIndex
- func (ValidatorIndex) ByteLength() uint64
- func (i *ValidatorIndex) Deserialize(dr *codec.DecodingReader) error
- func (ValidatorIndex) FixedLength() uint64
- func (i ValidatorIndex) HashTreeRoot(hFn tree.HashFn) Root
- func (e ValidatorIndex) MarshalJSON() ([]byte, error)
- func (i ValidatorIndex) Serialize(w *codec.EncodingWriter) error
- func (e ValidatorIndex) String() string
- func (e *ValidatorIndex) UnmarshalJSON(b []byte) error
- type ValidatorRegistry
- type ValidatorSet
- func (vs *ValidatorSet) Dedup()
- func (vs *ValidatorSet) Filter(retain func(index ValidatorIndex) (bool, error)) error
- func (vs ValidatorSet) Intersects(target ValidatorSet) bool
- func (vs ValidatorSet) Len() int
- func (vs ValidatorSet) Less(i int, j int) bool
- func (vs ValidatorSet) MergeDisjoint(other ValidatorSet) ValidatorSet
- func (vs ValidatorSet) Swap(i int, j int)
- func (vs ValidatorSet) ZigZagJoin(target ValidatorSet, onIn func(i ValidatorIndex), onOut func(i ValidatorIndex))
- type Version
- func (a Version) ByteLength() uint64
- func (v *Version) Deserialize(dr *codec.DecodingReader) error
- func (Version) FixedLength() uint64
- func (p Version) HashTreeRoot(_ tree.HashFn) (out Root)
- func (p Version) MarshalText() ([]byte, error)
- func (a Version) Serialize(w *codec.EncodingWriter) error
- func (p Version) String() string
- func (v Version) ToUint32() uint32
- func (p *Version) UnmarshalText(text []byte) error
- func (v Version) View() SmallByteVecView
- type Withdrawal
- func (s *Withdrawal) ByteLength() uint64
- func (s *Withdrawal) Deserialize(dr *codec.DecodingReader) error
- func (s *Withdrawal) FixedLength() uint64
- func (s *Withdrawal) HashTreeRoot(hFn tree.HashFn) Root
- func (s *Withdrawal) Serialize(w *codec.EncodingWriter) error
- func (s *Withdrawal) View() *WithdrawalView
- type WithdrawalIndex
- func (WithdrawalIndex) ByteLength() uint64
- func (a *WithdrawalIndex) Deserialize(dr *codec.DecodingReader) error
- func (WithdrawalIndex) FixedLength() uint64
- func (t WithdrawalIndex) HashTreeRoot(hFn tree.HashFn) Root
- func (e WithdrawalIndex) MarshalJSON() ([]byte, error)
- func (i WithdrawalIndex) Serialize(w *codec.EncodingWriter) error
- func (e WithdrawalIndex) String() string
- func (e *WithdrawalIndex) UnmarshalJSON(b []byte) error
- type WithdrawalPrefix
- type WithdrawalView
- type Withdrawals
- func (ws Withdrawals) ByteLength(spec *Spec) (out uint64)
- func (ws *Withdrawals) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (ws *Withdrawals) FixedLength(*Spec) uint64
- func (ws Withdrawals) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (ws Withdrawals) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type WrappedSpecObj
Constants ¶
const ATTESTATION_SUBNET_COUNT = 64
const BASE_REWARDS_PER_EPOCH = 4
const BLSDomainTreeType = RootType
const BLSDomainTypeTreeType = Bytes4Type
const BLSPointType = RootType
const BLS_WITHDRAWAL_PREFIX = 0
const BYTES_PER_LOGS_BLOOM = 256
const BuilderIndexType = Uint64Type
const Bytes32Type = RootType
const CommitteeIndexType = Uint64Type
const DEPOSIT_CONTRACT_TREE_DEPTH = 32
const EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION = 256
const ETH1_ADDRESS_WITHDRAWAL_PREFIX = 1
const EpochType = Uint64Type
const Eth1AddressType = SmallByteVecMeta(20)
const FAR_FUTURE_EPOCH = Epoch(^uint64(0))
const ForkDigestType = Bytes4Type
const GweiType = Uint64Type
const Hash32Type = RootType
const JUSTIFICATION_BITS_LENGTH = 4
const MAX_EXTRA_DATA_BYTES = 32
const MetadataByteLen = 8 + attnetByteLen + syncnetByteLen
const RANDOM_SUBNETS_PER_VALIDATOR = 1
const SECONDS_PER_DAY = 24 * 60 * 60
const SYNC_COMMITTEE_SUBNET_COUNT = 4
const ShardType = Uint64Type
const SlotType = Uint64Type
const StatusByteLen = 4 + 32 + 8 + 32 + 8
const TARGET_AGGREGATORS_PER_COMMITTEE = 16
const TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE = 16
const TimestampType = Uint64Type
const ValidatorIndexMarker = ValidatorIndex(^uint64(0))
Custom constant, not in spec: An impossible high validator index used to mark special internal cases. (all 1s binary)
const ValidatorIndexType = Uint64Type
const VersionType = Bytes4Type
const WithdrawalIndexType = Uint64Type
Variables ¶
var BLSPubkeyType = BasicVectorType(ByteType, 48)
var BLSSignatureType = BasicVectorType(ByteType, 96)
var BLSToExecutionChangeType = ContainerType("BLSToExecutionChange", []FieldDef{ {"validator_index", ValidatorIndexType}, {"from_bls_pubkey", BLSPubkeyType}, {"to_execution_address", Eth1AddressType}, })
var BeaconBlockHeaderType = ContainerType("BeaconBlockHeader", []FieldDef{ {"slot", SlotType}, {"proposer_index", ValidatorIndexType}, {"parent_root", RootType}, {"state_root", RootType}, {"body_root", RootType}, })
var CheckpointType = ContainerType("Checkpoint", []FieldDef{ {"epoch", EpochType}, {"root", RootType}, })
var DOMAIN_AGGREGATE_AND_PROOF = BLSDomainType{0x06, 0x00, 0x00, 0x00}
var DOMAIN_BEACON_ATTESTER = BLSDomainType{0x01, 0x00, 0x00, 0x00}
var DOMAIN_BEACON_PROPOSER = BLSDomainType{0x00, 0x00, 0x00, 0x00}
Phase0
var DOMAIN_BLS_TO_EXECUTION_CHANGE = BLSDomainType{0x0A, 0x00, 0x00, 0x00}
Capella
var DOMAIN_CONTRIBUTION_AND_PROOF = BLSDomainType{0x09, 0x00, 0x00, 0x00}
var DOMAIN_DEPOSIT = BLSDomainType{0x03, 0x00, 0x00, 0x00}
var DOMAIN_RANDAO = BLSDomainType{0x02, 0x00, 0x00, 0x00}
var DOMAIN_SELECTION_PROOF = BLSDomainType{0x05, 0x00, 0x00, 0x00}
var DOMAIN_SHARD_BLOB = BLSDomainType{0x80, 0x00, 0x00, 0x00}
Sharding
var DOMAIN_SYNC_COMMITTEE = BLSDomainType{0x07, 0x00, 0x00, 0x00}
Altair
var DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF = BLSDomainType{0x08, 0x00, 0x00, 0x00}
var DOMAIN_VOLUNTARY_EXIT = BLSDomainType{0x04, 0x00, 0x00, 0x00}
var DepositDataType = ContainerType("DepositData", []FieldDef{ {"pubkey", BLSPubkeyType}, {"withdrawal_credentials", Bytes32Type}, {"amount", GweiType}, {"signature", BLSSignatureType}, })
var DepositMessageType = ContainerType("DepositMessage", []FieldDef{ {"pubkey", BLSPubkeyType}, {"withdrawal_credentials", Bytes32Type}, {"amount", GweiType}, })
var DepositProofType = VectorType(Bytes32Type, DEPOSIT_CONTRACT_TREE_DEPTH+1)
var DepositType = ContainerType("Deposit", []FieldDef{ {"proof", DepositProofType}, {"data", DepositDataType}, })
var Eth1DataType = ContainerType("Eth1Data", []FieldDef{ {"deposit_root", RootType}, {"deposit_count", Uint64Type}, {"block_hash", Bytes32Type}, })
var ExecutionPayloadHeaderType = ContainerType("ExecutionPayloadHeader", []FieldDef{ {"parent_hash", Hash32Type}, {"fee_recipient", Eth1AddressType}, {"state_root", Bytes32Type}, {"receipts_root", Bytes32Type}, {"logs_bloom", LogsBloomType}, {"prev_randao", Bytes32Type}, {"block_number", Uint64Type}, {"gas_limit", Uint64Type}, {"gas_used", Uint64Type}, {"timestamp", TimestampType}, {"extra_data", ExtraDataType}, {"base_fee_per_gas", Uint256Type}, {"block_hash", Hash32Type}, {"transactions_root", RootType}, })
var ExtraDataType = BasicListType(Uint8Type, MAX_EXTRA_DATA_BYTES)
var ForkDataType = ContainerType("ForkData", []FieldDef{ {"current_version", VersionType}, {"genesis_validators_root", RootType}, })
var ForkType = ContainerType("Fork", []FieldDef{ {"previous_version", VersionType}, {"current_version", VersionType}, {"epoch", EpochType}, })
var JustificationBitsType = BitVectorType(JUSTIFICATION_BITS_LENGTH)
var LogsBloomType = view.BasicVectorType(view.Uint8Type, BYTES_PER_LOGS_BLOOM)
var SignedBLSToExecutionChangeType = ContainerType("SignedBLSToExecutionChange", []FieldDef{ {"message", BLSToExecutionChangeType}, {"signature", BLSSignatureType}, })
var SignedBeaconBlockHeaderType = ContainerType("SignedBeaconBlockHeader", []FieldDef{ {"message", BeaconBlockHeaderType}, {"signature", BLSSignatureType}, })
var SigningDataType = ContainerType("SigningData", []FieldDef{ {"object_root", RootType}, {"domain", BLSDomainTreeType}, })
var WithdrawalType = ContainerType("Withdrawal", []FieldDef{ {"index", WithdrawalIndexType}, {"validator_index", ValidatorIndexType}, {"address", Eth1AddressType}, {"amount", GweiType}, })
Functions ¶
func BlockSignedBLSToExecutionChangesType ¶ added in v0.29.0
func BlockSignedBLSToExecutionChangesType(spec *Spec) ListTypeDef
func CommitteeCount ¶
func DecreaseBalance ¶
func DecreaseBalance(v BalancesRegistry, index ValidatorIndex, delta Gwei) error
func ExecutionPayloadType ¶ added in v0.16.0
func ExecutionPayloadType(spec *Spec) *ContainerTypeDef
func IncreaseBalance ¶
func IncreaseBalance(v BalancesRegistry, index ValidatorIndex, delta Gwei) error
func PayloadTransactionsType ¶ added in v0.16.0
func PayloadTransactionsType(spec *Spec) ListTypeDef
func PostSlotTransition ¶
func PostSlotTransition(ctx context.Context, spec *Spec, epc *EpochsContext, state BeaconState, benv *BeaconBlockEnvelope, validateResult bool) error
PostSlotTransition finishes a state transition after applying ProcessSlots(..., block.Slot).
func PrepareRandao ¶
func PrepareRandao(mixes RandaoMixes, epoch Epoch) error
Prepare the randao mix for the given epoch by copying over the mix from the previous epoch.
func ProcessHeader ¶
func ProcessHeader(ctx context.Context, spec *Spec, state BeaconState, header *BeaconBlockHeader, expectedProposer ValidatorIndex) error
func ProcessSlot ¶
func ProcessSlot(ctx context.Context, _ *Spec, state BeaconState) error
func ProcessSlots ¶
func ProcessSlots(ctx context.Context, spec *Spec, epc *EpochsContext, state UpgradeableBeaconState, slot Slot) error
Process the state to the given slot. Returns an error if the slot is older than the state is already at. Mutates the state, does not copy.
func SetRecentRoots ¶
func ShuffleList ¶
func ShuffleList(rounds uint8, input []ValidatorIndex, seed Root)
ShuffleList shuffles a list, using the given seed for randomness.
func StateTransition ¶
func StateTransition(ctx context.Context, spec *Spec, epc *EpochsContext, state UpgradeableBeaconState, benv *BeaconBlockEnvelope, validateResult bool) error
StateTransition to the slot of the given block, then process the block. Returns an error if the slot is older or equal to what the state is already at. Mutates the state, does not copy.
func SyncCommitteePubkeysType ¶ added in v0.16.0
func SyncCommitteePubkeysType(spec *Spec) *ComplexVectorTypeDef
func SyncCommitteeType ¶ added in v0.16.0
func SyncCommitteeType(spec *Spec) *ContainerTypeDef
func TransactionType ¶ added in v0.19.0
func TransactionType(spec *Spec) *BasicListTypeDef
func UnshuffleList ¶
func UnshuffleList(rounds uint8, input []ValidatorIndex, seed Root)
UnshuffleList undoes a list shuffling using the seed of the shuffling.
func UpdateHistoricalRoots ¶
func UpdateHistoricalRoots(state BeaconState) error
func WithdrawalsType ¶ added in v0.29.0
func WithdrawalsType(spec *Spec) ListTypeDef
Types ¶
type AltairPreset ¶ added in v0.16.0
type AltairPreset struct { // Updated penalty values INACTIVITY_PENALTY_QUOTIENT_ALTAIR Uint64View `yaml:"INACTIVITY_PENALTY_QUOTIENT_ALTAIR" json:"INACTIVITY_PENALTY_QUOTIENT_ALTAIR"` MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR Uint64View `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR" json:"MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR"` PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR Uint64View `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR" json:"PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR"` // Sync committee SYNC_COMMITTEE_SIZE Uint64View `yaml:"SYNC_COMMITTEE_SIZE" json:"SYNC_COMMITTEE_SIZE"` EPOCHS_PER_SYNC_COMMITTEE_PERIOD Epoch `yaml:"EPOCHS_PER_SYNC_COMMITTEE_PERIOD" json:"EPOCHS_PER_SYNC_COMMITTEE_PERIOD"` // Sync committees and light clients MIN_SYNC_COMMITTEE_PARTICIPANTS Uint64View `yaml:"MIN_SYNC_COMMITTEE_PARTICIPANTS" json:"MIN_SYNC_COMMITTEE_PARTICIPANTS"` }
type AttnetBits ¶
type AttnetBits [attnetByteLen]byte
func (*AttnetBits) BitLen ¶
func (ab *AttnetBits) BitLen() uint64
func (AttnetBits) ByteLength ¶
func (p AttnetBits) ByteLength() uint64
func (*AttnetBits) Deserialize ¶
func (p *AttnetBits) Deserialize(dr *codec.DecodingReader) error
func (AttnetBits) FixedLength ¶
func (AttnetBits) FixedLength() uint64
func (AttnetBits) HashTreeRoot ¶
func (p AttnetBits) HashTreeRoot(_ tree.HashFn) (out Root)
func (AttnetBits) MarshalText ¶
func (p AttnetBits) MarshalText() ([]byte, error)
func (AttnetBits) Serialize ¶
func (p AttnetBits) Serialize(w *codec.EncodingWriter) error
func (AttnetBits) String ¶
func (p AttnetBits) String() string
func (*AttnetBits) UnmarshalText ¶
func (p *AttnetBits) UnmarshalText(text []byte) error
type BLSDomain ¶
type BLSDomain [32]byte
BLS domain (8 bytes): fork version (32 bits) concatenated with BLS domain type (32 bits)
func ComputeDomain ¶
func ComputeDomain(domainType BLSDomainType, forkVersion Version, genesisValidatorsRoot Root) (out BLSDomain)
func GetDomain ¶
func GetDomain(state BeaconState, dom BLSDomainType, messageEpoch Epoch) (BLSDomain, error)
Return the signature domain (fork version concatenated with domain type) of a message.
func (*BLSDomain) ByteLength ¶ added in v0.16.1
func (*BLSDomain) Deserialize ¶
func (dom *BLSDomain) Deserialize(dr *codec.DecodingReader) error
func (*BLSDomain) FixedLength ¶
type BLSDomainFn ¶
type BLSDomainFn func(typ BLSDomainType, epoch Epoch) (BLSDomain, error)
Sometimes a beacon state is not available, or too much for what it is good for. Functions that just need a specific BLS domain can use this function.
type BLSDomainType ¶
type BLSDomainType [4]byte
Mixed into a BLS domain to define its type
func (*BLSDomainType) ByteLength ¶ added in v0.16.1
func (dt *BLSDomainType) ByteLength() uint64
func (*BLSDomainType) Deserialize ¶ added in v0.16.1
func (dt *BLSDomainType) Deserialize(dr *codec.DecodingReader) error
func (*BLSDomainType) FixedLength ¶ added in v0.16.1
func (dt *BLSDomainType) FixedLength() uint64
func (BLSDomainType) HashTreeRoot ¶ added in v0.16.1
func (dt BLSDomainType) HashTreeRoot(hFn tree.HashFn) Root
func (BLSDomainType) MarshalText ¶
func (dt BLSDomainType) MarshalText() ([]byte, error)
func (*BLSDomainType) Serialize ¶ added in v0.16.1
func (dt *BLSDomainType) Serialize(w *codec.EncodingWriter) error
func (BLSDomainType) String ¶
func (dt BLSDomainType) String() string
func (*BLSDomainType) UnmarshalText ¶
func (dt *BLSDomainType) UnmarshalText(text []byte) error
type BLSPoint ¶ added in v0.16.1
type BLSPoint = Root
TODO: BLSPoint can be customized to have more bls-specific functionality and checks (e.g. modulus, not full 256 bits)
type BLSPubkey ¶
type BLSPubkey [48]byte
func AsBLSPubkey ¶
func (BLSPubkey) ByteLength ¶ added in v0.17.0
func (*BLSPubkey) Deserialize ¶ added in v0.17.0
func (p *BLSPubkey) Deserialize(dr *codec.DecodingReader) error
func (BLSPubkey) FixedLength ¶ added in v0.17.0
func (BLSPubkey) HashTreeRoot ¶ added in v0.17.0
func (BLSPubkey) MarshalText ¶ added in v0.17.0
func (*BLSPubkey) Serialize ¶ added in v0.17.0
func (p *BLSPubkey) Serialize(w *codec.EncodingWriter) error
func (*BLSPubkey) UnmarshalText ¶ added in v0.17.0
type BLSPubkeyView ¶
type BLSPubkeyView struct {
*BasicVectorView
}
func ViewPubkey ¶
func ViewPubkey(pub *BLSPubkey) *BLSPubkeyView
type BLSSignature ¶
type BLSSignature [96]byte
func AsBLSSignature ¶
func AsBLSSignature(v View, err error) (BLSSignature, error)
func (BLSSignature) ByteLength ¶ added in v0.17.0
func (BLSSignature) ByteLength() uint64
func (*BLSSignature) Deserialize ¶ added in v0.17.0
func (s *BLSSignature) Deserialize(dr *codec.DecodingReader) error
func (BLSSignature) FixedLength ¶ added in v0.17.0
func (BLSSignature) FixedLength() uint64
func (BLSSignature) HashTreeRoot ¶ added in v0.17.0
func (s BLSSignature) HashTreeRoot(hFn tree.HashFn) tree.Root
func (BLSSignature) MarshalText ¶ added in v0.17.0
func (p BLSSignature) MarshalText() ([]byte, error)
func (*BLSSignature) Serialize ¶ added in v0.17.0
func (s *BLSSignature) Serialize(w *codec.EncodingWriter) error
func (*BLSSignature) Signature ¶ added in v0.17.0
func (p *BLSSignature) Signature() (*blsu.Signature, error)
func (BLSSignature) String ¶ added in v0.17.0
func (p BLSSignature) String() string
func (*BLSSignature) UnmarshalText ¶ added in v0.17.0
func (p *BLSSignature) UnmarshalText(text []byte) error
type BLSSignatureView ¶
type BLSSignatureView struct {
*BasicVectorView
}
func ViewSignature ¶
func ViewSignature(sig *BLSSignature) *BLSSignatureView
type BLSToExecutionChange ¶ added in v0.29.0
type BLSToExecutionChange struct { ValidatorIndex ValidatorIndex `json:"validator_index" yaml:"validator_index"` FromBLSPubKey BLSPubkey `json:"from_bls_pubkey" yaml:"from_bls_pubkey"` ToExecutionAddress Eth1Address `json:"to_execution_address" yaml:"to_execution_address"` }
func (*BLSToExecutionChange) ByteLength ¶ added in v0.29.0
func (s *BLSToExecutionChange) ByteLength() uint64
func (*BLSToExecutionChange) Deserialize ¶ added in v0.29.0
func (s *BLSToExecutionChange) Deserialize(dr *codec.DecodingReader) error
func (*BLSToExecutionChange) FixedLength ¶ added in v0.29.0
func (s *BLSToExecutionChange) FixedLength() uint64
func (*BLSToExecutionChange) HashTreeRoot ¶ added in v0.29.0
func (s *BLSToExecutionChange) HashTreeRoot(hFn tree.HashFn) Root
func (*BLSToExecutionChange) Serialize ¶ added in v0.29.0
func (s *BLSToExecutionChange) Serialize(w *codec.EncodingWriter) error
func (*BLSToExecutionChange) View ¶ added in v0.29.0
func (s *BLSToExecutionChange) View() *BLSToExecutionChangeView
type BLSToExecutionChangeView ¶ added in v0.29.0
type BLSToExecutionChangeView struct {
*ContainerView
}
func AsBLSToExecutionChange ¶ added in v0.29.0
func AsBLSToExecutionChange(v View, err error) (*BLSToExecutionChangeView, error)
func (*BLSToExecutionChangeView) FromBLSPubKey ¶ added in v0.29.0
func (v *BLSToExecutionChangeView) FromBLSPubKey() (BLSPubkey, error)
func (*BLSToExecutionChangeView) Raw ¶ added in v0.29.0
func (v *BLSToExecutionChangeView) Raw() (*BLSToExecutionChange, error)
func (*BLSToExecutionChangeView) ToExecutionAddress ¶ added in v0.29.0
func (v *BLSToExecutionChangeView) ToExecutionAddress() (Eth1Address, error)
func (*BLSToExecutionChangeView) ValidatorIndex ¶ added in v0.29.0
func (v *BLSToExecutionChangeView) ValidatorIndex() (ValidatorIndex, error)
type BalancesRegistry ¶ added in v0.19.0
type BatchRoots ¶
type BeaconBlockEnvelope ¶
type BeaconBlockEnvelope struct { ForkDigest ForkDigest // Block header details BeaconBlockHeader // Fork-specific block body Body SpecObj // Cached block root (hash-tree-root of Message) BlockRoot Root // Block signature Signature BLSSignature }
func (*BeaconBlockEnvelope) VerifySignature ¶
func (b *BeaconBlockEnvelope) VerifySignature(spec *Spec, genesisValidatorsRoot Root, proposer ValidatorIndex, pub *CachedPubkey) bool
func (*BeaconBlockEnvelope) VerifySignatureVersioned ¶ added in v0.16.0
func (b *BeaconBlockEnvelope) VerifySignatureVersioned(spec *Spec, version Version, genesisValidatorsRoot Root, proposer ValidatorIndex, cachedPub *CachedPubkey) bool
type BeaconBlockHeader ¶
type BeaconBlockHeader struct { Slot Slot `json:"slot" yaml:"slot"` ProposerIndex ValidatorIndex `json:"proposer_index" yaml:"proposer_index"` ParentRoot Root `json:"parent_root" yaml:"parent_root"` StateRoot Root `json:"state_root" yaml:"state_root"` BodyRoot Root `json:"body_root" yaml:"body_root"` }
func (*BeaconBlockHeader) ByteLength ¶
func (s *BeaconBlockHeader) ByteLength() uint64
func (*BeaconBlockHeader) Deserialize ¶
func (s *BeaconBlockHeader) Deserialize(dr *codec.DecodingReader) error
func (*BeaconBlockHeader) FixedLength ¶
func (b *BeaconBlockHeader) FixedLength() uint64
func (*BeaconBlockHeader) HashTreeRoot ¶
func (b *BeaconBlockHeader) HashTreeRoot(hFn tree.HashFn) Root
func (*BeaconBlockHeader) Serialize ¶
func (s *BeaconBlockHeader) Serialize(w *codec.EncodingWriter) error
func (*BeaconBlockHeader) View ¶
func (h *BeaconBlockHeader) View() *BeaconBlockHeaderView
type BeaconBlockHeaderView ¶
type BeaconBlockHeaderView struct {
*ContainerView
}
func AsBeaconBlockHeader ¶
func AsBeaconBlockHeader(v View, err error) (*BeaconBlockHeaderView, error)
func (*BeaconBlockHeaderView) BodyRoot ¶
func (v *BeaconBlockHeaderView) BodyRoot() (Root, error)
func (*BeaconBlockHeaderView) ParentRoot ¶
func (v *BeaconBlockHeaderView) ParentRoot() (Root, error)
func (*BeaconBlockHeaderView) ProposerIndex ¶
func (v *BeaconBlockHeaderView) ProposerIndex() (ValidatorIndex, error)
func (*BeaconBlockHeaderView) Raw ¶
func (v *BeaconBlockHeaderView) Raw() (*BeaconBlockHeader, error)
func (*BeaconBlockHeaderView) SetStateRoot ¶
func (v *BeaconBlockHeaderView) SetStateRoot(root Root) error
func (*BeaconBlockHeaderView) Slot ¶
func (v *BeaconBlockHeaderView) Slot() (Slot, error)
func (*BeaconBlockHeaderView) StateRoot ¶
func (v *BeaconBlockHeaderView) StateRoot() (Root, error)
type BeaconState ¶
type BeaconState interface { view.View GenesisTime() (Timestamp, error) SetGenesisTime(t Timestamp) error GenesisValidatorsRoot() (Root, error) SetGenesisValidatorsRoot(r Root) error Slot() (Slot, error) SetSlot(slot Slot) error Fork() (Fork, error) SetFork(f Fork) error // Returns a copy of the latest header in the state LatestBlockHeader() (*BeaconBlockHeader, error) SetLatestBlockHeader(v *BeaconBlockHeader) error BlockRoots() (BatchRoots, error) StateRoots() (BatchRoots, error) HistoricalRoots() (HistoricalRoots, error) Eth1Data() (Eth1Data, error) SetEth1Data(v Eth1Data) error Eth1DataVotes() (Eth1DataVotes, error) Eth1DepositIndex() (DepositIndex, error) IncrementDepositIndex() error Validators() (ValidatorRegistry, error) Balances() (BalancesRegistry, error) SetBalances(balances []Gwei) error AddValidator(spec *Spec, pub BLSPubkey, withdrawalCreds Root, balance Gwei) error RandaoMixes() (RandaoMixes, error) SeedRandao(spec *Spec, seed Root) error Slashings() (Slashings, error) JustificationBits() (JustificationBits, error) SetJustificationBits(bits JustificationBits) error PreviousJustifiedCheckpoint() (Checkpoint, error) SetPreviousJustifiedCheckpoint(c Checkpoint) error CurrentJustifiedCheckpoint() (Checkpoint, error) SetCurrentJustifiedCheckpoint(c Checkpoint) error FinalizedCheckpoint() (Checkpoint, error) SetFinalizedCheckpoint(c Checkpoint) error HashTreeRoot(fn tree.HashFn) Root CopyState() (BeaconState, error) ForkSettings(spec *Spec) *ForkSettings // ProcessEpoch applies an epoch-transition to the state. ProcessEpoch(ctx context.Context, spec *Spec, epc *EpochsContext) error // ProcessBlock applies a block to the state. // Excludes slot processing and signature validation. Just applies the block as-is. Error if mismatching slot. ProcessBlock(ctx context.Context, spec *Spec, epc *EpochsContext, benv *BeaconBlockEnvelope) error }
type BellatrixPreset ¶ added in v0.25.0
type BellatrixPreset struct { INACTIVITY_PENALTY_QUOTIENT_BELLATRIX Uint64View `yaml:"INACTIVITY_PENALTY_QUOTIENT_BELLATRIX" json:"INACTIVITY_PENALTY_QUOTIENT_BELLATRIX"` MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX Uint64View `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX" json:"MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX"` PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX Uint64View `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX" json:"PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX"` MAX_BYTES_PER_TRANSACTION Uint64View `yaml:"MAX_BYTES_PER_TRANSACTION" json:"MAX_BYTES_PER_TRANSACTION"` MAX_TRANSACTIONS_PER_PAYLOAD Uint64View `yaml:"MAX_TRANSACTIONS_PER_PAYLOAD" json:"MAX_TRANSACTIONS_PER_PAYLOAD"` BYTES_PER_LOGS_BLOOM Uint64View `yaml:"BYTES_PER_LOGS_BLOOM" json:"BYTES_PER_LOGS_BLOOM"` MAX_EXTRA_DATA_BYTES Uint64View `yaml:"MAX_EXTRA_DATA_BYTES" json:"MAX_EXTRA_DATA_BYTES"` }
type BoundedIndex ¶
type BoundedIndex struct { Index ValidatorIndex Activation Epoch Exit Epoch }
func LoadBoundedIndices ¶
func LoadBoundedIndices(validators ValidatorRegistry) ([]BoundedIndex, error)
type BuilderBalancesRegistry ¶ added in v0.19.0
type BuilderBeaconState ¶ added in v0.19.0
type BuilderBeaconState interface { BeaconState BlobBuilders() (BuilderRegistry, error) BlobBuilderBalances() (BuilderBalancesRegistry, error) }
type BuilderIndex ¶ added in v0.19.0
type BuilderIndex Uint64View
Index of a builder, pointing to a builder registry location
func AsBuilderIndex ¶ added in v0.19.0
func AsBuilderIndex(v View, err error) (BuilderIndex, error)
func (BuilderIndex) ByteLength ¶ added in v0.19.0
func (BuilderIndex) ByteLength() uint64
func (*BuilderIndex) Deserialize ¶ added in v0.19.0
func (bi *BuilderIndex) Deserialize(dr *codec.DecodingReader) error
func (BuilderIndex) FixedLength ¶ added in v0.19.0
func (BuilderIndex) FixedLength() uint64
func (BuilderIndex) HashTreeRoot ¶ added in v0.19.0
func (bi BuilderIndex) HashTreeRoot(hFn tree.HashFn) Root
func (BuilderIndex) MarshalJSON ¶ added in v0.19.0
func (bi BuilderIndex) MarshalJSON() ([]byte, error)
func (BuilderIndex) Serialize ¶ added in v0.19.0
func (bi BuilderIndex) Serialize(w *codec.EncodingWriter) error
func (BuilderIndex) String ¶ added in v0.19.0
func (bi BuilderIndex) String() string
func (*BuilderIndex) UnmarshalJSON ¶ added in v0.19.0
func (bi *BuilderIndex) UnmarshalJSON(b []byte) error
type BuilderPubkeyCache ¶ added in v0.19.0
type BuilderPubkeyCache struct {
// contains filtered or unexported fields
}
BuilderPubkeyCache is shared between any state. However, if .Append(index, pubkey) conflicts, a new cache will be forked out.
func EmptyBuilderPubkeyCache ¶ added in v0.19.0
func EmptyBuilderPubkeyCache() *BuilderPubkeyCache
func NewBuilderPubkeyCache ¶ added in v0.19.0
func NewBuilderPubkeyCache(builders BuilderRegistry) (*BuilderPubkeyCache, error)
func (*BuilderPubkeyCache) AddBuilder ¶ added in v0.19.0
func (pc *BuilderPubkeyCache) AddBuilder(index BuilderIndex, pub BLSPubkey) (*BuilderPubkeyCache, error)
AddBuilder appends the (index, pubkey) pair to the pubkey cache. It returns the same cache if the added entry is not conflicting. If it conflicts, the part is inherited, and a forked pubkey cache is returned.
func (*BuilderPubkeyCache) BuilderIndex ¶ added in v0.19.0
func (pc *BuilderPubkeyCache) BuilderIndex(pubkey BLSPubkey) (index BuilderIndex, ok bool)
Get the builder index of a pubkey. Note: this does not mean the builder is part of the current state. It merely means that this is a known pubkey for that particular builder (could be in a later part of a forked version of the state).
func (*BuilderPubkeyCache) Pubkey ¶ added in v0.19.0
func (pc *BuilderPubkeyCache) Pubkey(index BuilderIndex) (pub *CachedPubkey, ok bool)
Get the pubkey of a builder index. Note: this does not mean the builder is part of the current state. It merely means that this is a known pubkey for that particular builder (could be in a later part of a forked version of the state).
type BuilderRegistry ¶ added in v0.19.0
type CachedPubkey ¶
type CachedPubkey struct { Compressed BLSPubkey // contains filtered or unexported fields }
type CapellaPreset ¶ added in v0.29.0
type CapellaPreset struct { MAX_BLS_TO_EXECUTION_CHANGES Uint64View `yaml:"MAX_BLS_TO_EXECUTION_CHANGES" json:"MAX_BLS_TO_EXECUTION_CHANGES"` MAX_WITHDRAWALS_PER_PAYLOAD Uint64View `yaml:"MAX_WITHDRAWALS_PER_PAYLOAD" json:"MAX_WITHDRAWALS_PER_PAYLOAD"` MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP Uint64View `yaml:"MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP" json:"MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP"` }
type Checkpoint ¶
type Checkpoint struct { Epoch Epoch `json:"epoch" yaml:"epoch"` Root Root `json:"root" yaml:"root"` }
func (*Checkpoint) ByteLength ¶
func (a *Checkpoint) ByteLength() uint64
func (*Checkpoint) Deserialize ¶
func (c *Checkpoint) Deserialize(dr *codec.DecodingReader) error
func (*Checkpoint) FixedLength ¶
func (g *Checkpoint) FixedLength() uint64
func (*Checkpoint) HashTreeRoot ¶
func (c *Checkpoint) HashTreeRoot(hFn tree.HashFn) Root
func (*Checkpoint) Serialize ¶
func (a *Checkpoint) Serialize(w *codec.EncodingWriter) error
func (*Checkpoint) String ¶
func (c *Checkpoint) String() string
func (*Checkpoint) View ¶
func (c *Checkpoint) View() *CheckpointView
type CheckpointView ¶
type CheckpointView struct {
*ContainerView
}
func AsCheckPoint ¶
func AsCheckPoint(v View, err error) (*CheckpointView, error)
func (*CheckpointView) Epoch ¶
func (v *CheckpointView) Epoch() (Epoch, error)
func (*CheckpointView) Raw ¶
func (v *CheckpointView) Raw() (Checkpoint, error)
func (*CheckpointView) Root ¶
func (v *CheckpointView) Root() (Root, error)
func (*CheckpointView) Set ¶
func (v *CheckpointView) Set(ch *Checkpoint) error
type CommitteeIndex ¶
type CommitteeIndex Uint64View
func AsCommitteeIndex ¶
func AsCommitteeIndex(v View, err error) (CommitteeIndex, error)
func (CommitteeIndex) ByteLength ¶
func (CommitteeIndex) ByteLength() uint64
func (*CommitteeIndex) Deserialize ¶
func (i *CommitteeIndex) Deserialize(dr *codec.DecodingReader) error
func (CommitteeIndex) FixedLength ¶
func (CommitteeIndex) FixedLength() uint64
func (CommitteeIndex) HashTreeRoot ¶
func (i CommitteeIndex) HashTreeRoot(hFn tree.HashFn) Root
func (CommitteeIndex) MarshalJSON ¶
func (e CommitteeIndex) MarshalJSON() ([]byte, error)
func (CommitteeIndex) Serialize ¶
func (i CommitteeIndex) Serialize(w *codec.EncodingWriter) error
func (CommitteeIndex) String ¶
func (e CommitteeIndex) String() string
func (*CommitteeIndex) UnmarshalJSON ¶
func (e *CommitteeIndex) UnmarshalJSON(b []byte) error
type CommitteeIndices ¶
type CommitteeIndices []ValidatorIndex
func (CommitteeIndices) ByteLength ¶
func (a CommitteeIndices) ByteLength(*Spec) uint64
func (*CommitteeIndices) Deserialize ¶
func (p *CommitteeIndices) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*CommitteeIndices) FixedLength ¶
func (*CommitteeIndices) FixedLength(*Spec) uint64
func (CommitteeIndices) HashTreeRoot ¶
func (p CommitteeIndices) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (CommitteeIndices) Serialize ¶
func (a CommitteeIndices) Serialize(_ *Spec, w *codec.EncodingWriter) error
type Config ¶ added in v0.16.0
type Config struct { PRESET_BASE string `yaml:"PRESET_BASE" json:"PRESET_BASE"` // Genesis. MIN_GENESIS_ACTIVE_VALIDATOR_COUNT Uint64View `yaml:"MIN_GENESIS_ACTIVE_VALIDATOR_COUNT" json:"MIN_GENESIS_ACTIVE_VALIDATOR_COUNT"` MIN_GENESIS_TIME Timestamp `yaml:"MIN_GENESIS_TIME" json:"MIN_GENESIS_TIME"` GENESIS_FORK_VERSION Version `yaml:"GENESIS_FORK_VERSION" json:"GENESIS_FORK_VERSION"` GENESIS_DELAY Timestamp `yaml:"GENESIS_DELAY" json:"GENESIS_DELAY"` // Altair ALTAIR_FORK_VERSION Version `yaml:"ALTAIR_FORK_VERSION" json:"ALTAIR_FORK_VERSION"` ALTAIR_FORK_EPOCH Epoch `yaml:"ALTAIR_FORK_EPOCH" json:"ALTAIR_FORK_EPOCH"` // Bellatrix BELLATRIX_FORK_VERSION Version `yaml:"BELLATRIX_FORK_VERSION" json:"BELLATRIX_FORK_VERSION"` BELLATRIX_FORK_EPOCH Epoch `yaml:"BELLATRIX_FORK_EPOCH" json:"BELLATRIX_FORK_EPOCH"` // Capella CAPELLA_FORK_VERSION Version `yaml:"CAPELLA_FORK_VERSION" json:"CAPELLA_FORK_VERSION"` CAPELLA_FORK_EPOCH Epoch `yaml:"CAPELLA_FORK_EPOCH" json:"CAPELLA_FORK_EPOCH"` // Sharding SHARDING_FORK_VERSION Version `yaml:"SHARDING_FORK_VERSION" json:"SHARDING_FORK_VERSION"` SHARDING_FORK_EPOCH Epoch `yaml:"SHARDING_FORK_EPOCH" json:"SHARDING_FORK_EPOCH"` // Merge transition TERMINAL_TOTAL_DIFFICULTY Uint256View `yaml:"TERMINAL_TOTAL_DIFFICULTY" json:"TERMINAL_TOTAL_DIFFICULTY"` TERMINAL_BLOCK_HASH Bytes32 `yaml:"TERMINAL_BLOCK_HASH" json:"TERMINAL_BLOCK_HASH"` TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH Timestamp `yaml:"TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH" json:"TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH"` // Time parameters SECONDS_PER_SLOT Timestamp `yaml:"SECONDS_PER_SLOT" json:"SECONDS_PER_SLOT"` SECONDS_PER_ETH1_BLOCK Uint64View `yaml:"SECONDS_PER_ETH1_BLOCK" json:"SECONDS_PER_ETH1_BLOCK"` MIN_VALIDATOR_WITHDRAWABILITY_DELAY Epoch `yaml:"MIN_VALIDATOR_WITHDRAWABILITY_DELAY" json:"MIN_VALIDATOR_WITHDRAWABILITY_DELAY"` SHARD_COMMITTEE_PERIOD Epoch `yaml:"SHARD_COMMITTEE_PERIOD" json:"SHARD_COMMITTEE_PERIOD"` ETH1_FOLLOW_DISTANCE Uint64View `yaml:"ETH1_FOLLOW_DISTANCE" json:"ETH1_FOLLOW_DISTANCE"` // Validator cycle INACTIVITY_SCORE_BIAS Uint64View `yaml:"INACTIVITY_SCORE_BIAS" json:"INACTIVITY_SCORE_BIAS"` INACTIVITY_SCORE_RECOVERY_RATE Uint64View `yaml:"INACTIVITY_SCORE_RECOVERY_RATE" json:"INACTIVITY_SCORE_RECOVERY_RATE"` EJECTION_BALANCE Gwei `yaml:"EJECTION_BALANCE" json:"EJECTION_BALANCE"` MIN_PER_EPOCH_CHURN_LIMIT Uint64View `yaml:"MIN_PER_EPOCH_CHURN_LIMIT" json:"MIN_PER_EPOCH_CHURN_LIMIT"` CHURN_LIMIT_QUOTIENT Uint64View `yaml:"CHURN_LIMIT_QUOTIENT" json:"CHURN_LIMIT_QUOTIENT"` // Fork choice PROPOSER_SCORE_BOOST Uint64View `yaml:"PROPOSER_SCORE_BOOST" json:"PROPOSER_SCORE_BOOST"` // Deposit contract DEPOSIT_CHAIN_ID Uint64View `yaml:"DEPOSIT_CHAIN_ID" json:"DEPOSIT_CHAIN_ID"` DEPOSIT_NETWORK_ID Uint64View `yaml:"DEPOSIT_NETWORK_ID" json:"DEPOSIT_NETWORK_ID"` DEPOSIT_CONTRACT_ADDRESS Eth1Address `yaml:"DEPOSIT_CONTRACT_ADDRESS" json:"DEPOSIT_CONTRACT_ADDRESS"` }
type Deltas ¶
type Deltas struct { Rewards GweiList `json:"rewards" yaml:"rewards"` Penalties GweiList `json:"penalties" yaml:"penalties"` }
func (*Deltas) ByteLength ¶
func (*Deltas) Deserialize ¶
func (a *Deltas) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Deltas) FixedLength ¶
type Deposit ¶
type Deposit struct { Proof DepositProof `json:"proof" yaml:"proof"` Data DepositData `json:"data" yaml:"data"` }
func (*Deposit) ByteLength ¶
func (*Deposit) Deserialize ¶
func (d *Deposit) Deserialize(dr *codec.DecodingReader) error
func (*Deposit) FixedLength ¶
type DepositData ¶
type DepositData struct { Pubkey BLSPubkey `json:"pubkey" yaml:"pubkey"` WithdrawalCredentials Root `json:"withdrawal_credentials" yaml:"withdrawal_credentials"` Amount Gwei `json:"amount" yaml:"amount"` // Signing over DepositMessage Signature BLSSignature `json:"signature" yaml:"signature"` }
func (*DepositData) ByteLength ¶
func (a *DepositData) ByteLength() uint64
func (*DepositData) Deserialize ¶
func (d *DepositData) Deserialize(dr *codec.DecodingReader) error
func (*DepositData) FixedLength ¶
func (a *DepositData) FixedLength() uint64
func (*DepositData) HashTreeRoot ¶
func (d *DepositData) HashTreeRoot(hFn tree.HashFn) Root
hash-tree-root including the signature
func (*DepositData) MessageRoot ¶
func (d *DepositData) MessageRoot() Root
hash-tree-root excluding the signature
func (*DepositData) Serialize ¶
func (d *DepositData) Serialize(w *codec.EncodingWriter) error
func (*DepositData) ToMessage ¶
func (d *DepositData) ToMessage() *DepositMessage
type DepositIndex ¶
type DepositIndex Uint64View
Eth1 deposit ordering
func AsDepositIndex ¶
func AsDepositIndex(v View, err error) (DepositIndex, error)
func (DepositIndex) ByteLength ¶
func (DepositIndex) ByteLength() uint64
func (*DepositIndex) Deserialize ¶
func (i *DepositIndex) Deserialize(dr *codec.DecodingReader) error
func (DepositIndex) FixedLength ¶
func (DepositIndex) FixedLength() uint64
func (DepositIndex) HashTreeRoot ¶
func (i DepositIndex) HashTreeRoot(hFn tree.HashFn) Root
func (DepositIndex) MarshalJSON ¶
func (e DepositIndex) MarshalJSON() ([]byte, error)
func (DepositIndex) Serialize ¶
func (i DepositIndex) Serialize(w *codec.EncodingWriter) error
func (DepositIndex) String ¶
func (e DepositIndex) String() string
func (*DepositIndex) UnmarshalJSON ¶
func (e *DepositIndex) UnmarshalJSON(b []byte) error
type DepositMessage ¶
type DepositMessage struct { Pubkey BLSPubkey `json:"pubkey" yaml:"pubkey"` WithdrawalCredentials Root `json:"withdrawal_credentials" yaml:"withdrawal_credentials"` Amount Gwei `json:"amount" yaml:"amount"` }
func (*DepositMessage) ByteLength ¶ added in v0.16.1
func (a *DepositMessage) ByteLength() uint64
func (*DepositMessage) Deserialize ¶ added in v0.16.1
func (d *DepositMessage) Deserialize(dr *codec.DecodingReader) error
func (*DepositMessage) FixedLength ¶ added in v0.16.1
func (a *DepositMessage) FixedLength() uint64
func (*DepositMessage) HashTreeRoot ¶
func (b *DepositMessage) HashTreeRoot(hFn tree.HashFn) Root
func (*DepositMessage) Serialize ¶ added in v0.16.1
func (d *DepositMessage) Serialize(w *codec.EncodingWriter) error
type DepositProof ¶
type DepositProof [DEPOSIT_CONTRACT_TREE_DEPTH + 1]Root
DepositProof contains the proof for the merkle-path to deposit root, including list mix-in.
func (*DepositProof) ByteLength ¶
func (a *DepositProof) ByteLength() uint64
func (*DepositProof) Deserialize ¶
func (d *DepositProof) Deserialize(dr *codec.DecodingReader) error
func (*DepositProof) FixedLength ¶
func (a *DepositProof) FixedLength() uint64
func (*DepositProof) HashTreeRoot ¶
func (b *DepositProof) HashTreeRoot(hFn tree.HashFn) Root
func (*DepositProof) Serialize ¶
func (d *DepositProof) Serialize(w *codec.EncodingWriter) error
type EnvelopeBuilder ¶
type EnvelopeBuilder interface {
Envelope(spec *Spec, digest ForkDigest) *BeaconBlockEnvelope
}
type Epoch ¶
type Epoch Uint64View
const GENESIS_EPOCH Epoch = 0
func (Epoch) ByteLength ¶
func (*Epoch) Deserialize ¶
func (a *Epoch) Deserialize(dr *codec.DecodingReader) error
func (Epoch) FixedLength ¶
func (Epoch) MarshalJSON ¶
func (*Epoch) UnmarshalJSON ¶
type EpochsContext ¶
type EpochsContext struct { Spec *Spec // ValidatorPubkeyCache may be replaced when a new forked-out cache takes over to process an alternative Eth1 deposit chain. ValidatorPubkeyCache *PubkeyCache Proposers *ProposersEpoch BuilderPubkeyCache *BuilderPubkeyCache PreviousEpoch *ShufflingEpoch CurrentEpoch *ShufflingEpoch NextEpoch *ShufflingEpoch // nil for pre-altair chain CurrentSyncCommittee *IndexedSyncCommittee NextSyncCommittee *IndexedSyncCommittee // TODO: track active effective balances // TODO: track total active stake // Effective balances of all validators at the start of the epoch. EffectiveBalances []Gwei // Total effective balance of the active validators at the start of the epoch. TotalActiveStake Gwei // cached integer square root of TotalActiveStake TotalActiveStakeSqRoot Gwei }
func NewEpochsContext ¶
func NewEpochsContext(spec *Spec, state BeaconState) (*EpochsContext, error)
NewEpochsContext constructs a new context for the processing of the current epoch.
func (*EpochsContext) Clone ¶
func (epc *EpochsContext) Clone() *EpochsContext
func (*EpochsContext) ComputeShardFromCommitteeIndex ¶ added in v0.16.0
func (epc *EpochsContext) ComputeShardFromCommitteeIndex(slot Slot, index CommitteeIndex) (Shard, error)
func (*EpochsContext) GetBeaconCommittee ¶
func (epc *EpochsContext) GetBeaconCommittee(slot Slot, index CommitteeIndex) ([]ValidatorIndex, error)
Return the beacon committee at slot for index.
func (*EpochsContext) GetBeaconProposer ¶
func (epc *EpochsContext) GetBeaconProposer(slot Slot) (ValidatorIndex, error)
func (*EpochsContext) GetCommitteeCountPerSlot ¶ added in v0.16.0
func (epc *EpochsContext) GetCommitteeCountPerSlot(epoch Epoch) (uint64, error)
func (*EpochsContext) GetShardProposer ¶ added in v0.16.0
func (epc *EpochsContext) GetShardProposer(slot Slot, shard Shard) (ValidatorIndex, error)
func (*EpochsContext) LoadProposers ¶
func (epc *EpochsContext) LoadProposers(state BeaconState) error
func (*EpochsContext) LoadShuffling ¶
func (epc *EpochsContext) LoadShuffling(state BeaconState) error
func (*EpochsContext) LoadSyncCommittees ¶ added in v0.16.0
func (epc *EpochsContext) LoadSyncCommittees(state SyncCommitteeBeaconState) error
func (*EpochsContext) RotateEpochs ¶
func (epc *EpochsContext) RotateEpochs(state BeaconState) error
func (*EpochsContext) StartShard ¶ added in v0.16.0
func (epc *EpochsContext) StartShard(slot Slot) (Shard, error)
type Eth1Address ¶
type Eth1Address [20]byte
func AsEth1Address ¶ added in v0.15.1
func AsEth1Address(v View, err error) (Eth1Address, error)
func (*Eth1Address) ByteLength ¶ added in v0.15.1
func (*Eth1Address) ByteLength() uint64
func (*Eth1Address) Deserialize ¶ added in v0.15.1
func (addr *Eth1Address) Deserialize(dr *codec.DecodingReader) error
func (*Eth1Address) FixedLength ¶ added in v0.15.1
func (*Eth1Address) FixedLength() uint64
func (*Eth1Address) HashTreeRoot ¶ added in v0.15.1
func (addr *Eth1Address) HashTreeRoot(hFn tree.HashFn) tree.Root
func (Eth1Address) MarshalText ¶
func (addr Eth1Address) MarshalText() ([]byte, error)
func (*Eth1Address) Serialize ¶ added in v0.15.1
func (addr *Eth1Address) Serialize(w *codec.EncodingWriter) error
func (Eth1Address) String ¶
func (addr Eth1Address) String() string
func (*Eth1Address) UnmarshalText ¶
func (addr *Eth1Address) UnmarshalText(text []byte) error
func (Eth1Address) View ¶ added in v0.15.1
func (addr Eth1Address) View() SmallByteVecView
type Eth1Data ¶
type Eth1Data struct { // Hash-tree-root of DepositData tree. DepositRoot Root `json:"deposit_root" yaml:"deposit_root"` DepositCount DepositIndex `json:"deposit_count" yaml:"deposit_count"` BlockHash Root `json:"block_hash" yaml:"block_hash"` }
func (*Eth1Data) ByteLength ¶
func (*Eth1Data) Deserialize ¶
func (b *Eth1Data) Deserialize(dr *codec.DecodingReader) error
func (*Eth1Data) FixedLength ¶
func (*Eth1Data) View ¶
func (dat *Eth1Data) View() *Eth1DataView
type Eth1DataView ¶
type Eth1DataView struct{ *ContainerView }
func AsEth1Data ¶
func AsEth1Data(v View, err error) (*Eth1DataView, error)
func (*Eth1DataView) BlockHash ¶
func (v *Eth1DataView) BlockHash() (Root, error)
func (*Eth1DataView) DepositCount ¶
func (v *Eth1DataView) DepositCount() (DepositIndex, error)
func (*Eth1DataView) DepositRoot ¶
func (v *Eth1DataView) DepositRoot() (Root, error)
func (*Eth1DataView) Raw ¶
func (v *Eth1DataView) Raw() (Eth1Data, error)
func (*Eth1DataView) SetDepositRoot ¶
func (v *Eth1DataView) SetDepositRoot(r Root) error
type Eth1DataVotes ¶
type Eth2Data ¶
type Eth2Data struct { ForkDigest ForkDigest `json:"fork_digest" yaml:"fork_digest"` NextForkVersion Version `json:"next_fork_version" yaml:"next_fork_version"` NextForkEpoch Epoch `json:"next_fork_epoch" yaml:"next_fork_epoch"` }
func (Eth2Data) ByteLength ¶
func (*Eth2Data) Deserialize ¶
func (d *Eth2Data) Deserialize(dr *codec.DecodingReader) error
func (*Eth2Data) FixedLength ¶
type ExecutionEngine ¶ added in v0.16.0
type ExecutionPayload ¶ added in v0.16.0
type ExecutionPayload struct { ParentHash Hash32 `json:"parent_hash" yaml:"parent_hash"` FeeRecipient Eth1Address `json:"fee_recipient" yaml:"fee_recipient"` StateRoot Bytes32 `json:"state_root" yaml:"state_root"` ReceiptsRoot Bytes32 `json:"receipts_root" yaml:"receipts_root"` LogsBloom LogsBloom `json:"logs_bloom" yaml:"logs_bloom"` PrevRandao Bytes32 `json:"prev_randao" yaml:"prev_randao"` BlockNumber Uint64View `json:"block_number" yaml:"block_number"` GasLimit Uint64View `json:"gas_limit" yaml:"gas_limit"` GasUsed Uint64View `json:"gas_used" yaml:"gas_used"` Timestamp Timestamp `json:"timestamp" yaml:"timestamp"` ExtraData ExtraData `json:"extra_data" yaml:"extra_data"` BaseFeePerGas Uint256View `json:"base_fee_per_gas" yaml:"base_fee_per_gas"` BlockHash Hash32 `json:"block_hash" yaml:"block_hash"` Transactions PayloadTransactions `json:"transactions" yaml:"transactions"` }
func (*ExecutionPayload) ByteLength ¶ added in v0.16.0
func (s *ExecutionPayload) ByteLength(spec *Spec) uint64
func (*ExecutionPayload) Deserialize ¶ added in v0.16.0
func (s *ExecutionPayload) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*ExecutionPayload) FixedLength ¶ added in v0.16.0
func (a *ExecutionPayload) FixedLength(*Spec) uint64
func (*ExecutionPayload) HashTreeRoot ¶ added in v0.16.0
func (s *ExecutionPayload) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*ExecutionPayload) Header ¶ added in v0.16.0
func (ep *ExecutionPayload) Header(spec *Spec) *ExecutionPayloadHeader
func (*ExecutionPayload) Serialize ¶ added in v0.16.0
func (s *ExecutionPayload) Serialize(spec *Spec, w *codec.EncodingWriter) error
type ExecutionPayloadHeader ¶ added in v0.16.0
type ExecutionPayloadHeader struct { ParentHash Hash32 `json:"parent_hash" yaml:"parent_hash"` FeeRecipient Eth1Address `json:"fee_recipient" yaml:"fee_recipient"` StateRoot Bytes32 `json:"state_root" yaml:"state_root"` ReceiptsRoot Bytes32 `json:"receipts_root" yaml:"receipts_root"` LogsBloom LogsBloom `json:"logs_bloom" yaml:"logs_bloom"` PrevRandao Bytes32 `json:"prev_randao" yaml:"prev_randao"` BlockNumber Uint64View `json:"block_number" yaml:"block_number"` GasLimit Uint64View `json:"gas_limit" yaml:"gas_limit"` GasUsed Uint64View `json:"gas_used" yaml:"gas_used"` Timestamp Timestamp `json:"timestamp" yaml:"timestamp"` ExtraData ExtraData `json:"extra_data" yaml:"extra_data"` BaseFeePerGas Uint256View `json:"base_fee_per_gas" yaml:"base_fee_per_gas"` BlockHash Hash32 `json:"block_hash" yaml:"block_hash"` TransactionsRoot Root `json:"transactions_root" yaml:"transactions_root"` }
func (*ExecutionPayloadHeader) ByteLength ¶ added in v0.16.0
func (s *ExecutionPayloadHeader) ByteLength() uint64
func (*ExecutionPayloadHeader) Deserialize ¶ added in v0.16.0
func (s *ExecutionPayloadHeader) Deserialize(dr *codec.DecodingReader) error
func (*ExecutionPayloadHeader) FixedLength ¶ added in v0.16.0
func (b *ExecutionPayloadHeader) FixedLength() uint64
func (*ExecutionPayloadHeader) HashTreeRoot ¶ added in v0.16.0
func (s *ExecutionPayloadHeader) HashTreeRoot(hFn tree.HashFn) Root
func (*ExecutionPayloadHeader) Serialize ¶ added in v0.16.0
func (s *ExecutionPayloadHeader) Serialize(w *codec.EncodingWriter) error
func (*ExecutionPayloadHeader) View ¶ added in v0.16.0
func (s *ExecutionPayloadHeader) View() *ExecutionPayloadHeaderView
type ExecutionPayloadHeaderView ¶ added in v0.16.0
type ExecutionPayloadHeaderView struct {
*ContainerView
}
func AsExecutionPayloadHeader ¶ added in v0.16.0
func AsExecutionPayloadHeader(v View, err error) (*ExecutionPayloadHeaderView, error)
func (*ExecutionPayloadHeaderView) BaseFeePerGas ¶ added in v0.20.0
func (v *ExecutionPayloadHeaderView) BaseFeePerGas() (Uint256View, error)
func (*ExecutionPayloadHeaderView) BlockHash ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) BlockHash() (Hash32, error)
func (*ExecutionPayloadHeaderView) BlockNumber ¶ added in v0.19.0
func (v *ExecutionPayloadHeaderView) BlockNumber() (Uint64View, error)
func (*ExecutionPayloadHeaderView) FeeRecipient ¶ added in v0.23.0
func (v *ExecutionPayloadHeaderView) FeeRecipient() (Eth1Address, error)
func (*ExecutionPayloadHeaderView) GasLimit ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) GasLimit() (Uint64View, error)
func (*ExecutionPayloadHeaderView) GasUsed ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) GasUsed() (Uint64View, error)
func (*ExecutionPayloadHeaderView) LogsBloom ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) LogsBloom() (*LogsBloom, error)
func (*ExecutionPayloadHeaderView) ParentHash ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) ParentHash() (Hash32, error)
func (*ExecutionPayloadHeaderView) Random ¶ added in v0.19.0
func (v *ExecutionPayloadHeaderView) Random() (Bytes32, error)
func (*ExecutionPayloadHeaderView) Raw ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) Raw() (*ExecutionPayloadHeader, error)
func (*ExecutionPayloadHeaderView) ReceiptRoot ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) ReceiptRoot() (Bytes32, error)
func (*ExecutionPayloadHeaderView) StateRoot ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) StateRoot() (Bytes32, error)
func (*ExecutionPayloadHeaderView) Timestamp ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) Timestamp() (Timestamp, error)
func (*ExecutionPayloadHeaderView) TransactionsRoot ¶ added in v0.16.0
func (v *ExecutionPayloadHeaderView) TransactionsRoot() (Root, error)
type ExecutionPayloadView ¶ added in v0.16.0
type ExecutionPayloadView struct {
*ContainerView
}
func AsExecutionPayload ¶ added in v0.16.0
func AsExecutionPayload(v View, err error) (*ExecutionPayloadView, error)
type ExtendedNodeRef ¶
func (ExtendedNodeRef) String ¶
func (n ExtendedNodeRef) String() string
type ExtraData ¶ added in v0.21.0
type ExtraData []byte
func (ExtraData) ByteLength ¶ added in v0.21.0
func (*ExtraData) Deserialize ¶ added in v0.21.0
func (otx *ExtraData) Deserialize(dr *codec.DecodingReader) error
func (*ExtraData) FixedLength ¶ added in v0.21.0
func (ExtraData) HashTreeRoot ¶ added in v0.21.0
func (ExtraData) MarshalText ¶ added in v0.21.0
func (ExtraData) Serialize ¶ added in v0.21.0
func (otx ExtraData) Serialize(w *codec.EncodingWriter) error
func (*ExtraData) UnmarshalText ¶ added in v0.21.0
func (ExtraData) View ¶ added in v0.21.0
func (otx ExtraData) View() (*ExtraDataView, error)
type ExtraDataView ¶ added in v0.21.0
type ExtraDataView struct {
*BasicListView
}
func AsExtraData ¶ added in v0.21.0
func AsExtraData(v View, err error) (*ExtraDataView, error)
func (*ExtraDataView) Raw ¶ added in v0.21.0
func (v *ExtraDataView) Raw() (ExtraData, error)
type FlatValidator ¶
type FlatValidator struct { EffectiveBalance Gwei Slashed bool ActivationEligibilityEpoch Epoch ActivationEpoch Epoch ExitEpoch Epoch WithdrawableEpoch Epoch }
func FlattenValidators ¶
func FlattenValidators(vals ValidatorRegistry) ([]FlatValidator, error)
func (*FlatValidator) IsActive ¶
func (v *FlatValidator) IsActive(epoch Epoch) bool
type Fork ¶
type Fork struct { PreviousVersion Version `json:"previous_version" yaml:"previous_version"` CurrentVersion Version `json:"current_version" yaml:"current_version"` Epoch Epoch `json:"epoch" yaml:"epoch"` }
func (*Fork) ByteLength ¶
func (*Fork) Deserialize ¶
func (b *Fork) Deserialize(dr *codec.DecodingReader) error
func (*Fork) FixedLength ¶
type ForkData ¶
type ForkData struct { CurrentVersion Version `json:"current_version" yaml:"current_version"` GenesisValidatorsRoot Root `json:"genesis_validators_root" yaml:"genesis_validators_root"` }
func (ForkData) ByteLength ¶
func (*ForkData) Deserialize ¶
func (v *ForkData) Deserialize(dr *codec.DecodingReader) error
func (*ForkData) FixedLength ¶
type ForkDigest ¶
type ForkDigest [4]byte
A digest of the current fork data
func ComputeForkDigest ¶
func ComputeForkDigest(currentVersion Version, genesisValidatorsRoot Root) ForkDigest
func (ForkDigest) ByteLength ¶
func (p ForkDigest) ByteLength() uint64
func (*ForkDigest) Deserialize ¶
func (p *ForkDigest) Deserialize(dr *codec.DecodingReader) error
func (ForkDigest) FixedLength ¶
func (ForkDigest) FixedLength() uint64
func (ForkDigest) HashTreeRoot ¶
func (p ForkDigest) HashTreeRoot(_ tree.HashFn) (out Root)
func (ForkDigest) MarshalText ¶
func (p ForkDigest) MarshalText() ([]byte, error)
func (ForkDigest) Serialize ¶
func (p ForkDigest) Serialize(w *codec.EncodingWriter) error
func (ForkDigest) String ¶
func (p ForkDigest) String() string
func (*ForkDigest) UnmarshalText ¶
func (p *ForkDigest) UnmarshalText(text []byte) error
type ForkSettings ¶
type ForkSettings struct { MinSlashingPenaltyQuotient uint64 ProportionalSlashingMultiplier uint64 InactivityPenaltyQuotient uint64 }
ForkSettings are values that changed throughout forks, without change in surrounding logic. To select the right settings based on configuration, ForkSettings(spec) is called on the fork-specific implementation of the BeaconState interface.
type ForkView ¶
type ForkView struct{ *ContainerView }
func (*ForkView) CurrentVersion ¶
func (*ForkView) PreviousVersion ¶
type Goodbye ¶
type Goodbye Uint64View
func (Goodbye) ByteLength ¶
func (*Goodbye) Deserialize ¶
func (i *Goodbye) Deserialize(dr *codec.DecodingReader) error
func (Goodbye) FixedLength ¶
func (Goodbye) MarshalJSON ¶
func (*Goodbye) UnmarshalJSON ¶
type Gwei ¶
type Gwei Uint64View
func ApplyDeltas ¶
func ApplyDeltas(state BeaconState, deltas *Deltas) ([]Gwei, error)
Applies deltas to the balances in the state, returns the resulting balances, ready to overwrite the state balances subtree with.
func (Gwei) ByteLength ¶
func (*Gwei) Deserialize ¶
func (g *Gwei) Deserialize(dr *codec.DecodingReader) error
func (Gwei) FixedLength ¶
func (Gwei) MarshalJSON ¶
func (*Gwei) UnmarshalJSON ¶
type GweiList ¶
type GweiList []Gwei
func (GweiList) ByteLength ¶
func (*GweiList) Deserialize ¶
func (a *GweiList) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*GweiList) FixedLength ¶
type HistoricalRoots ¶
type IndexedSyncCommittee ¶ added in v0.16.0
type IndexedSyncCommittee struct { CachedPubkeys []*CachedPubkey Indices []ValidatorIndex }
func (*IndexedSyncCommittee) InSubnet ¶ added in v0.26.1
func (isc *IndexedSyncCommittee) InSubnet(spec *Spec, valIndex ValidatorIndex, subnet uint64) bool
func (*IndexedSyncCommittee) Subcommittee ¶ added in v0.26.1
func (isc *IndexedSyncCommittee) Subcommittee(spec *Spec, subnet uint64) (pubs []*CachedPubkey, indices []ValidatorIndex, err error)
func (*IndexedSyncCommittee) Subnets ¶ added in v0.26.1
func (isc *IndexedSyncCommittee) Subnets(spec *Spec, valIndex ValidatorIndex) (out []uint64)
type JustificationBits ¶
type JustificationBits [1]byte
func (*JustificationBits) BitLen ¶
func (jb *JustificationBits) BitLen() uint64
func (JustificationBits) ByteLength ¶
func (jb JustificationBits) ByteLength() uint64
func (*JustificationBits) Deserialize ¶
func (b *JustificationBits) Deserialize(dr *codec.DecodingReader) error
func (JustificationBits) FixedLength ¶
func (jb JustificationBits) FixedLength() uint64
func (JustificationBits) HashTreeRoot ¶
func (jb JustificationBits) HashTreeRoot(hFn tree.HashFn) Root
func (*JustificationBits) IsJustified ¶
func (jb *JustificationBits) IsJustified(epochsAgo ...Epoch) bool
func (JustificationBits) MarshalText ¶
func (jb JustificationBits) MarshalText() ([]byte, error)
func (*JustificationBits) NextEpoch ¶
func (jb *JustificationBits) NextEpoch()
Prepare bitfield for next epoch by shifting previous bits (truncating to bitfield length)
func (JustificationBits) Serialize ¶
func (a JustificationBits) Serialize(w *codec.EncodingWriter) error
func (*JustificationBits) String ¶
func (jb *JustificationBits) String() string
func (*JustificationBits) UnmarshalText ¶
func (jb *JustificationBits) UnmarshalText(text []byte) error
func (*JustificationBits) View ¶ added in v0.19.0
func (jb *JustificationBits) View() *JustificationBitsView
type JustificationBitsView ¶
type JustificationBitsView struct {
*BitVectorView
}
func AsJustificationBits ¶
func AsJustificationBits(v View, err error) (*JustificationBitsView, error)
func (*JustificationBitsView) Raw ¶
func (v *JustificationBitsView) Raw() (JustificationBits, error)
func (*JustificationBitsView) Set ¶
func (v *JustificationBitsView) Set(bits JustificationBits) error
type LogsBloom ¶ added in v0.16.0
type LogsBloom [BYTES_PER_LOGS_BLOOM]byte
func (*LogsBloom) ByteLength ¶ added in v0.16.0
func (*LogsBloom) Deserialize ¶ added in v0.16.0
func (s *LogsBloom) Deserialize(dr *codec.DecodingReader) error
func (*LogsBloom) FixedLength ¶ added in v0.16.0
func (*LogsBloom) HashTreeRoot ¶ added in v0.16.0
func (*LogsBloom) MarshalText ¶ added in v0.16.0
func (*LogsBloom) Serialize ¶ added in v0.16.0
func (s *LogsBloom) Serialize(w *codec.EncodingWriter) error
func (*LogsBloom) UnmarshalText ¶ added in v0.16.0
func (*LogsBloom) View ¶ added in v0.16.0
func (s *LogsBloom) View() *LogsBloomView
type LogsBloomView ¶ added in v0.16.0
type LogsBloomView struct {
*view.BasicVectorView
}
func AsLogsBloom ¶ added in v0.16.0
func AsLogsBloom(v view.View, err error) (*LogsBloomView, error)
func (*LogsBloomView) Raw ¶ added in v0.16.0
func (v *LogsBloomView) Raw() (*LogsBloom, error)
type MetaData ¶
type MetaData struct { SeqNumber SeqNr `json:"seq_number" yaml:"seq_number"` Attnets AttnetBits `json:"attnets" yaml:"attnets"` Syncnets SyncnetBits `json:"syncnets" yaml:"syncnets"` }
func (MetaData) ByteLength ¶
func (*MetaData) Deserialize ¶
func (d *MetaData) Deserialize(dr *codec.DecodingReader) error
func (*MetaData) FixedLength ¶
type PayloadTransactions ¶ added in v0.16.0
type PayloadTransactions []Transaction
func (PayloadTransactions) ByteLength ¶ added in v0.16.0
func (txs PayloadTransactions) ByteLength(spec *Spec) (out uint64)
func (*PayloadTransactions) Deserialize ¶ added in v0.16.0
func (txs *PayloadTransactions) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*PayloadTransactions) FixedLength ¶ added in v0.16.0
func (txs *PayloadTransactions) FixedLength(*Spec) uint64
func (PayloadTransactions) HashTreeRoot ¶ added in v0.16.0
func (txs PayloadTransactions) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (PayloadTransactions) Serialize ¶ added in v0.16.0
func (txs PayloadTransactions) Serialize(spec *Spec, w *codec.EncodingWriter) error
type Phase0Preset ¶ added in v0.16.0
type Phase0Preset struct { // Misc. MAX_COMMITTEES_PER_SLOT Uint64View `yaml:"MAX_COMMITTEES_PER_SLOT" json:"MAX_COMMITTEES_PER_SLOT"` TARGET_COMMITTEE_SIZE Uint64View `yaml:"TARGET_COMMITTEE_SIZE" json:"TARGET_COMMITTEE_SIZE"` MAX_VALIDATORS_PER_COMMITTEE Uint64View `yaml:"MAX_VALIDATORS_PER_COMMITTEE" json:"MAX_VALIDATORS_PER_COMMITTEE"` SHUFFLE_ROUND_COUNT Uint8View `yaml:"SHUFFLE_ROUND_COUNT" json:"SHUFFLE_ROUND_COUNT"` // Balance math HYSTERESIS_QUOTIENT Uint64View `yaml:"HYSTERESIS_QUOTIENT" json:"HYSTERESIS_QUOTIENT"` HYSTERESIS_DOWNWARD_MULTIPLIER Uint64View `yaml:"HYSTERESIS_DOWNWARD_MULTIPLIER" json:"HYSTERESIS_DOWNWARD_MULTIPLIER"` HYSTERESIS_UPWARD_MULTIPLIER Uint64View `yaml:"HYSTERESIS_UPWARD_MULTIPLIER" json:"HYSTERESIS_UPWARD_MULTIPLIER"` // Fork Choice SAFE_SLOTS_TO_UPDATE_JUSTIFIED Uint64View `yaml:"SAFE_SLOTS_TO_UPDATE_JUSTIFIED" json:"SAFE_SLOTS_TO_UPDATE_JUSTIFIED"` // Gwei values MIN_DEPOSIT_AMOUNT Gwei `yaml:"MIN_DEPOSIT_AMOUNT" json:"MIN_DEPOSIT_AMOUNT"` MAX_EFFECTIVE_BALANCE Gwei `yaml:"MAX_EFFECTIVE_BALANCE" json:"MAX_EFFECTIVE_BALANCE"` EFFECTIVE_BALANCE_INCREMENT Gwei `yaml:"EFFECTIVE_BALANCE_INCREMENT" json:"EFFECTIVE_BALANCE_INCREMENT"` // Time parameters MIN_ATTESTATION_INCLUSION_DELAY Slot `yaml:"MIN_ATTESTATION_INCLUSION_DELAY" json:"MIN_ATTESTATION_INCLUSION_DELAY"` SLOTS_PER_EPOCH Slot `yaml:"SLOTS_PER_EPOCH" json:"SLOTS_PER_EPOCH"` MIN_SEED_LOOKAHEAD Epoch `yaml:"MIN_SEED_LOOKAHEAD" json:"MIN_SEED_LOOKAHEAD"` MAX_SEED_LOOKAHEAD Epoch `yaml:"MAX_SEED_LOOKAHEAD" json:"MAX_SEED_LOOKAHEAD"` EPOCHS_PER_ETH1_VOTING_PERIOD Epoch `yaml:"EPOCHS_PER_ETH1_VOTING_PERIOD" json:"EPOCHS_PER_ETH1_VOTING_PERIOD"` SLOTS_PER_HISTORICAL_ROOT Slot `yaml:"SLOTS_PER_HISTORICAL_ROOT" json:"SLOTS_PER_HISTORICAL_ROOT"` MIN_EPOCHS_TO_INACTIVITY_PENALTY Epoch `yaml:"MIN_EPOCHS_TO_INACTIVITY_PENALTY" json:"MIN_EPOCHS_TO_INACTIVITY_PENALTY"` // State vector lengths EPOCHS_PER_HISTORICAL_VECTOR Epoch `yaml:"EPOCHS_PER_HISTORICAL_VECTOR" json:"EPOCHS_PER_HISTORICAL_VECTOR"` EPOCHS_PER_SLASHINGS_VECTOR Epoch `yaml:"EPOCHS_PER_SLASHINGS_VECTOR" json:"EPOCHS_PER_SLASHINGS_VECTOR"` HISTORICAL_ROOTS_LIMIT Uint64View `yaml:"HISTORICAL_ROOTS_LIMIT" json:"HISTORICAL_ROOTS_LIMIT"` VALIDATOR_REGISTRY_LIMIT Uint64View `yaml:"VALIDATOR_REGISTRY_LIMIT" json:"VALIDATOR_REGISTRY_LIMIT"` // Reward and penalty quotients BASE_REWARD_FACTOR Uint64View `yaml:"BASE_REWARD_FACTOR" json:"BASE_REWARD_FACTOR"` WHISTLEBLOWER_REWARD_QUOTIENT Uint64View `yaml:"WHISTLEBLOWER_REWARD_QUOTIENT" json:"WHISTLEBLOWER_REWARD_QUOTIENT"` PROPOSER_REWARD_QUOTIENT Uint64View `yaml:"PROPOSER_REWARD_QUOTIENT" json:"PROPOSER_REWARD_QUOTIENT"` INACTIVITY_PENALTY_QUOTIENT Uint64View `yaml:"INACTIVITY_PENALTY_QUOTIENT" json:"INACTIVITY_PENALTY_QUOTIENT"` MIN_SLASHING_PENALTY_QUOTIENT Uint64View `yaml:"MIN_SLASHING_PENALTY_QUOTIENT" json:"MIN_SLASHING_PENALTY_QUOTIENT"` PROPORTIONAL_SLASHING_MULTIPLIER Uint64View `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER" json:"PROPORTIONAL_SLASHING_MULTIPLIER"` // Max operations per block MAX_PROPOSER_SLASHINGS Uint64View `yaml:"MAX_PROPOSER_SLASHINGS" json:"MAX_PROPOSER_SLASHINGS"` MAX_ATTESTER_SLASHINGS Uint64View `yaml:"MAX_ATTESTER_SLASHINGS" json:"MAX_ATTESTER_SLASHINGS"` MAX_ATTESTATIONS Uint64View `yaml:"MAX_ATTESTATIONS" json:"MAX_ATTESTATIONS"` MAX_DEPOSITS Uint64View `yaml:"MAX_DEPOSITS" json:"MAX_DEPOSITS"` MAX_VOLUNTARY_EXITS Uint64View `yaml:"MAX_VOLUNTARY_EXITS" json:"MAX_VOLUNTARY_EXITS"` }
func (*Phase0Preset) CheckPoint ¶ added in v0.16.0
func (c *Phase0Preset) CheckPoint() *ContainerTypeDef
func (*Phase0Preset) CommitteeIndices ¶ added in v0.16.0
func (c *Phase0Preset) CommitteeIndices() ListTypeDef
type Ping ¶
type Ping SeqNr
func (Ping) ByteLength ¶
func (*Ping) Deserialize ¶
func (i *Ping) Deserialize(dr *codec.DecodingReader) error
func (Ping) FixedLength ¶
func (Ping) MarshalJSON ¶
func (*Ping) UnmarshalJSON ¶
type Pong ¶
type Pong SeqNr
func (Pong) ByteLength ¶
func (*Pong) Deserialize ¶
func (i *Pong) Deserialize(dr *codec.DecodingReader) error
func (Pong) FixedLength ¶
func (Pong) MarshalJSON ¶
func (*Pong) UnmarshalJSON ¶
type ProposersEpoch ¶
type ProposersEpoch struct { Spec *Spec Epoch Epoch // Proposers is a slice of SLOTS_PER_EPOCH proposer indices for the epoch Proposers []ValidatorIndex // ShardProposers is a slice of SLOTS_PER_EPOCH slices, each slice committees-per-slot long ShardProposers [][]ValidatorIndex CommitteesPerSlot uint64 ActiveShards uint64 }
func ComputeProposers ¶
func ComputeProposers(spec *Spec, state BeaconState, epoch Epoch, active []ValidatorIndex) (*ProposersEpoch, error)
func (*ProposersEpoch) GetBeaconProposer ¶
func (epc *ProposersEpoch) GetBeaconProposer(slot Slot) (ValidatorIndex, error)
func (*ProposersEpoch) GetShardProposer ¶ added in v0.19.0
func (epc *ProposersEpoch) GetShardProposer(slot Slot, shard Shard) (ValidatorIndex, error)
type PubkeyCache ¶
type PubkeyCache struct {
// contains filtered or unexported fields
}
PubkeyCache is shared between any state. However, if .Append(index, pubkey) conflicts, a new cache will be forked out.
func EmptyPubkeyCache ¶
func EmptyPubkeyCache() *PubkeyCache
func NewPubkeyCache ¶
func NewPubkeyCache(vals ValidatorRegistry) (*PubkeyCache, error)
func (*PubkeyCache) AddValidator ¶
func (pc *PubkeyCache) AddValidator(index ValidatorIndex, pub BLSPubkey) (*PubkeyCache, error)
AddValidator appends the (index, pubkey) pair to the pubkey cache. It returns the same cache if the added entry is not conflicting. If it conflicts, the part is inherited, and a forked pubkey cache is returned.
func (*PubkeyCache) Pubkey ¶
func (pc *PubkeyCache) Pubkey(index ValidatorIndex) (pub *CachedPubkey, ok bool)
Get the pubkey of a validator index. Note: this does not mean the validator is part of the current state. It merely means that this is a known pubkey for that particular validator (could be in a later part of a forked version of the state).
func (*PubkeyCache) ValidatorIndex ¶
func (pc *PubkeyCache) ValidatorIndex(pubkey BLSPubkey) (index ValidatorIndex, ok bool)
Get the validator index of a pubkey. Note: this does not mean the validator is part of the current state. It merely means that this is a known pubkey for that particular validator (could be in a later part of a forked version of the state).
type RandaoMixes ¶
type Root ¶
func ComputeForkDataRoot ¶
func ComputeSigningRoot ¶
func GetBlockRoot ¶
func GetBlockRoot(spec *Spec, state BeaconState, epoch Epoch) (Root, error)
Return the block root at a recent epoch. Only valid to SLOTS_PER_HISTORICAL_ROOT slots ago.
func GetBlockRootAtSlot ¶
func GetBlockRootAtSlot(spec *Spec, state BeaconState, slot Slot) (Root, error)
Return the block root at a recent slot. Only valid to SLOTS_PER_HISTORICAL_ROOT slots ago.
func GetSeed ¶
func GetSeed(spec *Spec, mixes RandaoMixes, epoch Epoch, domainType BLSDomainType) (Root, error)
type SSZObj ¶
type SSZObj interface { codec.Serializable codec.Deserializable codec.FixedLength tree.HTR }
type SeqNr ¶
type SeqNr Uint64View
func (SeqNr) ByteLength ¶
func (*SeqNr) Deserialize ¶
func (i *SeqNr) Deserialize(dr *codec.DecodingReader) error
func (SeqNr) FixedLength ¶
func (SeqNr) MarshalJSON ¶
func (*SeqNr) UnmarshalJSON ¶
type Shard ¶
type Shard Uint64View
func (Shard) ByteLength ¶
func (*Shard) Deserialize ¶
func (a *Shard) Deserialize(dr *codec.DecodingReader) error
func (Shard) FixedLength ¶
func (Shard) MarshalJSON ¶
func (*Shard) UnmarshalJSON ¶
type ShardingPreset ¶ added in v0.16.0
type ShardingPreset struct { // Misc. MAX_SHARDS Uint64View `yaml:"MAX_SHARDS" json:"MAX_SHARDS"` INITIAL_ACTIVE_SHARDS Uint64View `yaml:"INITIAL_ACTIVE_SHARDS" json:"INITIAL_ACTIVE_SHARDS"` SAMPLE_PRICE_ADJUSTMENT_COEFFICIENT Uint64View `yaml:"SAMPLE_PRICE_ADJUSTMENT_COEFFICIENT" json:"SAMPLE_PRICE_ADJUSTMENT_COEFFICIENT"` MAX_SHARD_PROPOSER_SLASHINGS Uint64View `yaml:"MAX_SHARD_PROPOSER_SLASHINGS" json:"MAX_SHARD_PROPOSER_SLASHINGS"` MAX_SHARD_HEADERS_PER_SHARD Uint64View `yaml:"MAX_SHARD_HEADERS_PER_SHARD" json:"MAX_SHARD_HEADERS_PER_SHARD"` SHARD_STATE_MEMORY_SLOTS Slot `yaml:"SHARD_STATE_MEMORY_SLOTS" json:"SHARD_STATE_MEMORY_SLOTS"` BLOB_BUILDER_REGISTRY_LIMIT Uint64View `yaml:"BLOB_BUILDER_REGISTRY_LIMIT" json:"BLOB_BUILDER_REGISTRY_LIMIT"` // Shard blob samples MAX_SAMPLES_PER_BLOCK Uint64View `yaml:"MAX_SAMPLES_PER_BLOCK" json:"MAX_SAMPLES_PER_BLOCK"` TARGET_SAMPLES_PER_BLOCK Uint64View `yaml:"TARGET_SAMPLES_PER_BLOCK" json:"TARGET_SAMPLES_PER_BLOCK"` // Gwei values MAX_SAMPLE_PRICE Gwei `yaml:"MAX_SAMPLE_PRICE" json:"MAX_SAMPLE_PRICE"` MIN_SAMPLE_PRICE Gwei `yaml:"MIN_SAMPLE_PRICE" json:"MIN_SAMPLE_PRICE"` }
type ShufflingEpoch ¶
type ShufflingEpoch struct { Epoch Epoch ActiveIndices []ValidatorIndex Shuffling []ValidatorIndex // the active validator indices, shuffled into their committee // slot (vector SLOTS_PER_EPOCH) -> index of committee (< MAX_COMMITTEES_PER_SLOT) -> index of validator within committee -> validator Committees [][][]ValidatorIndex // slices of Shuffling, 1 per slot. Committee can be nil slice. }
With a high amount of shards, or low amount of validators, some shards may not have a committee this epoch.
func ComputeShufflingEpoch ¶
func ComputeShufflingEpoch(spec *Spec, state BeaconState, indicesBounded []BoundedIndex, epoch Epoch) (*ShufflingEpoch, error)
func NewShufflingEpoch ¶
func NewShufflingEpoch(spec *Spec, indicesBounded []BoundedIndex, seed Root, epoch Epoch) *ShufflingEpoch
type SignedBLSToExecutionChange ¶ added in v0.29.0
type SignedBLSToExecutionChange struct { BLSToExecutionChange BLSToExecutionChange `json:"message" yaml:"message"` Signature BLSSignature `json:"signature" yaml:"signature"` }
func (*SignedBLSToExecutionChange) ByteLength ¶ added in v0.29.0
func (s *SignedBLSToExecutionChange) ByteLength() uint64
func (*SignedBLSToExecutionChange) Deserialize ¶ added in v0.29.0
func (s *SignedBLSToExecutionChange) Deserialize(dr *codec.DecodingReader) error
func (*SignedBLSToExecutionChange) FixedLength ¶ added in v0.29.0
func (s *SignedBLSToExecutionChange) FixedLength() uint64
func (*SignedBLSToExecutionChange) HashTreeRoot ¶ added in v0.29.0
func (s *SignedBLSToExecutionChange) HashTreeRoot(hFn tree.HashFn) Root
func (*SignedBLSToExecutionChange) Serialize ¶ added in v0.29.0
func (s *SignedBLSToExecutionChange) Serialize(w *codec.EncodingWriter) error
func (*SignedBLSToExecutionChange) View ¶ added in v0.29.0
func (s *SignedBLSToExecutionChange) View() *SignedBLSToExecutionChangeView
type SignedBLSToExecutionChangeView ¶ added in v0.29.0
type SignedBLSToExecutionChangeView struct {
*ContainerView
}
func AsSignedBLSToExecutionChange ¶ added in v0.29.0
func AsSignedBLSToExecutionChange(v View, err error) (*SignedBLSToExecutionChangeView, error)
func (*SignedBLSToExecutionChangeView) BLSToExecutionChange ¶ added in v0.29.0
func (v *SignedBLSToExecutionChangeView) BLSToExecutionChange() (*BLSToExecutionChangeView, error)
func (*SignedBLSToExecutionChangeView) Raw ¶ added in v0.29.0
func (v *SignedBLSToExecutionChangeView) Raw() (*SignedBLSToExecutionChange, error)
func (*SignedBLSToExecutionChangeView) Signature ¶ added in v0.29.0
func (v *SignedBLSToExecutionChangeView) Signature() (BLSSignature, error)
type SignedBLSToExecutionChanges ¶ added in v0.29.0
type SignedBLSToExecutionChanges []SignedBLSToExecutionChange
func (SignedBLSToExecutionChanges) ByteLength ¶ added in v0.29.0
func (li SignedBLSToExecutionChanges) ByteLength(_ *Spec) (out uint64)
func (*SignedBLSToExecutionChanges) Deserialize ¶ added in v0.29.0
func (li *SignedBLSToExecutionChanges) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*SignedBLSToExecutionChanges) FixedLength ¶ added in v0.29.0
func (*SignedBLSToExecutionChanges) FixedLength(*Spec) uint64
func (SignedBLSToExecutionChanges) HashTreeRoot ¶ added in v0.29.0
func (li SignedBLSToExecutionChanges) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (SignedBLSToExecutionChanges) Serialize ¶ added in v0.29.0
func (li SignedBLSToExecutionChanges) Serialize(_ *Spec, w *codec.EncodingWriter) error
type SignedBeaconBlockHeader ¶
type SignedBeaconBlockHeader struct { Message BeaconBlockHeader `json:"message" yaml:"message"` Signature BLSSignature `json:"signature" yaml:"signature"` }
func (*SignedBeaconBlockHeader) ByteLength ¶
func (s *SignedBeaconBlockHeader) ByteLength() uint64
func (*SignedBeaconBlockHeader) Deserialize ¶
func (s *SignedBeaconBlockHeader) Deserialize(dr *codec.DecodingReader) error
func (*SignedBeaconBlockHeader) FixedLength ¶
func (b *SignedBeaconBlockHeader) FixedLength() uint64
func (*SignedBeaconBlockHeader) HashTreeRoot ¶
func (s *SignedBeaconBlockHeader) HashTreeRoot(hFn tree.HashFn) Root
func (*SignedBeaconBlockHeader) Serialize ¶
func (s *SignedBeaconBlockHeader) Serialize(w *codec.EncodingWriter) error
type SigningData ¶
type SigningData struct { ObjectRoot Root `json:"object_root" yaml:"object_root"` Domain BLSDomain `json:"domain" yaml:"domain"` }
func (*SigningData) ByteLength ¶ added in v0.16.1
func (a *SigningData) ByteLength() uint64
func (*SigningData) Deserialize ¶ added in v0.16.1
func (d *SigningData) Deserialize(dr *codec.DecodingReader) error
func (*SigningData) FixedLength ¶ added in v0.16.1
func (a *SigningData) FixedLength() uint64
func (*SigningData) HashTreeRoot ¶
func (d *SigningData) HashTreeRoot(hFn tree.HashFn) Root
func (*SigningData) Serialize ¶ added in v0.16.1
func (d *SigningData) Serialize(w *codec.EncodingWriter) error
type Slot ¶
type Slot Uint64View
const GENESIS_SLOT Slot = 0
func (Slot) ByteLength ¶
func (*Slot) Deserialize ¶
func (a *Slot) Deserialize(dr *codec.DecodingReader) error
func (Slot) FixedLength ¶
func (Slot) MarshalJSON ¶
func (*Slot) UnmarshalJSON ¶
type Spec ¶
type Spec struct { Phase0Preset `json:",inline" yaml:",inline"` AltairPreset `json:",inline" yaml:",inline"` BellatrixPreset `json:",inline" yaml:",inline"` CapellaPreset `json:",inline" yaml:",inline"` ShardingPreset `json:",inline" yaml:",inline"` Config `json:",inline" yaml:",inline"` Setup `json:",inline" yaml:",inline"` // Experimental, for bellatrix ExecutionEngine `json:"-" yaml:"-"` }
func (*Spec) ActiveShardCount ¶ added in v0.16.0
func (*Spec) ComputeActivationExitEpoch ¶
Return the epoch at which an activation or exit triggered in epoch takes effect.
func (*Spec) ComputeUpdatedSamplePrice ¶ added in v0.19.0
func (*Spec) ForkVersion ¶
func (*Spec) GetChurnLimit ¶
func (*Spec) SlotToEpoch ¶
func (*Spec) TimeAtSlot ¶ added in v0.16.0
type Status ¶
type Status struct { ForkDigest ForkDigest `json:"fork_digest" yaml:"fork_digest"` FinalizedRoot Root `json:"finalized_root" yaml:"finalized_root"` FinalizedEpoch Epoch `json:"finalized_epoch" yaml:"finalized_epoch"` HeadRoot Root `json:"head_root" yaml:"head_root"` HeadSlot Slot `json:"head_slot" yaml:"head_slot"` }
func (Status) ByteLength ¶
func (*Status) Deserialize ¶
func (d *Status) Deserialize(dr *codec.DecodingReader) error
func (*Status) FixedLength ¶
type Step ¶ added in v0.27.0
type Step uint64
Step combines a Slot and bool for block processing being included or not.
type SyncCommittee ¶ added in v0.16.0
type SyncCommittee struct { Pubkeys SyncCommitteePubkeys `json:"pubkeys" yaml:"pubkeys"` AggregatePubkey BLSPubkey `json:"aggregate_pubkey" yaml:"aggregate_pubkey"` }
func ComputeNextSyncCommittee ¶ added in v0.16.0
func ComputeNextSyncCommittee(spec *Spec, epc *EpochsContext, state BeaconState) (*SyncCommittee, error)
func IndicesToSyncCommittee ¶ added in v0.16.2
func IndicesToSyncCommittee(indices []ValidatorIndex, pubCache *PubkeyCache) (*SyncCommittee, error)
func (*SyncCommittee) ByteLength ¶ added in v0.16.0
func (a *SyncCommittee) ByteLength(spec *Spec) uint64
func (*SyncCommittee) Deserialize ¶ added in v0.16.0
func (a *SyncCommittee) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*SyncCommittee) FixedLength ¶ added in v0.16.0
func (*SyncCommittee) FixedLength(spec *Spec) uint64
func (*SyncCommittee) HashTreeRoot ¶ added in v0.16.0
func (p *SyncCommittee) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*SyncCommittee) Serialize ¶ added in v0.16.0
func (a *SyncCommittee) Serialize(spec *Spec, w *codec.EncodingWriter) error
func (*SyncCommittee) View ¶ added in v0.16.0
func (p *SyncCommittee) View(spec *Spec) (*SyncCommitteeView, error)
type SyncCommitteeBeaconState ¶ added in v0.16.0
type SyncCommitteeBeaconState interface { BeaconState CurrentSyncCommittee() (*SyncCommitteeView, error) NextSyncCommittee() (*SyncCommitteeView, error) SetCurrentSyncCommittee(v *SyncCommitteeView) error SetNextSyncCommittee(v *SyncCommitteeView) error RotateSyncCommittee(next *SyncCommitteeView) error }
type SyncCommitteePubkeys ¶ added in v0.16.0
type SyncCommitteePubkeys []BLSPubkey
func (SyncCommitteePubkeys) ByteLength ¶ added in v0.16.0
func (a SyncCommitteePubkeys) ByteLength(spec *Spec) uint64
func (*SyncCommitteePubkeys) Deserialize ¶ added in v0.16.0
func (li *SyncCommitteePubkeys) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*SyncCommitteePubkeys) FixedLength ¶ added in v0.16.0
func (a *SyncCommitteePubkeys) FixedLength(spec *Spec) uint64
func (SyncCommitteePubkeys) HashTreeRoot ¶ added in v0.16.0
func (li SyncCommitteePubkeys) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (SyncCommitteePubkeys) Serialize ¶ added in v0.16.0
func (a SyncCommitteePubkeys) Serialize(spec *Spec, w *codec.EncodingWriter) error
type SyncCommitteePubkeysView ¶ added in v0.16.0
type SyncCommitteePubkeysView struct {
*ComplexVectorView
}
func AsSyncCommitteePubkeys ¶ added in v0.16.0
func AsSyncCommitteePubkeys(v View, err error) (*SyncCommitteePubkeysView, error)
func (*SyncCommitteePubkeysView) Flatten ¶ added in v0.16.0
func (v *SyncCommitteePubkeysView) Flatten() ([]BLSPubkey, error)
type SyncCommitteeView ¶ added in v0.16.0
type SyncCommitteeView struct {
*ContainerView
}
func AsSyncCommittee ¶ added in v0.16.0
func AsSyncCommittee(v View, err error) (*SyncCommitteeView, error)
func (*SyncCommitteeView) AggregatePubkey ¶ added in v0.16.0
func (p *SyncCommitteeView) AggregatePubkey() (BLSPubkey, error)
func (*SyncCommitteeView) Pubkeys ¶ added in v0.16.0
func (p *SyncCommitteeView) Pubkeys() (*SyncCommitteePubkeysView, error)
type SyncnetBits ¶ added in v0.28.0
type SyncnetBits [syncnetByteLen]byte
func (*SyncnetBits) BitLen ¶ added in v0.28.0
func (ab *SyncnetBits) BitLen() uint64
func (SyncnetBits) ByteLength ¶ added in v0.28.0
func (p SyncnetBits) ByteLength() uint64
func (*SyncnetBits) Deserialize ¶ added in v0.28.0
func (p *SyncnetBits) Deserialize(dr *codec.DecodingReader) error
func (SyncnetBits) FixedLength ¶ added in v0.28.0
func (SyncnetBits) FixedLength() uint64
func (SyncnetBits) HashTreeRoot ¶ added in v0.28.0
func (p SyncnetBits) HashTreeRoot(_ tree.HashFn) (out Root)
func (SyncnetBits) MarshalText ¶ added in v0.28.0
func (p SyncnetBits) MarshalText() ([]byte, error)
func (SyncnetBits) Serialize ¶ added in v0.28.0
func (p SyncnetBits) Serialize(w *codec.EncodingWriter) error
func (SyncnetBits) String ¶ added in v0.28.0
func (p SyncnetBits) String() string
func (*SyncnetBits) UnmarshalText ¶ added in v0.28.0
func (p *SyncnetBits) UnmarshalText(text []byte) error
type Timestamp ¶
type Timestamp Uint64View
Unix timestamp
func AsTimestamp ¶
func (Timestamp) ByteLength ¶
func (*Timestamp) Deserialize ¶
func (a *Timestamp) Deserialize(dr *codec.DecodingReader) error
func (Timestamp) FixedLength ¶
func (Timestamp) MarshalJSON ¶
func (*Timestamp) UnmarshalJSON ¶
type Transaction ¶ added in v0.19.0
type Transaction []byte
func (Transaction) ByteLength ¶ added in v0.19.0
func (otx Transaction) ByteLength(spec *Spec) (out uint64)
func (*Transaction) Deserialize ¶ added in v0.19.0
func (otx *Transaction) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Transaction) FixedLength ¶ added in v0.19.0
func (otx *Transaction) FixedLength(*Spec) uint64
func (Transaction) HashTreeRoot ¶ added in v0.19.0
func (otx Transaction) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (Transaction) MarshalText ¶ added in v0.23.0
func (otx Transaction) MarshalText() ([]byte, error)
func (Transaction) Serialize ¶ added in v0.19.0
func (otx Transaction) Serialize(spec *Spec, w *codec.EncodingWriter) error
func (Transaction) String ¶ added in v0.23.0
func (otx Transaction) String() string
func (*Transaction) UnmarshalText ¶ added in v0.23.0
func (otx *Transaction) UnmarshalText(text []byte) error
func (Transaction) View ¶ added in v0.19.0
func (otx Transaction) View(spec *Spec) (*TransactionView, error)
type TransactionView ¶ added in v0.19.0
type TransactionView struct {
*UnionView
}
func AsTransaction ¶ added in v0.19.0
func AsTransaction(v View, err error) (*TransactionView, error)
type UpgradeableBeaconState ¶ added in v0.16.1
type UpgradeableBeaconState interface { BeaconState // Called whenever the state may need to upgrade to a next fork, changes the BeaconState interface contents if so. UpgradeMaybe(ctx context.Context, spec *Spec, epc *EpochsContext) error }
type Validator ¶
type Validator interface { Pubkey() (BLSPubkey, error) WithdrawalCredentials() (out Root, err error) SetWithdrawalCredentials(out Root) (err error) EffectiveBalance() (Gwei, error) SetEffectiveBalance(b Gwei) error Slashed() (bool, error) MakeSlashed() error ActivationEligibilityEpoch() (Epoch, error) SetActivationEligibilityEpoch(epoch Epoch) error ActivationEpoch() (Epoch, error) SetActivationEpoch(epoch Epoch) error ExitEpoch() (Epoch, error) SetExitEpoch(ep Epoch) error WithdrawableEpoch() (Epoch, error) SetWithdrawableEpoch(epoch Epoch) error // Flatten the validator data into destination struct // For intensive validator registry work, it is more efficient to iterate the registry once, // unpack validators into a flat structure, and work with the flattened data. Flatten(dst *FlatValidator) error }
type ValidatorIndex ¶
type ValidatorIndex Uint64View
Index of a validator, pointing to a validator registry location
func ActiveIndices ¶ added in v0.16.2
func ActiveIndices(indicesBounded []BoundedIndex, epoch Epoch) []ValidatorIndex
func AsValidatorIndex ¶
func AsValidatorIndex(v View, err error) (ValidatorIndex, error)
func ComputeProposerIndex ¶
func ComputeProposerIndex(spec *Spec, registry ValidatorRegistry, active []ValidatorIndex, seed Root) (ValidatorIndex, error)
func ComputeSyncCommitteeIndices ¶
func ComputeSyncCommitteeIndices(spec *Spec, state BeaconState, baseEpoch Epoch, active []ValidatorIndex) ([]ValidatorIndex, error)
Return the sequence of sync committee indices (which may include duplicate indices) for the next sync committee, given a state at a sync committee period boundary.
Note: Committee can contain duplicate indices for small validator sets (< SYNC_COMMITTEE_SIZE + 128)
func PermuteIndex ¶
func PermuteIndex(rounds uint8, index ValidatorIndex, listSize uint64, seed Root) ValidatorIndex
PermuteIndex shuffles an individual list item without allocating a complete list. Returns the index in the would-be shuffled list.
func UnpermuteIndex ¶
func UnpermuteIndex(rounds uint8, index ValidatorIndex, listSize uint64, seed Root) ValidatorIndex
UnpermuteIndex does the inverse of PermuteIndex, it returns the original index when given the same shuffling context parameters and permuted index.
func (ValidatorIndex) ByteLength ¶
func (ValidatorIndex) ByteLength() uint64
func (*ValidatorIndex) Deserialize ¶
func (i *ValidatorIndex) Deserialize(dr *codec.DecodingReader) error
func (ValidatorIndex) FixedLength ¶
func (ValidatorIndex) FixedLength() uint64
func (ValidatorIndex) HashTreeRoot ¶
func (i ValidatorIndex) HashTreeRoot(hFn tree.HashFn) Root
func (ValidatorIndex) MarshalJSON ¶
func (e ValidatorIndex) MarshalJSON() ([]byte, error)
func (ValidatorIndex) Serialize ¶
func (i ValidatorIndex) Serialize(w *codec.EncodingWriter) error
func (ValidatorIndex) String ¶
func (e ValidatorIndex) String() string
func (*ValidatorIndex) UnmarshalJSON ¶
func (e *ValidatorIndex) UnmarshalJSON(b []byte) error
type ValidatorRegistry ¶
type ValidatorSet ¶
type ValidatorSet []ValidatorIndex
Collection of validators, should always be sorted.
func (*ValidatorSet) Dedup ¶
func (vs *ValidatorSet) Dedup()
De-duplicates entries in the set in-place. (util to make a valid set from a list with duplicates)
func (*ValidatorSet) Filter ¶
func (vs *ValidatorSet) Filter(retain func(index ValidatorIndex) (bool, error)) error
Filter the set in-place. Retains every validator for which the function returns true.
func (ValidatorSet) Intersects ¶
func (vs ValidatorSet) Intersects(target ValidatorSet) bool
Joins two validator sets: check if there is any overlap
func (ValidatorSet) Len ¶
func (vs ValidatorSet) Len() int
func (ValidatorSet) MergeDisjoint ¶
func (vs ValidatorSet) MergeDisjoint(other ValidatorSet) ValidatorSet
merges with other disjoint set, producing a new set.
func (ValidatorSet) Swap ¶
func (vs ValidatorSet) Swap(i int, j int)
func (ValidatorSet) ZigZagJoin ¶
func (vs ValidatorSet) ZigZagJoin(target ValidatorSet, onIn func(i ValidatorIndex), onOut func(i ValidatorIndex))
Joins two validator sets: reports all indices of source that are in the target (call onIn), and those that are not (call onOut)
type Version ¶
type Version [4]byte
32 bits, not strictly an integer, hence represented as 4 bytes (bytes not necessarily corresponding to versions)
func (Version) ByteLength ¶
func (*Version) Deserialize ¶
func (v *Version) Deserialize(dr *codec.DecodingReader) error
func (Version) FixedLength ¶
func (Version) MarshalText ¶
func (*Version) UnmarshalText ¶
type Withdrawal ¶ added in v0.29.0
type Withdrawal struct { Index WithdrawalIndex `json:"index" yaml:"index"` ValidatorIndex ValidatorIndex `json:"validator_index" yaml:"validator_index"` Address Eth1Address `json:"address" yaml:"address"` Amount Gwei `json:"amount" yaml:"amount"` }
func (*Withdrawal) ByteLength ¶ added in v0.29.0
func (s *Withdrawal) ByteLength() uint64
func (*Withdrawal) Deserialize ¶ added in v0.29.0
func (s *Withdrawal) Deserialize(dr *codec.DecodingReader) error
func (*Withdrawal) FixedLength ¶ added in v0.29.0
func (s *Withdrawal) FixedLength() uint64
func (*Withdrawal) HashTreeRoot ¶ added in v0.29.0
func (s *Withdrawal) HashTreeRoot(hFn tree.HashFn) Root
func (*Withdrawal) Serialize ¶ added in v0.29.0
func (s *Withdrawal) Serialize(w *codec.EncodingWriter) error
func (*Withdrawal) View ¶ added in v0.29.0
func (s *Withdrawal) View() *WithdrawalView
type WithdrawalIndex ¶ added in v0.29.0
type WithdrawalIndex Uint64View
func AsWithdrawalIndex ¶ added in v0.29.0
func AsWithdrawalIndex(v View, err error) (WithdrawalIndex, error)
func (WithdrawalIndex) ByteLength ¶ added in v0.29.0
func (WithdrawalIndex) ByteLength() uint64
func (*WithdrawalIndex) Deserialize ¶ added in v0.29.0
func (a *WithdrawalIndex) Deserialize(dr *codec.DecodingReader) error
func (WithdrawalIndex) FixedLength ¶ added in v0.29.0
func (WithdrawalIndex) FixedLength() uint64
func (WithdrawalIndex) HashTreeRoot ¶ added in v0.29.0
func (t WithdrawalIndex) HashTreeRoot(hFn tree.HashFn) Root
func (WithdrawalIndex) MarshalJSON ¶ added in v0.29.0
func (e WithdrawalIndex) MarshalJSON() ([]byte, error)
func (WithdrawalIndex) Serialize ¶ added in v0.29.0
func (i WithdrawalIndex) Serialize(w *codec.EncodingWriter) error
func (WithdrawalIndex) String ¶ added in v0.29.0
func (e WithdrawalIndex) String() string
func (*WithdrawalIndex) UnmarshalJSON ¶ added in v0.29.0
func (e *WithdrawalIndex) UnmarshalJSON(b []byte) error
type WithdrawalPrefix ¶
type WithdrawalPrefix [1]byte
func (WithdrawalPrefix) MarshalText ¶
func (p WithdrawalPrefix) MarshalText() ([]byte, error)
func (WithdrawalPrefix) String ¶
func (p WithdrawalPrefix) String() string
func (*WithdrawalPrefix) UnmarshalText ¶
func (p *WithdrawalPrefix) UnmarshalText(text []byte) error
type WithdrawalView ¶ added in v0.29.0
type WithdrawalView struct {
*ContainerView
}
func AsWithdrawal ¶ added in v0.29.0
func AsWithdrawal(v View, err error) (*WithdrawalView, error)
func (*WithdrawalView) Address ¶ added in v0.29.0
func (v *WithdrawalView) Address() (Eth1Address, error)
func (*WithdrawalView) Amount ¶ added in v0.29.0
func (v *WithdrawalView) Amount() (Gwei, error)
func (*WithdrawalView) Index ¶ added in v0.29.0
func (v *WithdrawalView) Index() (WithdrawalIndex, error)
func (*WithdrawalView) Raw ¶ added in v0.29.0
func (v *WithdrawalView) Raw() (*Withdrawal, error)
func (*WithdrawalView) ValidatorIndex ¶ added in v0.29.0
func (v *WithdrawalView) ValidatorIndex() (ValidatorIndex, error)
type Withdrawals ¶ added in v0.29.0
type Withdrawals []Withdrawal
func (Withdrawals) ByteLength ¶ added in v0.29.0
func (ws Withdrawals) ByteLength(spec *Spec) (out uint64)
func (*Withdrawals) Deserialize ¶ added in v0.29.0
func (ws *Withdrawals) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Withdrawals) FixedLength ¶ added in v0.29.0
func (ws *Withdrawals) FixedLength(*Spec) uint64
func (Withdrawals) HashTreeRoot ¶ added in v0.29.0
func (ws Withdrawals) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (Withdrawals) Serialize ¶ added in v0.29.0
func (ws Withdrawals) Serialize(spec *Spec, w *codec.EncodingWriter) error
type WrappedSpecObj ¶ added in v0.16.1
Source Files ¶
- block.go
- bls.go
- builder.go
- builder_pubkeys.go
- constants.go
- deltas.go
- deposit.go
- epochs_context.go
- eth1.go
- execution.go
- flat.go
- general.go
- header.go
- history.go
- indices.go
- justification.go
- logs_bloom.go
- network.go
- proposers.go
- randao.go
- shuffle.go
- shuffling.go
- spec.go
- state.go
- step.go
- sync_committee.go
- time.go
- transactions.go
- transition.go
- validator_indices.go
- validator_pubkeys.go
- versioning.go
- withdrawals.go