Documentation ¶
Index ¶
- Constants
- func GetDepth(v uint64) uint8
- func IntersectionOfSortedSets(v1, v2 IterableSSZ[uint64]) []uint64
- func IsUint64SortedSet(set IterableSSZ[uint64]) bool
- func NewUint64Slice(limit int) *byteBasedUint64Slice
- func RangeErr[T any](r Ranger[T], fn func(int, T, int) error) (err error)
- type Attestation
- func (a *Attestation) AggregationBits() []byte
- func (a *Attestation) AttestantionData() AttestationData
- func (*Attestation) Clone() clonable.Clonable
- func (a *Attestation) CopyHashBufferTo(o []byte) error
- func (a *Attestation) DecodeSSZ(buf []byte, _ int) error
- func (a *Attestation) EncodeSSZ(dst []byte) ([]byte, error)
- func (a *Attestation) EncodingSizeSSZ() (size int)
- func (a *Attestation) HashSSZ() (o [32]byte, err error)
- func (a Attestation) MarshalJSON() ([]byte, error)
- func (a *Attestation) SetAggregationBits(bits []byte)
- func (a *Attestation) SetAttestationData(d AttestationData)
- func (a *Attestation) SetSignature(signature [96]byte)
- func (a *Attestation) Signature() (o [96]byte)
- func (*Attestation) Static() bool
- func (a *Attestation) UnmarshalJSON(buf []byte) error
- type AttestationData
- func (a AttestationData) BeaconBlockRoot() (o libcommon.Hash)
- func (a AttestationData) Clone() clonable.Clonable
- func (a AttestationData) CopyHashBufferTo(o []byte) error
- func (a AttestationData) DecodeSSZ(buf []byte, _ int) error
- func (a AttestationData) EncodeSSZ(dst []byte) ([]byte, error)
- func (a AttestationData) EncodingSizeSSZ() int
- func (a AttestationData) Equal(other AttestationData) bool
- func (a AttestationData) HashSSZ() (o [32]byte, err error)
- func (a AttestationData) MarshalJSON() ([]byte, error)
- func (a AttestationData) RawBeaconBlockRoot() []byte
- func (a AttestationData) RawSlot() []byte
- func (a AttestationData) RawValidatorIndex() []byte
- func (a AttestationData) SetBeaconBlockRoot(beaconBlockRoot libcommon.Hash)
- func (a AttestationData) SetBeaconBlockRootWithRawBytes(b []byte)
- func (a AttestationData) SetSlot(slot uint64)
- func (a AttestationData) SetSlotWithRawBytes(b []byte)
- func (a AttestationData) SetSource(c Checkpoint)
- func (a AttestationData) SetTarget(c Checkpoint)
- func (a AttestationData) SetValidatorIndex(validatorIndex uint64)
- func (a AttestationData) SetValidatorIndexWithRawBytes(b []byte)
- func (a AttestationData) Slot() uint64
- func (a AttestationData) Source() Checkpoint
- func (a AttestationData) Static() bool
- func (a AttestationData) Target() Checkpoint
- func (a AttestationData) UnmarshalJSON(buf []byte) error
- func (a AttestationData) ValidatorIndex() uint64
- type BitList
- func (u *BitList) Append(v byte)
- func (u *BitList) Bits() int
- func (u *BitList) Bytes() []byte
- func (u *BitList) Cap() int
- func (u *BitList) Clear()
- func (u *BitList) Clone() clonable.Clonable
- func (u *BitList) CopyTo(target IterableSSZ[byte])
- func (u *BitList) DecodeSSZ(dst []byte, _ int) error
- func (u *BitList) EncodeSSZ(dst []byte) ([]byte, error)
- func (u *BitList) EncodingSizeSSZ() int
- func (u *BitList) Get(index int) byte
- func (u *BitList) HashSSZ() ([32]byte, error)
- func (u *BitList) Length() int
- func (u *BitList) MarshalJSON() ([]byte, error)
- func (u *BitList) Pop() (x byte)
- func (u *BitList) Range(fn func(index int, value byte, length int) bool)
- func (u *BitList) Set(index int, v byte)
- func (*BitList) Static() bool
- func (u *BitList) UnmarshalJSON(input []byte) error
- type Checkpoint
- func (c Checkpoint) BlockRoot() (o libcommon.Hash)
- func (c Checkpoint) Clone() clonable.Clonable
- func (c Checkpoint) Copy() Checkpoint
- func (c Checkpoint) CopyHashBufferTo(o []byte) error
- func (c Checkpoint) DecodeSSZ(buf []byte, _ int) error
- func (c Checkpoint) EncodeSSZ(dst []byte) ([]byte, error)
- func (Checkpoint) EncodingSizeSSZ() int
- func (c Checkpoint) Epoch() uint64
- func (c Checkpoint) Equal(other Checkpoint) bool
- func (c Checkpoint) HashSSZ() (o [32]byte, err error)
- func (c Checkpoint) MarshalJSON() ([]byte, error)
- func (c Checkpoint) RawBlockRoot() []byte
- func (c Checkpoint) RawEpoch() []byte
- func (c Checkpoint) SetBlockRoot(blockRoot libcommon.Hash)
- func (c Checkpoint) SetEpoch(epoch uint64)
- func (c Checkpoint) SetRawBlockRoot(b []byte)
- func (c Checkpoint) SetRawEpoch(b []byte)
- func (c Checkpoint) Static() bool
- func (c Checkpoint) UnmarshalJSON(buf []byte) error
- type ExtraData
- func (e *ExtraData) Bytes() []byte
- func (*ExtraData) Clone() clonable.Clonable
- func (e *ExtraData) DecodeSSZ(buf []byte, _ int) error
- func (e *ExtraData) EncodeSSZ(buf []byte) ([]byte, error)
- func (e *ExtraData) EncodingSizeSSZ() int
- func (e *ExtraData) HashSSZ() ([32]byte, error)
- func (e ExtraData) MarshalJSON() ([]byte, error)
- func (e *ExtraData) SetBytes(buf []byte)
- func (*ExtraData) Static() bool
- func (e *ExtraData) UnmarshalJSON(buf []byte) error
- type HashListSSZ
- type HashVectorSSZ
- type IterableSSZ
- type ListSSZ
- func NewDynamicListSSZ[T encodableHashableSSZ](limit int) *ListSSZ[T]
- func NewDynamicListSSZFromList[T encodableHashableSSZ](list []T, limit int) *ListSSZ[T]
- func NewStaticListSSZ[T encodableHashableSSZ](limit int, bytesPerElement int) *ListSSZ[T]
- func NewStaticListSSZFromList[T encodableHashableSSZ](list []T, limit int, bytesPerElement int) *ListSSZ[T]
- func NewStatucListSSZFromList[T encodableHashableSSZ](list []T, limit int, bytesPerElement int) *ListSSZ[T]
- func (l *ListSSZ[T]) Append(obj T)
- func (l *ListSSZ[T]) Clear()
- func (l *ListSSZ[T]) Clone() clonable.Clonable
- func (l *ListSSZ[T]) DecodeSSZ(buf []byte, version int) (err error)
- func (l *ListSSZ[T]) EncodeSSZ(buf []byte) (dst []byte, err error)
- func (l *ListSSZ[T]) EncodingSizeSSZ() (size int)
- func (l *ListSSZ[T]) Get(index int) T
- func (l *ListSSZ[T]) HashSSZ() ([32]byte, error)
- func (l *ListSSZ[T]) Len() int
- func (l ListSSZ[T]) MarshalJSON() ([]byte, error)
- func (l *ListSSZ[T]) Range(fn func(index int, value T, length int) bool)
- func (l *ListSSZ[T]) Static() bool
- func (l *ListSSZ[T]) Truncate(length int)
- func (l *ListSSZ[T]) UnmarshalJSON(data []byte) error
- type PendingAttestation
- func (a *PendingAttestation) AggregationBits() []byte
- func (a *PendingAttestation) AttestantionData() AttestationData
- func (*PendingAttestation) Clone() clonable.Clonable
- func (a *PendingAttestation) DecodeSSZ(buf []byte, _ int) error
- func (a *PendingAttestation) EncodeSSZ(dst []byte) ([]byte, error)
- func (a *PendingAttestation) EncodingSizeSSZ() (size int)
- func (a *PendingAttestation) HashSSZ() (o [32]byte, err error)
- func (a *PendingAttestation) InclusionDelay() uint64
- func (a *PendingAttestation) MarshalJSON() ([]byte, error)
- func (a *PendingAttestation) ProposerIndex() uint64
- func (a *PendingAttestation) SetAggregationBits(bits []byte)
- func (a *PendingAttestation) SetAttestationData(d AttestationData)
- func (a *PendingAttestation) SetInclusionDelay(inclusionDelay uint64)
- func (a *PendingAttestation) SetProposerIndex(proposerIndex uint64)
- func (a *PendingAttestation) UnmarshalJSON(input []byte) error
- type Phase0Data
- type Ranger
- type RawUint64List
- func (arr *RawUint64List) Append(value uint64)
- func (arr *RawUint64List) Bytes() []byte
- func (arr *RawUint64List) Cap() int
- func (arr *RawUint64List) Clear()
- func (arr *RawUint64List) Clone() clonable.Clonable
- func (arr *RawUint64List) CopyTo(target IterableSSZ[uint64])
- func (arr *RawUint64List) DecodeSSZ(buf []byte, _ int) error
- func (arr *RawUint64List) EncodeSSZ(buf []byte) (dst []byte, err error)
- func (arr *RawUint64List) EncodingSizeSSZ() int
- func (arr *RawUint64List) Get(index int) uint64
- func (arr *RawUint64List) HashSSZ() ([32]byte, error)
- func (arr *RawUint64List) Length() int
- func (arr *RawUint64List) MarshalJSON() ([]byte, error)
- func (arr *RawUint64List) Pop() uint64
- func (arr *RawUint64List) Range(fn func(index int, value uint64, length int) bool)
- func (arr *RawUint64List) Set(index int, v uint64)
- func (arr *RawUint64List) SetReusableHashBuffer(buf []byte)
- func (arr *RawUint64List) Static() bool
- func (arr *RawUint64List) UnmarshalJSON(data []byte) error
- type SyncCommittee
- func (s *SyncCommittee) AggregatePublicKey() (out libcommon.Bytes48)
- func (s *SyncCommittee) Clone() clonable.Clonable
- func (s *SyncCommittee) Copy() *SyncCommittee
- func (s *SyncCommittee) DecodeSSZ(buf []byte, _ int) error
- func (s *SyncCommittee) EncodeSSZ(dst []byte) ([]byte, error)
- func (s *SyncCommittee) EncodingSizeSSZ() int
- func (s *SyncCommittee) Equal(o *SyncCommittee) bool
- func (s *SyncCommittee) GetCommittee() []libcommon.Bytes48
- func (s *SyncCommittee) HashSSZ() ([32]byte, error)
- func (s *SyncCommittee) MarshalJSON() ([]byte, error)
- func (s *SyncCommittee) SetAggregatePublicKey(k libcommon.Bytes48)
- func (s *SyncCommittee) SetCommittee(committee []libcommon.Bytes48)
- func (s *SyncCommittee) Static() bool
- func (s *SyncCommittee) UnmarshalJSON(input []byte) error
- type TransactionsSSZ
- func (*TransactionsSSZ) Clone() clonable.Clonable
- func (t *TransactionsSSZ) DecodeSSZ(buf []byte, _ int) error
- func (t *TransactionsSSZ) EncodeSSZ(buf []byte) (dst []byte, err error)
- func (t *TransactionsSSZ) EncodingSizeSSZ() (size int)
- func (t *TransactionsSSZ) ForEach(fn func(tx []byte, idx int, total int) bool)
- func (t *TransactionsSSZ) HashSSZ() ([32]byte, error)
- func (t TransactionsSSZ) MarshalJSON() ([]byte, error)
- func (*TransactionsSSZ) Static() bool
- func (t *TransactionsSSZ) UnderlyngReference() [][]byte
- func (t *TransactionsSSZ) UnmarshalJSON(buf []byte) error
- type Uint64ListSSZ
- type Uint64VectorSSZ
- type Validator
- func (v Validator) ActivationEligibilityEpoch() uint64
- func (v Validator) ActivationEpoch() uint64
- func (v Validator) Active(epoch uint64) bool
- func (v Validator) Clone() clonable.Clonable
- func (v Validator) CopyHashBufferTo(o []byte) error
- func (v Validator) CopyTo(dst Validator)
- func (v Validator) DecodeSSZ(buf []byte, _ int) error
- func (v Validator) EffectiveBalance() uint64
- func (v Validator) EncodeSSZ(dst []byte) ([]byte, error)
- func (v Validator) EncodingSizeSSZ() int
- func (v Validator) ExitEpoch() uint64
- func (v Validator) HashSSZ() ([32]byte, error)
- func (v Validator) IsSlashable(epoch uint64) bool
- func (v Validator) MarshalJSON() ([]byte, error)
- func (v Validator) PublicKey() (o [48]byte)
- func (v Validator) PublicKeyBytes() (o []byte)
- func (v Validator) SetActivationEligibilityEpoch(i uint64)
- func (v Validator) SetActivationEpoch(i uint64)
- func (v Validator) SetEffectiveBalance(i uint64)
- func (v Validator) SetEffectiveBalanceFromBytes(b []byte)
- func (v Validator) SetExitEpoch(i uint64)
- func (v Validator) SetPublicKey(o [48]byte)
- func (v Validator) SetSlashed(b bool)
- func (v Validator) SetWithdrawableEpoch(i uint64)
- func (v Validator) SetWithdrawalCredentials(o common.Hash)
- func (v Validator) Slashed() bool
- func (v *Validator) UnmarshalJSON(input []byte) error
- func (v Validator) WithdrawableEpoch() uint64
- func (v Validator) WithdrawalCredentials() (o common.Hash)
- type ValidatorSet
- func (v *ValidatorSet) Append(val Validator)
- func (v *ValidatorSet) Bytes() []byte
- func (v *ValidatorSet) Cap() int
- func (v *ValidatorSet) Clear()
- func (v *ValidatorSet) Clone() clonable.Clonable
- func (v *ValidatorSet) CopyTo(t *ValidatorSet)
- func (v *ValidatorSet) DecodeSSZ(buf []byte, _ int) error
- func (v *ValidatorSet) EncodeSSZ(buf []byte) ([]byte, error)
- func (v *ValidatorSet) EncodingSizeSSZ() int
- func (v *ValidatorSet) Get(idx int) Validator
- func (v *ValidatorSet) HashSSZ() ([32]byte, error)
- func (v *ValidatorSet) IsCurrentMatchingHeadAttester(idx int) bool
- func (v *ValidatorSet) IsCurrentMatchingSourceAttester(idx int) bool
- func (v *ValidatorSet) IsCurrentMatchingTargetAttester(idx int) bool
- func (v *ValidatorSet) IsPreviousMatchingHeadAttester(idx int) bool
- func (v *ValidatorSet) IsPreviousMatchingSourceAttester(idx int) bool
- func (v *ValidatorSet) IsPreviousMatchingTargetAttester(idx int) bool
- func (v *ValidatorSet) Length() int
- func (v *ValidatorSet) MarshalJSON() ([]byte, error)
- func (v *ValidatorSet) MinCurrentInclusionDelayAttestation(idx int) *PendingAttestation
- func (v *ValidatorSet) MinPreviousInclusionDelayAttestation(idx int) *PendingAttestation
- func (v *ValidatorSet) Pop() Validator
- func (v *ValidatorSet) Range(fn func(int, Validator, int) bool)
- func (v *ValidatorSet) Set(idx int, val Validator)
- func (v *ValidatorSet) SetActivationEligibilityEpochForValidatorAtIndex(index int, epoch uint64)
- func (v *ValidatorSet) SetActivationEpochForValidatorAtIndex(index int, epoch uint64)
- func (v *ValidatorSet) SetEffectiveBalanceForValidatorAtIndex(index int, balance uint64)
- func (v *ValidatorSet) SetExitEpochForValidatorAtIndex(index int, epoch uint64)
- func (v *ValidatorSet) SetIsCurrentMatchingHeadAttester(idx int, val bool)
- func (v *ValidatorSet) SetIsCurrentMatchingSourceAttester(idx int, val bool)
- func (v *ValidatorSet) SetIsCurrentMatchingTargetAttester(idx int, val bool)
- func (v *ValidatorSet) SetIsPreviousMatchingHeadAttester(idx int, val bool)
- func (v *ValidatorSet) SetIsPreviousMatchingSourceAttester(idx int, val bool)
- func (v *ValidatorSet) SetIsPreviousMatchingTargetAttester(idx int, val bool)
- func (v *ValidatorSet) SetMinCurrentInclusionDelayAttestation(idx int, val *PendingAttestation)
- func (v *ValidatorSet) SetMinPreviousInclusionDelayAttestation(idx int, val *PendingAttestation)
- func (v *ValidatorSet) SetValidatorSlashed(index int, slashed bool)
- func (v *ValidatorSet) SetWithdrawableEpochForValidatorAtIndex(index int, epoch uint64)
- func (v *ValidatorSet) SetWithdrawalCredentialForValidatorAtIndex(index int, creds libcommon.Hash)
- func (*ValidatorSet) Static() bool
- func (v *ValidatorSet) UnmarshalJSON(data []byte) error
Constants ¶
const ( IsCurrentMatchingSourceAttesterBit = 0x0 IsPreviousMatchingSourceAttesterBit = 0x1 IsCurrentMatchingTargetAttesterBit = 0x2 IsPreviousMatchingTargetAttesterBit = 0x3 IsCurrentMatchingHeadAttesterBit = 0x4 IsPreviousMatchingHeadAttesterBit = 0x5 )
const AttestationDataBufferSize = 8 + 8 + 32 + 40*2
slot: 8 bytes validatorIndex: 8 bytes beaconBlockHash: 32 bytes source: 40 bytes target: 40 bytes
const CheckpointSize = 32 + 8 // BlockRoot(32 bytes) + Epoch(8 bytes)
Constants to represent the size and layout of a Checkpoint
Variables ¶
This section is empty.
Functions ¶
func IntersectionOfSortedSets ¶
func IntersectionOfSortedSets(v1, v2 IterableSSZ[uint64]) []uint64
func IsUint64SortedSet ¶
func IsUint64SortedSet(set IterableSSZ[uint64]) bool
Check if it is sorted and check if there are duplicates. O(N) complexity.
func NewUint64Slice ¶
func NewUint64Slice(limit int) *byteBasedUint64Slice
NewUint64Slice creates a new instance of byteBasedUint64Slice with a specified capacity limit.
Types ¶
type Attestation ¶
type Attestation struct {
// contains filtered or unexported fields
}
Attestation type represents a statement or confirmation of some occurrence or phenomenon.
func NewAttestionFromParameters ¶
func NewAttestionFromParameters( aggregationBits []byte, attestationData AttestationData, signature [96]byte, ) *Attestation
NewAttestionFromParameters creates a new Attestation instance using provided parameters
func (*Attestation) AggregationBits ¶
func (a *Attestation) AggregationBits() []byte
AggregationBits returns the aggregation bits buffer of the Attestation instance.
func (*Attestation) AttestantionData ¶
func (a *Attestation) AttestantionData() AttestationData
AttestantionData returns the attestation data of the Attestation instance.
func (*Attestation) Clone ¶
func (*Attestation) Clone() clonable.Clonable
Clone creates a new clone of the Attestation instance. This can be useful for creating copies without changing the original object.
func (*Attestation) CopyHashBufferTo ¶
func (a *Attestation) CopyHashBufferTo(o []byte) error
CopyHashBufferTo copies the hash buffer of the Attestation instance to the provided byte slice.
func (*Attestation) DecodeSSZ ¶
func (a *Attestation) DecodeSSZ(buf []byte, _ int) error
DecodeSSZ decodes the provided buffer into the Attestation instance.
func (*Attestation) EncodeSSZ ¶
func (a *Attestation) EncodeSSZ(dst []byte) ([]byte, error)
EncodeSSZ encodes the Attestation instance into the provided buffer.
func (*Attestation) EncodingSizeSSZ ¶
func (a *Attestation) EncodingSizeSSZ() (size int)
EncodingSizeSSZ returns the size of the Attestation instance when encoded in SSZ format.
func (*Attestation) HashSSZ ¶
func (a *Attestation) HashSSZ() (o [32]byte, err error)
HashSSZ hashes the Attestation instance using SSZ. It creates a byte slice `leaves` with a size based on length.Hash, then fills this slice with the values from the Attestation's hash buffer.
func (Attestation) MarshalJSON ¶
func (a Attestation) MarshalJSON() ([]byte, error)
func (*Attestation) SetAggregationBits ¶
func (a *Attestation) SetAggregationBits(bits []byte)
SetAggregationBits sets the aggregation bits buffer of the Attestation instance.
func (*Attestation) SetAttestationData ¶
func (a *Attestation) SetAttestationData(d AttestationData)
SetAttestationData sets the attestation data of the Attestation instance.
func (*Attestation) SetSignature ¶
func (a *Attestation) SetSignature(signature [96]byte)
SetSignature sets the signature of the Attestation instance.
func (*Attestation) Signature ¶
func (a *Attestation) Signature() (o [96]byte)
Signature returns the signature of the Attestation instance.
func (*Attestation) Static ¶
func (*Attestation) Static() bool
Static returns whether the attestation is static or not. For Attestation, it's always false.
func (*Attestation) UnmarshalJSON ¶
func (a *Attestation) UnmarshalJSON(buf []byte) error
type AttestationData ¶
type AttestationData []byte
AttestantionData contains information about attestantion, including finalized/attested checkpoints.
func NewAttestationData ¶
func NewAttestationData() AttestationData
func NewAttestionDataFromParameters ¶
func NewAttestionDataFromParameters( slot uint64, validatorIndex uint64, beaconBlockRoot libcommon.Hash, source Checkpoint, target Checkpoint, ) AttestationData
func (AttestationData) BeaconBlockRoot ¶
func (a AttestationData) BeaconBlockRoot() (o libcommon.Hash)
func (AttestationData) Clone ¶
func (a AttestationData) Clone() clonable.Clonable
func (AttestationData) CopyHashBufferTo ¶
func (a AttestationData) CopyHashBufferTo(o []byte) error
func (AttestationData) EncodingSizeSSZ ¶
func (a AttestationData) EncodingSizeSSZ() int
func (AttestationData) Equal ¶
func (a AttestationData) Equal(other AttestationData) bool
func (AttestationData) HashSSZ ¶
func (a AttestationData) HashSSZ() (o [32]byte, err error)
func (AttestationData) MarshalJSON ¶
func (a AttestationData) MarshalJSON() ([]byte, error)
func (AttestationData) RawBeaconBlockRoot ¶
func (a AttestationData) RawBeaconBlockRoot() []byte
func (AttestationData) RawSlot ¶
func (a AttestationData) RawSlot() []byte
func (AttestationData) RawValidatorIndex ¶
func (a AttestationData) RawValidatorIndex() []byte
func (AttestationData) SetBeaconBlockRoot ¶
func (a AttestationData) SetBeaconBlockRoot(beaconBlockRoot libcommon.Hash)
func (AttestationData) SetBeaconBlockRootWithRawBytes ¶
func (a AttestationData) SetBeaconBlockRootWithRawBytes(b []byte)
func (AttestationData) SetSlot ¶
func (a AttestationData) SetSlot(slot uint64)
func (AttestationData) SetSlotWithRawBytes ¶
func (a AttestationData) SetSlotWithRawBytes(b []byte)
func (AttestationData) SetSource ¶
func (a AttestationData) SetSource(c Checkpoint)
func (AttestationData) SetTarget ¶
func (a AttestationData) SetTarget(c Checkpoint)
func (AttestationData) SetValidatorIndex ¶
func (a AttestationData) SetValidatorIndex(validatorIndex uint64)
func (AttestationData) SetValidatorIndexWithRawBytes ¶
func (a AttestationData) SetValidatorIndexWithRawBytes(b []byte)
func (AttestationData) Slot ¶
func (a AttestationData) Slot() uint64
func (AttestationData) Source ¶
func (a AttestationData) Source() Checkpoint
func (AttestationData) Static ¶
func (a AttestationData) Static() bool
func (AttestationData) Target ¶
func (a AttestationData) Target() Checkpoint
func (AttestationData) UnmarshalJSON ¶
func (a AttestationData) UnmarshalJSON(buf []byte) error
func (AttestationData) ValidatorIndex ¶
func (a AttestationData) ValidatorIndex() uint64
type BitList ¶
type BitList struct {
// contains filtered or unexported fields
}
BitList is like a dynamic binary string. It's like a flipbook of 1s and 0s! And just like a flipbook, we can add (Append), remove (Pop), or look at any bit (Get) we want.
func BitlistFromBytes ¶
BitlistFromBytes is like getting a new Power Ranger from a civilian - we already have the bits!
func NewBitList ¶
NewBitList creates a brand new BitList, just like when Zordon created the Power Rangers! We make sure to set its length and capacity first.
func (*BitList) Append ¶
Append is like adding a new Power Ranger to the team - the bitlist gets bigger!
func (*BitList) Clear ¶
func (u *BitList) Clear()
Clear wipes the BitList clean, just like the memory wipe spell from a particularly forgetful wizard.
func (*BitList) Clone ¶
Clone creates a new BitList with the same length and capacity as the original. Note that the underlying byte slice is not copied.
func (*BitList) CopyTo ¶
func (u *BitList) CopyTo(target IterableSSZ[byte])
CopyTo is like a Power Rangers team up episode - we get the bits from another list!
func (*BitList) DecodeSSZ ¶
DecodeSSZ replaces the underlying byte slice of the BitList with a copy of the input byte slice. It then updates the length of the BitList to match the length of the new byte slice.
func (*BitList) EncodeSSZ ¶
EncodeSSZ appends the underlying byte slice of the BitList to the destination byte slice. It returns the resulting byte slice.
func (*BitList) EncodingSizeSSZ ¶
EncodingSizeSSZ returns the current length of the BitList. This is the number of bytes that would be written out when EncodeSSZ is called.
func (*BitList) Get ¶
Get lets us peek at a bit in the list, like when the team uses their sensors to spot the monster.
func (*BitList) Length ¶
Length gives us the length of the bitlist, just like a roll call tells us how many Rangers there are.
func (*BitList) MarshalJSON ¶
func (*BitList) Pop ¶
Pop removes the first bit from the list, like when the Red Ranger takes the first hit.
func (*BitList) Range ¶
Range allows us to do something to each bit in the list, just like a Power Rangers roll call.
func (*BitList) UnmarshalJSON ¶
type Checkpoint ¶
type Checkpoint []byte // Define Checkpoint as a byte slice
func NewCheckpoint ¶
func NewCheckpoint() Checkpoint
NewCheckpoint returns a new Checkpoint with the underlying byte slice initialized to zeros
func NewCheckpointFromParameters ¶
func NewCheckpointFromParameters( blockRoot libcommon.Hash, epoch uint64, ) Checkpoint
NewCheckpointFromParameters returns a new Checkpoint constructed from the given blockRoot and epoch
func (Checkpoint) BlockRoot ¶
func (c Checkpoint) BlockRoot() (o libcommon.Hash)
BlockRoot returns the block root encoded within the Checkpoint
func (Checkpoint) Clone ¶
func (c Checkpoint) Clone() clonable.Clonable
Clone returns a new Checkpoint object that is a copy of the current object.
func (Checkpoint) Copy ¶
func (c Checkpoint) Copy() Checkpoint
Copy returns a copy of the Checkpoint object.
func (Checkpoint) CopyHashBufferTo ¶
func (c Checkpoint) CopyHashBufferTo(o []byte) error
CopyHashBufferTo copies the hash of the Checkpoint to the buffer 'o'.
func (Checkpoint) DecodeSSZ ¶
func (c Checkpoint) DecodeSSZ(buf []byte, _ int) error
DecodeSSZ decodes the Checkpoint object from SSZ-encoded data.
func (Checkpoint) EncodeSSZ ¶
func (c Checkpoint) EncodeSSZ(dst []byte) ([]byte, error)
EncodeSSZ encodes the Checkpoint object into SSZ format.
func (Checkpoint) EncodingSizeSSZ ¶
func (Checkpoint) EncodingSizeSSZ() int
EncodingSizeSSZ returns the size of the Checkpoint object when encoded as SSZ.
func (Checkpoint) Epoch ¶
func (c Checkpoint) Epoch() uint64
Epoch returns the epoch encoded within the Checkpoint
func (Checkpoint) Equal ¶
func (c Checkpoint) Equal(other Checkpoint) bool
Equal checks if the Checkpoint object is equal to another Checkpoint object.
func (Checkpoint) HashSSZ ¶
func (c Checkpoint) HashSSZ() (o [32]byte, err error)
HashSSZ returns the hash of the Checkpoint object when encoded as SSZ.
func (Checkpoint) MarshalJSON ¶
func (c Checkpoint) MarshalJSON() ([]byte, error)
func (Checkpoint) RawBlockRoot ¶
func (c Checkpoint) RawBlockRoot() []byte
func (Checkpoint) RawEpoch ¶
func (c Checkpoint) RawEpoch() []byte
func (Checkpoint) SetBlockRoot ¶
func (c Checkpoint) SetBlockRoot(blockRoot libcommon.Hash)
SetBlockRoot copies the given blockRoot into the correct location within the Checkpoint
func (Checkpoint) SetEpoch ¶
func (c Checkpoint) SetEpoch(epoch uint64)
SetEpoch encodes the given epoch into the correct location within the Checkpoint
func (Checkpoint) SetRawBlockRoot ¶
func (c Checkpoint) SetRawBlockRoot(b []byte)
func (Checkpoint) SetRawEpoch ¶
func (c Checkpoint) SetRawEpoch(b []byte)
func (Checkpoint) Static ¶
func (c Checkpoint) Static() bool
Static always returns true, indicating that the Checkpoint object is static.
func (Checkpoint) UnmarshalJSON ¶
func (c Checkpoint) UnmarshalJSON(buf []byte) error
type ExtraData ¶
type ExtraData struct {
// contains filtered or unexported fields
}
ExtraData type stores data as a byte slice and its length.
func NewExtraData ¶
func NewExtraData() *ExtraData
NewExtraData creates a new instance of ExtraData type with initialized byte slice of length 32.
func (*ExtraData) EncodingSizeSSZ ¶
EncodingSizeSSZ returns the length of ExtraData.
func (ExtraData) MarshalJSON ¶
func (*ExtraData) Static ¶
Static always returns false, indicating that the ExtraData object is not static.
func (*ExtraData) UnmarshalJSON ¶
type HashListSSZ ¶
type HashListSSZ interface { IterableSSZ[common.Hash] json.Marshaler json.Unmarshaler }
func NewHashList ¶
func NewHashList(c int) HashListSSZ
type HashVectorSSZ ¶
type HashVectorSSZ interface { IterableSSZ[common.Hash] json.Marshaler json.Unmarshaler }
func NewHashVector ¶
func NewHashVector(s int) HashVectorSSZ
type IterableSSZ ¶
type ListSSZ ¶
type ListSSZ[T encodableHashableSSZ] struct {
// contains filtered or unexported fields
}
func NewDynamicListSSZ ¶
func NewStaticListSSZ ¶
func (*ListSSZ[T]) EncodingSizeSSZ ¶
func (ListSSZ[T]) MarshalJSON ¶
func (*ListSSZ[T]) UnmarshalJSON ¶
type PendingAttestation ¶
type PendingAttestation struct {
// contains filtered or unexported fields
}
func NewPendingAttestionFromParameters ¶
func NewPendingAttestionFromParameters( aggregationBits []byte, attestationData AttestationData, inclusionDelay uint64, proposerIndex uint64, ) *PendingAttestation
func (*PendingAttestation) AggregationBits ¶
func (a *PendingAttestation) AggregationBits() []byte
func (*PendingAttestation) AttestantionData ¶
func (a *PendingAttestation) AttestantionData() AttestationData
func (*PendingAttestation) Clone ¶
func (*PendingAttestation) Clone() clonable.Clonable
func (*PendingAttestation) DecodeSSZ ¶
func (a *PendingAttestation) DecodeSSZ(buf []byte, _ int) error
func (*PendingAttestation) EncodeSSZ ¶
func (a *PendingAttestation) EncodeSSZ(dst []byte) ([]byte, error)
func (*PendingAttestation) EncodingSizeSSZ ¶
func (a *PendingAttestation) EncodingSizeSSZ() (size int)
func (*PendingAttestation) HashSSZ ¶
func (a *PendingAttestation) HashSSZ() (o [32]byte, err error)
func (*PendingAttestation) InclusionDelay ¶
func (a *PendingAttestation) InclusionDelay() uint64
func (*PendingAttestation) MarshalJSON ¶
func (a *PendingAttestation) MarshalJSON() ([]byte, error)
func (*PendingAttestation) ProposerIndex ¶
func (a *PendingAttestation) ProposerIndex() uint64
func (*PendingAttestation) SetAggregationBits ¶
func (a *PendingAttestation) SetAggregationBits(bits []byte)
func (*PendingAttestation) SetAttestationData ¶
func (a *PendingAttestation) SetAttestationData(d AttestationData)
func (*PendingAttestation) SetInclusionDelay ¶
func (a *PendingAttestation) SetInclusionDelay(inclusionDelay uint64)
func (*PendingAttestation) SetProposerIndex ¶
func (a *PendingAttestation) SetProposerIndex(proposerIndex uint64)
func (*PendingAttestation) UnmarshalJSON ¶
func (a *PendingAttestation) UnmarshalJSON(input []byte) error
type Phase0Data ¶
type Phase0Data struct { // MinInclusionDelay MinCurrentInclusionDelayAttestation *PendingAttestation MinPreviousInclusionDelayAttestation *PendingAttestation }
This is all stuff used by phase0 state transition. It makes many operations faster.
type RawUint64List ¶
type RawUint64List struct {
// contains filtered or unexported fields
}
func NewRawUint64List ¶
func NewRawUint64List(limit int, u []uint64) *RawUint64List
func (*RawUint64List) Append ¶
func (arr *RawUint64List) Append(value uint64)
func (*RawUint64List) Bytes ¶
func (arr *RawUint64List) Bytes() []byte
func (*RawUint64List) Cap ¶
func (arr *RawUint64List) Cap() int
func (*RawUint64List) Clear ¶
func (arr *RawUint64List) Clear()
func (*RawUint64List) Clone ¶
func (arr *RawUint64List) Clone() clonable.Clonable
func (*RawUint64List) CopyTo ¶
func (arr *RawUint64List) CopyTo(target IterableSSZ[uint64])
func (*RawUint64List) EncodeSSZ ¶
func (arr *RawUint64List) EncodeSSZ(buf []byte) (dst []byte, err error)
func (*RawUint64List) EncodingSizeSSZ ¶
func (arr *RawUint64List) EncodingSizeSSZ() int
func (*RawUint64List) Get ¶
func (arr *RawUint64List) Get(index int) uint64
func (*RawUint64List) HashSSZ ¶
func (arr *RawUint64List) HashSSZ() ([32]byte, error)
func (*RawUint64List) Length ¶
func (arr *RawUint64List) Length() int
func (*RawUint64List) MarshalJSON ¶
func (arr *RawUint64List) MarshalJSON() ([]byte, error)
func (*RawUint64List) Pop ¶
func (arr *RawUint64List) Pop() uint64
func (*RawUint64List) Range ¶
func (arr *RawUint64List) Range(fn func(index int, value uint64, length int) bool)
func (*RawUint64List) Set ¶
func (arr *RawUint64List) Set(index int, v uint64)
func (*RawUint64List) SetReusableHashBuffer ¶
func (arr *RawUint64List) SetReusableHashBuffer(buf []byte)
func (*RawUint64List) Static ¶
func (arr *RawUint64List) Static() bool
func (*RawUint64List) UnmarshalJSON ¶
func (arr *RawUint64List) UnmarshalJSON(data []byte) error
type SyncCommittee ¶
type SyncCommittee [syncCommitteeSize]byte
func NewSyncCommitteeFromParameters ¶
func NewSyncCommitteeFromParameters( committee []libcommon.Bytes48, aggregatePublicKey libcommon.Bytes48, ) *SyncCommittee
func (*SyncCommittee) AggregatePublicKey ¶
func (s *SyncCommittee) AggregatePublicKey() (out libcommon.Bytes48)
func (*SyncCommittee) Clone ¶
func (s *SyncCommittee) Clone() clonable.Clonable
func (*SyncCommittee) Copy ¶
func (s *SyncCommittee) Copy() *SyncCommittee
func (*SyncCommittee) EncodingSizeSSZ ¶
func (s *SyncCommittee) EncodingSizeSSZ() int
func (*SyncCommittee) Equal ¶
func (s *SyncCommittee) Equal(o *SyncCommittee) bool
func (*SyncCommittee) GetCommittee ¶
func (s *SyncCommittee) GetCommittee() []libcommon.Bytes48
func (*SyncCommittee) HashSSZ ¶
func (s *SyncCommittee) HashSSZ() ([32]byte, error)
func (*SyncCommittee) MarshalJSON ¶
func (s *SyncCommittee) MarshalJSON() ([]byte, error)
func (*SyncCommittee) SetAggregatePublicKey ¶
func (s *SyncCommittee) SetAggregatePublicKey(k libcommon.Bytes48)
func (*SyncCommittee) SetCommittee ¶
func (s *SyncCommittee) SetCommittee(committee []libcommon.Bytes48)
func (*SyncCommittee) Static ¶
func (s *SyncCommittee) Static() bool
func (*SyncCommittee) UnmarshalJSON ¶
func (s *SyncCommittee) UnmarshalJSON(input []byte) error
type TransactionsSSZ ¶
type TransactionsSSZ struct {
// contains filtered or unexported fields
}
func NewTransactionsSSZFromTransactions ¶
func NewTransactionsSSZFromTransactions(txs [][]byte) *TransactionsSSZ
func (*TransactionsSSZ) Clone ¶
func (*TransactionsSSZ) Clone() clonable.Clonable
func (*TransactionsSSZ) EncodeSSZ ¶
func (t *TransactionsSSZ) EncodeSSZ(buf []byte) (dst []byte, err error)
func (*TransactionsSSZ) EncodingSizeSSZ ¶
func (t *TransactionsSSZ) EncodingSizeSSZ() (size int)
func (*TransactionsSSZ) ForEach ¶
func (t *TransactionsSSZ) ForEach(fn func(tx []byte, idx int, total int) bool)
func (*TransactionsSSZ) HashSSZ ¶
func (t *TransactionsSSZ) HashSSZ() ([32]byte, error)
func (TransactionsSSZ) MarshalJSON ¶
func (t TransactionsSSZ) MarshalJSON() ([]byte, error)
func (*TransactionsSSZ) Static ¶
func (*TransactionsSSZ) Static() bool
func (*TransactionsSSZ) UnderlyngReference ¶
func (t *TransactionsSSZ) UnderlyngReference() [][]byte
func (*TransactionsSSZ) UnmarshalJSON ¶
func (t *TransactionsSSZ) UnmarshalJSON(buf []byte) error
type Uint64ListSSZ ¶
type Uint64ListSSZ interface { IterableSSZ[uint64] json.Marshaler json.Unmarshaler }
func NewUint64ListSSZ ¶
func NewUint64ListSSZ(limit int) Uint64ListSSZ
func NewUint64ListSSZFromSlice ¶
func NewUint64ListSSZFromSlice(limit int, slice []uint64) Uint64ListSSZ
type Uint64VectorSSZ ¶
type Uint64VectorSSZ interface { IterableSSZ[uint64] json.Marshaler json.Unmarshaler }
func NewUint64VectorSSZ ¶
func NewUint64VectorSSZ(size int) Uint64VectorSSZ
type Validator ¶
type Validator []byte
The Validator type represents an Ethereum 2.0 validator. It is stored as a flat buffer, which is a serialized representation of the struct. A flat buffer enables efficient read and write operations, as well as memory storage, without the need for serialization or deserialization.
func NewValidator ¶
func NewValidator() Validator
func NewValidatorFromParameters ¶
func NewValidatorFromParameters( PublicKey [48]byte, WithdrawalCredentials [32]byte, EffectiveBalance uint64, Slashed bool, ActivationEligibilityEpoch uint64, ActivationEpoch uint64, ExitEpoch uint64, WithdrawableEpoch uint64, ) Validator
NewValidatorFromParameters creates a new Validator object from the provided parameters. It is represented as a flat buffer.
func (Validator) ActivationEligibilityEpoch ¶
func (Validator) ActivationEpoch ¶
func (Validator) CopyHashBufferTo ¶
func (Validator) EffectiveBalance ¶
func (Validator) EncodingSizeSSZ ¶
func (Validator) IsSlashable ¶
func (Validator) MarshalJSON ¶
func (Validator) PublicKeyBytes ¶
func (Validator) SetActivationEligibilityEpoch ¶
func (Validator) SetActivationEpoch ¶
func (Validator) SetEffectiveBalance ¶
func (Validator) SetEffectiveBalanceFromBytes ¶
func (Validator) SetExitEpoch ¶
func (Validator) SetPublicKey ¶
func (Validator) SetSlashed ¶
func (Validator) SetWithdrawableEpoch ¶
func (Validator) SetWithdrawalCredentials ¶
func (*Validator) UnmarshalJSON ¶
func (Validator) WithdrawableEpoch ¶
func (Validator) WithdrawalCredentials ¶
type ValidatorSet ¶
type ValidatorSet struct {
// contains filtered or unexported fields
}
func NewValidatorSet ¶
func NewValidatorSet(c int) *ValidatorSet
func NewValidatorSetWithLength ¶
func NewValidatorSetWithLength(c int, l int) *ValidatorSet
func (*ValidatorSet) Append ¶
func (v *ValidatorSet) Append(val Validator)
func (*ValidatorSet) Bytes ¶
func (v *ValidatorSet) Bytes() []byte
func (*ValidatorSet) Cap ¶
func (v *ValidatorSet) Cap() int
func (*ValidatorSet) Clear ¶
func (v *ValidatorSet) Clear()
func (*ValidatorSet) Clone ¶
func (v *ValidatorSet) Clone() clonable.Clonable
func (*ValidatorSet) CopyTo ¶
func (v *ValidatorSet) CopyTo(t *ValidatorSet)
func (*ValidatorSet) EncodingSizeSSZ ¶
func (v *ValidatorSet) EncodingSizeSSZ() int
func (*ValidatorSet) Get ¶
func (v *ValidatorSet) Get(idx int) Validator
func (*ValidatorSet) HashSSZ ¶
func (v *ValidatorSet) HashSSZ() ([32]byte, error)
func (*ValidatorSet) IsCurrentMatchingHeadAttester ¶
func (v *ValidatorSet) IsCurrentMatchingHeadAttester(idx int) bool
func (*ValidatorSet) IsCurrentMatchingSourceAttester ¶
func (v *ValidatorSet) IsCurrentMatchingSourceAttester(idx int) bool
func (*ValidatorSet) IsCurrentMatchingTargetAttester ¶
func (v *ValidatorSet) IsCurrentMatchingTargetAttester(idx int) bool
func (*ValidatorSet) IsPreviousMatchingHeadAttester ¶
func (v *ValidatorSet) IsPreviousMatchingHeadAttester(idx int) bool
func (*ValidatorSet) IsPreviousMatchingSourceAttester ¶
func (v *ValidatorSet) IsPreviousMatchingSourceAttester(idx int) bool
func (*ValidatorSet) IsPreviousMatchingTargetAttester ¶
func (v *ValidatorSet) IsPreviousMatchingTargetAttester(idx int) bool
func (*ValidatorSet) Length ¶
func (v *ValidatorSet) Length() int
func (*ValidatorSet) MarshalJSON ¶
func (v *ValidatorSet) MarshalJSON() ([]byte, error)
func (*ValidatorSet) MinCurrentInclusionDelayAttestation ¶
func (v *ValidatorSet) MinCurrentInclusionDelayAttestation(idx int) *PendingAttestation
func (*ValidatorSet) MinPreviousInclusionDelayAttestation ¶
func (v *ValidatorSet) MinPreviousInclusionDelayAttestation(idx int) *PendingAttestation
func (*ValidatorSet) Pop ¶
func (v *ValidatorSet) Pop() Validator
func (*ValidatorSet) Set ¶
func (v *ValidatorSet) Set(idx int, val Validator)
func (*ValidatorSet) SetActivationEligibilityEpochForValidatorAtIndex ¶
func (v *ValidatorSet) SetActivationEligibilityEpochForValidatorAtIndex(index int, epoch uint64)
func (*ValidatorSet) SetActivationEpochForValidatorAtIndex ¶
func (v *ValidatorSet) SetActivationEpochForValidatorAtIndex(index int, epoch uint64)
func (*ValidatorSet) SetEffectiveBalanceForValidatorAtIndex ¶
func (v *ValidatorSet) SetEffectiveBalanceForValidatorAtIndex(index int, balance uint64)
func (*ValidatorSet) SetExitEpochForValidatorAtIndex ¶
func (v *ValidatorSet) SetExitEpochForValidatorAtIndex(index int, epoch uint64)
func (*ValidatorSet) SetIsCurrentMatchingHeadAttester ¶
func (v *ValidatorSet) SetIsCurrentMatchingHeadAttester(idx int, val bool)
func (*ValidatorSet) SetIsCurrentMatchingSourceAttester ¶
func (v *ValidatorSet) SetIsCurrentMatchingSourceAttester(idx int, val bool)
func (*ValidatorSet) SetIsCurrentMatchingTargetAttester ¶
func (v *ValidatorSet) SetIsCurrentMatchingTargetAttester(idx int, val bool)
func (*ValidatorSet) SetIsPreviousMatchingHeadAttester ¶
func (v *ValidatorSet) SetIsPreviousMatchingHeadAttester(idx int, val bool)
func (*ValidatorSet) SetIsPreviousMatchingSourceAttester ¶
func (v *ValidatorSet) SetIsPreviousMatchingSourceAttester(idx int, val bool)
func (*ValidatorSet) SetIsPreviousMatchingTargetAttester ¶
func (v *ValidatorSet) SetIsPreviousMatchingTargetAttester(idx int, val bool)
func (*ValidatorSet) SetMinCurrentInclusionDelayAttestation ¶
func (v *ValidatorSet) SetMinCurrentInclusionDelayAttestation(idx int, val *PendingAttestation)
func (*ValidatorSet) SetMinPreviousInclusionDelayAttestation ¶
func (v *ValidatorSet) SetMinPreviousInclusionDelayAttestation(idx int, val *PendingAttestation)
func (*ValidatorSet) SetValidatorSlashed ¶
func (v *ValidatorSet) SetValidatorSlashed(index int, slashed bool)
func (*ValidatorSet) SetWithdrawableEpochForValidatorAtIndex ¶
func (v *ValidatorSet) SetWithdrawableEpochForValidatorAtIndex(index int, epoch uint64)
func (*ValidatorSet) SetWithdrawalCredentialForValidatorAtIndex ¶
func (v *ValidatorSet) SetWithdrawalCredentialForValidatorAtIndex(index int, creds libcommon.Hash)
func (*ValidatorSet) Static ¶
func (*ValidatorSet) Static() bool
func (*ValidatorSet) UnmarshalJSON ¶
func (v *ValidatorSet) UnmarshalJSON(data []byte) error
Source Files ¶
- attestation.go
- attestation_data.go
- bitlist.go
- checkpoint.go
- extra_data.go
- hash_list.go
- hash_vector.go
- hashutil.go
- interfaces.go
- list_ssz.go
- pending_attestation.go
- ranger.go
- sync_committee.go
- transactions.go
- uint64_list.go
- uint64_raw_list.go
- uint64_vector.go
- uint64slice_byte.go
- validator.go
- validator_set.go