Documentation ¶
Index ¶
- Constants
- Variables
- func IsDoubleVote(a *AttestationData, b *AttestationData) bool
- func IsSlashableAttestationData(a *AttestationData, b *AttestationData) bool
- func IsSurroundVote(a *AttestationData, b *AttestationData) bool
- func ShuffleList(rounds uint8, input []ValidatorIndex, seed Root)
- func UnshuffleList(rounds uint8, input []ValidatorIndex, seed Root)
- type AggregateAndProof
- func (a *AggregateAndProof) ByteLength(spec *Spec) uint64
- func (a *AggregateAndProof) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *AggregateAndProof) FixedLength(*Spec) uint64
- func (a *AggregateAndProof) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *AggregateAndProof) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type Attestation
- func (a *Attestation) ByteLength(spec *Spec) uint64
- func (attestation *Attestation) ConvertToIndexed(spec *Spec, committee []ValidatorIndex) (*IndexedAttestation, error)
- func (a *Attestation) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *Attestation) FixedLength(*Spec) uint64
- func (a *Attestation) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *Attestation) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type AttestationData
- func (a *AttestationData) ByteLength() uint64
- func (a *AttestationData) Deserialize(dr *codec.DecodingReader) error
- func (*AttestationData) FixedLength() uint64
- func (p *AttestationData) HashTreeRoot(hFn tree.HashFn) Root
- func (a *AttestationData) Serialize(w *codec.EncodingWriter) error
- func (data *AttestationData) View() *AttestationDataView
- type AttestationDataView
- type Attestations
- func (a Attestations) ByteLength(spec *Spec) (out uint64)
- func (a *Attestations) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *Attestations) FixedLength(*Spec) uint64
- func (li Attestations) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a Attestations) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type AttesterFlag
- type AttesterSlashing
- func (a *AttesterSlashing) ByteLength(spec *Spec) uint64
- func (a *AttesterSlashing) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *AttesterSlashing) FixedLength(*Spec) uint64
- func (a *AttesterSlashing) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *AttesterSlashing) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type AttesterSlashings
- func (a AttesterSlashings) ByteLength(spec *Spec) (out uint64)
- func (a *AttesterSlashings) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *AttesterSlashings) FixedLength(*Spec) uint64
- func (li AttesterSlashings) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a AttesterSlashings) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type AttesterStatus
- 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
- type BLSDomainType
- type BLSPubkey
- type BLSPubkeyView
- type BLSSignature
- type BLSSignatureView
- type Balances
- func (a Balances) ByteLength(spec *Spec) (out uint64)
- func (a *Balances) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *Balances) FixedLength(spec *Spec) uint64
- func (li Balances) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a Balances) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type BatchRootsView
- type BeaconBlock
- func (b *BeaconBlock) ByteLength(spec *Spec) uint64
- func (b *BeaconBlock) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *BeaconBlock) FixedLength(*Spec) uint64
- func (b *BeaconBlock) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (block *BeaconBlock) Header(spec *Spec) *BeaconBlockHeader
- func (b *BeaconBlock) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type BeaconBlockBody
- func (b *BeaconBlockBody) ByteLength(spec *Spec) uint64
- func (b BeaconBlockBody) CheckLimits(spec *Spec) error
- func (b *BeaconBlockBody) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *BeaconBlockBody) FixedLength(*Spec) uint64
- func (b *BeaconBlockBody) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (b *BeaconBlockBody) Serialize(spec *Spec, w *codec.EncodingWriter) error
- 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
- func (v *BeaconState) ByteLength(spec *Spec) uint64
- func (v *BeaconState) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*BeaconState) FixedLength(*Spec) uint64
- func (v *BeaconState) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (v *BeaconState) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type BeaconStateView
- func (state *BeaconStateView) Balances() (*RegistryBalancesView, error)
- func (state *BeaconStateView) BlockRoots() (*BatchRootsView, error)
- func (state *BeaconStateView) CurrentEpochAttestations() (*PendingAttestationsView, error)
- func (state *BeaconStateView) CurrentJustifiedCheckpoint() (*CheckpointView, error)
- func (state *BeaconStateView) DepositIndex() (DepositIndex, error)
- func (state *BeaconStateView) Eth1Data() (*Eth1DataView, error)
- func (state *BeaconStateView) Eth1DataVotes() (*Eth1DataVotesView, error)
- func (state *BeaconStateView) FinalizedCheckpoint() (*CheckpointView, error)
- func (state *BeaconStateView) Fork() (*ForkView, error)
- func (state *BeaconStateView) GenesisTime() (Timestamp, error)
- func (state *BeaconStateView) GenesisValidatorsRoot() (Root, error)
- func (state *BeaconStateView) GetDomain(dom BLSDomainType, messageEpoch Epoch) (BLSDomain, error)
- func (state *BeaconStateView) HistoricalRoots() (*HistoricalRootsView, error)
- func (state *BeaconStateView) IncrementDepositIndex() error
- func (state *BeaconStateView) IsValidIndex(index ValidatorIndex) (bool, error)
- func (state *BeaconStateView) JustificationBits() (*JustificationBitsView, error)
- func (state *BeaconStateView) LatestBlockHeader() (*BeaconBlockHeaderView, error)
- func (state *BeaconStateView) PreviousEpochAttestations() (*PendingAttestationsView, error)
- func (state *BeaconStateView) PreviousJustifiedCheckpoint() (*CheckpointView, error)
- func (state *BeaconStateView) RandaoMixes() (*RandaoMixesView, error)
- func (state *BeaconStateView) Raw(spec *Spec) (*BeaconState, error)
- func (state *BeaconStateView) SetEth1Data(v *Eth1DataView) error
- func (state *BeaconStateView) SetFork(f Fork) error
- func (state *BeaconStateView) SetGenesisTime(t Timestamp) error
- func (state *BeaconStateView) SetGenesisValidatorsRoot(r Root) error
- func (state *BeaconStateView) SetLatestBlockHeader(v *BeaconBlockHeaderView) error
- func (state *BeaconStateView) SetRandaoMixes(v *RandaoMixesView) error
- func (state *BeaconStateView) SetRecentRoots(slot Slot, blockRoot Root, stateRoot Root) error
- func (state *BeaconStateView) SetSlot(slot Slot) error
- func (state *BeaconStateView) Slashings() (*SlashingsView, error)
- func (state *BeaconStateView) Slot() (Slot, error)
- func (state *BeaconStateView) StateRoots() (*BatchRootsView, error)
- func (state *BeaconStateView) UpdateHistoricalRoots() error
- func (state *BeaconStateView) Validators() (*ValidatorsRegistryView, error)
- type BoundedIndex
- type CachedPubkey
- 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) View() *CheckpointView
- type CheckpointView
- type CommitteeBits
- func (cb CommitteeBits) BitLen() uint64
- func (a CommitteeBits) ByteLength(spec *Spec) uint64
- func (li *CommitteeBits) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (cb CommitteeBits) FilterNonParticipants(committee []ValidatorIndex) []ValidatorIndex
- func (cb CommitteeBits) FilterParticipants(committee []ValidatorIndex) []ValidatorIndex
- func (a *CommitteeBits) FixedLength(*Spec) uint64
- func (cb CommitteeBits) GetBit(i uint64) bool
- func (li CommitteeBits) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (cb CommitteeBits) MarshalText() ([]byte, error)
- func (cb CommitteeBits) Or(other CommitteeBits)
- func (a CommitteeBits) Serialize(spec *Spec, w *codec.EncodingWriter) error
- func (cb CommitteeBits) SetBit(i uint64, v bool)
- func (cb CommitteeBits) String() string
- func (cb *CommitteeBits) UnmarshalText(text []byte) error
- func (li CommitteeBits) View(spec *Spec) *CommitteeBitsView
- type CommitteeBitsView
- 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 *Spec, w *codec.EncodingWriter) error
- 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 DepositRootsView
- type Deposits
- func (a Deposits) ByteLength(*Spec) (out uint64)
- func (a *Deposits) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *Deposits) FixedLength(*Spec) uint64
- func (li Deposits) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a Deposits) Serialize(spec *Spec, w *codec.EncodingWriter) error
- 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 EpochProcess
- type EpochStakeSummary
- type EpochsContext
- func (epc *EpochsContext) Clone() *EpochsContext
- func (epc *EpochsContext) GetBeaconCommittee(slot Slot, index CommitteeIndex) ([]ValidatorIndex, error)
- func (epc *EpochsContext) GetBeaconProposer(slot Slot) (ValidatorIndex, error)
- func (epc *EpochsContext) GetCommitteeCountAtSlot(slot Slot) (uint64, error)
- func (epc *EpochsContext) LoadProposers(state *BeaconStateView) error
- func (epc *EpochsContext) LoadShuffling(state *BeaconStateView) error
- func (epc *EpochsContext) RotateEpochs(state *BeaconStateView) error
- type Eth1Address
- type Eth1Data
- type Eth1DataView
- type Eth1DataVotes
- func (a Eth1DataVotes) ByteLength(spec *Spec) (out uint64)
- func (a *Eth1DataVotes) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *Eth1DataVotes) FixedLength(spec *Spec) uint64
- func (li Eth1DataVotes) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a Eth1DataVotes) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type Eth1DataVotesView
- type Eth2Data
- type FlatValidator
- type Fork
- 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 ForkView
- 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 HistoricalBatch
- func (a *HistoricalBatch) ByteLength(spec *Spec) uint64
- func (a *HistoricalBatch) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*HistoricalBatch) FixedLength(spec *Spec) uint64
- func (p *HistoricalBatch) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *HistoricalBatch) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type HistoricalBatchRoots
- func (a HistoricalBatchRoots) ByteLength(spec *Spec) (out uint64)
- func (a *HistoricalBatchRoots) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *HistoricalBatchRoots) FixedLength(spec *Spec) uint64
- func (li HistoricalBatchRoots) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a HistoricalBatchRoots) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type HistoricalBatchView
- type HistoricalRoots
- func (a HistoricalRoots) ByteLength(spec *Spec) (out uint64)
- func (a *HistoricalRoots) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *HistoricalRoots) FixedLength(spec *Spec) uint64
- func (li HistoricalRoots) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a HistoricalRoots) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type HistoricalRootsView
- type IndexedAttestation
- func (a *IndexedAttestation) ByteLength(spec *Spec) uint64
- func (p *IndexedAttestation) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*IndexedAttestation) FixedLength(*Spec) uint64
- func (p *IndexedAttestation) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *IndexedAttestation) Serialize(spec *Spec, w *codec.EncodingWriter) error
- 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
- type JustificationBitsView
- type KickstartValidatorData
- 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 PendingAttestation
- func (a *PendingAttestation) ByteLength(spec *Spec) uint64
- func (a *PendingAttestation) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *PendingAttestation) FixedLength(*Spec) uint64
- func (a *PendingAttestation) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *PendingAttestation) Serialize(spec *Spec, w *codec.EncodingWriter) error
- func (att *PendingAttestation) View(spec *Spec) *PendingAttestationView
- type PendingAttestationView
- type PendingAttestations
- func (p PendingAttestations) ByteLength(spec *Spec) (out uint64)
- func (a *PendingAttestations) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *PendingAttestations) FixedLength(*Spec) uint64
- func (li PendingAttestations) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a PendingAttestations) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type PendingAttestationsView
- type Phase0Config
- func (c *Phase0Config) Attestation() *ContainerTypeDef
- func (c *Phase0Config) AttesterSlashing() *ContainerTypeDef
- func (c *Phase0Config) BatchRoots() VectorTypeDef
- func (c *Phase0Config) BeaconBlock() *ContainerTypeDef
- func (c *Phase0Config) BeaconBlockBody() *ContainerTypeDef
- func (c *Phase0Config) BeaconState() *ContainerTypeDef
- func (c *Phase0Config) BlockAttestations() ListTypeDef
- func (c *Phase0Config) BlockAttesterSlashings() ListTypeDef
- func (c *Phase0Config) BlockDeposits() ListTypeDef
- func (c *Phase0Config) BlockProposerSlashings() ListTypeDef
- func (c *Phase0Config) BlockVoluntaryExits() ListTypeDef
- func (c *Phase0Config) CheckPoint() *ContainerTypeDef
- func (c *Phase0Config) CommitteeBits() *BitListTypeDef
- func (c *Phase0Config) CommitteeIndices() ListTypeDef
- func (c *Phase0Config) Eth1DataVotes() ListTypeDef
- func (c *Phase0Config) HistoricalBatch() *ContainerTypeDef
- func (c *Phase0Config) HistoricalRoots() ListTypeDef
- func (c *Phase0Config) IndexedAttestation() *ContainerTypeDef
- func (c *Phase0Config) NewBeaconStateView() *BeaconStateView
- func (c *Phase0Config) PendingAttestation() *ContainerTypeDef
- func (c *Phase0Config) PendingAttestations() ListTypeDef
- func (c *Phase0Config) RandaoMixes() VectorTypeDef
- func (c *Phase0Config) RegistryBalances() *BasicListTypeDef
- func (c *Phase0Config) ResetEth1Votes(state *BeaconStateView) error
- func (c *Phase0Config) SignedBeaconBlock() *ContainerTypeDef
- func (c *Phase0Config) Slashings() VectorTypeDef
- func (c *Phase0Config) ValidatorsRegistry() ListTypeDef
- func (c *Phase0Config) View(cb CommitteeBits) *CommitteeBitsView
- type Phase1Config
- 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 ProposerSlashing
- type ProposerSlashings
- func (a ProposerSlashings) ByteLength(spec *Spec) (out uint64)
- func (a *ProposerSlashings) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*ProposerSlashings) FixedLength(*Spec) uint64
- func (li ProposerSlashings) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a ProposerSlashings) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type PubkeyCache
- type RandaoMixes
- func (a RandaoMixes) ByteLength(spec *Spec) (out uint64)
- func (a *RandaoMixes) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *RandaoMixes) FixedLength(spec *Spec) uint64
- func (li RandaoMixes) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a RandaoMixes) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type RandaoMixesView
- type RegistryBalancesView
- func (v *RegistryBalancesView) DecreaseBalance(index ValidatorIndex, delta Gwei) error
- func (v *RegistryBalancesView) GetBalance(index ValidatorIndex) (Gwei, error)
- func (v *RegistryBalancesView) IncreaseBalance(index ValidatorIndex, delta Gwei) error
- func (v *RegistryBalancesView) SetBalance(index ValidatorIndex, bal Gwei) error
- type RegistryIndices
- func (a RegistryIndices) ByteLength(spec *Spec) uint64
- func (p *RegistryIndices) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*RegistryIndices) FixedLength() uint64
- func (p RegistryIndices) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a RegistryIndices) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type RewardsAndPenalties
- type Root
- 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 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 ShufflingEpoch
- type SignedAggregateAndProof
- func (a *SignedAggregateAndProof) ByteLength(spec *Spec) uint64
- func (a *SignedAggregateAndProof) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *SignedAggregateAndProof) FixedLength(*Spec) uint64
- func (a *SignedAggregateAndProof) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a *SignedAggregateAndProof) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type SignedBeaconBlock
- func (b *SignedBeaconBlock) ByteLength(spec *Spec) uint64
- func (b *SignedBeaconBlock) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *SignedBeaconBlock) FixedLength(*Spec) uint64
- func (b *SignedBeaconBlock) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (b *SignedBeaconBlock) Serialize(spec *Spec, w *codec.EncodingWriter) error
- func (block *SignedBeaconBlock) SignedHeader(spec *Spec) *SignedBeaconBlockHeader
- 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 SignedVoluntaryExit
- func (v *SignedVoluntaryExit) ByteLength() uint64
- func (v *SignedVoluntaryExit) Deserialize(dr *codec.DecodingReader) error
- func (*SignedVoluntaryExit) FixedLength() uint64
- func (v *SignedVoluntaryExit) HashTreeRoot(hFn tree.HashFn) Root
- func (v *SignedVoluntaryExit) Serialize(w *codec.EncodingWriter) error
- type SigningData
- type SlashingsHistory
- func (a SlashingsHistory) ByteLength(spec *Spec) (out uint64)
- func (a *SlashingsHistory) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *SlashingsHistory) FixedLength(spec *Spec) uint64
- func (li SlashingsHistory) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a SlashingsHistory) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type SlashingsView
- 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 (i Slot) Serialize(w *codec.EncodingWriter) error
- func (e Slot) String() string
- func (e *Slot) UnmarshalJSON(b []byte) error
- type Spec
- func (spec *Spec) AttestationRewardsAndPenalties(ctx context.Context, epc *EpochsContext, process *EpochProcess, ...) (*RewardsAndPenalties, error)
- func (spec *Spec) CommitteeCount(activeValidators uint64) uint64
- func (spec *Spec) ComputeActivationExitEpoch(e Epoch) Epoch
- func (spec *Spec) EpochStartSlot(e Epoch) Slot
- func (spec *Spec) GenesisFromEth1(eth1BlockHash Root, time Timestamp, deps []Deposit, ...) (*BeaconStateView, *EpochsContext, error)
- func (spec *Spec) GetBlockRoot(state *BeaconStateView, epoch Epoch) (Root, error)
- func (spec *Spec) GetBlockRootAtSlot(state *BeaconStateView, slot Slot) (Root, error)
- func (spec *Spec) GetChurnLimit(activeValidatorCount uint64) uint64
- func (spec *Spec) GetSeed(mixes *RandaoMixesView, epoch Epoch, domainType BLSDomainType) (Root, error)
- func (spec *Spec) InitiateValidatorExit(epc *EpochsContext, state *BeaconStateView, index ValidatorIndex) error
- func (spec *Spec) IsActive(v *ValidatorView, epoch Epoch) (bool, error)
- func (spec *Spec) IsEligibleForActivation(v *ValidatorView, finalizedEpoch Epoch) (bool, error)
- func (spec *Spec) IsEligibleForActivationQueue(v *ValidatorView) (bool, error)
- func (spec *Spec) IsSlashable(v *ValidatorView, epoch Epoch) (bool, error)
- func (spec *Spec) IsValidGenesisState(state *BeaconStateView) (bool, error)
- func (spec *Spec) KickStartState(eth1BlockHash Root, time Timestamp, validators []KickstartValidatorData) (*BeaconStateView, *EpochsContext, error)
- func (spec *Spec) KickStartStateWithSignatures(eth1BlockHash Root, time Timestamp, validators []KickstartValidatorData, ...) (*BeaconStateView, *EpochsContext, error)
- func (spec *Spec) NewEpochsContext(state *BeaconStateView) (*EpochsContext, error)
- func (spec *Spec) NewShufflingEpoch(indicesBounded []BoundedIndex, seed Root, epoch Epoch) *ShufflingEpoch
- func (spec *Spec) PrepareEpochProcess(ctx context.Context, epc *EpochsContext, state *BeaconStateView) (out *EpochProcess, err error)
- func (spec *Spec) ProcessAttestation(epc *EpochsContext, state *BeaconStateView, attestation *Attestation) error
- func (spec *Spec) ProcessAttestations(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) ProcessAttesterSlashing(epc *EpochsContext, state *BeaconStateView, attesterSlashing *AttesterSlashing) error
- func (spec *Spec) ProcessAttesterSlashings(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) ProcessBlock(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) ProcessDeposit(epc *EpochsContext, state *BeaconStateView, dep *Deposit, ...) error
- func (spec *Spec) ProcessDeposits(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ops []Deposit) error
- func (spec *Spec) ProcessEpoch(ctx context.Context, epc *EpochsContext, state *BeaconStateView) error
- func (spec *Spec) ProcessEpochFinalUpdates(ctx context.Context, epc *EpochsContext, process *EpochProcess, ...) error
- func (spec *Spec) ProcessEpochJustification(ctx context.Context, epc *EpochsContext, process *EpochProcess, ...) error
- func (spec *Spec) ProcessEpochRegistryUpdates(ctx context.Context, epc *EpochsContext, process *EpochProcess, ...) error
- func (spec *Spec) ProcessEpochRewardsAndPenalties(ctx context.Context, epc *EpochsContext, process *EpochProcess, ...) error
- func (spec *Spec) ProcessEpochSlashings(ctx context.Context, epc *EpochsContext, process *EpochProcess, ...) error
- func (spec *Spec) ProcessEth1Vote(ctx context.Context, epc *EpochsContext, state *BeaconStateView, data Eth1Data) error
- func (spec *Spec) ProcessHeader(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) ProcessProposerSlashing(epc *EpochsContext, state *BeaconStateView, ps *ProposerSlashing) error
- func (spec *Spec) ProcessProposerSlashings(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) ProcessRandaoReveal(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) ProcessSlot(ctx context.Context, state *BeaconStateView) error
- func (spec *Spec) ProcessSlots(ctx context.Context, epc *EpochsContext, state *BeaconStateView, slot Slot) error
- func (spec *Spec) ProcessVoluntaryExit(epc *EpochsContext, state *BeaconStateView, signedExit *SignedVoluntaryExit) error
- func (spec *Spec) ProcessVoluntaryExits(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) SeedRandao(seed Root) (*RandaoMixesView, error)
- func (spec *Spec) ShufflingEpoch(state *BeaconStateView, indicesBounded []BoundedIndex, epoch Epoch) (*ShufflingEpoch, error)
- func (spec *Spec) SlashValidator(epc *EpochsContext, state *BeaconStateView, slashedIndex ValidatorIndex, ...) error
- func (spec *Spec) SlotToEpoch(s Slot) Epoch
- func (spec *Spec) StateTransition(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) TimeToSlot(t Timestamp, genesisTime Timestamp) Slot
- func (spec *Spec) ValidateIndexedAttestation(epc *EpochsContext, state *BeaconStateView, ...) error
- func (spec *Spec) VerifyBlockSignature(epc *EpochsContext, state *BeaconStateView, block *SignedBeaconBlock, ...) bool
- 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 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 Validator
- func (a *Validator) ByteLength() uint64
- func (v *Validator) Deserialize(dr *codec.DecodingReader) error
- func (*Validator) FixedLength() uint64
- func (v *Validator) HashTreeRoot(hFn tree.HashFn) Root
- func (v *Validator) Serialize(w *codec.EncodingWriter) error
- func (v *Validator) View() *ValidatorView
- type 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
- func (a ValidatorRegistry) ByteLength(spec *Spec) (out uint64)
- func (a *ValidatorRegistry) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (a *ValidatorRegistry) FixedLength(spec *Spec) uint64
- func (li ValidatorRegistry) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a ValidatorRegistry) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type ValidatorSet
- func (vs *ValidatorSet) Dedup()
- 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 ValidatorView
- func (v *ValidatorView) ActivationEligibilityEpoch() (Epoch, error)
- func (v *ValidatorView) ActivationEpoch() (Epoch, error)
- func (v *ValidatorView) EffectiveBalance() (Gwei, error)
- func (v *ValidatorView) ExitEpoch() (Epoch, error)
- func (v *ValidatorView) MakeSlashed() error
- func (v *ValidatorView) Pubkey() (BLSPubkey, error)
- func (v *ValidatorView) SetActivationEligibilityEpoch(epoch Epoch) error
- func (v *ValidatorView) SetActivationEpoch(epoch Epoch) error
- func (v *ValidatorView) SetEffectiveBalance(b Gwei) error
- func (v *ValidatorView) SetExitEpoch(ep Epoch) error
- func (v *ValidatorView) SetWithdrawableEpoch(epoch Epoch) error
- func (v *ValidatorView) Slashed() (BoolView, error)
- func (v *ValidatorView) WithdrawableEpoch() (Epoch, error)
- func (v *ValidatorView) WithdrawalCredentials() (out Root, err error)
- type ValidatorsRegistryView
- 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 VoluntaryExit
- type VoluntaryExits
- func (a VoluntaryExits) ByteLength(spec *Spec) (out uint64)
- func (a *VoluntaryExits) Deserialize(spec *Spec, dr *codec.DecodingReader) error
- func (*VoluntaryExits) FixedLength(*Spec) uint64
- func (li VoluntaryExits) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
- func (a VoluntaryExits) Serialize(spec *Spec, w *codec.EncodingWriter) error
- type WithdrawalPrefix
Constants ¶
const ATTESTATION_SUBNET_COUNT = 64
const BASE_REWARDS_PER_EPOCH = 4
const Bytes32Type = RootType
const CommitteeIndexType = Uint64Type
const DEPOSIT_CONTRACT_TREE_DEPTH = 32
const EpochType = Uint64Type
const FAR_FUTURE_EPOCH = Epoch(^uint64(0))
const GweiType = Uint64Type
const JUSTIFICATION_BITS_LENGTH = 4
const MetadataByteLen = 8 + attnetByteLen
const SECONDS_PER_DAY = 24 * 60 * 60
const ShardType = Uint64Type
const SlotType = Uint64Type
const StatusByteLen = 4 + 32 + 8 + 32 + 8
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
Variables ¶
var AttestationDataType = ContainerType("AttestationData", []FieldDef{ {"slot", SlotType}, {"index", CommitteeIndexType}, {"beacon_block_root", RootType}, {"source", CheckpointType}, {"target", CheckpointType}, })
var BLSPubkeyType = BasicVectorType(ByteType, 48)
var BLSSignatureType = BasicVectorType(ByteType, 96)
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 DepositDataType = ContainerType("DepositData", []FieldDef{ {"pubkey", BLSPubkeyType}, {"withdrawal_credentials", Bytes32Type}, {"amount", GweiType}, {"signature", BLSSignatureType}, })
var DepositProofType = VectorType(Bytes32Type, DEPOSIT_CONTRACT_TREE_DEPTH+1)
var DepositRootsType = ComplexListType(RootType, 1<<DEPOSIT_CONTRACT_TREE_DEPTH)
var DepositType = ContainerType("Deposit", []FieldDef{ {"proof", DepositProofType}, {"data", DepositDataType}, })
var Eth1DataType = ContainerType("Eth1Data", []FieldDef{ {"deposit_root", RootType}, {"deposit_count", Uint64Type}, {"block_hash", Bytes32Type}, })
var ForkType = ContainerType("Fork", []FieldDef{ {"previous_version", VersionType}, {"current_version", VersionType}, {"epoch", EpochType}, })
var JustificationBitsType = BitVectorType(JUSTIFICATION_BITS_LENGTH)
var ProposerSlashingType = ContainerType("ProposerSlashing", []FieldDef{ {"header_1", SignedBeaconBlockHeaderType}, {"header_2", SignedBeaconBlockHeaderType}, })
var SignedBeaconBlockHeaderType = ContainerType("SignedBeaconBlockHeader", []FieldDef{ {"message", BeaconBlockHeaderType}, {"signature", BLSSignatureType}, })
var SignedVoluntaryExitType = ContainerType("SignedVoluntaryExit", []FieldDef{ {"message", VoluntaryExitType}, {"signature", BLSSignatureType}, })
var TransitionCancelErr = errors.New("state transition was cancelled")
var ValidatorType = ContainerType("Validator", []FieldDef{ {"pubkey", BLSPubkeyType}, {"withdrawal_credentials", Bytes32Type}, {"effective_balance", GweiType}, {"slashed", BoolType}, {"activation_eligibility_epoch", EpochType}, {"activation_epoch", EpochType}, {"exit_epoch", EpochType}, {"withdrawable_epoch", EpochType}, })
var VoluntaryExitType = ContainerType("VoluntaryExit", []FieldDef{ {"epoch", EpochType}, {"validator_index", ValidatorIndexType}, })
Functions ¶
func IsDoubleVote ¶ added in v0.12.1
func IsDoubleVote(a *AttestationData, b *AttestationData) bool
Check if a and b have the same target epoch.
func IsSlashableAttestationData ¶ added in v0.12.1
func IsSlashableAttestationData(a *AttestationData, b *AttestationData) bool
func IsSurroundVote ¶ added in v0.12.1
func IsSurroundVote(a *AttestationData, b *AttestationData) bool
Check if a surrounds b, i.E. source(a) < source(b) and target(a) > target(b)
func ShuffleList ¶ added in v0.12.1
func ShuffleList(rounds uint8, input []ValidatorIndex, seed Root)
ShuffleList shuffles a list, using the given seed for randomness.
func UnshuffleList ¶ added in v0.12.1
func UnshuffleList(rounds uint8, input []ValidatorIndex, seed Root)
UnshuffleList undoes a list shuffling using the seed of the shuffling.
Types ¶
type AggregateAndProof ¶ added in v0.13.1
type AggregateAndProof struct { AggregatorIndex ValidatorIndex `json:"aggregator_index"` Aggregate Attestation `json:"aggregate"` SelectionProof BLSSignature `json:"selection_proof"` }
func (*AggregateAndProof) ByteLength ¶ added in v0.13.1
func (a *AggregateAndProof) ByteLength(spec *Spec) uint64
func (*AggregateAndProof) Deserialize ¶ added in v0.13.1
func (a *AggregateAndProof) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*AggregateAndProof) FixedLength ¶ added in v0.13.1
func (a *AggregateAndProof) FixedLength(*Spec) uint64
func (*AggregateAndProof) HashTreeRoot ¶ added in v0.13.1
func (a *AggregateAndProof) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*AggregateAndProof) Serialize ¶ added in v0.13.1
func (a *AggregateAndProof) Serialize(spec *Spec, w *codec.EncodingWriter) error
type Attestation ¶
type Attestation struct { AggregationBits CommitteeBits `json:"aggregation_bits" yaml:"aggregation_bits"` Data AttestationData `json:"data" yaml:"data"` Signature BLSSignature `json:"signature" yaml:"signature"` }
func (*Attestation) ByteLength ¶ added in v0.12.2
func (a *Attestation) ByteLength(spec *Spec) uint64
func (*Attestation) ConvertToIndexed ¶ added in v0.12.1
func (attestation *Attestation) ConvertToIndexed(spec *Spec, committee []ValidatorIndex) (*IndexedAttestation, error)
Convert attestation to (almost) indexed-verifiable form
func (*Attestation) Deserialize ¶ added in v0.12.2
func (a *Attestation) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Attestation) FixedLength ¶ added in v0.12.2
func (a *Attestation) FixedLength(*Spec) uint64
func (*Attestation) HashTreeRoot ¶ added in v0.12.2
func (a *Attestation) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*Attestation) Serialize ¶ added in v0.12.2
func (a *Attestation) Serialize(spec *Spec, w *codec.EncodingWriter) error
type AttestationData ¶
type AttestationData struct { Slot Slot `json:"slot" yaml:"slot"` Index CommitteeIndex `json:"index" yaml:"index"` // LMD GHOST vote BeaconBlockRoot Root `json:"beacon_block_root" yaml:"beacon_block_root"` // FFG vote Source Checkpoint `json:"source" yaml:"source"` Target Checkpoint `json:"target" yaml:"target"` }
func (*AttestationData) ByteLength ¶ added in v0.12.2
func (a *AttestationData) ByteLength() uint64
func (*AttestationData) Deserialize ¶ added in v0.12.2
func (a *AttestationData) Deserialize(dr *codec.DecodingReader) error
func (*AttestationData) FixedLength ¶ added in v0.12.2
func (*AttestationData) FixedLength() uint64
func (*AttestationData) HashTreeRoot ¶ added in v0.12.2
func (p *AttestationData) HashTreeRoot(hFn tree.HashFn) Root
func (*AttestationData) Serialize ¶ added in v0.12.2
func (a *AttestationData) Serialize(w *codec.EncodingWriter) error
func (*AttestationData) View ¶ added in v0.12.1
func (data *AttestationData) View() *AttestationDataView
type AttestationDataView ¶ added in v0.12.1
type AttestationDataView struct{ *ContainerView }
func AsAttestationData ¶ added in v0.12.1
func AsAttestationData(v View, err error) (*AttestationDataView, error)
func (*AttestationDataView) Raw ¶ added in v0.12.1
func (v *AttestationDataView) Raw() (*AttestationData, error)
type Attestations ¶ added in v0.12.1
type Attestations []Attestation
func (Attestations) ByteLength ¶ added in v0.12.2
func (a Attestations) ByteLength(spec *Spec) (out uint64)
func (*Attestations) Deserialize ¶ added in v0.12.2
func (a *Attestations) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Attestations) FixedLength ¶ added in v0.12.2
func (a *Attestations) FixedLength(*Spec) uint64
func (Attestations) HashTreeRoot ¶ added in v0.12.2
func (li Attestations) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (Attestations) Serialize ¶ added in v0.12.2
func (a Attestations) Serialize(spec *Spec, w *codec.EncodingWriter) error
type AttesterFlag ¶ added in v0.12.1
type AttesterFlag uint8
const ( PrevSourceAttester AttesterFlag = 1 << iota PrevTargetAttester PrevHeadAttester CurrSourceAttester CurrTargetAttester CurrHeadAttester UnslashedAttester EligibleAttester )
func (AttesterFlag) HasMarkers ¶ added in v0.12.1
func (flags AttesterFlag) HasMarkers(markers AttesterFlag) bool
type AttesterSlashing ¶
type AttesterSlashing struct { Attestation1 IndexedAttestation `json:"attestation_1" yaml:"attestation_1"` Attestation2 IndexedAttestation `json:"attestation_2" yaml:"attestation_2"` }
func (*AttesterSlashing) ByteLength ¶ added in v0.12.2
func (a *AttesterSlashing) ByteLength(spec *Spec) uint64
func (*AttesterSlashing) Deserialize ¶ added in v0.12.2
func (a *AttesterSlashing) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*AttesterSlashing) FixedLength ¶ added in v0.12.2
func (a *AttesterSlashing) FixedLength(*Spec) uint64
func (*AttesterSlashing) HashTreeRoot ¶ added in v0.12.2
func (a *AttesterSlashing) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*AttesterSlashing) Serialize ¶ added in v0.12.2
func (a *AttesterSlashing) Serialize(spec *Spec, w *codec.EncodingWriter) error
type AttesterSlashings ¶ added in v0.12.1
type AttesterSlashings []AttesterSlashing
func (AttesterSlashings) ByteLength ¶ added in v0.12.2
func (a AttesterSlashings) ByteLength(spec *Spec) (out uint64)
func (*AttesterSlashings) Deserialize ¶ added in v0.12.2
func (a *AttesterSlashings) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*AttesterSlashings) FixedLength ¶ added in v0.12.2
func (a *AttesterSlashings) FixedLength(*Spec) uint64
func (AttesterSlashings) HashTreeRoot ¶ added in v0.12.2
func (li AttesterSlashings) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (AttesterSlashings) Serialize ¶ added in v0.12.2
func (a AttesterSlashings) Serialize(spec *Spec, w *codec.EncodingWriter) error
type AttesterStatus ¶ added in v0.12.1
type AttesterStatus struct { // The delay of inclusion of the latest attestation by the attester. // No delay (i.e. 0) by default InclusionDelay Slot // The validator index of the proposer of the attested beacon block. // Only valid if the validator has an attesting flag set. AttestedProposer ValidatorIndex // A bitfield of markers describing the recent actions of the validator Flags AttesterFlag Validator *FlatValidator // If the validator is active Active bool }
type AttnetBits ¶ added in v0.12.2
type AttnetBits [attnetByteLen]byte
func (*AttnetBits) BitLen ¶ added in v0.12.2
func (ab *AttnetBits) BitLen() uint64
func (AttnetBits) ByteLength ¶ added in v0.12.2
func (p AttnetBits) ByteLength() uint64
func (*AttnetBits) Deserialize ¶ added in v0.12.2
func (p *AttnetBits) Deserialize(dr *codec.DecodingReader) error
func (AttnetBits) FixedLength ¶ added in v0.12.2
func (AttnetBits) FixedLength() uint64
func (AttnetBits) HashTreeRoot ¶ added in v0.12.2
func (p AttnetBits) HashTreeRoot(_ tree.HashFn) (out Root)
func (AttnetBits) MarshalText ¶ added in v0.12.2
func (p AttnetBits) MarshalText() ([]byte, error)
func (AttnetBits) Serialize ¶ added in v0.12.2
func (p AttnetBits) Serialize(w *codec.EncodingWriter) error
func (AttnetBits) String ¶ added in v0.12.2
func (p AttnetBits) String() string
func (*AttnetBits) UnmarshalText ¶ added in v0.12.2
func (p *AttnetBits) UnmarshalText(text []byte) error
type BLSDomain ¶ added in v0.12.1
type BLSDomain [32]byte
BLS domain (8 bytes): fork version (32 bits) concatenated with BLS domain type (32 bits)
func ComputeDomain ¶ added in v0.12.1
func ComputeDomain(domainType BLSDomainType, forkVersion Version, genesisValidatorsRoot Root) (out BLSDomain)
func (*BLSDomain) Deserialize ¶ added in v0.12.2
func (dom *BLSDomain) Deserialize(dr *codec.DecodingReader) error
func (*BLSDomain) FixedLength ¶ added in v0.12.2
func (BLSDomain) HashTreeRoot ¶ added in v0.12.2
type BLSDomainType ¶ added in v0.12.1
type BLSDomainType [4]byte
Mixed into a BLS domain to define its type
func (BLSDomainType) MarshalText ¶ added in v0.12.2
func (p BLSDomainType) MarshalText() ([]byte, error)
func (BLSDomainType) String ¶ added in v0.12.2
func (p BLSDomainType) String() string
func (*BLSDomainType) UnmarshalText ¶ added in v0.12.2
func (p *BLSDomainType) UnmarshalText(text []byte) error
type BLSPubkey ¶ added in v0.12.1
func AsBLSPubkey ¶ added in v0.12.1
type BLSPubkeyView ¶ added in v0.12.1
type BLSPubkeyView struct {
*BasicVectorView
}
func ViewPubkey ¶ added in v0.12.1
func ViewPubkey(pub *BLSPubkey) *BLSPubkeyView
type BLSSignature ¶ added in v0.12.1
type BLSSignature = bls.BLSSignature
func AsBLSSignature ¶ added in v0.12.1
func AsBLSSignature(v View, err error) (BLSSignature, error)
type BLSSignatureView ¶ added in v0.12.1
type BLSSignatureView struct {
*BasicVectorView
}
func ViewSignature ¶ added in v0.12.1
func ViewSignature(sig *BLSSignature) *BLSSignatureView
type Balances ¶ added in v0.12.1
type Balances []Gwei
func (Balances) ByteLength ¶ added in v0.12.2
func (*Balances) Deserialize ¶ added in v0.12.2
func (a *Balances) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Balances) FixedLength ¶ added in v0.12.2
func (Balances) HashTreeRoot ¶ added in v0.12.2
type BatchRootsView ¶ added in v0.12.1
type BatchRootsView struct{ *ComplexVectorView }
func AsBatchRoots ¶ added in v0.12.1
func AsBatchRoots(v View, err error) (*BatchRootsView, error)
type BeaconBlock ¶
type BeaconBlock 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"` Body BeaconBlockBody `json:"body" yaml:"body"` }
func (*BeaconBlock) ByteLength ¶ added in v0.12.2
func (b *BeaconBlock) ByteLength(spec *Spec) uint64
func (*BeaconBlock) Deserialize ¶ added in v0.12.2
func (b *BeaconBlock) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*BeaconBlock) FixedLength ¶ added in v0.12.2
func (a *BeaconBlock) FixedLength(*Spec) uint64
func (*BeaconBlock) HashTreeRoot ¶ added in v0.12.1
func (b *BeaconBlock) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*BeaconBlock) Header ¶ added in v0.12.1
func (block *BeaconBlock) Header(spec *Spec) *BeaconBlockHeader
func (*BeaconBlock) Serialize ¶ added in v0.12.2
func (b *BeaconBlock) Serialize(spec *Spec, w *codec.EncodingWriter) error
type BeaconBlockBody ¶
type BeaconBlockBody struct { RandaoReveal BLSSignature `json:"randao_reveal" yaml:"randao_reveal"` Eth1Data Eth1Data `json:"eth1_data" yaml:"eth1_data"` Graffiti Root `json:"graffiti" yaml:"graffiti"` ProposerSlashings ProposerSlashings `json:"proposer_slashings" yaml:"proposer_slashings"` AttesterSlashings AttesterSlashings `json:"attester_slashings" yaml:"attester_slashings"` Attestations Attestations `json:"attestations" yaml:"attestations"` Deposits Deposits `json:"deposits" yaml:"deposits"` VoluntaryExits VoluntaryExits `json:"voluntary_exits" yaml:"voluntary_exits"` }
func (*BeaconBlockBody) ByteLength ¶ added in v0.12.2
func (b *BeaconBlockBody) ByteLength(spec *Spec) uint64
func (BeaconBlockBody) CheckLimits ¶ added in v0.12.2
func (b BeaconBlockBody) CheckLimits(spec *Spec) error
func (*BeaconBlockBody) Deserialize ¶ added in v0.12.2
func (b *BeaconBlockBody) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*BeaconBlockBody) FixedLength ¶ added in v0.12.2
func (a *BeaconBlockBody) FixedLength(*Spec) uint64
func (*BeaconBlockBody) HashTreeRoot ¶ added in v0.12.1
func (b *BeaconBlockBody) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*BeaconBlockBody) Serialize ¶ added in v0.12.2
func (b *BeaconBlockBody) Serialize(spec *Spec, w *codec.EncodingWriter) error
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 ¶ added in v0.12.2
func (s *BeaconBlockHeader) ByteLength() uint64
func (*BeaconBlockHeader) Deserialize ¶ added in v0.12.2
func (s *BeaconBlockHeader) Deserialize(dr *codec.DecodingReader) error
func (*BeaconBlockHeader) FixedLength ¶ added in v0.12.2
func (b *BeaconBlockHeader) FixedLength() uint64
func (*BeaconBlockHeader) HashTreeRoot ¶ added in v0.12.1
func (b *BeaconBlockHeader) HashTreeRoot(hFn tree.HashFn) Root
func (*BeaconBlockHeader) Serialize ¶ added in v0.12.2
func (s *BeaconBlockHeader) Serialize(w *codec.EncodingWriter) error
func (*BeaconBlockHeader) View ¶ added in v0.12.1
func (h *BeaconBlockHeader) View() *BeaconBlockHeaderView
type BeaconBlockHeaderView ¶ added in v0.12.1
type BeaconBlockHeaderView struct {
*ContainerView
}
func AsBeaconBlockHeader ¶ added in v0.12.1
func AsBeaconBlockHeader(v View, err error) (*BeaconBlockHeaderView, error)
func (*BeaconBlockHeaderView) BodyRoot ¶ added in v0.12.1
func (v *BeaconBlockHeaderView) BodyRoot() (Root, error)
func (*BeaconBlockHeaderView) ParentRoot ¶ added in v0.12.1
func (v *BeaconBlockHeaderView) ParentRoot() (Root, error)
func (*BeaconBlockHeaderView) ProposerIndex ¶ added in v0.12.1
func (v *BeaconBlockHeaderView) ProposerIndex() (ValidatorIndex, error)
func (*BeaconBlockHeaderView) Raw ¶ added in v0.12.1
func (v *BeaconBlockHeaderView) Raw() (*BeaconBlockHeader, error)
func (*BeaconBlockHeaderView) SetStateRoot ¶ added in v0.12.1
func (v *BeaconBlockHeaderView) SetStateRoot(root Root) error
func (*BeaconBlockHeaderView) Slot ¶ added in v0.12.1
func (v *BeaconBlockHeaderView) Slot() (Slot, error)
func (*BeaconBlockHeaderView) StateRoot ¶ added in v0.12.1
func (v *BeaconBlockHeaderView) StateRoot() (Root, error)
type BeaconState ¶
type BeaconState struct { // Versioning GenesisTime Timestamp `json:"genesis_time" yaml:"genesis_time"` GenesisValidatorsRoot Root `json:"genesis_validators_root" yaml:"genesis_validators_root"` Slot Slot `json:"slot" yaml:"slot"` Fork Fork `json:"fork" yaml:"fork"` // History LatestBlockHeader BeaconBlockHeader `json:"latest_block_header" yaml:"latest_block_header"` BlockRoots HistoricalBatchRoots `json:"block_roots" yaml:"block_roots"` StateRoots HistoricalBatchRoots `json:"state_roots" yaml:"state_roots"` HistoricalRoots HistoricalRoots `json:"historical_roots" yaml:"historical_roots"` // Eth1 Eth1Data Eth1Data `json:"eth1_data" yaml:"eth1_data"` Eth1DataVotes Eth1DataVotes `json:"eth1_data_votes" yaml:"eth1_data_votes"` DepositIndex DepositIndex `json:"eth1_deposit_index" yaml:"eth1_deposit_index"` // Registry Validators ValidatorRegistry `json:"validators" yaml:"validators"` Balances Balances `json:"balances" yaml:"balances"` RandaoMixes RandaoMixes `json:"randao_mixes" yaml:"randao_mixes"` Slashings SlashingsHistory `json:"slashings" yaml:"slashings"` // Attestations PreviousEpochAttestations PendingAttestations `json:"previous_epoch_attestations" yaml:"previous_epoch_attestations"` CurrentEpochAttestations PendingAttestations `json:"current_epoch_attestations" yaml:"current_epoch_attestations"` // Finality JustificationBits JustificationBits `json:"justification_bits" yaml:"justification_bits"` PreviousJustifiedCheckpoint Checkpoint `json:"previous_justified_checkpoint" yaml:"previous_justified_checkpoint"` CurrentJustifiedCheckpoint Checkpoint `json:"current_justified_checkpoint" yaml:"current_justified_checkpoint"` FinalizedCheckpoint Checkpoint `json:"finalized_checkpoint" yaml:"finalized_checkpoint"` }
func (*BeaconState) ByteLength ¶ added in v0.12.2
func (v *BeaconState) ByteLength(spec *Spec) uint64
func (*BeaconState) Deserialize ¶ added in v0.12.2
func (v *BeaconState) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*BeaconState) FixedLength ¶ added in v0.12.2
func (*BeaconState) FixedLength(*Spec) uint64
func (*BeaconState) HashTreeRoot ¶ added in v0.12.2
func (v *BeaconState) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*BeaconState) Serialize ¶ added in v0.12.2
func (v *BeaconState) Serialize(spec *Spec, w *codec.EncodingWriter) error
type BeaconStateView ¶ added in v0.12.1
type BeaconStateView struct {
*ContainerView
}
func AsBeaconStateView ¶ added in v0.12.1
func AsBeaconStateView(v View, err error) (*BeaconStateView, error)
To load a state:
state, err := beacon.AsBeaconStateView(beacon.BeaconStateType.Deserialize(codec.NewDecodingReader(reader, size)))
func (*BeaconStateView) Balances ¶ added in v0.12.1
func (state *BeaconStateView) Balances() (*RegistryBalancesView, error)
func (*BeaconStateView) BlockRoots ¶ added in v0.12.1
func (state *BeaconStateView) BlockRoots() (*BatchRootsView, error)
func (*BeaconStateView) CurrentEpochAttestations ¶ added in v0.12.1
func (state *BeaconStateView) CurrentEpochAttestations() (*PendingAttestationsView, error)
func (*BeaconStateView) CurrentJustifiedCheckpoint ¶ added in v0.12.1
func (state *BeaconStateView) CurrentJustifiedCheckpoint() (*CheckpointView, error)
func (*BeaconStateView) DepositIndex ¶ added in v0.12.1
func (state *BeaconStateView) DepositIndex() (DepositIndex, error)
func (*BeaconStateView) Eth1Data ¶ added in v0.12.1
func (state *BeaconStateView) Eth1Data() (*Eth1DataView, error)
func (*BeaconStateView) Eth1DataVotes ¶ added in v0.12.1
func (state *BeaconStateView) Eth1DataVotes() (*Eth1DataVotesView, error)
func (*BeaconStateView) FinalizedCheckpoint ¶ added in v0.12.1
func (state *BeaconStateView) FinalizedCheckpoint() (*CheckpointView, error)
func (*BeaconStateView) Fork ¶ added in v0.12.1
func (state *BeaconStateView) Fork() (*ForkView, error)
func (*BeaconStateView) GenesisTime ¶ added in v0.12.1
func (state *BeaconStateView) GenesisTime() (Timestamp, error)
func (*BeaconStateView) GenesisValidatorsRoot ¶ added in v0.12.1
func (state *BeaconStateView) GenesisValidatorsRoot() (Root, error)
func (*BeaconStateView) GetDomain ¶ added in v0.12.1
func (state *BeaconStateView) GetDomain(dom BLSDomainType, messageEpoch Epoch) (BLSDomain, error)
Return the signature domain (fork version concatenated with domain type) of a message.
func (*BeaconStateView) HistoricalRoots ¶ added in v0.12.1
func (state *BeaconStateView) HistoricalRoots() (*HistoricalRootsView, error)
func (*BeaconStateView) IncrementDepositIndex ¶ added in v0.12.1
func (state *BeaconStateView) IncrementDepositIndex() error
func (*BeaconStateView) IsValidIndex ¶ added in v0.12.1
func (state *BeaconStateView) IsValidIndex(index ValidatorIndex) (bool, error)
func (*BeaconStateView) JustificationBits ¶ added in v0.12.1
func (state *BeaconStateView) JustificationBits() (*JustificationBitsView, error)
func (*BeaconStateView) LatestBlockHeader ¶ added in v0.12.1
func (state *BeaconStateView) LatestBlockHeader() (*BeaconBlockHeaderView, error)
func (*BeaconStateView) PreviousEpochAttestations ¶ added in v0.12.1
func (state *BeaconStateView) PreviousEpochAttestations() (*PendingAttestationsView, error)
func (*BeaconStateView) PreviousJustifiedCheckpoint ¶ added in v0.12.1
func (state *BeaconStateView) PreviousJustifiedCheckpoint() (*CheckpointView, error)
func (*BeaconStateView) RandaoMixes ¶ added in v0.12.1
func (state *BeaconStateView) RandaoMixes() (*RandaoMixesView, error)
func (*BeaconStateView) Raw ¶ added in v0.12.1
func (state *BeaconStateView) Raw(spec *Spec) (*BeaconState, error)
Raw converts the tree-structured state into a flattened native Go structure.
func (*BeaconStateView) SetEth1Data ¶ added in v0.12.1
func (state *BeaconStateView) SetEth1Data(v *Eth1DataView) error
func (*BeaconStateView) SetFork ¶ added in v0.12.1
func (state *BeaconStateView) SetFork(f Fork) error
func (*BeaconStateView) SetGenesisTime ¶ added in v0.12.1
func (state *BeaconStateView) SetGenesisTime(t Timestamp) error
func (*BeaconStateView) SetGenesisValidatorsRoot ¶ added in v0.12.1
func (state *BeaconStateView) SetGenesisValidatorsRoot(r Root) error
func (*BeaconStateView) SetLatestBlockHeader ¶ added in v0.12.1
func (state *BeaconStateView) SetLatestBlockHeader(v *BeaconBlockHeaderView) error
func (*BeaconStateView) SetRandaoMixes ¶ added in v0.12.1
func (state *BeaconStateView) SetRandaoMixes(v *RandaoMixesView) error
func (*BeaconStateView) SetRecentRoots ¶ added in v0.12.1
func (state *BeaconStateView) SetRecentRoots(slot Slot, blockRoot Root, stateRoot Root) error
func (*BeaconStateView) SetSlot ¶ added in v0.12.1
func (state *BeaconStateView) SetSlot(slot Slot) error
func (*BeaconStateView) Slashings ¶ added in v0.12.1
func (state *BeaconStateView) Slashings() (*SlashingsView, error)
func (*BeaconStateView) Slot ¶ added in v0.12.1
func (state *BeaconStateView) Slot() (Slot, error)
func (*BeaconStateView) StateRoots ¶ added in v0.12.1
func (state *BeaconStateView) StateRoots() (*BatchRootsView, error)
func (*BeaconStateView) UpdateHistoricalRoots ¶ added in v0.12.1
func (state *BeaconStateView) UpdateHistoricalRoots() error
func (*BeaconStateView) Validators ¶ added in v0.12.1
func (state *BeaconStateView) Validators() (*ValidatorsRegistryView, error)
type BoundedIndex ¶ added in v0.12.1
type BoundedIndex struct { Index ValidatorIndex Activation Epoch Exit Epoch }
type CachedPubkey ¶ added in v0.12.1
type CachedPubkey = bls.CachedPubkey
type Checkpoint ¶ added in v0.12.1
type Checkpoint struct { Epoch Epoch `json:"epoch" yaml:"epoch"` Root Root `json:"root" yaml:"root"` }
func (*Checkpoint) ByteLength ¶ added in v0.12.2
func (a *Checkpoint) ByteLength() uint64
func (*Checkpoint) Deserialize ¶ added in v0.12.2
func (c *Checkpoint) Deserialize(dr *codec.DecodingReader) error
func (*Checkpoint) FixedLength ¶ added in v0.12.2
func (g *Checkpoint) FixedLength() uint64
func (*Checkpoint) HashTreeRoot ¶ added in v0.12.2
func (c *Checkpoint) HashTreeRoot(hFn tree.HashFn) Root
func (*Checkpoint) Serialize ¶ added in v0.12.2
func (a *Checkpoint) Serialize(w *codec.EncodingWriter) error
func (*Checkpoint) View ¶ added in v0.12.1
func (c *Checkpoint) View() *CheckpointView
type CheckpointView ¶ added in v0.12.1
type CheckpointView struct {
*ContainerView
}
func AsCheckPoint ¶ added in v0.12.1
func AsCheckPoint(v View, err error) (*CheckpointView, error)
func (*CheckpointView) Epoch ¶ added in v0.12.1
func (v *CheckpointView) Epoch() (Epoch, error)
func (*CheckpointView) Raw ¶ added in v0.12.1
func (v *CheckpointView) Raw() (Checkpoint, error)
func (*CheckpointView) Root ¶ added in v0.12.1
func (v *CheckpointView) Root() (Root, error)
func (*CheckpointView) Set ¶ added in v0.12.1
func (v *CheckpointView) Set(ch *Checkpoint) error
type CommitteeBits ¶ added in v0.12.1
type CommitteeBits []byte
CommitteeBits is formatted as a serialized SSZ bitlist, including the delimit bit
func (CommitteeBits) BitLen ¶ added in v0.12.1
func (cb CommitteeBits) BitLen() uint64
func (CommitteeBits) ByteLength ¶ added in v0.12.2
func (a CommitteeBits) ByteLength(spec *Spec) uint64
func (*CommitteeBits) Deserialize ¶ added in v0.12.2
func (li *CommitteeBits) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (CommitteeBits) FilterNonParticipants ¶ added in v0.12.1
func (cb CommitteeBits) FilterNonParticipants(committee []ValidatorIndex) []ValidatorIndex
In-place filters a list of committees indices to only keep the bitfield NON-participants. The result is not sorted. Returns the re-sliced filtered non-participants list.
func (CommitteeBits) FilterParticipants ¶ added in v0.12.1
func (cb CommitteeBits) FilterParticipants(committee []ValidatorIndex) []ValidatorIndex
In-place filters a list of committees indices to only keep the bitfield participants. The result is not sorted. Returns the re-sliced filtered participants list.
func (*CommitteeBits) FixedLength ¶ added in v0.12.2
func (a *CommitteeBits) FixedLength(*Spec) uint64
func (CommitteeBits) GetBit ¶ added in v0.12.1
func (cb CommitteeBits) GetBit(i uint64) bool
func (CommitteeBits) HashTreeRoot ¶ added in v0.12.2
func (li CommitteeBits) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (CommitteeBits) MarshalText ¶ added in v0.12.5
func (cb CommitteeBits) MarshalText() ([]byte, error)
func (CommitteeBits) Or ¶ added in v0.12.1
func (cb CommitteeBits) Or(other CommitteeBits)
Sets the bits to true that are true in other. (in place)
func (CommitteeBits) Serialize ¶ added in v0.12.2
func (a CommitteeBits) Serialize(spec *Spec, w *codec.EncodingWriter) error
func (CommitteeBits) SetBit ¶ added in v0.12.1
func (cb CommitteeBits) SetBit(i uint64, v bool)
func (CommitteeBits) String ¶ added in v0.13.2
func (cb CommitteeBits) String() string
func (*CommitteeBits) UnmarshalText ¶ added in v0.12.5
func (cb *CommitteeBits) UnmarshalText(text []byte) error
func (CommitteeBits) View ¶ added in v0.12.1
func (li CommitteeBits) View(spec *Spec) *CommitteeBitsView
type CommitteeBitsView ¶ added in v0.12.1
type CommitteeBitsView struct {
*BitListView
}
func AsCommitteeBits ¶ added in v0.12.1
func AsCommitteeBits(v View, err error) (*CommitteeBitsView, error)
func (*CommitteeBitsView) Raw ¶ added in v0.12.1
func (v *CommitteeBitsView) Raw() (CommitteeBits, error)
type CommitteeIndex ¶ added in v0.12.1
type CommitteeIndex Uint64View
func AsCommitteeIndex ¶ added in v0.12.1
func AsCommitteeIndex(v View, err error) (CommitteeIndex, error)
func (CommitteeIndex) ByteLength ¶ added in v0.12.2
func (CommitteeIndex) ByteLength() uint64
func (*CommitteeIndex) Deserialize ¶ added in v0.12.2
func (i *CommitteeIndex) Deserialize(dr *codec.DecodingReader) error
func (CommitteeIndex) FixedLength ¶ added in v0.12.2
func (CommitteeIndex) FixedLength() uint64
func (CommitteeIndex) HashTreeRoot ¶ added in v0.12.2
func (i CommitteeIndex) HashTreeRoot(hFn tree.HashFn) Root
func (CommitteeIndex) MarshalJSON ¶ added in v0.12.5
func (e CommitteeIndex) MarshalJSON() ([]byte, error)
func (CommitteeIndex) Serialize ¶ added in v0.12.2
func (i CommitteeIndex) Serialize(w *codec.EncodingWriter) error
func (CommitteeIndex) String ¶ added in v0.13.2
func (e CommitteeIndex) String() string
func (*CommitteeIndex) UnmarshalJSON ¶ added in v0.12.5
func (e *CommitteeIndex) UnmarshalJSON(b []byte) error
type CommitteeIndices ¶ added in v0.12.1
type CommitteeIndices []ValidatorIndex
func (CommitteeIndices) ByteLength ¶ added in v0.12.2
func (a CommitteeIndices) ByteLength(*Spec) uint64
func (*CommitteeIndices) Deserialize ¶ added in v0.12.2
func (p *CommitteeIndices) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*CommitteeIndices) FixedLength ¶ added in v0.12.2
func (*CommitteeIndices) FixedLength(*Spec) uint64
func (CommitteeIndices) HashTreeRoot ¶ added in v0.12.2
func (p CommitteeIndices) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (CommitteeIndices) Serialize ¶ added in v0.12.2
func (a CommitteeIndices) Serialize(spec *Spec, w *codec.EncodingWriter) error
type Deltas ¶
type Deltas struct { Rewards GweiList `json:"rewards" yaml:"rewards"` Penalties GweiList `json:"penalties" yaml:"penalties"` }
func (*Deltas) ByteLength ¶ added in v0.12.2
func (*Deltas) Deserialize ¶ added in v0.12.2
func (a *Deltas) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Deltas) FixedLength ¶ added in v0.12.2
func (*Deltas) HashTreeRoot ¶ added in v0.12.2
type Deposit ¶
type Deposit struct { Proof DepositProof `json:"proof" yaml:"proof"` Data DepositData `json:"data" yaml:"data"` }
func (*Deposit) ByteLength ¶ added in v0.12.2
func (*Deposit) Deserialize ¶ added in v0.12.2
func (d *Deposit) Deserialize(dr *codec.DecodingReader) error
func (*Deposit) FixedLength ¶ added in v0.12.2
func (*Deposit) HashTreeRoot ¶ added in v0.12.2
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 ¶ added in v0.12.2
func (a *DepositData) ByteLength() uint64
func (*DepositData) Deserialize ¶ added in v0.12.2
func (d *DepositData) Deserialize(dr *codec.DecodingReader) error
func (*DepositData) FixedLength ¶ added in v0.12.2
func (a *DepositData) FixedLength() uint64
func (*DepositData) HashTreeRoot ¶ added in v0.12.2
func (d *DepositData) HashTreeRoot(hFn tree.HashFn) Root
hash-tree-root including the signature
func (*DepositData) MessageRoot ¶ added in v0.12.1
func (d *DepositData) MessageRoot() Root
hash-tree-root excluding the signature
func (*DepositData) Serialize ¶ added in v0.12.2
func (d *DepositData) Serialize(w *codec.EncodingWriter) error
func (*DepositData) ToMessage ¶ added in v0.12.1
func (d *DepositData) ToMessage() *DepositMessage
type DepositIndex ¶ added in v0.12.1
type DepositIndex Uint64View
Eth1 deposit ordering
func AsDepositIndex ¶ added in v0.12.1
func AsDepositIndex(v View, err error) (DepositIndex, error)
func (DepositIndex) ByteLength ¶ added in v0.12.2
func (DepositIndex) ByteLength() uint64
func (*DepositIndex) Deserialize ¶ added in v0.12.2
func (i *DepositIndex) Deserialize(dr *codec.DecodingReader) error
func (DepositIndex) FixedLength ¶ added in v0.12.2
func (DepositIndex) FixedLength() uint64
func (DepositIndex) HashTreeRoot ¶ added in v0.12.2
func (i DepositIndex) HashTreeRoot(hFn tree.HashFn) Root
func (DepositIndex) MarshalJSON ¶ added in v0.12.5
func (e DepositIndex) MarshalJSON() ([]byte, error)
func (DepositIndex) Serialize ¶ added in v0.12.2
func (i DepositIndex) Serialize(w *codec.EncodingWriter) error
func (DepositIndex) String ¶ added in v0.13.2
func (e DepositIndex) String() string
func (*DepositIndex) UnmarshalJSON ¶ added in v0.12.5
func (e *DepositIndex) UnmarshalJSON(b []byte) error
type DepositMessage ¶ added in v0.12.1
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) HashTreeRoot ¶ added in v0.12.2
func (b *DepositMessage) HashTreeRoot(hFn tree.HashFn) Root
type DepositProof ¶ added in v0.12.2
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 ¶ added in v0.12.2
func (a *DepositProof) ByteLength() uint64
func (*DepositProof) Deserialize ¶ added in v0.12.2
func (d *DepositProof) Deserialize(dr *codec.DecodingReader) error
func (*DepositProof) FixedLength ¶ added in v0.12.2
func (a *DepositProof) FixedLength() uint64
func (*DepositProof) HashTreeRoot ¶ added in v0.12.2
func (b *DepositProof) HashTreeRoot(hFn tree.HashFn) Root
func (*DepositProof) Serialize ¶ added in v0.12.2
func (d *DepositProof) Serialize(w *codec.EncodingWriter) error
type DepositRootsView ¶ added in v0.12.1
type DepositRootsView struct {
*ComplexListView
}
func AsDepositRootsView ¶ added in v0.12.1
func AsDepositRootsView(v View, err error) (*DepositRootsView, error)
func NewDepositRootsView ¶ added in v0.12.1
func NewDepositRootsView() *DepositRootsView
type Deposits ¶ added in v0.12.1
type Deposits []Deposit
func (Deposits) ByteLength ¶ added in v0.12.2
func (*Deposits) Deserialize ¶ added in v0.12.2
func (a *Deposits) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Deposits) FixedLength ¶ added in v0.12.2
func (Deposits) HashTreeRoot ¶ added in v0.12.2
type Epoch ¶ added in v0.12.1
type Epoch Uint64View
const GENESIS_EPOCH Epoch = 0
func (Epoch) ByteLength ¶ added in v0.12.2
func (*Epoch) Deserialize ¶ added in v0.12.2
func (a *Epoch) Deserialize(dr *codec.DecodingReader) error
func (Epoch) FixedLength ¶ added in v0.12.2
func (Epoch) MarshalJSON ¶ added in v0.12.5
func (*Epoch) UnmarshalJSON ¶ added in v0.12.5
type EpochProcess ¶ added in v0.12.1
type EpochProcess struct { PrevEpoch Epoch CurrEpoch Epoch Statuses []AttesterStatus TotalActiveStake Gwei PrevEpochUnslashedStake EpochStakeSummary CurrEpochUnslashedTargetStake Gwei // Thanks to exit delay, this does not change within the epoch processing. ActiveValidators uint64 IndicesToSlash []ValidatorIndex IndicesToSetActivationEligibility []ValidatorIndex // Ignores churn. Apply churn-limit manually. // Maybe, because finality affects it still. IndicesToMaybeActivate []ValidatorIndex IndicesToEject []ValidatorIndex ExitQueueEnd Epoch ExitQueueEndChurn uint64 ChurnLimit uint64 }
type EpochStakeSummary ¶ added in v0.12.1
type EpochsContext ¶ added in v0.12.1
type EpochsContext struct { Spec *Spec // PubkeyCache may be replaced when a new forked-out cache takes over to process an alternative Eth1 deposit chain. PubkeyCache *PubkeyCache // Proposers is a slice of SLOTS_PER_EPOCH proposer indices for the current epoch Proposers []ValidatorIndex PreviousEpoch *ShufflingEpoch CurrentEpoch *ShufflingEpoch NextEpoch *ShufflingEpoch }
func (*EpochsContext) Clone ¶ added in v0.12.1
func (epc *EpochsContext) Clone() *EpochsContext
func (*EpochsContext) GetBeaconCommittee ¶ added in v0.12.1
func (epc *EpochsContext) GetBeaconCommittee(slot Slot, index CommitteeIndex) ([]ValidatorIndex, error)
Return the beacon committee at slot for index.
func (*EpochsContext) GetBeaconProposer ¶ added in v0.12.1
func (epc *EpochsContext) GetBeaconProposer(slot Slot) (ValidatorIndex, error)
func (*EpochsContext) GetCommitteeCountAtSlot ¶ added in v0.12.1
func (epc *EpochsContext) GetCommitteeCountAtSlot(slot Slot) (uint64, error)
func (*EpochsContext) LoadProposers ¶ added in v0.12.1
func (epc *EpochsContext) LoadProposers(state *BeaconStateView) error
func (*EpochsContext) LoadShuffling ¶ added in v0.12.1
func (epc *EpochsContext) LoadShuffling(state *BeaconStateView) error
func (*EpochsContext) RotateEpochs ¶ added in v0.12.1
func (epc *EpochsContext) RotateEpochs(state *BeaconStateView) error
type Eth1Address ¶ added in v0.12.2
type Eth1Address [20]byte
func (Eth1Address) MarshalText ¶ added in v0.12.2
func (p Eth1Address) MarshalText() ([]byte, error)
func (Eth1Address) String ¶ added in v0.12.2
func (p Eth1Address) String() string
func (*Eth1Address) UnmarshalText ¶ added in v0.12.2
func (p *Eth1Address) UnmarshalText(text []byte) error
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 ¶ added in v0.12.2
func (*Eth1Data) Deserialize ¶ added in v0.12.2
func (b *Eth1Data) Deserialize(dr *codec.DecodingReader) error
func (*Eth1Data) FixedLength ¶ added in v0.12.2
func (*Eth1Data) HashTreeRoot ¶ added in v0.12.2
func (*Eth1Data) Serialize ¶ added in v0.12.2
func (a *Eth1Data) Serialize(w *codec.EncodingWriter) error
func (*Eth1Data) View ¶ added in v0.12.1
func (dat *Eth1Data) View() *Eth1DataView
type Eth1DataView ¶ added in v0.12.1
type Eth1DataView struct{ *ContainerView }
func AsEth1Data ¶ added in v0.12.1
func AsEth1Data(v View, err error) (*Eth1DataView, error)
func (*Eth1DataView) DepositCount ¶ added in v0.12.1
func (v *Eth1DataView) DepositCount() (DepositIndex, error)
func (*Eth1DataView) DepositIndex ¶ added in v0.12.1
func (v *Eth1DataView) DepositIndex() (DepositIndex, error)
func (*Eth1DataView) DepositRoot ¶ added in v0.12.1
func (v *Eth1DataView) DepositRoot() (Root, error)
func (*Eth1DataView) SetDepositRoot ¶ added in v0.12.1
func (v *Eth1DataView) SetDepositRoot(r Root) error
type Eth1DataVotes ¶ added in v0.12.1
type Eth1DataVotes []Eth1Data
func (Eth1DataVotes) ByteLength ¶ added in v0.12.2
func (a Eth1DataVotes) ByteLength(spec *Spec) (out uint64)
func (*Eth1DataVotes) Deserialize ¶ added in v0.12.2
func (a *Eth1DataVotes) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*Eth1DataVotes) FixedLength ¶ added in v0.12.2
func (a *Eth1DataVotes) FixedLength(spec *Spec) uint64
func (Eth1DataVotes) HashTreeRoot ¶ added in v0.12.2
func (li Eth1DataVotes) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (Eth1DataVotes) Serialize ¶ added in v0.12.2
func (a Eth1DataVotes) Serialize(spec *Spec, w *codec.EncodingWriter) error
type Eth1DataVotesView ¶ added in v0.12.1
type Eth1DataVotesView struct{ *ComplexListView }
func AsEth1DataVotes ¶ added in v0.12.1
func AsEth1DataVotes(v View, err error) (*Eth1DataVotesView, error)
type Eth2Data ¶ added in v0.12.2
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 ¶ added in v0.12.2
func (*Eth2Data) Deserialize ¶ added in v0.12.2
func (d *Eth2Data) Deserialize(dr *codec.DecodingReader) error
func (*Eth2Data) FixedLength ¶ added in v0.12.2
func (*Eth2Data) HashTreeRoot ¶ added in v0.12.2
type FlatValidator ¶ added in v0.12.1
type FlatValidator struct { EffectiveBalance Gwei Slashed bool ActivationEligibilityEpoch Epoch ActivationEpoch Epoch ExitEpoch Epoch WithdrawableEpoch Epoch }
func ToFlatValidator ¶ added in v0.12.1
func ToFlatValidator(v *ValidatorView) (*FlatValidator, error)
func (*FlatValidator) IsActive ¶ added in v0.12.1
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 ¶ added in v0.12.2
func (*Fork) Deserialize ¶ added in v0.12.2
func (b *Fork) Deserialize(dr *codec.DecodingReader) error
func (*Fork) FixedLength ¶ added in v0.12.2
type ForkData ¶ added in v0.12.1
type ForkData struct { CurrentVersion Version `json:"curent_version" yaml:"curent_version"` GenesisValidatorsRoot Root `json:"genesis_validators_root" yaml:"genesis_validators_root"` }
func (ForkData) ByteLength ¶ added in v0.12.2
func (*ForkData) Deserialize ¶ added in v0.12.2
func (v *ForkData) Deserialize(dr *codec.DecodingReader) error
func (*ForkData) FixedLength ¶ added in v0.12.2
func (*ForkData) HashTreeRoot ¶ added in v0.12.2
type ForkDigest ¶ added in v0.12.1
type ForkDigest [4]byte
A digest of the current fork data
func ComputeForkDigest ¶ added in v0.12.1
func ComputeForkDigest(currentVersion Version, genesisValidatorsRoot Root) ForkDigest
func (ForkDigest) ByteLength ¶ added in v0.12.2
func (p ForkDigest) ByteLength() uint64
func (*ForkDigest) Deserialize ¶ added in v0.12.2
func (p *ForkDigest) Deserialize(dr *codec.DecodingReader) error
func (ForkDigest) FixedLength ¶ added in v0.12.2
func (ForkDigest) FixedLength() uint64
func (ForkDigest) HashTreeRoot ¶ added in v0.12.2
func (p ForkDigest) HashTreeRoot(_ tree.HashFn) (out Root)
func (ForkDigest) MarshalText ¶ added in v0.12.2
func (p ForkDigest) MarshalText() ([]byte, error)
func (ForkDigest) Serialize ¶ added in v0.12.2
func (p ForkDigest) Serialize(w *codec.EncodingWriter) error
func (ForkDigest) String ¶ added in v0.12.2
func (p ForkDigest) String() string
func (*ForkDigest) UnmarshalText ¶ added in v0.12.2
func (p *ForkDigest) UnmarshalText(text []byte) error
type ForkView ¶ added in v0.12.1
type ForkView struct{ *ContainerView }
func (*ForkView) CurrentVersion ¶ added in v0.12.1
func (*ForkView) PreviousVersion ¶ added in v0.12.1
type Goodbye ¶ added in v0.12.2
type Goodbye Uint64View
func (Goodbye) ByteLength ¶ added in v0.12.2
func (*Goodbye) Deserialize ¶ added in v0.12.2
func (i *Goodbye) Deserialize(dr *codec.DecodingReader) error
func (Goodbye) FixedLength ¶ added in v0.12.2
func (Goodbye) MarshalJSON ¶ added in v0.12.5
func (Goodbye) Serialize ¶ added in v0.12.2
func (i Goodbye) Serialize(w *codec.EncodingWriter) error
func (*Goodbye) UnmarshalJSON ¶ added in v0.12.5
type Gwei ¶ added in v0.12.1
type Gwei Uint64View
func (Gwei) ByteLength ¶ added in v0.12.2
func (*Gwei) Deserialize ¶ added in v0.12.2
func (g *Gwei) Deserialize(dr *codec.DecodingReader) error
func (Gwei) FixedLength ¶ added in v0.12.2
func (Gwei) MarshalJSON ¶ added in v0.12.5
func (*Gwei) UnmarshalJSON ¶ added in v0.12.5
type GweiList ¶ added in v0.12.1
type GweiList []Gwei
func (GweiList) ByteLength ¶ added in v0.12.2
func (*GweiList) Deserialize ¶ added in v0.12.2
func (a *GweiList) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*GweiList) FixedLength ¶ added in v0.12.2
func (GweiList) HashTreeRoot ¶ added in v0.12.2
type HistoricalBatch ¶
type HistoricalBatch struct { BlockRoots HistoricalBatchRoots `json:"block_roots" yaml:"block_roots"` StateRoots HistoricalBatchRoots `json:"state_roots" yaml:"state_roots"` }
func (*HistoricalBatch) ByteLength ¶ added in v0.12.2
func (a *HistoricalBatch) ByteLength(spec *Spec) uint64
func (*HistoricalBatch) Deserialize ¶ added in v0.12.2
func (a *HistoricalBatch) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*HistoricalBatch) FixedLength ¶ added in v0.12.2
func (*HistoricalBatch) FixedLength(spec *Spec) uint64
func (*HistoricalBatch) HashTreeRoot ¶ added in v0.12.2
func (p *HistoricalBatch) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*HistoricalBatch) Serialize ¶ added in v0.12.2
func (a *HistoricalBatch) Serialize(spec *Spec, w *codec.EncodingWriter) error
type HistoricalBatchRoots ¶ added in v0.12.2
type HistoricalBatchRoots []Root
HistoricalBatchRoots stores roots: a batch of state or block roots. It represents a Vector[Root, SLOTS_PER_HISTORICAL_ROOT]
func (HistoricalBatchRoots) ByteLength ¶ added in v0.12.2
func (a HistoricalBatchRoots) ByteLength(spec *Spec) (out uint64)
func (*HistoricalBatchRoots) Deserialize ¶ added in v0.12.2
func (a *HistoricalBatchRoots) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*HistoricalBatchRoots) FixedLength ¶ added in v0.12.2
func (a *HistoricalBatchRoots) FixedLength(spec *Spec) uint64
func (HistoricalBatchRoots) HashTreeRoot ¶ added in v0.12.2
func (li HistoricalBatchRoots) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (HistoricalBatchRoots) Serialize ¶ added in v0.12.2
func (a HistoricalBatchRoots) Serialize(spec *Spec, w *codec.EncodingWriter) error
type HistoricalBatchView ¶ added in v0.12.1
type HistoricalBatchView struct{ *ContainerView }
func AsHistoricalBatch ¶ added in v0.12.1
func AsHistoricalBatch(v View, err error) (*HistoricalBatchView, error)
func (*HistoricalBatchView) BlockRoots ¶ added in v0.12.1
func (v *HistoricalBatchView) BlockRoots() (*BatchRootsView, error)
func (*HistoricalBatchView) StateRoots ¶ added in v0.12.1
func (v *HistoricalBatchView) StateRoots() (*BatchRootsView, error)
type HistoricalRoots ¶ added in v0.12.1
type HistoricalRoots []Root
roots of HistoricalBatch
func (HistoricalRoots) ByteLength ¶ added in v0.12.2
func (a HistoricalRoots) ByteLength(spec *Spec) (out uint64)
func (*HistoricalRoots) Deserialize ¶ added in v0.12.2
func (a *HistoricalRoots) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*HistoricalRoots) FixedLength ¶ added in v0.12.2
func (a *HistoricalRoots) FixedLength(spec *Spec) uint64
func (HistoricalRoots) HashTreeRoot ¶ added in v0.12.2
func (li HistoricalRoots) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (HistoricalRoots) Serialize ¶ added in v0.12.2
func (a HistoricalRoots) Serialize(spec *Spec, w *codec.EncodingWriter) error
type HistoricalRootsView ¶ added in v0.12.1
type HistoricalRootsView struct{ *ComplexListView }
roots of HistoricalBatch
func AsHistoricalRoots ¶ added in v0.12.1
func AsHistoricalRoots(v View, err error) (*HistoricalRootsView, error)
type IndexedAttestation ¶
type IndexedAttestation struct { AttestingIndices CommitteeIndices `json:"attesting_indices" yaml:"attesting_indices"` Data AttestationData `json:"data" yaml:"data"` Signature BLSSignature `json:"signature" yaml:"signature"` }
func (*IndexedAttestation) ByteLength ¶ added in v0.12.2
func (a *IndexedAttestation) ByteLength(spec *Spec) uint64
func (*IndexedAttestation) Deserialize ¶ added in v0.12.2
func (p *IndexedAttestation) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*IndexedAttestation) FixedLength ¶ added in v0.12.2
func (*IndexedAttestation) FixedLength(*Spec) uint64
func (*IndexedAttestation) HashTreeRoot ¶ added in v0.12.2
func (p *IndexedAttestation) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*IndexedAttestation) Serialize ¶ added in v0.12.2
func (a *IndexedAttestation) Serialize(spec *Spec, w *codec.EncodingWriter) error
type JustificationBits ¶ added in v0.12.1
type JustificationBits [1]byte
func (*JustificationBits) BitLen ¶ added in v0.12.1
func (jb *JustificationBits) BitLen() uint64
func (JustificationBits) ByteLength ¶ added in v0.12.2
func (jb JustificationBits) ByteLength() uint64
func (*JustificationBits) Deserialize ¶ added in v0.12.2
func (b *JustificationBits) Deserialize(dr *codec.DecodingReader) error
func (JustificationBits) FixedLength ¶ added in v0.12.2
func (jb JustificationBits) FixedLength() uint64
func (JustificationBits) HashTreeRoot ¶ added in v0.12.2
func (jb JustificationBits) HashTreeRoot(hFn tree.HashFn) Root
func (*JustificationBits) IsJustified ¶ added in v0.12.1
func (jb *JustificationBits) IsJustified(epochsAgo ...Epoch) bool
func (JustificationBits) MarshalText ¶ added in v0.12.5
func (jb JustificationBits) MarshalText() ([]byte, error)
func (*JustificationBits) NextEpoch ¶ added in v0.12.1
func (jb *JustificationBits) NextEpoch()
Prepare bitfield for next epoch by shifting previous bits (truncating to bitfield length)
func (JustificationBits) Serialize ¶ added in v0.12.2
func (a JustificationBits) Serialize(w *codec.EncodingWriter) error
func (*JustificationBits) String ¶ added in v0.13.2
func (jb *JustificationBits) String() string
func (*JustificationBits) UnmarshalText ¶ added in v0.12.5
func (jb *JustificationBits) UnmarshalText(text []byte) error
type JustificationBitsView ¶ added in v0.12.1
type JustificationBitsView struct {
*BitVectorView
}
func AsJustificationBits ¶ added in v0.12.1
func AsJustificationBits(v View, err error) (*JustificationBitsView, error)
func (*JustificationBitsView) Raw ¶ added in v0.12.1
func (v *JustificationBitsView) Raw() (JustificationBits, error)
func (*JustificationBitsView) Set ¶ added in v0.12.1
func (v *JustificationBitsView) Set(bits JustificationBits) error
type KickstartValidatorData ¶ added in v0.12.1
type MetaData ¶ added in v0.12.2
type MetaData struct { SeqNumber SeqNr `json:"seq_number" yaml:"seq_number"` Attnets AttnetBits `json:"attnets" yaml:"attnets"` }
func (MetaData) ByteLength ¶ added in v0.12.2
func (*MetaData) Deserialize ¶ added in v0.12.2
func (d *MetaData) Deserialize(dr *codec.DecodingReader) error
func (*MetaData) FixedLength ¶ added in v0.12.2
func (*MetaData) HashTreeRoot ¶ added in v0.12.2
type PendingAttestation ¶
type PendingAttestation struct { AggregationBits CommitteeBits `json:"aggregation_bits" yaml:"aggregation_bits"` Data AttestationData `json:"data" yaml:"data"` InclusionDelay Slot `json:"inclusion_delay" yaml:"inclusion_delay"` ProposerIndex ValidatorIndex `json:"proposer_index" yaml:"proposer_index"` }
func (*PendingAttestation) ByteLength ¶ added in v0.12.2
func (a *PendingAttestation) ByteLength(spec *Spec) uint64
func (*PendingAttestation) Deserialize ¶ added in v0.12.2
func (a *PendingAttestation) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*PendingAttestation) FixedLength ¶ added in v0.12.2
func (a *PendingAttestation) FixedLength(*Spec) uint64
func (*PendingAttestation) HashTreeRoot ¶ added in v0.12.2
func (a *PendingAttestation) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*PendingAttestation) Serialize ¶ added in v0.12.2
func (a *PendingAttestation) Serialize(spec *Spec, w *codec.EncodingWriter) error
func (*PendingAttestation) View ¶ added in v0.12.1
func (att *PendingAttestation) View(spec *Spec) *PendingAttestationView
type PendingAttestationView ¶ added in v0.12.1
type PendingAttestationView struct{ *ContainerView }
func AsPendingAttestation ¶ added in v0.12.1
func AsPendingAttestation(v View, err error) (*PendingAttestationView, error)
func (*PendingAttestationView) Raw ¶ added in v0.12.1
func (v *PendingAttestationView) Raw() (*PendingAttestation, error)
type PendingAttestations ¶ added in v0.12.1
type PendingAttestations []*PendingAttestation
func (PendingAttestations) ByteLength ¶ added in v0.12.2
func (p PendingAttestations) ByteLength(spec *Spec) (out uint64)
func (*PendingAttestations) Deserialize ¶ added in v0.12.2
func (a *PendingAttestations) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*PendingAttestations) FixedLength ¶ added in v0.12.2
func (a *PendingAttestations) FixedLength(*Spec) uint64
func (PendingAttestations) HashTreeRoot ¶ added in v0.12.2
func (li PendingAttestations) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (PendingAttestations) Serialize ¶ added in v0.12.2
func (a PendingAttestations) Serialize(spec *Spec, w *codec.EncodingWriter) error
type PendingAttestationsView ¶ added in v0.12.1
type PendingAttestationsView struct{ *ComplexListView }
func AsPendingAttestations ¶ added in v0.12.1
func AsPendingAttestations(v View, err error) (*PendingAttestationsView, error)
type Phase0Config ¶ added in v0.12.2
type Phase0Config struct { // Misc. MAX_COMMITTEES_PER_SLOT uint64 `yaml:"MAX_COMMITTEES_PER_SLOT" json:"MAX_COMMITTEES_PER_SLOT"` TARGET_COMMITTEE_SIZE uint64 `yaml:"TARGET_COMMITTEE_SIZE" json:"TARGET_COMMITTEE_SIZE"` MAX_VALIDATORS_PER_COMMITTEE uint64 `yaml:"MAX_VALIDATORS_PER_COMMITTEE" json:"MAX_VALIDATORS_PER_COMMITTEE"` MIN_PER_EPOCH_CHURN_LIMIT uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT" json:"MIN_PER_EPOCH_CHURN_LIMIT"` CHURN_LIMIT_QUOTIENT uint64 `yaml:"CHURN_LIMIT_QUOTIENT" json:"CHURN_LIMIT_QUOTIENT"` SHUFFLE_ROUND_COUNT uint8 `yaml:"SHUFFLE_ROUND_COUNT" json:"SHUFFLE_ROUND_COUNT"` // Genesis. MIN_GENESIS_ACTIVE_VALIDATOR_COUNT uint64 `yaml:"MIN_GENESIS_ACTIVE_VALIDATOR_COUNT" json:"MIN_GENESIS_ACTIVE_VALIDATOR_COUNT"` MIN_GENESIS_TIME Timestamp `yaml:"MIN_GENESIS_TIME" json:"MIN_GENESIS_TIME"` // Balance math HYSTERESIS_QUOTIENT uint64 `yaml:"HYSTERESIS_QUOTIENT" json:"HYSTERESIS_QUOTIENT"` HYSTERESIS_DOWNWARD_MULTIPLIER uint64 `yaml:"HYSTERESIS_DOWNWARD_MULTIPLIER" json:"HYSTERESIS_DOWNWARD_MULTIPLIER"` HYSTERESIS_UPWARD_MULTIPLIER uint64 `yaml:"HYSTERESIS_UPWARD_MULTIPLIER" json:"HYSTERESIS_UPWARD_MULTIPLIER"` // Fork Choice SAFE_SLOTS_TO_UPDATE_JUSTIFIED uint64 `yaml:"SAFE_SLOTS_TO_UPDATE_JUSTIFIED" json:"SAFE_SLOTS_TO_UPDATE_JUSTIFIED"` // Validator ETH1_FOLLOW_DISTANCE uint64 `yaml:"ETH1_FOLLOW_DISTANCE" json:"ETH1_FOLLOW_DISTANCE"` TARGET_AGGREGATORS_PER_COMMITTEE uint64 `yaml:"TARGET_AGGREGATORS_PER_COMMITTEE" json:"TARGET_AGGREGATORS_PER_COMMITTEE"` RANDOM_SUBNETS_PER_VALIDATOR uint64 `yaml:"RANDOM_SUBNETS_PER_VALIDATOR" json:"RANDOM_SUBNETS_PER_VALIDATOR"` EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION uint64 `yaml:"EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION" json:"EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION"` SECONDS_PER_ETH1_BLOCK uint64 `yaml:"SECONDS_PER_ETH1_BLOCK" json:"SECONDS_PER_ETH1_BLOCK"` // Deposit contract DEPOSIT_CHAIN_ID uint64 `yaml:"DEPOSIT_CHAIN_ID" json:"DEPOSIT_CHAIN_ID"` DEPOSIT_NETWORK_ID uint64 `yaml:"DEPOSIT_NETWORK_ID" json:"DEPOSIT_NETWORK_ID"` DEPOSIT_CONTRACT_ADDRESS Eth1Address `yaml:"DEPOSIT_CONTRACT_ADDRESS" json:"DEPOSIT_CONTRACT_ADDRESS"` // 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"` EJECTION_BALANCE Gwei `yaml:"EJECTION_BALANCE" json:"EJECTION_BALANCE"` EFFECTIVE_BALANCE_INCREMENT Gwei `yaml:"EFFECTIVE_BALANCE_INCREMENT" json:"EFFECTIVE_BALANCE_INCREMENT"` // Initial values GENESIS_FORK_VERSION Version `yaml:"GENESIS_FORK_VERSION" json:"GENESIS_FORK_VERSION"` BLS_WITHDRAWAL_PREFIX WithdrawalPrefix `yaml:"BLS_WITHDRAWAL_PREFIX" json:"BLS_WITHDRAWAL_PREFIX"` // Time parameters GENESIS_DELAY Timestamp `yaml:"GENESIS_DELAY" json:"GENESIS_DELAY"` SECONDS_PER_SLOT Timestamp `yaml:"SECONDS_PER_SLOT" json:"SECONDS_PER_SLOT"` 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_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"` 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 uint64 `yaml:"HISTORICAL_ROOTS_LIMIT" json:"HISTORICAL_ROOTS_LIMIT"` VALIDATOR_REGISTRY_LIMIT uint64 `yaml:"VALIDATOR_REGISTRY_LIMIT" json:"VALIDATOR_REGISTRY_LIMIT"` // Reward and penalty quotients BASE_REWARD_FACTOR uint64 `yaml:"BASE_REWARD_FACTOR" json:"BASE_REWARD_FACTOR"` WHISTLEBLOWER_REWARD_QUOTIENT uint64 `yaml:"WHISTLEBLOWER_REWARD_QUOTIENT" json:"WHISTLEBLOWER_REWARD_QUOTIENT"` PROPOSER_REWARD_QUOTIENT uint64 `yaml:"PROPOSER_REWARD_QUOTIENT" json:"PROPOSER_REWARD_QUOTIENT"` INACTIVITY_PENALTY_QUOTIENT uint64 `yaml:"INACTIVITY_PENALTY_QUOTIENT" json:"INACTIVITY_PENALTY_QUOTIENT"` MIN_SLASHING_PENALTY_QUOTIENT uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT" json:"MIN_SLASHING_PENALTY_QUOTIENT"` PROPORTIONAL_SLASHING_MULTIPLIER uint64 `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER" json:"PROPORTIONAL_SLASHING_MULTIPLIER"` // Max operations per block MAX_PROPOSER_SLASHINGS uint64 `yaml:"MAX_PROPOSER_SLASHINGS" json:"MAX_PROPOSER_SLASHINGS"` MAX_ATTESTER_SLASHINGS uint64 `yaml:"MAX_ATTESTER_SLASHINGS" json:"MAX_ATTESTER_SLASHINGS"` MAX_ATTESTATIONS uint64 `yaml:"MAX_ATTESTATIONS" json:"MAX_ATTESTATIONS"` MAX_DEPOSITS uint64 `yaml:"MAX_DEPOSITS" json:"MAX_DEPOSITS"` MAX_VOLUNTARY_EXITS uint64 `yaml:"MAX_VOLUNTARY_EXITS" json:"MAX_VOLUNTARY_EXITS"` // Signature domains DOMAIN_BEACON_PROPOSER BLSDomainType `yaml:"DOMAIN_BEACON_PROPOSER" json:"DOMAIN_BEACON_PROPOSER"` DOMAIN_BEACON_ATTESTER BLSDomainType `yaml:"DOMAIN_BEACON_ATTESTER" json:"DOMAIN_BEACON_ATTESTER"` DOMAIN_RANDAO BLSDomainType `yaml:"DOMAIN_RANDAO" json:"DOMAIN_RANDAO"` DOMAIN_DEPOSIT BLSDomainType `yaml:"DOMAIN_DEPOSIT" json:"DOMAIN_DEPOSIT"` DOMAIN_VOLUNTARY_EXIT BLSDomainType `yaml:"DOMAIN_VOLUNTARY_EXIT" json:"DOMAIN_VOLUNTARY_EXIT"` DOMAIN_SELECTION_PROOF BLSDomainType `yaml:"DOMAIN_SELECTION_PROOF" json:"DOMAIN_SELECTION_PROOF"` DOMAIN_AGGREGATE_AND_PROOF BLSDomainType `yaml:"DOMAIN_AGGREGATE_AND_PROOF" json:"DOMAIN_AGGREGATE_AND_PROOF"` }
func (*Phase0Config) Attestation ¶ added in v0.12.2
func (c *Phase0Config) Attestation() *ContainerTypeDef
func (*Phase0Config) AttesterSlashing ¶ added in v0.12.2
func (c *Phase0Config) AttesterSlashing() *ContainerTypeDef
func (*Phase0Config) BatchRoots ¶ added in v0.12.2
func (c *Phase0Config) BatchRoots() VectorTypeDef
func (*Phase0Config) BeaconBlock ¶ added in v0.12.2
func (c *Phase0Config) BeaconBlock() *ContainerTypeDef
func (*Phase0Config) BeaconBlockBody ¶ added in v0.12.2
func (c *Phase0Config) BeaconBlockBody() *ContainerTypeDef
func (*Phase0Config) BeaconState ¶ added in v0.12.2
func (c *Phase0Config) BeaconState() *ContainerTypeDef
func (*Phase0Config) BlockAttestations ¶ added in v0.12.2
func (c *Phase0Config) BlockAttestations() ListTypeDef
func (*Phase0Config) BlockAttesterSlashings ¶ added in v0.12.2
func (c *Phase0Config) BlockAttesterSlashings() ListTypeDef
func (*Phase0Config) BlockDeposits ¶ added in v0.12.2
func (c *Phase0Config) BlockDeposits() ListTypeDef
func (*Phase0Config) BlockProposerSlashings ¶ added in v0.12.2
func (c *Phase0Config) BlockProposerSlashings() ListTypeDef
func (*Phase0Config) BlockVoluntaryExits ¶ added in v0.12.2
func (c *Phase0Config) BlockVoluntaryExits() ListTypeDef
func (*Phase0Config) CheckPoint ¶ added in v0.12.2
func (c *Phase0Config) CheckPoint() *ContainerTypeDef
func (*Phase0Config) CommitteeBits ¶ added in v0.12.2
func (c *Phase0Config) CommitteeBits() *BitListTypeDef
func (*Phase0Config) CommitteeIndices ¶ added in v0.12.2
func (c *Phase0Config) CommitteeIndices() ListTypeDef
func (*Phase0Config) Eth1DataVotes ¶ added in v0.12.2
func (c *Phase0Config) Eth1DataVotes() ListTypeDef
func (*Phase0Config) HistoricalBatch ¶ added in v0.12.2
func (c *Phase0Config) HistoricalBatch() *ContainerTypeDef
func (*Phase0Config) HistoricalRoots ¶ added in v0.12.2
func (c *Phase0Config) HistoricalRoots() ListTypeDef
func (*Phase0Config) IndexedAttestation ¶ added in v0.12.2
func (c *Phase0Config) IndexedAttestation() *ContainerTypeDef
func (*Phase0Config) NewBeaconStateView ¶ added in v0.12.2
func (c *Phase0Config) NewBeaconStateView() *BeaconStateView
func (*Phase0Config) PendingAttestation ¶ added in v0.12.2
func (c *Phase0Config) PendingAttestation() *ContainerTypeDef
func (*Phase0Config) PendingAttestations ¶ added in v0.12.2
func (c *Phase0Config) PendingAttestations() ListTypeDef
func (*Phase0Config) RandaoMixes ¶ added in v0.12.2
func (c *Phase0Config) RandaoMixes() VectorTypeDef
func (*Phase0Config) RegistryBalances ¶ added in v0.12.2
func (c *Phase0Config) RegistryBalances() *BasicListTypeDef
func (*Phase0Config) ResetEth1Votes ¶ added in v0.12.2
func (c *Phase0Config) ResetEth1Votes(state *BeaconStateView) error
Done at the end of every voting period
func (*Phase0Config) SignedBeaconBlock ¶ added in v0.12.2
func (c *Phase0Config) SignedBeaconBlock() *ContainerTypeDef
func (*Phase0Config) Slashings ¶ added in v0.12.2
func (c *Phase0Config) Slashings() VectorTypeDef
Balances slashed at every withdrawal period
func (*Phase0Config) ValidatorsRegistry ¶ added in v0.12.2
func (c *Phase0Config) ValidatorsRegistry() ListTypeDef
func (*Phase0Config) View ¶ added in v0.12.2
func (c *Phase0Config) View(cb CommitteeBits) *CommitteeBitsView
type Phase1Config ¶ added in v0.12.2
type Phase1Config struct { // phase1-fork PHASE_1_FORK_VERSION Version `yaml:"PHASE_1_FORK_VERSION" json:"PHASE_1_FORK_VERSION"` PHASE_1_FORK_SLOT uint64 `yaml:"PHASE_1_FORK_SLOT" json:"PHASE_1_FORK_SLOT"` INITIAL_ACTIVE_SHARDS uint64 `yaml:"INITIAL_ACTIVE_SHARDS" json:"INITIAL_ACTIVE_SHARDS"` // beacon-chain MAX_SHARDS uint64 `yaml:"MAX_SHARDS" json:"MAX_SHARDS"` LIGHT_CLIENT_COMMITTEE_SIZE uint64 `yaml:"LIGHT_CLIENT_COMMITTEE_SIZE" json:"LIGHT_CLIENT_COMMITTEE_SIZE"` GASPRICE_ADJUSTMENT_COEFFICIENT uint64 `yaml:"GASPRICE_ADJUSTMENT_COEFFICIENT" json:"GASPRICE_ADJUSTMENT_COEFFICIENT"` // Shard block configs MAX_SHARD_BLOCK_SIZE uint64 `yaml:"MAX_SHARD_BLOCK_SIZE" json:"MAX_SHARD_BLOCK_SIZE"` TARGET_SHARD_BLOCK_SIZE uint64 `yaml:"TARGET_SHARD_BLOCK_SIZE" json:"TARGET_SHARD_BLOCK_SIZE"` SHARD_BLOCK_OFFSETS []uint64 `yaml:"SHARD_BLOCK_OFFSETS" json:"SHARD_BLOCK_OFFSETS"` MAX_SHARD_BLOCKS_PER_ATTESTATION uint64 `yaml:"MAX_SHARD_BLOCKS_PER_ATTESTATION" json:"MAX_SHARD_BLOCKS_PER_ATTESTATION"` BYTES_PER_CUSTODY_CHUNK uint64 `yaml:"BYTES_PER_CUSTODY_CHUNK" json:"BYTES_PER_CUSTODY_CHUNK"` CUSTODY_RESPONSE_DEPTH uint64 `yaml:"CUSTODY_RESPONSE_DEPTH" json:"CUSTODY_RESPONSE_DEPTH"` // Gwei values MAX_GASPRICE uint64 `yaml:"MAX_GASPRICE" json:"MAX_GASPRICE"` MIN_GASPRICE uint64 `yaml:"MIN_GASPRICE" json:"MIN_GASPRICE"` // Time parameters ONLINE_PERIOD uint64 `yaml:"ONLINE_PERIOD" json:"ONLINE_PERIOD"` LIGHT_CLIENT_COMMITTEE_PERIOD uint64 `yaml:"LIGHT_CLIENT_COMMITTEE_PERIOD" json:"LIGHT_CLIENT_COMMITTEE_PERIOD"` // Max operations per block MAX_CUSTODY_CHUNK_CHALLENGE_RECORDS uint64 `yaml:"MAX_CUSTODY_CHUNK_CHALLENGE_RECORDS" json:"MAX_CUSTODY_CHUNK_CHALLENGE_RECORDS"` // Domain types DOMAIN_SHARD_PROPOSAL BLSDomainType `yaml:"DOMAIN_SHARD_PROPOSAL" json:"DOMAIN_SHARD_PROPOSAL"` DOMAIN_SHARD_COMMITTEE BLSDomainType `yaml:"DOMAIN_SHARD_COMMITTEE" json:"DOMAIN_SHARD_COMMITTEE"` DOMAIN_LIGHT_CLIENT BLSDomainType `yaml:"DOMAIN_LIGHT_CLIENT" json:"DOMAIN_LIGHT_CLIENT"` // custody-game domains DOMAIN_CUSTODY_BIT_SLASHING BLSDomainType `yaml:"DOMAIN_CUSTODY_BIT_SLASHING" json:"DOMAIN_CUSTODY_BIT_SLASHING"` DOMAIN_LIGHT_SELECTION_PROOF BLSDomainType `yaml:"DOMAIN_LIGHT_SELECTION_PROOF" json:"DOMAIN_LIGHT_SELECTION_PROOF"` DOMAIN_LIGHT_AGGREGATE_AND_PROOF BLSDomainType `yaml:"DOMAIN_LIGHT_AGGREGATE_AND_PROOF" json:"DOMAIN_LIGHT_AGGREGATE_AND_PROOF"` // Custody game RANDAO_PENALTY_EPOCHS uint64 `yaml:"RANDAO_PENALTY_EPOCHS" json:"RANDAO_PENALTY_EPOCHS"` EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS uint64 `yaml:"EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS" json:"EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS"` EPOCHS_PER_CUSTODY_PERIOD uint64 `yaml:"EPOCHS_PER_CUSTODY_PERIOD" json:"EPOCHS_PER_CUSTODY_PERIOD"` CUSTODY_PERIOD_TO_RANDAO_PADDING uint64 `yaml:"CUSTODY_PERIOD_TO_RANDAO_PADDING" json:"CUSTODY_PERIOD_TO_RANDAO_PADDING"` MAX_CHUNK_CHALLENGE_DELAY uint64 `yaml:"MAX_CHUNK_CHALLENGE_DELAY" json:"MAX_CHUNK_CHALLENGE_DELAY"` CUSTODY_PRIME *big.Int `yaml:"CUSTODY_PRIME" json:"CUSTODY_PRIME"` CUSTODY_SECRETS uint64 `yaml:"CUSTODY_SECRETS" json:"CUSTODY_SECRETS"` BYTES_PER_CUSTODY_ATOM uint64 `yaml:"BYTES_PER_CUSTODY_ATOM" json:"BYTES_PER_CUSTODY_ATOM"` CUSTODY_PROBABILITY_EXPONENT uint64 `yaml:"CUSTODY_PROBABILITY_EXPONENT" json:"CUSTODY_PROBABILITY_EXPONENT"` // Max operations MAX_CUSTODY_KEY_REVEALS uint64 `yaml:"MAX_CUSTODY_KEY_REVEALS" json:"MAX_CUSTODY_KEY_REVEALS"` MAX_EARLY_DERIVED_SECRET_REVEALS uint64 `yaml:"MAX_EARLY_DERIVED_SECRET_REVEALS" json:"MAX_EARLY_DERIVED_SECRET_REVEALS"` MAX_CUSTODY_CHUNK_CHALLENGES uint64 `yaml:"MAX_CUSTODY_CHUNK_CHALLENGES" json:"MAX_CUSTODY_CHUNK_CHALLENGES"` MAX_CUSTODY_CHUNK_CHALLENGE_RESP uint64 `yaml:"MAX_CUSTODY_CHUNK_CHALLENGE_RESP" json:"MAX_CUSTODY_CHUNK_CHALLENGE_RESP"` MAX_CUSTODY_SLASHINGS uint64 `yaml:"MAX_CUSTODY_SLASHINGS" json:"MAX_CUSTODY_SLASHINGS"` // Reward and penalty quotients EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE uint64 `yaml:"EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE" json:"EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE"` MINOR_REWARD_QUOTIENT uint64 `yaml:"MINOR_REWARD_QUOTIENT" json:"MINOR_REWARD_QUOTIENT"` }
type Ping ¶ added in v0.12.2
type Ping SeqNr
func (Ping) ByteLength ¶ added in v0.12.2
func (*Ping) Deserialize ¶ added in v0.12.2
func (i *Ping) Deserialize(dr *codec.DecodingReader) error
func (Ping) FixedLength ¶ added in v0.12.2
func (Ping) MarshalJSON ¶ added in v0.12.5
func (*Ping) UnmarshalJSON ¶ added in v0.12.5
type Pong ¶ added in v0.12.2
type Pong SeqNr
func (Pong) ByteLength ¶ added in v0.12.2
func (*Pong) Deserialize ¶ added in v0.12.2
func (i *Pong) Deserialize(dr *codec.DecodingReader) error
func (Pong) FixedLength ¶ added in v0.12.2
func (Pong) MarshalJSON ¶ added in v0.12.5
func (*Pong) UnmarshalJSON ¶ added in v0.12.5
type ProposerSlashing ¶
type ProposerSlashing struct { SignedHeader1 SignedBeaconBlockHeader `json:"signed_header_1" yaml:"signed_header_1"` SignedHeader2 SignedBeaconBlockHeader `json:"signed_header_2" yaml:"signed_header_2"` }
func (*ProposerSlashing) ByteLength ¶ added in v0.12.2
func (a *ProposerSlashing) ByteLength() uint64
func (*ProposerSlashing) Deserialize ¶ added in v0.12.2
func (a *ProposerSlashing) Deserialize(dr *codec.DecodingReader) error
func (*ProposerSlashing) FixedLength ¶ added in v0.12.2
func (*ProposerSlashing) FixedLength() uint64
func (*ProposerSlashing) HashTreeRoot ¶ added in v0.12.2
func (p *ProposerSlashing) HashTreeRoot(hFn tree.HashFn) Root
func (*ProposerSlashing) Serialize ¶ added in v0.12.2
func (a *ProposerSlashing) Serialize(w *codec.EncodingWriter) error
type ProposerSlashings ¶ added in v0.12.1
type ProposerSlashings []ProposerSlashing
func (ProposerSlashings) ByteLength ¶ added in v0.12.2
func (a ProposerSlashings) ByteLength(spec *Spec) (out uint64)
func (*ProposerSlashings) Deserialize ¶ added in v0.12.2
func (a *ProposerSlashings) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*ProposerSlashings) FixedLength ¶ added in v0.12.2
func (*ProposerSlashings) FixedLength(*Spec) uint64
func (ProposerSlashings) HashTreeRoot ¶ added in v0.12.2
func (li ProposerSlashings) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (ProposerSlashings) Serialize ¶ added in v0.12.2
func (a ProposerSlashings) Serialize(spec *Spec, w *codec.EncodingWriter) error
type PubkeyCache ¶ added in v0.12.1
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 ¶ added in v0.12.1
func EmptyPubkeyCache() *PubkeyCache
func NewPubkeyCache ¶ added in v0.12.1
func NewPubkeyCache(state *BeaconStateView) (*PubkeyCache, error)
func (*PubkeyCache) AddValidator ¶ added in v0.12.1
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 common part is inherited, and a forked pubkey cache is returned.
func (*PubkeyCache) Pubkey ¶ added in v0.12.1
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 ¶ added in v0.12.1
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 ¶ added in v0.12.2
type RandaoMixes []Root
RandaoMixes is a EPOCHS_PER_HISTORICAL_VECTOR vector
func (RandaoMixes) ByteLength ¶ added in v0.12.2
func (a RandaoMixes) ByteLength(spec *Spec) (out uint64)
func (*RandaoMixes) Deserialize ¶ added in v0.12.2
func (a *RandaoMixes) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*RandaoMixes) FixedLength ¶ added in v0.12.2
func (a *RandaoMixes) FixedLength(spec *Spec) uint64
func (RandaoMixes) HashTreeRoot ¶ added in v0.12.2
func (li RandaoMixes) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (RandaoMixes) Serialize ¶ added in v0.12.2
func (a RandaoMixes) Serialize(spec *Spec, w *codec.EncodingWriter) error
type RandaoMixesView ¶ added in v0.12.1
type RandaoMixesView struct{ *ComplexVectorView }
Randomness and committees
func AsRandaoMixes ¶ added in v0.12.1
func AsRandaoMixes(v View, err error) (*RandaoMixesView, error)
func (*RandaoMixesView) GetRandomMix ¶ added in v0.12.1
func (mixes *RandaoMixesView) GetRandomMix(epoch Epoch) (Root, error)
Provides a source of randomness for the state, for e.g. shuffling
func (*RandaoMixesView) PrepareRandao ¶ added in v0.12.1
func (mixes *RandaoMixesView) PrepareRandao(epoch Epoch) error
Prepare the randao mix for the given epoch by copying over the mix from the previous epoch.
func (*RandaoMixesView) SetRandomMix ¶ added in v0.12.1
func (mixes *RandaoMixesView) SetRandomMix(epoch Epoch, mix Root) error
type RegistryBalancesView ¶ added in v0.12.1
type RegistryBalancesView struct {
*BasicListView
}
func AsRegistryBalances ¶ added in v0.12.1
func AsRegistryBalances(v View, err error) (*RegistryBalancesView, error)
func (*RegistryBalancesView) DecreaseBalance ¶ added in v0.12.1
func (v *RegistryBalancesView) DecreaseBalance(index ValidatorIndex, delta Gwei) error
func (*RegistryBalancesView) GetBalance ¶ added in v0.12.1
func (v *RegistryBalancesView) GetBalance(index ValidatorIndex) (Gwei, error)
func (*RegistryBalancesView) IncreaseBalance ¶ added in v0.12.1
func (v *RegistryBalancesView) IncreaseBalance(index ValidatorIndex, delta Gwei) error
func (*RegistryBalancesView) SetBalance ¶ added in v0.12.1
func (v *RegistryBalancesView) SetBalance(index ValidatorIndex, bal Gwei) error
type RegistryIndices ¶ added in v0.12.1
type RegistryIndices []ValidatorIndex
func (RegistryIndices) ByteLength ¶ added in v0.12.2
func (a RegistryIndices) ByteLength(spec *Spec) uint64
func (*RegistryIndices) Deserialize ¶ added in v0.12.2
func (p *RegistryIndices) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*RegistryIndices) FixedLength ¶ added in v0.12.2
func (*RegistryIndices) FixedLength() uint64
func (RegistryIndices) HashTreeRoot ¶ added in v0.12.1
func (p RegistryIndices) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (RegistryIndices) Serialize ¶ added in v0.12.2
func (a RegistryIndices) Serialize(spec *Spec, w *codec.EncodingWriter) error
type RewardsAndPenalties ¶ added in v0.12.1
type RewardsAndPenalties struct { Source *Deltas Target *Deltas Head *Deltas InclusionDelay *Deltas Inactivity *Deltas }
func NewRewardsAndPenalties ¶ added in v0.12.1
func NewRewardsAndPenalties(validatorCount uint64) *RewardsAndPenalties
type Root ¶ added in v0.12.1
func ComputeForkDataRoot ¶ added in v0.12.1
func ComputeSigningRoot ¶ added in v0.12.1
type SSZObj ¶ added in v0.12.2
type SSZObj interface { codec.Serializable codec.Deserializable codec.FixedLength tree.HTR }
type SeqNr ¶ added in v0.12.2
type SeqNr Uint64View
func (SeqNr) ByteLength ¶ added in v0.12.2
func (*SeqNr) Deserialize ¶ added in v0.12.2
func (i *SeqNr) Deserialize(dr *codec.DecodingReader) error
func (SeqNr) FixedLength ¶ added in v0.12.2
func (SeqNr) MarshalJSON ¶ added in v0.12.5
func (*SeqNr) UnmarshalJSON ¶ added in v0.12.5
type Shard ¶ added in v0.12.1
type Shard Uint64View
func (Shard) ByteLength ¶ added in v0.12.2
func (*Shard) Deserialize ¶ added in v0.12.2
func (a *Shard) Deserialize(dr *codec.DecodingReader) error
func (Shard) FixedLength ¶ added in v0.12.2
func (Shard) MarshalJSON ¶ added in v0.12.5
func (*Shard) UnmarshalJSON ¶ added in v0.12.5
type ShufflingEpoch ¶ added in v0.12.1
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.
type SignedAggregateAndProof ¶ added in v0.13.1
type SignedAggregateAndProof struct { Message AggregateAndProof `json:"message"` Signature BLSSignature `json:"signature"` }
func (*SignedAggregateAndProof) ByteLength ¶ added in v0.13.1
func (a *SignedAggregateAndProof) ByteLength(spec *Spec) uint64
func (*SignedAggregateAndProof) Deserialize ¶ added in v0.13.1
func (a *SignedAggregateAndProof) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*SignedAggregateAndProof) FixedLength ¶ added in v0.13.1
func (a *SignedAggregateAndProof) FixedLength(*Spec) uint64
func (*SignedAggregateAndProof) HashTreeRoot ¶ added in v0.13.1
func (a *SignedAggregateAndProof) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*SignedAggregateAndProof) Serialize ¶ added in v0.13.1
func (a *SignedAggregateAndProof) Serialize(spec *Spec, w *codec.EncodingWriter) error
type SignedBeaconBlock ¶ added in v0.12.1
type SignedBeaconBlock struct { Message BeaconBlock `json:"message" yaml:"message"` Signature BLSSignature `json:"signature" yaml:"signature"` }
func (*SignedBeaconBlock) ByteLength ¶ added in v0.12.2
func (b *SignedBeaconBlock) ByteLength(spec *Spec) uint64
func (*SignedBeaconBlock) Deserialize ¶ added in v0.12.2
func (b *SignedBeaconBlock) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*SignedBeaconBlock) FixedLength ¶ added in v0.12.2
func (a *SignedBeaconBlock) FixedLength(*Spec) uint64
func (*SignedBeaconBlock) HashTreeRoot ¶ added in v0.12.2
func (b *SignedBeaconBlock) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (*SignedBeaconBlock) Serialize ¶ added in v0.12.2
func (b *SignedBeaconBlock) Serialize(spec *Spec, w *codec.EncodingWriter) error
func (*SignedBeaconBlock) SignedHeader ¶ added in v0.12.1
func (block *SignedBeaconBlock) SignedHeader(spec *Spec) *SignedBeaconBlockHeader
type SignedBeaconBlockHeader ¶ added in v0.12.1
type SignedBeaconBlockHeader struct { Message BeaconBlockHeader `json:"message" yaml:"message"` Signature BLSSignature `json:"signature" yaml:"signature"` }
func (*SignedBeaconBlockHeader) ByteLength ¶ added in v0.12.2
func (s *SignedBeaconBlockHeader) ByteLength() uint64
func (*SignedBeaconBlockHeader) Deserialize ¶ added in v0.12.2
func (s *SignedBeaconBlockHeader) Deserialize(dr *codec.DecodingReader) error
func (*SignedBeaconBlockHeader) FixedLength ¶ added in v0.12.2
func (b *SignedBeaconBlockHeader) FixedLength() uint64
func (*SignedBeaconBlockHeader) HashTreeRoot ¶ added in v0.12.1
func (s *SignedBeaconBlockHeader) HashTreeRoot(hFn tree.HashFn) Root
func (*SignedBeaconBlockHeader) Serialize ¶ added in v0.12.2
func (s *SignedBeaconBlockHeader) Serialize(w *codec.EncodingWriter) error
type SignedVoluntaryExit ¶ added in v0.12.1
type SignedVoluntaryExit struct { Message VoluntaryExit `json:"message" yaml:"message"` Signature BLSSignature `json:"signature" yaml:"signature"` }
func (*SignedVoluntaryExit) ByteLength ¶ added in v0.12.2
func (v *SignedVoluntaryExit) ByteLength() uint64
func (*SignedVoluntaryExit) Deserialize ¶ added in v0.12.2
func (v *SignedVoluntaryExit) Deserialize(dr *codec.DecodingReader) error
func (*SignedVoluntaryExit) FixedLength ¶ added in v0.12.2
func (*SignedVoluntaryExit) FixedLength() uint64
func (*SignedVoluntaryExit) HashTreeRoot ¶ added in v0.12.2
func (v *SignedVoluntaryExit) HashTreeRoot(hFn tree.HashFn) Root
func (*SignedVoluntaryExit) Serialize ¶ added in v0.12.2
func (v *SignedVoluntaryExit) Serialize(w *codec.EncodingWriter) error
type SigningData ¶ added in v0.12.1
func (*SigningData) HashTreeRoot ¶ added in v0.12.2
func (d *SigningData) HashTreeRoot(hFn tree.HashFn) Root
type SlashingsHistory ¶ added in v0.12.2
type SlashingsHistory []Gwei
SlashingsHistory is a EPOCHS_PER_SLASHINGS_VECTOR vector
func (SlashingsHistory) ByteLength ¶ added in v0.12.2
func (a SlashingsHistory) ByteLength(spec *Spec) (out uint64)
func (*SlashingsHistory) Deserialize ¶ added in v0.12.2
func (a *SlashingsHistory) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*SlashingsHistory) FixedLength ¶ added in v0.12.2
func (a *SlashingsHistory) FixedLength(spec *Spec) uint64
func (SlashingsHistory) HashTreeRoot ¶ added in v0.12.2
func (li SlashingsHistory) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (SlashingsHistory) Serialize ¶ added in v0.12.2
func (a SlashingsHistory) Serialize(spec *Spec, w *codec.EncodingWriter) error
type SlashingsView ¶ added in v0.12.1
type SlashingsView struct{ *BasicVectorView }
func AsSlashings ¶ added in v0.12.1
func AsSlashings(v View, err error) (*SlashingsView, error)
func (*SlashingsView) AddSlashing ¶ added in v0.12.1
func (sl *SlashingsView) AddSlashing(epoch Epoch, add Gwei) error
func (*SlashingsView) GetSlashingsValue ¶ added in v0.12.1
func (sl *SlashingsView) GetSlashingsValue(epoch Epoch) (Gwei, error)
func (*SlashingsView) ResetSlashings ¶ added in v0.12.1
func (sl *SlashingsView) ResetSlashings(epoch Epoch) error
func (*SlashingsView) Total ¶ added in v0.12.1
func (sl *SlashingsView) Total() (sum Gwei, err error)
type Slot ¶ added in v0.12.1
type Slot Uint64View
const GENESIS_SLOT Slot = 0
func (Slot) ByteLength ¶ added in v0.12.2
func (*Slot) Deserialize ¶ added in v0.12.2
func (a *Slot) Deserialize(dr *codec.DecodingReader) error
func (Slot) FixedLength ¶ added in v0.12.2
func (Slot) MarshalJSON ¶ added in v0.12.5
func (*Slot) UnmarshalJSON ¶ added in v0.12.5
type Spec ¶ added in v0.12.2
type Spec struct { CONFIG_NAME string `yaml:"CONFIG_NAME,omitempty"` Phase0Config `yaml:",inline"` Phase1Config `yaml:",inline"` }
func (*Spec) AttestationRewardsAndPenalties ¶ added in v0.12.2
func (spec *Spec) AttestationRewardsAndPenalties(ctx context.Context, epc *EpochsContext, process *EpochProcess, state *BeaconStateView) (*RewardsAndPenalties, error)
func (*Spec) CommitteeCount ¶ added in v0.12.2
func (*Spec) ComputeActivationExitEpoch ¶ added in v0.12.2
Return the epoch at which an activation or exit triggered in epoch takes effect.
func (*Spec) EpochStartSlot ¶ added in v0.12.2
func (*Spec) GenesisFromEth1 ¶ added in v0.12.2
func (spec *Spec) GenesisFromEth1(eth1BlockHash Root, time Timestamp, deps []Deposit, ignoreSignaturesAndProofs bool) (*BeaconStateView, *EpochsContext, error)
func (*Spec) GetBlockRoot ¶ added in v0.12.2
func (spec *Spec) GetBlockRoot(state *BeaconStateView, epoch Epoch) (Root, error)
Return the block root at a recent epoch. Only valid to SLOTS_PER_HISTORICAL_ROOT slots ago.
func (*Spec) GetBlockRootAtSlot ¶ added in v0.12.2
func (spec *Spec) GetBlockRootAtSlot(state *BeaconStateView, slot Slot) (Root, error)
Return the block root at a recent slot. Only valid to SLOTS_PER_HISTORICAL_ROOT slots ago.
func (*Spec) GetChurnLimit ¶ added in v0.12.2
func (*Spec) GetSeed ¶ added in v0.12.2
func (spec *Spec) GetSeed(mixes *RandaoMixesView, epoch Epoch, domainType BLSDomainType) (Root, error)
func (*Spec) InitiateValidatorExit ¶ added in v0.12.2
func (spec *Spec) InitiateValidatorExit(epc *EpochsContext, state *BeaconStateView, index ValidatorIndex) error
Initiate the exit of the validator of the given index
func (*Spec) IsActive ¶ added in v0.12.2
func (spec *Spec) IsActive(v *ValidatorView, epoch Epoch) (bool, error)
func (*Spec) IsEligibleForActivation ¶ added in v0.12.2
func (spec *Spec) IsEligibleForActivation(v *ValidatorView, finalizedEpoch Epoch) (bool, error)
func (*Spec) IsEligibleForActivationQueue ¶ added in v0.12.2
func (spec *Spec) IsEligibleForActivationQueue(v *ValidatorView) (bool, error)
func (*Spec) IsSlashable ¶ added in v0.12.2
func (spec *Spec) IsSlashable(v *ValidatorView, epoch Epoch) (bool, error)
func (*Spec) IsValidGenesisState ¶ added in v0.12.2
func (spec *Spec) IsValidGenesisState(state *BeaconStateView) (bool, error)
func (*Spec) KickStartState ¶ added in v0.12.2
func (spec *Spec) KickStartState(eth1BlockHash Root, time Timestamp, validators []KickstartValidatorData) (*BeaconStateView, *EpochsContext, error)
To build a genesis state without Eth 1.0 deposits, i.e. directly from a sequence of minimal validator data.
func (*Spec) KickStartStateWithSignatures ¶ added in v0.12.2
func (spec *Spec) KickStartStateWithSignatures(eth1BlockHash Root, time Timestamp, validators []KickstartValidatorData, keys [][32]byte) (*BeaconStateView, *EpochsContext, error)
To build a genesis state without Eth 1.0 deposits, i.e. directly from a sequence of minimal validator data.
func (*Spec) NewEpochsContext ¶ added in v0.12.2
func (spec *Spec) NewEpochsContext(state *BeaconStateView) (*EpochsContext, error)
NewEpochsContext constructs a new context for the processing of the current epoch.
func (*Spec) NewShufflingEpoch ¶ added in v0.12.2
func (spec *Spec) NewShufflingEpoch(indicesBounded []BoundedIndex, seed Root, epoch Epoch) *ShufflingEpoch
func (*Spec) PrepareEpochProcess ¶ added in v0.12.2
func (spec *Spec) PrepareEpochProcess(ctx context.Context, epc *EpochsContext, state *BeaconStateView) (out *EpochProcess, err error)
func (*Spec) ProcessAttestation ¶ added in v0.12.2
func (spec *Spec) ProcessAttestation(epc *EpochsContext, state *BeaconStateView, attestation *Attestation) error
func (*Spec) ProcessAttestations ¶ added in v0.12.2
func (spec *Spec) ProcessAttestations(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ops []Attestation) error
func (*Spec) ProcessAttesterSlashing ¶ added in v0.12.2
func (spec *Spec) ProcessAttesterSlashing(epc *EpochsContext, state *BeaconStateView, attesterSlashing *AttesterSlashing) error
func (*Spec) ProcessAttesterSlashings ¶ added in v0.12.2
func (spec *Spec) ProcessAttesterSlashings(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ops []AttesterSlashing) error
func (*Spec) ProcessBlock ¶ added in v0.12.2
func (spec *Spec) ProcessBlock(ctx context.Context, epc *EpochsContext, state *BeaconStateView, block *BeaconBlock) error
func (*Spec) ProcessDeposit ¶ added in v0.12.2
func (spec *Spec) ProcessDeposit(epc *EpochsContext, state *BeaconStateView, dep *Deposit, ignoreSignatureAndProof bool) error
Process an Eth1 deposit, registering a validator or increasing its balance.
func (*Spec) ProcessDeposits ¶ added in v0.12.2
func (spec *Spec) ProcessDeposits(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ops []Deposit) error
Verify that outstanding deposits are processed up to the maximum number of deposits, then process all in order.
func (*Spec) ProcessEpoch ¶ added in v0.12.2
func (spec *Spec) ProcessEpoch(ctx context.Context, epc *EpochsContext, state *BeaconStateView) error
func (*Spec) ProcessEpochFinalUpdates ¶ added in v0.12.2
func (spec *Spec) ProcessEpochFinalUpdates(ctx context.Context, epc *EpochsContext, process *EpochProcess, state *BeaconStateView) error
func (*Spec) ProcessEpochJustification ¶ added in v0.12.2
func (spec *Spec) ProcessEpochJustification(ctx context.Context, epc *EpochsContext, process *EpochProcess, state *BeaconStateView) error
func (*Spec) ProcessEpochRegistryUpdates ¶ added in v0.12.2
func (spec *Spec) ProcessEpochRegistryUpdates(ctx context.Context, epc *EpochsContext, process *EpochProcess, state *BeaconStateView) error
func (*Spec) ProcessEpochRewardsAndPenalties ¶ added in v0.12.2
func (spec *Spec) ProcessEpochRewardsAndPenalties(ctx context.Context, epc *EpochsContext, process *EpochProcess, state *BeaconStateView) error
func (*Spec) ProcessEpochSlashings ¶ added in v0.12.2
func (spec *Spec) ProcessEpochSlashings(ctx context.Context, epc *EpochsContext, process *EpochProcess, state *BeaconStateView) error
func (*Spec) ProcessEth1Vote ¶ added in v0.12.2
func (spec *Spec) ProcessEth1Vote(ctx context.Context, epc *EpochsContext, state *BeaconStateView, data Eth1Data) error
func (*Spec) ProcessHeader ¶ added in v0.12.2
func (spec *Spec) ProcessHeader(ctx context.Context, epc *EpochsContext, state *BeaconStateView, header *BeaconBlock) error
func (*Spec) ProcessProposerSlashing ¶ added in v0.12.2
func (spec *Spec) ProcessProposerSlashing(epc *EpochsContext, state *BeaconStateView, ps *ProposerSlashing) error
func (*Spec) ProcessProposerSlashings ¶ added in v0.12.2
func (spec *Spec) ProcessProposerSlashings(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ops []ProposerSlashing) error
func (*Spec) ProcessRandaoReveal ¶ added in v0.12.2
func (spec *Spec) ProcessRandaoReveal(ctx context.Context, epc *EpochsContext, state *BeaconStateView, reveal BLSSignature) error
func (*Spec) ProcessSlot ¶ added in v0.12.2
func (spec *Spec) ProcessSlot(ctx context.Context, state *BeaconStateView) error
func (*Spec) ProcessSlots ¶ added in v0.12.2
func (spec *Spec) ProcessSlots(ctx context.Context, epc *EpochsContext, state *BeaconStateView, 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 (*Spec) ProcessVoluntaryExit ¶ added in v0.12.2
func (spec *Spec) ProcessVoluntaryExit(epc *EpochsContext, state *BeaconStateView, signedExit *SignedVoluntaryExit) error
func (*Spec) ProcessVoluntaryExits ¶ added in v0.12.2
func (spec *Spec) ProcessVoluntaryExits(ctx context.Context, epc *EpochsContext, state *BeaconStateView, ops []SignedVoluntaryExit) error
func (*Spec) SeedRandao ¶ added in v0.12.2
func (spec *Spec) SeedRandao(seed Root) (*RandaoMixesView, error)
func (*Spec) ShufflingEpoch ¶ added in v0.12.2
func (spec *Spec) ShufflingEpoch(state *BeaconStateView, indicesBounded []BoundedIndex, epoch Epoch) (*ShufflingEpoch, error)
func (*Spec) SlashValidator ¶ added in v0.12.2
func (spec *Spec) SlashValidator(epc *EpochsContext, state *BeaconStateView, slashedIndex ValidatorIndex, whistleblowerIndex *ValidatorIndex) error
Slash the validator with the given index.
func (*Spec) SlotToEpoch ¶ added in v0.12.2
func (*Spec) StateTransition ¶ added in v0.12.2
func (spec *Spec) StateTransition(ctx context.Context, epc *EpochsContext, state *BeaconStateView, block *SignedBeaconBlock, validateResult bool) error
Transition the state to the slot of the given block, then processes the block. Returns an error if the slot is older than the state is already at. Mutates the state, does not copy.
func (*Spec) TimeToSlot ¶ added in v0.12.2
func (*Spec) ValidateIndexedAttestation ¶ added in v0.12.2
func (spec *Spec) ValidateIndexedAttestation(epc *EpochsContext, state *BeaconStateView, indexedAttestation *IndexedAttestation) error
Verify validity of slashable_attestation fields.
func (*Spec) VerifyBlockSignature ¶ added in v0.12.2
func (spec *Spec) VerifyBlockSignature(epc *EpochsContext, state *BeaconStateView, block *SignedBeaconBlock, validateProposerIndex bool) bool
Assuming the slot is valid, and optionally assume the proposer index is valid, check if the signature is valid
type Status ¶ added in v0.12.2
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 ¶ added in v0.12.2
func (*Status) Deserialize ¶ added in v0.12.2
func (d *Status) Deserialize(dr *codec.DecodingReader) error
func (*Status) FixedLength ¶ added in v0.12.2
type Timestamp ¶ added in v0.12.1
type Timestamp Uint64View
Unix timestamp
func AsTimestamp ¶ added in v0.12.1
func (Timestamp) ByteLength ¶ added in v0.12.2
func (*Timestamp) Deserialize ¶ added in v0.12.2
func (a *Timestamp) Deserialize(dr *codec.DecodingReader) error
func (Timestamp) FixedLength ¶ added in v0.12.2
func (Timestamp) HashTreeRoot ¶ added in v0.12.2
func (Timestamp) MarshalJSON ¶ added in v0.12.5
func (Timestamp) Serialize ¶ added in v0.12.2
func (i Timestamp) Serialize(w *codec.EncodingWriter) error
func (*Timestamp) UnmarshalJSON ¶ added in v0.12.5
type Validator ¶
type Validator struct { Pubkey BLSPubkey `json:"pubkey" yaml:"pubkey"` WithdrawalCredentials Root `json:"withdrawal_credentials" yaml:"withdrawal_credentials"` EffectiveBalance Gwei `json:"effective_balance" yaml:"effective_balance"` Slashed bool `json:"slashed" yaml:"slashed"` ActivationEligibilityEpoch Epoch `json:"activation_eligibility_epoch" yaml:"activation_eligibility_epoch"` ActivationEpoch Epoch `json:"activation_epoch" yaml:"activation_epoch"` ExitEpoch Epoch `json:"exit_epoch" yaml:"exit_epoch"` WithdrawableEpoch Epoch `json:"withdrawable_epoch" yaml:"withdrawable_epoch"` }
func (*Validator) ByteLength ¶ added in v0.12.2
func (*Validator) Deserialize ¶ added in v0.12.2
func (v *Validator) Deserialize(dr *codec.DecodingReader) error
func (*Validator) FixedLength ¶ added in v0.12.2
func (*Validator) HashTreeRoot ¶ added in v0.12.2
func (*Validator) Serialize ¶ added in v0.12.2
func (v *Validator) Serialize(w *codec.EncodingWriter) error
func (*Validator) View ¶ added in v0.12.1
func (v *Validator) View() *ValidatorView
type ValidatorIndex ¶ added in v0.12.1
type ValidatorIndex Uint64View
Index of a validator, pointing to a validator registry location
func AsValidatorIndex ¶ added in v0.12.1
func AsValidatorIndex(v View, err error) (ValidatorIndex, error)
func PermuteIndex ¶ added in v0.12.1
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 ¶ added in v0.12.1
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 ¶ added in v0.12.2
func (ValidatorIndex) ByteLength() uint64
func (*ValidatorIndex) Deserialize ¶ added in v0.12.2
func (i *ValidatorIndex) Deserialize(dr *codec.DecodingReader) error
func (ValidatorIndex) FixedLength ¶ added in v0.12.2
func (ValidatorIndex) FixedLength() uint64
func (ValidatorIndex) HashTreeRoot ¶ added in v0.12.2
func (i ValidatorIndex) HashTreeRoot(hFn tree.HashFn) Root
func (ValidatorIndex) MarshalJSON ¶ added in v0.12.5
func (e ValidatorIndex) MarshalJSON() ([]byte, error)
func (ValidatorIndex) Serialize ¶ added in v0.12.2
func (i ValidatorIndex) Serialize(w *codec.EncodingWriter) error
func (ValidatorIndex) String ¶ added in v0.13.2
func (e ValidatorIndex) String() string
func (*ValidatorIndex) UnmarshalJSON ¶ added in v0.12.5
func (e *ValidatorIndex) UnmarshalJSON(b []byte) error
type ValidatorRegistry ¶
type ValidatorRegistry []*Validator
func (ValidatorRegistry) ByteLength ¶ added in v0.12.2
func (a ValidatorRegistry) ByteLength(spec *Spec) (out uint64)
func (*ValidatorRegistry) Deserialize ¶ added in v0.12.2
func (a *ValidatorRegistry) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*ValidatorRegistry) FixedLength ¶ added in v0.12.2
func (a *ValidatorRegistry) FixedLength(spec *Spec) uint64
func (ValidatorRegistry) HashTreeRoot ¶ added in v0.12.2
func (li ValidatorRegistry) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (ValidatorRegistry) Serialize ¶ added in v0.12.2
func (a ValidatorRegistry) Serialize(spec *Spec, w *codec.EncodingWriter) error
type ValidatorSet ¶ added in v0.12.1
type ValidatorSet []ValidatorIndex
Collection of validators, should always be sorted.
func (*ValidatorSet) Dedup ¶ added in v0.12.1
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) Intersects ¶ added in v0.12.1
func (vs ValidatorSet) Intersects(target ValidatorSet) bool
Joins two validator sets: check if there is any overlap
func (ValidatorSet) Len ¶ added in v0.12.1
func (vs ValidatorSet) Len() int
func (ValidatorSet) MergeDisjoint ¶ added in v0.12.1
func (vs ValidatorSet) MergeDisjoint(other ValidatorSet) ValidatorSet
merges with other disjoint set, producing a new set.
func (ValidatorSet) Swap ¶ added in v0.12.1
func (vs ValidatorSet) Swap(i int, j int)
func (ValidatorSet) ZigZagJoin ¶ added in v0.12.1
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 ValidatorView ¶ added in v0.12.1
type ValidatorView struct {
*ContainerView
}
func AsValidator ¶ added in v0.12.1
func AsValidator(v View, err error) (*ValidatorView, error)
func NewValidatorView ¶ added in v0.12.1
func NewValidatorView() *ValidatorView
func (*ValidatorView) ActivationEligibilityEpoch ¶ added in v0.12.1
func (v *ValidatorView) ActivationEligibilityEpoch() (Epoch, error)
func (*ValidatorView) ActivationEpoch ¶ added in v0.12.1
func (v *ValidatorView) ActivationEpoch() (Epoch, error)
func (*ValidatorView) EffectiveBalance ¶ added in v0.12.1
func (v *ValidatorView) EffectiveBalance() (Gwei, error)
func (*ValidatorView) ExitEpoch ¶ added in v0.12.1
func (v *ValidatorView) ExitEpoch() (Epoch, error)
func (*ValidatorView) MakeSlashed ¶ added in v0.12.1
func (v *ValidatorView) MakeSlashed() error
func (*ValidatorView) Pubkey ¶ added in v0.12.1
func (v *ValidatorView) Pubkey() (BLSPubkey, error)
func (*ValidatorView) SetActivationEligibilityEpoch ¶ added in v0.12.1
func (v *ValidatorView) SetActivationEligibilityEpoch(epoch Epoch) error
func (*ValidatorView) SetActivationEpoch ¶ added in v0.12.1
func (v *ValidatorView) SetActivationEpoch(epoch Epoch) error
func (*ValidatorView) SetEffectiveBalance ¶ added in v0.12.1
func (v *ValidatorView) SetEffectiveBalance(b Gwei) error
func (*ValidatorView) SetExitEpoch ¶ added in v0.12.1
func (v *ValidatorView) SetExitEpoch(ep Epoch) error
func (*ValidatorView) SetWithdrawableEpoch ¶ added in v0.12.1
func (v *ValidatorView) SetWithdrawableEpoch(epoch Epoch) error
func (*ValidatorView) Slashed ¶ added in v0.12.1
func (v *ValidatorView) Slashed() (BoolView, error)
func (*ValidatorView) WithdrawableEpoch ¶ added in v0.12.1
func (v *ValidatorView) WithdrawableEpoch() (Epoch, error)
func (*ValidatorView) WithdrawalCredentials ¶ added in v0.12.1
func (v *ValidatorView) WithdrawalCredentials() (out Root, err error)
type ValidatorsRegistryView ¶ added in v0.12.1
type ValidatorsRegistryView struct{ *ComplexListView }
func AsValidatorsRegistry ¶ added in v0.12.1
func AsValidatorsRegistry(v View, err error) (*ValidatorsRegistryView, error)
func (*ValidatorsRegistryView) Validator ¶ added in v0.12.1
func (registry *ValidatorsRegistryView) Validator(index ValidatorIndex) (*ValidatorView, error)
func (*ValidatorsRegistryView) ValidatorCount ¶ added in v0.12.1
func (registry *ValidatorsRegistryView) ValidatorCount() (uint64, error)
type Version ¶ added in v0.12.1
type Version [4]byte
32 bits, not strictly an integer, hence represented as 4 bytes (bytes not necessarily corresponding to versions)
func (Version) ByteLength ¶ added in v0.12.2
func (*Version) Deserialize ¶ added in v0.12.2
func (v *Version) Deserialize(dr *codec.DecodingReader) error
func (Version) FixedLength ¶ added in v0.12.2
func (Version) HashTreeRoot ¶ added in v0.12.2
func (Version) MarshalText ¶ added in v0.12.2
func (Version) Serialize ¶ added in v0.12.2
func (a Version) Serialize(w *codec.EncodingWriter) error
func (*Version) UnmarshalText ¶ added in v0.12.2
type VoluntaryExit ¶
type VoluntaryExit struct { // Earliest epoch when voluntary exit can be processed Epoch Epoch `json:"epoch" yaml:"epoch"` ValidatorIndex ValidatorIndex `json:"validator_index" yaml:"validator_index"` }
func (*VoluntaryExit) ByteLength ¶ added in v0.12.2
func (v *VoluntaryExit) ByteLength() uint64
func (*VoluntaryExit) Deserialize ¶ added in v0.12.2
func (v *VoluntaryExit) Deserialize(dr *codec.DecodingReader) error
func (*VoluntaryExit) FixedLength ¶ added in v0.12.2
func (*VoluntaryExit) FixedLength() uint64
func (*VoluntaryExit) HashTreeRoot ¶ added in v0.12.1
func (v *VoluntaryExit) HashTreeRoot(hFn tree.HashFn) Root
func (*VoluntaryExit) Serialize ¶ added in v0.12.2
func (v *VoluntaryExit) Serialize(w *codec.EncodingWriter) error
type VoluntaryExits ¶ added in v0.12.1
type VoluntaryExits []SignedVoluntaryExit
func (VoluntaryExits) ByteLength ¶ added in v0.12.2
func (a VoluntaryExits) ByteLength(spec *Spec) (out uint64)
func (*VoluntaryExits) Deserialize ¶ added in v0.12.2
func (a *VoluntaryExits) Deserialize(spec *Spec, dr *codec.DecodingReader) error
func (*VoluntaryExits) FixedLength ¶ added in v0.12.2
func (*VoluntaryExits) FixedLength(*Spec) uint64
func (VoluntaryExits) HashTreeRoot ¶ added in v0.12.2
func (li VoluntaryExits) HashTreeRoot(spec *Spec, hFn tree.HashFn) Root
func (VoluntaryExits) Serialize ¶ added in v0.12.2
func (a VoluntaryExits) Serialize(spec *Spec, w *codec.EncodingWriter) error
type WithdrawalPrefix ¶ added in v0.12.2
type WithdrawalPrefix [1]byte
func (WithdrawalPrefix) MarshalText ¶ added in v0.12.2
func (p WithdrawalPrefix) MarshalText() ([]byte, error)
func (WithdrawalPrefix) String ¶ added in v0.12.2
func (p WithdrawalPrefix) String() string
func (*WithdrawalPrefix) UnmarshalText ¶ added in v0.12.2
func (p *WithdrawalPrefix) UnmarshalText(text []byte) error
Source Files ¶
- aggregate_and_proof.go
- attestation.go
- attester.go
- attester_slashing.go
- balances.go
- block.go
- bls.go
- committee_bits.go
- constants.go
- deltas.go
- deposit.go
- epoch.go
- epochs_context.go
- eth1.go
- final.go
- general.go
- genesis.go
- header.go
- history.go
- indexed.go
- justification.go
- kickstart.go
- network.go
- pending_attestation.go
- proposer_slashing.go
- randao.go
- registry.go
- shuffle.go
- shuffling.go
- slashings.go
- spec.go
- state.go
- time.go
- transition.go
- validator.go
- validator_indices.go
- versioning.go
- voluntary_exit.go
- withdrawals.go