Documentation ¶
Index ¶
- Constants
- func EncodeAttestationDataForStorage(data *AttestationData, defaultData *AttestationData) []byte
- func EncodeAttestationsForStorage(attestations []*Attestation) []byte
- func IsSlashableAttestationData(d1, d2 *AttestationData) bool
- type AggregateAndProof
- type Attestation
- func (*Attestation) Clone() clonable.Clonable
- func (a *Attestation) DecodeSSZ(buf []byte) error
- func (a *Attestation) DecodeSSZWithVersion(buf []byte, _ int) error
- func (a *Attestation) EncodeSSZ(buf []byte) (dst []byte, err error)
- func (a *Attestation) EncodingSizeSSZ() int
- func (a *Attestation) HashSSZ() ([32]byte, error)
- type AttestationData
- type AttesterSlashing
- func (*AttesterSlashing) Clone() clonable.Clonable
- func (a *AttesterSlashing) DecodeSSZ(buf []byte) error
- func (a *AttesterSlashing) DecodeSSZWithVersion(buf []byte, _ int) error
- func (a *AttesterSlashing) EncodeSSZ(dst []byte) ([]byte, error)
- func (a *AttesterSlashing) EncodingSizeSSZ() int
- func (a *AttesterSlashing) HashSSZ() ([32]byte, error)
- type BLSToExecutionChange
- type BeaconBlock
- func (*BeaconBlock) Clone() clonable.Clonable
- func (*BeaconBlock) DecodeSSZ(buf []byte) error
- func (b *BeaconBlock) DecodeSSZWithVersion(buf []byte, version int) error
- func (b *BeaconBlock) EncodeSSZ(buf []byte) (dst []byte, err error)
- func (b *BeaconBlock) EncodingSizeSSZ() int
- func (b *BeaconBlock) HashSSZ() ([32]byte, error)
- func (b *BeaconBlock) Version() clparams.StateVersion
- type BeaconBlockForStorage
- type BeaconBlockHeader
- type BeaconBlocksByRangeRequest
- func (*BeaconBlocksByRangeRequest) Clone() clonable.Clonable
- func (b *BeaconBlocksByRangeRequest) DecodeSSZ(buf []byte) error
- func (b *BeaconBlocksByRangeRequest) DecodeSSZWithVersion(buf []byte, _ int) error
- func (b *BeaconBlocksByRangeRequest) EncodeSSZ(buf []byte) ([]byte, error)
- func (b *BeaconBlocksByRangeRequest) EncodingSizeSSZ() int
- type BeaconBlocksByRootRequest
- func (*BeaconBlocksByRootRequest) Clone() clonable.Clonable
- func (r *BeaconBlocksByRootRequest) DecodeSSZ(buf []byte) error
- func (r *BeaconBlocksByRootRequest) DecodeSSZWithVersion(buf []byte, _ int) error
- func (r *BeaconBlocksByRootRequest) EncodeSSZ(dst []byte) ([]byte, error)
- func (r *BeaconBlocksByRootRequest) EncodingSizeSSZ() int
- func (r *BeaconBlocksByRootRequest) HashSSZ() ([32]byte, error)
- type BeaconBody
- func (*BeaconBody) Clone() clonable.Clonable
- func (b *BeaconBody) DecodeSSZ(buf []byte) error
- func (b *BeaconBody) DecodeSSZWithVersion(buf []byte, version int) error
- func (b *BeaconBody) EncodeSSZ(dst []byte) ([]byte, error)
- func (b *BeaconBody) EncodingSizeSSZ() (size int)
- func (b *BeaconBody) HashSSZ() ([32]byte, error)
- type Checkpoint
- func (*Checkpoint) Clone() clonable.Clonable
- func (c *Checkpoint) Copy() *Checkpoint
- func (c *Checkpoint) DecodeSSZ(buf []byte) error
- func (c *Checkpoint) DecodeSSZWithVersion(buf []byte, _ int) error
- func (c *Checkpoint) EncodeSSZ(buf []byte) ([]byte, error)
- func (c *Checkpoint) EncodingSizeSSZ() int
- func (c *Checkpoint) Equal(other *Checkpoint) bool
- func (c *Checkpoint) HashSSZ() ([32]byte, error)
- type Deposit
- type DepositData
- func (*DepositData) Clone() clonable.Clonable
- func (d *DepositData) DecodeSSZ(buf []byte) error
- func (d *DepositData) DecodeSSZWithVersion(buf []byte, _ int) error
- func (d *DepositData) EncodeSSZ(dst []byte) ([]byte, error)
- func (d *DepositData) EncodingSizeSSZ() int
- func (d *DepositData) HashSSZ() ([32]byte, error)
- func (d *DepositData) MessageHash() ([32]byte, error)
- type Eth1Block
- func (b *Eth1Block) Body() *types.RawBody
- func (*Eth1Block) Clone() clonable.Clonable
- func (b *Eth1Block) DecodeSSZ(buf []byte) error
- func (b *Eth1Block) DecodeSSZWithVersion(buf []byte, version int) error
- func (b *Eth1Block) EncodeSSZ(dst []byte) ([]byte, error)
- func (b *Eth1Block) EncodingSizeSSZ() (size int)
- func (b *Eth1Block) HashSSZ(version clparams.StateVersion) ([32]byte, error)
- func (b *Eth1Block) PayloadHeader() (*Eth1Header, error)
- func (b *Eth1Block) RlpHeader() (*types.Header, error)
- type Eth1Data
- func (*Eth1Data) Clone() clonable.Clonable
- func (e *Eth1Data) Copy() *Eth1Data
- func (e *Eth1Data) DecodeSSZ(buf []byte) error
- func (e *Eth1Data) DecodeSSZWithVersion(buf []byte, _ int) error
- func (e *Eth1Data) EncodeSSZ(buf []byte) (dst []byte, err error)
- func (e *Eth1Data) EncodingSizeSSZ() int
- func (e *Eth1Data) Equal(b *Eth1Data) bool
- func (e *Eth1Data) HashSSZ() ([32]byte, error)
- type Eth1Header
- func (e *Eth1Header) Capella()
- func (e *Eth1Header) Copy() *Eth1Header
- func (h *Eth1Header) DecodeSSZWithVersion(buf []byte, version int) error
- func (h *Eth1Header) EncodeSSZ(dst []byte) (buf []byte, err error)
- func (h *Eth1Header) EncodingSizeSSZ() int
- func (h *Eth1Header) HashSSZ() ([32]byte, error)
- func (e *Eth1Header) IsZero() bool
- type Fork
- type HistoricalSummary
- func (*HistoricalSummary) Clone() clonable.Clonable
- func (h *HistoricalSummary) DecodeSSZ(buf []byte) error
- func (h *HistoricalSummary) DecodeSSZWithVersion(buf []byte, _ int) error
- func (h *HistoricalSummary) EncodeSSZ(buf []byte) ([]byte, error)
- func (*HistoricalSummary) EncodingSizeSSZ() int
- func (h *HistoricalSummary) HashSSZ() ([32]byte, error)
- type IndexedAttestation
- type JustificationBits
- type LightClientBootstrap
- func (*LightClientBootstrap) Clone() clonable.Clonable
- func (l *LightClientBootstrap) DecodeSSZ(buf []byte) error
- func (l *LightClientBootstrap) DecodeSSZWithVersion(buf []byte, version int) error
- func (l *LightClientBootstrap) EncodeSSZ(dst []byte) ([]byte, error)
- func (l *LightClientBootstrap) EncodingSizeSSZ() (size int)
- func (l *LightClientBootstrap) WithVersion(v clparams.StateVersion) *LightClientBootstrap
- type LightClientFinalityUpdate
- func (*LightClientFinalityUpdate) Clone() clonable.Clonable
- func (l *LightClientFinalityUpdate) DecodeSSZ(buf []byte) error
- func (l *LightClientFinalityUpdate) DecodeSSZWithVersion(buf []byte, version int) error
- func (l *LightClientFinalityUpdate) EncodeSSZ(buf []byte) ([]byte, error)
- func (l *LightClientFinalityUpdate) EncodingSizeSSZ() int
- func (l *LightClientFinalityUpdate) WithVersion(v clparams.StateVersion) *LightClientFinalityUpdate
- type LightClientHeader
- func (l *LightClientHeader) DecodeSSZ([]byte) error
- func (l *LightClientHeader) DecodeSSZWithVersion(buf []byte, v int) error
- func (l *LightClientHeader) EncodeSSZ(buf []byte) ([]byte, error)
- func (l *LightClientHeader) EncodingSizeSSZ() int
- func (l *LightClientHeader) WithVersion(v clparams.StateVersion) *LightClientHeader
- type LightClientOptimisticUpdate
- func (*LightClientOptimisticUpdate) Clone() clonable.Clonable
- func (l *LightClientOptimisticUpdate) DecodeSSZ([]byte) error
- func (l *LightClientOptimisticUpdate) DecodeSSZWithVersion(buf []byte, version int) error
- func (l *LightClientOptimisticUpdate) EncodeSSZ(buf []byte) ([]byte, error)
- func (l *LightClientOptimisticUpdate) EncodingSizeSSZ() (size int)
- func (l *LightClientOptimisticUpdate) WithVersion(v clparams.StateVersion) *LightClientOptimisticUpdate
- type LightClientUpdate
- func (*LightClientUpdate) Clone() clonable.Clonable
- func (l *LightClientUpdate) DecodeSSZ(buf []byte) error
- func (l *LightClientUpdate) DecodeSSZWithVersion(buf []byte, version int) error
- func (l *LightClientUpdate) EncodeSSZ(buf []byte) ([]byte, error)
- func (l *LightClientUpdate) EncodingSizeSSZ() int
- func (l *LightClientUpdate) HasNextSyncCommittee() bool
- func (l *LightClientUpdate) HasSyncFinality() bool
- func (l *LightClientUpdate) IsFinalityUpdate() bool
- func (l *LightClientUpdate) WithVersion(v clparams.StateVersion) *LightClientUpdate
- type LightClientUpdatesByRangeRequest
- func (*LightClientUpdatesByRangeRequest) Clone() clonable.Clonable
- func (l *LightClientUpdatesByRangeRequest) DecodeSSZ(buf []byte) error
- func (l *LightClientUpdatesByRangeRequest) DecodeSSZWithVersion(buf []byte, _ int) error
- func (l *LightClientUpdatesByRangeRequest) EncodeSSZ(buf []byte) ([]byte, error)
- func (l *LightClientUpdatesByRangeRequest) EncodingSizeSSZ() int
- type Metadata
- type ParticipationFlags
- type ParticipationFlagsList
- type PendingAttestation
- func (*PendingAttestation) Clone() clonable.Clonable
- func (a *PendingAttestation) DecodeSSZ(buf []byte) error
- func (a *PendingAttestation) DecodeSSZWithVersion(buf []byte, _ int) error
- func (a *PendingAttestation) EncodeSSZ(buf []byte) (dst []byte, err error)
- func (a *PendingAttestation) EncodingSizeSSZ() int
- func (a *PendingAttestation) HashSSZ() ([32]byte, error)
- type Ping
- type ProposerSlashing
- func (*ProposerSlashing) Clone() clonable.Clonable
- func (p *ProposerSlashing) DecodeSSZ(buf []byte) error
- func (p *ProposerSlashing) DecodeSSZWithVersion(buf []byte, _ int) error
- func (p *ProposerSlashing) EncodeSSZ(dst []byte) (buf []byte, err error)
- func (p *ProposerSlashing) EncodingSizeSSZ() int
- func (p *ProposerSlashing) HashSSZ() ([32]byte, error)
- type SignedAggregateAndProof
- func (*SignedAggregateAndProof) Clone() clonable.Clonable
- func (a *SignedAggregateAndProof) DecodeSSZ(buf []byte) error
- func (a *SignedAggregateAndProof) DecodeSSZWithVersion(buf []byte, _ int) error
- func (a *SignedAggregateAndProof) EncodedSSZ(dst []byte) ([]byte, error)
- func (a *SignedAggregateAndProof) EncodingSizeSSZ() int
- type SignedBLSToExecutionChange
- func (*SignedBLSToExecutionChange) Clone() clonable.Clonable
- func (s *SignedBLSToExecutionChange) DecodeSSZ(buf []byte) error
- func (s *SignedBLSToExecutionChange) DecodeSSZWithVersion(buf []byte, _ int) error
- func (s *SignedBLSToExecutionChange) EncodeSSZ(buf []byte) ([]byte, error)
- func (s *SignedBLSToExecutionChange) EncodingSizeSSZ() int
- func (s *SignedBLSToExecutionChange) HashSSZ() ([32]byte, error)
- type SignedBeaconBlock
- func (*SignedBeaconBlock) Clone() clonable.Clonable
- func (b *SignedBeaconBlock) DecodeSSZ(buf []byte) error
- func (b *SignedBeaconBlock) DecodeSSZWithVersion(buf []byte, s int) error
- func (b *SignedBeaconBlock) EncodeForStorage() ([]byte, error)
- func (b *SignedBeaconBlock) EncodeSSZ(buf []byte) ([]byte, error)
- func (b *SignedBeaconBlock) EncodingSizeSSZ() int
- func (b *SignedBeaconBlock) HashSSZ() ([32]byte, error)
- func (b *SignedBeaconBlock) Version() clparams.StateVersion
- type SignedBeaconBlockHeader
- type SignedVoluntaryExit
- func (*SignedVoluntaryExit) Clone() clonable.Clonable
- func (e *SignedVoluntaryExit) DecodeSSZ(buf []byte) error
- func (e *SignedVoluntaryExit) DecodeSSZWithVersion(buf []byte, _ int) error
- func (e *SignedVoluntaryExit) EncodeSSZ(dst []byte) []byte
- func (e *SignedVoluntaryExit) EncodingSizeSSZ() int
- func (e *SignedVoluntaryExit) HashSSZ() ([32]byte, error)
- type SingleRoot
- type Status
- type SyncAggregate
- func (*SyncAggregate) Clone() clonable.Clonable
- func (agg *SyncAggregate) DecodeSSZ(buf []byte) error
- func (agg *SyncAggregate) DecodeSSZWithVersion(buf []byte, _ int) error
- func (agg *SyncAggregate) EncodeSSZ(buf []byte) []byte
- func (agg *SyncAggregate) EncodingSizeSSZ() int
- func (agg *SyncAggregate) HashSSZ() ([32]byte, error)
- func (agg *SyncAggregate) Sum() int
- type SyncCommittee
- func (s *SyncCommittee) Copy() *SyncCommittee
- func (s *SyncCommittee) DecodeSSZ(buf []byte) error
- func (s *SyncCommittee) EncodeSSZ(buf []byte) ([]byte, error)
- func (s *SyncCommittee) EncodingSizeSSZ() (size int)
- func (s *SyncCommittee) Equal(s2 *SyncCommittee) bool
- func (s *SyncCommittee) HashSSZ() ([32]byte, error)
- type Validator
- func (v *Validator) Active(epoch uint64) bool
- func (*Validator) Clone() clonable.Clonable
- func (v *Validator) Copy() *Validator
- func (v *Validator) DecodeSSZ(buf []byte) error
- func (v *Validator) DecodeSSZWithVersion(buf []byte, _ int) error
- func (v *Validator) DutiesAttested() (attested, missed uint64)
- func (v *Validator) EncodeSSZ(dst []byte) ([]byte, error)
- func (v *Validator) EncodingSizeSSZ() int
- func (v *Validator) HashSSZ() ([32]byte, error)
- func (v *Validator) IsSlashable(epoch uint64) bool
- type VoluntaryExit
Constants ¶
const ( MaxAttesterSlashings = 2 MaxProposerSlashings = 16 MaxAttestations = 128 MaxDeposits = 16 MaxVoluntaryExits = 16 MaxExecutionChanges = 16 )
const ( SyncCommitteeBranchLength = 5 FinalityBranchLength = 6 ExecutionBranchLength = 4 )
const ( DepositProofLength = 33 SyncCommitteeSize = 512 )
const JustificationBitsLength = 4
Variables ¶
This section is empty.
Functions ¶
func EncodeAttestationDataForStorage ¶
func EncodeAttestationDataForStorage(data *AttestationData, defaultData *AttestationData) []byte
EncodeAttestationsDataForStorage encodes attestation data and compress everything by defaultData.
func EncodeAttestationsForStorage ¶
func EncodeAttestationsForStorage(attestations []*Attestation) []byte
func IsSlashableAttestationData ¶
func IsSlashableAttestationData(d1, d2 *AttestationData) bool
Types ¶
type AggregateAndProof ¶
type AggregateAndProof struct { AggregatorIndex uint64 Aggregate *Attestation SelectionProof [96]byte }
* AggregateAndProof contains the index of the aggregator, the attestation * to be aggregated and the BLS signature of the attestation.
func (*AggregateAndProof) DecodeSSZ ¶
func (a *AggregateAndProof) DecodeSSZ(buf []byte) error
func (*AggregateAndProof) EncodeSSZ ¶
func (a *AggregateAndProof) EncodeSSZ(dst []byte) ([]byte, error)
func (*AggregateAndProof) EncodingSizeSSZ ¶
func (a *AggregateAndProof) EncodingSizeSSZ() int
type Attestation ¶
type Attestation struct { AggregationBits []byte `ssz-max:"2048" ssz:"bitlist"` Data *AttestationData Signature [96]byte `ssz-size:"96"` }
Full signed attestation
func DecodeAttestationsForStorage ¶
func DecodeAttestationsForStorage(buf []byte) ([]*Attestation, error)
func (*Attestation) Clone ¶
func (*Attestation) Clone() clonable.Clonable
func (*Attestation) DecodeSSZ ¶
func (a *Attestation) DecodeSSZ(buf []byte) error
DecodeSSZ ssz unmarshals the Attestation object
func (*Attestation) DecodeSSZWithVersion ¶
func (a *Attestation) DecodeSSZWithVersion(buf []byte, _ int) error
func (*Attestation) EncodeSSZ ¶
func (a *Attestation) EncodeSSZ(buf []byte) (dst []byte, err error)
MarshalSSZTo ssz marshals the Attestation object to a target array
func (*Attestation) EncodingSizeSSZ ¶
func (a *Attestation) EncodingSizeSSZ() int
EncodingSizeSSZ returns the ssz encoded size in bytes for the Attestation object
func (*Attestation) HashSSZ ¶
func (a *Attestation) HashSSZ() ([32]byte, error)
HashSSZ ssz hashes the Attestation object
type AttestationData ¶
type AttestationData struct { Slot uint64 Index uint64 BeaconBlockHash libcommon.Hash Source *Checkpoint Target *Checkpoint }
AttestantionData contains information about attestantion, including finalized/attested checkpoints.
func DecodeAttestationDataForStorage ¶
func DecodeAttestationDataForStorage(buf []byte, defaultData *AttestationData) (n int, data *AttestationData)
DecodeAttestationDataForStorage decodes attestation data and decompress everything by defaultData.
func (*AttestationData) DecodeSSZ ¶
func (a *AttestationData) DecodeSSZ(buf []byte) error
DecodeSSZ ssz unmarshals the AttestationData object
func (*AttestationData) EncodeSSZ ¶
func (a *AttestationData) EncodeSSZ(dst []byte) ([]byte, error)
EncodeSSZ ssz marshals the AttestationData object
func (*AttestationData) EncodingSizeSSZ ¶
func (a *AttestationData) EncodingSizeSSZ() int
EncodingSizeSSZ returns the ssz encoded size in bytes for the AttestationData object
func (*AttestationData) Equal ¶
func (a *AttestationData) Equal(other *AttestationData) bool
func (*AttestationData) HashSSZ ¶
func (a *AttestationData) HashSSZ() ([32]byte, error)
HashSSZ ssz hashes the AttestationData object
type AttesterSlashing ¶
type AttesterSlashing struct { Attestation_1 *IndexedAttestation Attestation_2 *IndexedAttestation }
func (*AttesterSlashing) Clone ¶
func (*AttesterSlashing) Clone() clonable.Clonable
func (*AttesterSlashing) DecodeSSZ ¶
func (a *AttesterSlashing) DecodeSSZ(buf []byte) error
func (*AttesterSlashing) DecodeSSZWithVersion ¶
func (a *AttesterSlashing) DecodeSSZWithVersion(buf []byte, _ int) error
func (*AttesterSlashing) EncodeSSZ ¶
func (a *AttesterSlashing) EncodeSSZ(dst []byte) ([]byte, error)
func (*AttesterSlashing) EncodingSizeSSZ ¶
func (a *AttesterSlashing) EncodingSizeSSZ() int
func (*AttesterSlashing) HashSSZ ¶
func (a *AttesterSlashing) HashSSZ() ([32]byte, error)
type BLSToExecutionChange ¶
Change to EL engine
func (*BLSToExecutionChange) DecodeSSZ ¶
func (b *BLSToExecutionChange) DecodeSSZ(buf []byte) error
func (*BLSToExecutionChange) EncodeSSZ ¶
func (b *BLSToExecutionChange) EncodeSSZ(buf []byte) ([]byte, error)
func (*BLSToExecutionChange) EncodingSizeSSZ ¶
func (*BLSToExecutionChange) EncodingSizeSSZ() int
func (*BLSToExecutionChange) HashSSZ ¶
func (b *BLSToExecutionChange) HashSSZ() ([32]byte, error)
type BeaconBlock ¶
type BeaconBlock struct { Slot uint64 ProposerIndex uint64 ParentRoot libcommon.Hash StateRoot libcommon.Hash Body *BeaconBody }
func (*BeaconBlock) Clone ¶
func (*BeaconBlock) Clone() clonable.Clonable
func (*BeaconBlock) DecodeSSZ ¶
func (*BeaconBlock) DecodeSSZ(buf []byte) error
func (*BeaconBlock) DecodeSSZWithVersion ¶
func (b *BeaconBlock) DecodeSSZWithVersion(buf []byte, version int) error
func (*BeaconBlock) EncodingSizeSSZ ¶
func (b *BeaconBlock) EncodingSizeSSZ() int
func (*BeaconBlock) HashSSZ ¶
func (b *BeaconBlock) HashSSZ() ([32]byte, error)
func (*BeaconBlock) Version ¶
func (b *BeaconBlock) Version() clparams.StateVersion
Version returns beacon block version.
type BeaconBlockForStorage ¶
type BeaconBlockForStorage struct { // Non-body fields Signature [96]byte Slot uint64 ProposerIndex uint64 ParentRoot libcommon.Hash StateRoot libcommon.Hash // Body fields RandaoReveal [96]byte Eth1Data *Eth1Data Graffiti []byte ProposerSlashings []*ProposerSlashing AttesterSlashings []*AttesterSlashing Deposits []*Deposit VoluntaryExits []*SignedVoluntaryExit AddressChanges []*SignedBLSToExecutionChange SyncAggregate *SyncAggregate // Metadatas Eth1Number uint64 Eth1BlockHash libcommon.Hash Eth2BlockRoot libcommon.Hash // Version type Version uint8 }
* Block body for Consensus Layer to be stored internally (payload and attestations are stored separatedly).
type BeaconBlockHeader ¶
type BeaconBlockHeader struct { Slot uint64 ProposerIndex uint64 ParentRoot libcommon.Hash Root libcommon.Hash BodyRoot libcommon.Hash }
* BeaconBlockHeader is the message we validate in the lightclient. * It contains the hash of the block body, and state root data.
func (*BeaconBlockHeader) Copy ¶
func (b *BeaconBlockHeader) Copy() *BeaconBlockHeader
func (*BeaconBlockHeader) DecodeSSZ ¶
func (b *BeaconBlockHeader) DecodeSSZ(buf []byte) error
func (*BeaconBlockHeader) EncodeSSZ ¶
func (b *BeaconBlockHeader) EncodeSSZ(dst []byte) ([]byte, error)
func (*BeaconBlockHeader) EncodingSizeSSZ ¶
func (b *BeaconBlockHeader) EncodingSizeSSZ() int
func (*BeaconBlockHeader) HashSSZ ¶
func (b *BeaconBlockHeader) HashSSZ() ([32]byte, error)
type BeaconBlocksByRangeRequest ¶
type BeaconBlocksByRangeRequest struct { StartSlot uint64 Count uint64 Step uint64 // Deprecated, must be set to 1 }
* BeaconBlocksByRangeRequest is the request for getting a range of blocks.
func (*BeaconBlocksByRangeRequest) Clone ¶
func (*BeaconBlocksByRangeRequest) Clone() clonable.Clonable
func (*BeaconBlocksByRangeRequest) DecodeSSZ ¶
func (b *BeaconBlocksByRangeRequest) DecodeSSZ(buf []byte) error
func (*BeaconBlocksByRangeRequest) DecodeSSZWithVersion ¶
func (b *BeaconBlocksByRangeRequest) DecodeSSZWithVersion(buf []byte, _ int) error
func (*BeaconBlocksByRangeRequest) EncodeSSZ ¶
func (b *BeaconBlocksByRangeRequest) EncodeSSZ(buf []byte) ([]byte, error)
func (*BeaconBlocksByRangeRequest) EncodingSizeSSZ ¶
func (b *BeaconBlocksByRangeRequest) EncodingSizeSSZ() int
type BeaconBlocksByRootRequest ¶
type BeaconBlocksByRootRequest [][rootLength]byte
BeaconBlocksByRootRequest specifies the blocks by root request type.
func (*BeaconBlocksByRootRequest) Clone ¶
func (*BeaconBlocksByRootRequest) Clone() clonable.Clonable
func (*BeaconBlocksByRootRequest) DecodeSSZ ¶
func (r *BeaconBlocksByRootRequest) DecodeSSZ(buf []byte) error
DecodeSSZ unmarshals the provided bytes buffer into the block by roots request object.
func (*BeaconBlocksByRootRequest) DecodeSSZWithVersion ¶
func (r *BeaconBlocksByRootRequest) DecodeSSZWithVersion(buf []byte, _ int) error
func (*BeaconBlocksByRootRequest) EncodeSSZ ¶
func (r *BeaconBlocksByRootRequest) EncodeSSZ(dst []byte) ([]byte, error)
EncodeSSZ Marshals the block by roots request type into the serialized object.
func (*BeaconBlocksByRootRequest) EncodingSizeSSZ ¶
func (r *BeaconBlocksByRootRequest) EncodingSizeSSZ() int
EncodingSizeSSZ returns the size of the serialized representation.
func (*BeaconBlocksByRootRequest) HashSSZ ¶
func (r *BeaconBlocksByRootRequest) HashSSZ() ([32]byte, error)
Just to satisfy the ObjectSSZ interface.
type BeaconBody ¶
type BeaconBody struct { // A byte array used for randomness in the beacon chain RandaoReveal [96]byte // Data related to the Ethereum 1.0 chain Eth1Data *Eth1Data // A byte array used to customize validators' behavior Graffiti []byte // A list of slashing events for validators who included invalid blocks in the chain ProposerSlashings []*ProposerSlashing // A list of slashing events for validators who included invalid attestations in the chain AttesterSlashings []*AttesterSlashing // A list of attestations included in the block Attestations []*Attestation // A list of deposits made to the Ethereum 1.0 chain Deposits []*Deposit // A list of validators who have voluntarily exited the beacon chain VoluntaryExits []*SignedVoluntaryExit // A summary of the current state of the beacon chain SyncAggregate *SyncAggregate // Data related to crosslink records and executing operations on the Ethereum 2.0 chain ExecutionPayload *Eth1Block // Withdrawals Diffs for Execution Layer ExecutionChanges []*SignedBLSToExecutionChange // The version of the beacon chain Version clparams.StateVersion }
func (*BeaconBody) Clone ¶
func (*BeaconBody) Clone() clonable.Clonable
func (*BeaconBody) DecodeSSZ ¶
func (b *BeaconBody) DecodeSSZ(buf []byte) error
func (*BeaconBody) DecodeSSZWithVersion ¶
func (b *BeaconBody) DecodeSSZWithVersion(buf []byte, version int) error
func (*BeaconBody) EncodingSizeSSZ ¶
func (b *BeaconBody) EncodingSizeSSZ() (size int)
func (*BeaconBody) HashSSZ ¶
func (b *BeaconBody) HashSSZ() ([32]byte, error)
type Checkpoint ¶
func (*Checkpoint) Clone ¶
func (*Checkpoint) Clone() clonable.Clonable
func (*Checkpoint) Copy ¶
func (c *Checkpoint) Copy() *Checkpoint
func (*Checkpoint) DecodeSSZ ¶
func (c *Checkpoint) DecodeSSZ(buf []byte) error
func (*Checkpoint) DecodeSSZWithVersion ¶
func (c *Checkpoint) DecodeSSZWithVersion(buf []byte, _ int) error
func (*Checkpoint) EncodingSizeSSZ ¶
func (c *Checkpoint) EncodingSizeSSZ() int
func (*Checkpoint) Equal ¶
func (c *Checkpoint) Equal(other *Checkpoint) bool
func (*Checkpoint) HashSSZ ¶
func (c *Checkpoint) HashSSZ() ([32]byte, error)
type Deposit ¶
type Deposit struct { // Merkle proof is used for deposits Proof []libcommon.Hash // 33 X 32 size. Data *DepositData }
func (*Deposit) DecodeSSZWithVersion ¶
func (*Deposit) EncodingSizeSSZ ¶
type DepositData ¶
type DepositData struct { PubKey [48]byte WithdrawalCredentials [32]byte // 32 byte Amount uint64 Signature [96]byte Root libcommon.Hash // Ignored if not for hashing }
func (*DepositData) Clone ¶
func (*DepositData) Clone() clonable.Clonable
func (*DepositData) DecodeSSZ ¶
func (d *DepositData) DecodeSSZ(buf []byte) error
func (*DepositData) DecodeSSZWithVersion ¶
func (d *DepositData) DecodeSSZWithVersion(buf []byte, _ int) error
func (*DepositData) EncodingSizeSSZ ¶
func (d *DepositData) EncodingSizeSSZ() int
func (*DepositData) HashSSZ ¶
func (d *DepositData) HashSSZ() ([32]byte, error)
func (*DepositData) MessageHash ¶
func (d *DepositData) MessageHash() ([32]byte, error)
type Eth1Block ¶
type Eth1Block struct { ParentHash libcommon.Hash FeeRecipient libcommon.Address StateRoot libcommon.Hash ReceiptsRoot libcommon.Hash LogsBloom types.Bloom PrevRandao libcommon.Hash BlockNumber uint64 GasLimit uint64 GasUsed uint64 Time uint64 Extra []byte BaseFeePerGas [32]byte // Extra fields BlockHash libcommon.Hash Transactions [][]byte Withdrawals types.Withdrawals // contains filtered or unexported fields }
ETH1Block represents a block structure CL-side.
func NewEth1Block ¶
func NewEth1Block(version clparams.StateVersion) *Eth1Block
NewEth1Block creates a new Eth1Block.
func NewEth1BlockFromHeaderAndBody ¶
NewEth1BlockFromHeaderAndBody with given header/body.
func (*Eth1Block) DecodeSSZWithVersion ¶
DecodeSSZWithVersion decodes the block in SSZ format.
func (*Eth1Block) EncodingSizeSSZ ¶
Return minimum required buffer length to be an acceptable SSZ encoding.
func (*Eth1Block) HashSSZ ¶
func (b *Eth1Block) HashSSZ(version clparams.StateVersion) ([32]byte, error)
HashSSZ calculates the SSZ hash of the Eth1Block's payload header.
func (*Eth1Block) PayloadHeader ¶
func (b *Eth1Block) PayloadHeader() (*Eth1Header, error)
PayloadHeader returns the equivalent ExecutionPayloadHeader object.
type Eth1Data ¶
func (*Eth1Data) DecodeSSZWithVersion ¶
func (*Eth1Data) EncodingSizeSSZ ¶
EncodingSizeSSZ returns the ssz encoded size in bytes for the Eth1Data object
type Eth1Header ¶
type Eth1Header struct { ParentHash libcommon.Hash FeeRecipient libcommon.Address StateRoot libcommon.Hash ReceiptsRoot libcommon.Hash LogsBloom types.Bloom PrevRandao libcommon.Hash BlockNumber uint64 GasLimit uint64 GasUsed uint64 Time uint64 Extra []byte BaseFeePerGas [32]byte // Extra fields BlockHash libcommon.Hash TransactionsRoot libcommon.Hash WithdrawalsRoot libcommon.Hash // contains filtered or unexported fields }
ETH1Header represents the ethereum 1 header structure CL-side.
func NewEth1Header ¶
func NewEth1Header(version clparams.StateVersion) *Eth1Header
NewEth1Header creates new header with given version.
func (*Eth1Header) Capella ¶
func (e *Eth1Header) Capella()
Capella converts the header to capella version.
func (*Eth1Header) Copy ¶
func (e *Eth1Header) Copy() *Eth1Header
func (*Eth1Header) DecodeSSZWithVersion ¶
func (h *Eth1Header) DecodeSSZWithVersion(buf []byte, version int) error
DecodeSSZWithVersion decodes given SSZ slice.
func (*Eth1Header) EncodeSSZ ¶
func (h *Eth1Header) EncodeSSZ(dst []byte) (buf []byte, err error)
EncodeSSZ encodes the header in SSZ format.
func (*Eth1Header) EncodingSizeSSZ ¶
func (h *Eth1Header) EncodingSizeSSZ() int
EncodingSizeSSZ returns the ssz encoded size in bytes for the Header object
func (*Eth1Header) HashSSZ ¶
func (h *Eth1Header) HashSSZ() ([32]byte, error)
HashSSZ encodes the header in SSZ tree format.
func (*Eth1Header) IsZero ¶
func (e *Eth1Header) IsZero() bool
type Fork ¶
Fork data, contains if we were on bellatrix/alteir/phase0 and transition epoch.
func (*Fork) EncodingSizeSSZ ¶
type HistoricalSummary ¶
func (*HistoricalSummary) Clone ¶
func (*HistoricalSummary) Clone() clonable.Clonable
func (*HistoricalSummary) DecodeSSZ ¶
func (h *HistoricalSummary) DecodeSSZ(buf []byte) error
func (*HistoricalSummary) DecodeSSZWithVersion ¶
func (h *HistoricalSummary) DecodeSSZWithVersion(buf []byte, _ int) error
func (*HistoricalSummary) EncodeSSZ ¶
func (h *HistoricalSummary) EncodeSSZ(buf []byte) ([]byte, error)
func (*HistoricalSummary) EncodingSizeSSZ ¶
func (*HistoricalSummary) EncodingSizeSSZ() int
func (*HistoricalSummary) HashSSZ ¶
func (h *HistoricalSummary) HashSSZ() ([32]byte, error)
type IndexedAttestation ¶
type IndexedAttestation struct { AttestingIndices []uint64 Data *AttestationData Signature [96]byte }
* IndexedAttestation are attestantions sets to prove that someone misbehaved.
func (*IndexedAttestation) DecodeSSZ ¶
func (i *IndexedAttestation) DecodeSSZ(buf []byte) error
DecodeSSZ ssz unmarshals the IndexedAttestation object
func (*IndexedAttestation) EncodeSSZ ¶
func (i *IndexedAttestation) EncodeSSZ(buf []byte) (dst []byte, err error)
func (*IndexedAttestation) EncodingSizeSSZ ¶
func (i *IndexedAttestation) EncodingSizeSSZ() int
EncodingSizeSSZ returns the ssz encoded size in bytes for the IndexedAttestation object
func (*IndexedAttestation) HashSSZ ¶
func (i *IndexedAttestation) HashSSZ() ([32]byte, error)
HashSSZ ssz hashes the IndexedAttestation object
type JustificationBits ¶
type JustificationBits [JustificationBitsLength]bool // Bit vector of size 4
func (JustificationBits) Byte ¶
func (j JustificationBits) Byte() (out byte)
func (JustificationBits) CheckRange ¶
func (j JustificationBits) CheckRange(start int, end int) bool
CheckRange checks if bits in certain range are all enabled.
func (JustificationBits) Copy ¶
func (j JustificationBits) Copy() JustificationBits
func (*JustificationBits) FromByte ¶
func (j *JustificationBits) FromByte(b byte)
type LightClientBootstrap ¶
type LightClientBootstrap struct { Header *LightClientHeader CurrentSyncCommittee *SyncCommittee CurrentSyncCommitteeBranch []libcommon.Hash // contains filtered or unexported fields }
LightClientBootstrap is used to bootstrap the lightclient from checkpoint sync.
func (*LightClientBootstrap) Clone ¶
func (*LightClientBootstrap) Clone() clonable.Clonable
func (*LightClientBootstrap) DecodeSSZ ¶
func (l *LightClientBootstrap) DecodeSSZ(buf []byte) error
func (*LightClientBootstrap) DecodeSSZWithVersion ¶
func (l *LightClientBootstrap) DecodeSSZWithVersion(buf []byte, version int) error
DecodeSSZ ssz unmarshals the LightClientBootstrap object
func (*LightClientBootstrap) EncodeSSZ ¶
func (l *LightClientBootstrap) EncodeSSZ(dst []byte) ([]byte, error)
EncodeSSZ ssz marshals the LightClientBootstrap object
func (*LightClientBootstrap) EncodingSizeSSZ ¶
func (l *LightClientBootstrap) EncodingSizeSSZ() (size int)
EncodingSizeSSZ returns the ssz encoded size in bytes for the LightClientBootstrap object
func (*LightClientBootstrap) WithVersion ¶
func (l *LightClientBootstrap) WithVersion(v clparams.StateVersion) *LightClientBootstrap
type LightClientFinalityUpdate ¶
type LightClientFinalityUpdate struct { AttestedHeader *LightClientHeader FinalizedHeader *LightClientHeader FinalityBranch []libcommon.Hash `ssz-size:"6,32"` SyncAggregate *SyncAggregate SignatureSlot uint64 // contains filtered or unexported fields }
LightClientFinalityUpdate is used to update the sync aggreggate every 6 minutes.
func (*LightClientFinalityUpdate) Clone ¶
func (*LightClientFinalityUpdate) Clone() clonable.Clonable
func (*LightClientFinalityUpdate) DecodeSSZ ¶
func (l *LightClientFinalityUpdate) DecodeSSZ(buf []byte) error
func (*LightClientFinalityUpdate) DecodeSSZWithVersion ¶
func (l *LightClientFinalityUpdate) DecodeSSZWithVersion(buf []byte, version int) error
DecodeSSZ ssz unmarshals the LightClientFinalityUpdate object
func (*LightClientFinalityUpdate) EncodeSSZ ¶
func (l *LightClientFinalityUpdate) EncodeSSZ(buf []byte) ([]byte, error)
func (*LightClientFinalityUpdate) EncodingSizeSSZ ¶
func (l *LightClientFinalityUpdate) EncodingSizeSSZ() int
func (*LightClientFinalityUpdate) WithVersion ¶
func (l *LightClientFinalityUpdate) WithVersion(v clparams.StateVersion) *LightClientFinalityUpdate
type LightClientHeader ¶
type LightClientHeader struct { HeaderEth2 *BeaconBlockHeader HeaderEth1 *Eth1Header ExecutionBranch [ExecutionBranchLength]libcommon.Hash // contains filtered or unexported fields }
func (*LightClientHeader) DecodeSSZ ¶
func (l *LightClientHeader) DecodeSSZ([]byte) error
func (*LightClientHeader) DecodeSSZWithVersion ¶
func (l *LightClientHeader) DecodeSSZWithVersion(buf []byte, v int) error
func (*LightClientHeader) EncodeSSZ ¶
func (l *LightClientHeader) EncodeSSZ(buf []byte) ([]byte, error)
func (*LightClientHeader) EncodingSizeSSZ ¶
func (l *LightClientHeader) EncodingSizeSSZ() int
func (*LightClientHeader) WithVersion ¶
func (l *LightClientHeader) WithVersion(v clparams.StateVersion) *LightClientHeader
type LightClientOptimisticUpdate ¶
type LightClientOptimisticUpdate struct { AttestedHeader *LightClientHeader SyncAggregate *SyncAggregate SignatureSlot uint64 // contains filtered or unexported fields }
LightClientOptimisticUpdate is used for verifying N-1 block.
func (*LightClientOptimisticUpdate) Clone ¶
func (*LightClientOptimisticUpdate) Clone() clonable.Clonable
func (*LightClientOptimisticUpdate) DecodeSSZ ¶
func (l *LightClientOptimisticUpdate) DecodeSSZ([]byte) error
func (*LightClientOptimisticUpdate) DecodeSSZWithVersion ¶
func (l *LightClientOptimisticUpdate) DecodeSSZWithVersion(buf []byte, version int) error
func (*LightClientOptimisticUpdate) EncodeSSZ ¶
func (l *LightClientOptimisticUpdate) EncodeSSZ(buf []byte) ([]byte, error)
func (*LightClientOptimisticUpdate) EncodingSizeSSZ ¶
func (l *LightClientOptimisticUpdate) EncodingSizeSSZ() (size int)
func (*LightClientOptimisticUpdate) WithVersion ¶
func (l *LightClientOptimisticUpdate) WithVersion(v clparams.StateVersion) *LightClientOptimisticUpdate
type LightClientUpdate ¶
type LightClientUpdate struct { AttestedHeader *LightClientHeader NextSyncCommitee *SyncCommittee NextSyncCommitteeBranch []libcommon.Hash FinalizedHeader *LightClientHeader FinalityBranch []libcommon.Hash SyncAggregate *SyncAggregate SignatureSlot uint64 // contains filtered or unexported fields }
LightClientUpdate is used to update the sync committee every 27 hours.
func (*LightClientUpdate) Clone ¶
func (*LightClientUpdate) Clone() clonable.Clonable
func (*LightClientUpdate) DecodeSSZ ¶
func (l *LightClientUpdate) DecodeSSZ(buf []byte) error
func (*LightClientUpdate) DecodeSSZWithVersion ¶
func (l *LightClientUpdate) DecodeSSZWithVersion(buf []byte, version int) error
DecodeSSZ ssz unmarshals the LightClientUpdate object
func (*LightClientUpdate) EncodeSSZ ¶
func (l *LightClientUpdate) EncodeSSZ(buf []byte) ([]byte, error)
MarshalSSZTo ssz marshals the LightClientUpdate object to a target array
func (*LightClientUpdate) EncodingSizeSSZ ¶
func (l *LightClientUpdate) EncodingSizeSSZ() int
EncodingSizeSSZ returns the ssz encoded size in bytes for the LightClientUpdate object
func (*LightClientUpdate) HasNextSyncCommittee ¶
func (l *LightClientUpdate) HasNextSyncCommittee() bool
func (*LightClientUpdate) HasSyncFinality ¶
func (l *LightClientUpdate) HasSyncFinality() bool
func (*LightClientUpdate) IsFinalityUpdate ¶
func (l *LightClientUpdate) IsFinalityUpdate() bool
func (*LightClientUpdate) WithVersion ¶
func (l *LightClientUpdate) WithVersion(v clparams.StateVersion) *LightClientUpdate
type LightClientUpdatesByRangeRequest ¶
* LightClientUpdatesByRangeRequest that helps syncing to chain tip from a past point. * It takes the Period of the starting update and the amount of updates we want (MAX: 128).
func (*LightClientUpdatesByRangeRequest) Clone ¶
func (*LightClientUpdatesByRangeRequest) Clone() clonable.Clonable
func (*LightClientUpdatesByRangeRequest) DecodeSSZ ¶
func (l *LightClientUpdatesByRangeRequest) DecodeSSZ(buf []byte) error
func (*LightClientUpdatesByRangeRequest) DecodeSSZWithVersion ¶
func (l *LightClientUpdatesByRangeRequest) DecodeSSZWithVersion(buf []byte, _ int) error
func (*LightClientUpdatesByRangeRequest) EncodeSSZ ¶
func (l *LightClientUpdatesByRangeRequest) EncodeSSZ(buf []byte) ([]byte, error)
func (*LightClientUpdatesByRangeRequest) EncodingSizeSSZ ¶
func (l *LightClientUpdatesByRangeRequest) EncodingSizeSSZ() int
type ParticipationFlags ¶
type ParticipationFlags byte
func (ParticipationFlags) Add ¶
func (f ParticipationFlags) Add(index int) ParticipationFlags
func (ParticipationFlags) HasFlag ¶
func (f ParticipationFlags) HasFlag(index int) bool
type ParticipationFlagsList ¶
type ParticipationFlagsList []ParticipationFlags
func ParticipationFlagsListFromBytes ¶
func ParticipationFlagsListFromBytes(buf []byte) ParticipationFlagsList
func (ParticipationFlagsList) Bytes ¶
func (p ParticipationFlagsList) Bytes() []byte
func (ParticipationFlagsList) Copy ¶
func (p ParticipationFlagsList) Copy() ParticipationFlagsList
type PendingAttestation ¶
type PendingAttestation struct { AggregationBits []byte Data *AttestationData InclusionDelay uint64 ProposerIndex uint64 }
Pending attestation. (only in Phase0 state)
func (*PendingAttestation) Clone ¶
func (*PendingAttestation) Clone() clonable.Clonable
func (*PendingAttestation) DecodeSSZ ¶
func (a *PendingAttestation) DecodeSSZ(buf []byte) error
DecodeSSZ ssz unmarshals the Attestation object
func (*PendingAttestation) DecodeSSZWithVersion ¶
func (a *PendingAttestation) DecodeSSZWithVersion(buf []byte, _ int) error
func (*PendingAttestation) EncodeSSZ ¶
func (a *PendingAttestation) EncodeSSZ(buf []byte) (dst []byte, err error)
MarshalSSZTo ssz marshals the Attestation object to a target array
func (*PendingAttestation) EncodingSizeSSZ ¶
func (a *PendingAttestation) EncodingSizeSSZ() int
EncodingSizeSSZ returns the ssz encoded size in bytes for the Attestation object
func (*PendingAttestation) HashSSZ ¶
func (a *PendingAttestation) HashSSZ() ([32]byte, error)
HashSSZ ssz hashes the Attestation object
type Ping ¶
type Ping struct {
Id uint64
}
Ping is a test P2P message, used to test out liveness of our peer/signaling disconnection.
func (*Ping) EncodingSizeSSZ ¶
type ProposerSlashing ¶
type ProposerSlashing struct { Header1 *SignedBeaconBlockHeader Header2 *SignedBeaconBlockHeader }
func (*ProposerSlashing) Clone ¶
func (*ProposerSlashing) Clone() clonable.Clonable
func (*ProposerSlashing) DecodeSSZ ¶
func (p *ProposerSlashing) DecodeSSZ(buf []byte) error
func (*ProposerSlashing) DecodeSSZWithVersion ¶
func (p *ProposerSlashing) DecodeSSZWithVersion(buf []byte, _ int) error
func (*ProposerSlashing) EncodeSSZ ¶
func (p *ProposerSlashing) EncodeSSZ(dst []byte) (buf []byte, err error)
func (*ProposerSlashing) EncodingSizeSSZ ¶
func (p *ProposerSlashing) EncodingSizeSSZ() int
func (*ProposerSlashing) HashSSZ ¶
func (p *ProposerSlashing) HashSSZ() ([32]byte, error)
type SignedAggregateAndProof ¶
type SignedAggregateAndProof struct { Message *AggregateAndProof Signature [96]byte }
func (*SignedAggregateAndProof) Clone ¶
func (*SignedAggregateAndProof) Clone() clonable.Clonable
func (*SignedAggregateAndProof) DecodeSSZ ¶
func (a *SignedAggregateAndProof) DecodeSSZ(buf []byte) error
func (*SignedAggregateAndProof) DecodeSSZWithVersion ¶
func (a *SignedAggregateAndProof) DecodeSSZWithVersion(buf []byte, _ int) error
func (*SignedAggregateAndProof) EncodedSSZ ¶
func (a *SignedAggregateAndProof) EncodedSSZ(dst []byte) ([]byte, error)
func (*SignedAggregateAndProof) EncodingSizeSSZ ¶
func (a *SignedAggregateAndProof) EncodingSizeSSZ() int
type SignedBLSToExecutionChange ¶
type SignedBLSToExecutionChange struct { Message *BLSToExecutionChange Signature [96]byte }
func (*SignedBLSToExecutionChange) Clone ¶
func (*SignedBLSToExecutionChange) Clone() clonable.Clonable
func (*SignedBLSToExecutionChange) DecodeSSZ ¶
func (s *SignedBLSToExecutionChange) DecodeSSZ(buf []byte) error
func (*SignedBLSToExecutionChange) DecodeSSZWithVersion ¶
func (s *SignedBLSToExecutionChange) DecodeSSZWithVersion(buf []byte, _ int) error
func (*SignedBLSToExecutionChange) EncodeSSZ ¶
func (s *SignedBLSToExecutionChange) EncodeSSZ(buf []byte) ([]byte, error)
func (*SignedBLSToExecutionChange) EncodingSizeSSZ ¶
func (s *SignedBLSToExecutionChange) EncodingSizeSSZ() int
func (*SignedBLSToExecutionChange) HashSSZ ¶
func (s *SignedBLSToExecutionChange) HashSSZ() ([32]byte, error)
type SignedBeaconBlock ¶
type SignedBeaconBlock struct { Signature [96]byte Block *BeaconBlock }
func DecodeBeaconBlockForStorage ¶
func DecodeBeaconBlockForStorage(buf []byte) (block *SignedBeaconBlock, eth1Number uint64, eth1Hash libcommon.Hash, eth2Hash libcommon.Hash, err error)
DecodeBeaconBlockForStorage decodes beacon block in snappy compressed CBOR format.
func (*SignedBeaconBlock) Clone ¶
func (*SignedBeaconBlock) Clone() clonable.Clonable
func (*SignedBeaconBlock) DecodeSSZ ¶
func (b *SignedBeaconBlock) DecodeSSZ(buf []byte) error
func (*SignedBeaconBlock) DecodeSSZWithVersion ¶
func (b *SignedBeaconBlock) DecodeSSZWithVersion(buf []byte, s int) error
func (*SignedBeaconBlock) EncodeForStorage ¶
func (b *SignedBeaconBlock) EncodeForStorage() ([]byte, error)
EncodeForStorage encodes beacon block in snappy compressed CBOR format.
func (*SignedBeaconBlock) EncodeSSZ ¶
func (b *SignedBeaconBlock) EncodeSSZ(buf []byte) ([]byte, error)
func (*SignedBeaconBlock) EncodingSizeSSZ ¶
func (b *SignedBeaconBlock) EncodingSizeSSZ() int
func (*SignedBeaconBlock) HashSSZ ¶
func (b *SignedBeaconBlock) HashSSZ() ([32]byte, error)
func (*SignedBeaconBlock) Version ¶
func (b *SignedBeaconBlock) Version() clparams.StateVersion
Version returns beacon block version.
type SignedBeaconBlockHeader ¶
type SignedBeaconBlockHeader struct { Header *BeaconBlockHeader Signature [96]byte }
* SignedBeaconBlockHeader is a beacon block header + validator signature.
func (*SignedBeaconBlockHeader) DecodeSSZ ¶
func (b *SignedBeaconBlockHeader) DecodeSSZ(buf []byte) error
func (*SignedBeaconBlockHeader) EncodeSSZ ¶
func (b *SignedBeaconBlockHeader) EncodeSSZ(dst []byte) ([]byte, error)
func (*SignedBeaconBlockHeader) EncodingSizeSSZ ¶
func (b *SignedBeaconBlockHeader) EncodingSizeSSZ() int
func (*SignedBeaconBlockHeader) HashSSZ ¶
func (b *SignedBeaconBlockHeader) HashSSZ() ([32]byte, error)
type SignedVoluntaryExit ¶
type SignedVoluntaryExit struct { VolunaryExit *VoluntaryExit Signature [96]byte }
func (*SignedVoluntaryExit) Clone ¶
func (*SignedVoluntaryExit) Clone() clonable.Clonable
func (*SignedVoluntaryExit) DecodeSSZ ¶
func (e *SignedVoluntaryExit) DecodeSSZ(buf []byte) error
func (*SignedVoluntaryExit) DecodeSSZWithVersion ¶
func (e *SignedVoluntaryExit) DecodeSSZWithVersion(buf []byte, _ int) error
func (*SignedVoluntaryExit) EncodeSSZ ¶
func (e *SignedVoluntaryExit) EncodeSSZ(dst []byte) []byte
func (*SignedVoluntaryExit) EncodingSizeSSZ ¶
func (e *SignedVoluntaryExit) EncodingSizeSSZ() int
func (*SignedVoluntaryExit) HashSSZ ¶
func (e *SignedVoluntaryExit) HashSSZ() ([32]byte, error)
type SingleRoot ¶
type SingleRoot struct {
Root [32]byte
}
P2P Message for bootstrap
func (*SingleRoot) Clone ¶
func (*SingleRoot) Clone() clonable.Clonable
func (*SingleRoot) DecodeSSZ ¶
func (s *SingleRoot) DecodeSSZ(buf []byte) error
func (*SingleRoot) DecodeSSZWithVersion ¶
func (s *SingleRoot) DecodeSSZWithVersion(buf []byte, _ int) error
func (*SingleRoot) EncodingSizeSSZ ¶
func (s *SingleRoot) EncodingSizeSSZ() int
type Status ¶
type Status struct { ForkDigest [4]byte `ssz-size:"4"` FinalizedRoot [32]byte `ssz-size:"32"` FinalizedEpoch uint64 HeadRoot [32]byte `ssz-size:"32"` HeadSlot uint64 }
* Status is a P2P Message we exchange when connecting to a new Peer. * It contains network information about the other peer and if mismatching we drop it.
func (*Status) DecodeSSZWithVersion ¶
func (*Status) EncodingSizeSSZ ¶
type SyncAggregate ¶
* SyncAggregate, Determines successfull committee, bits shows active participants, * and signature is the aggregate BLS signature of the committee.
func (*SyncAggregate) Clone ¶
func (*SyncAggregate) Clone() clonable.Clonable
func (*SyncAggregate) DecodeSSZ ¶
func (agg *SyncAggregate) DecodeSSZ(buf []byte) error
func (*SyncAggregate) DecodeSSZWithVersion ¶
func (agg *SyncAggregate) DecodeSSZWithVersion(buf []byte, _ int) error
func (*SyncAggregate) EncodeSSZ ¶
func (agg *SyncAggregate) EncodeSSZ(buf []byte) []byte
func (*SyncAggregate) EncodingSizeSSZ ¶
func (agg *SyncAggregate) EncodingSizeSSZ() int
func (*SyncAggregate) HashSSZ ¶
func (agg *SyncAggregate) HashSSZ() ([32]byte, error)
type SyncCommittee ¶
type SyncCommittee struct { PubKeys [][48]byte `ssz-size:"512,48"` AggregatePublicKey [48]byte `ssz-size:"48"` }
* Sync committe public keys and their aggregate public keys, we use array of pubKeys.
func (*SyncCommittee) Copy ¶
func (s *SyncCommittee) Copy() *SyncCommittee
func (*SyncCommittee) DecodeSSZ ¶
func (s *SyncCommittee) DecodeSSZ(buf []byte) error
DecodeSSZ ssz unmarshals the SyncCommittee object
func (*SyncCommittee) EncodeSSZ ¶
func (s *SyncCommittee) EncodeSSZ(buf []byte) ([]byte, error)
MarshalSSZTo ssz marshals the SyncCommittee object to a target array
func (*SyncCommittee) EncodingSizeSSZ ¶
func (s *SyncCommittee) EncodingSizeSSZ() (size int)
EncodingSizeSSZ returns the ssz encoded size in bytes for the SyncCommittee object
func (*SyncCommittee) Equal ¶
func (s *SyncCommittee) Equal(s2 *SyncCommittee) bool
func (*SyncCommittee) HashSSZ ¶
func (s *SyncCommittee) HashSSZ() ([32]byte, error)
HashTreeRootWith ssz hashes the SyncCommittee object with a hasher
type Validator ¶
type Validator struct { PublicKey [48]byte WithdrawalCredentials libcommon.Hash EffectiveBalance uint64 Slashed bool ActivationEligibilityEpoch uint64 ActivationEpoch uint64 ExitEpoch uint64 WithdrawableEpoch uint64 // This is all stuff used by phase0 state transition. It makes many operations faster. // Source attesters IsCurrentMatchingSourceAttester bool IsPreviousMatchingSourceAttester bool // Target Attesters IsCurrentMatchingTargetAttester bool IsPreviousMatchingTargetAttester bool // Head attesters IsCurrentMatchingHeadAttester bool IsPreviousMatchingHeadAttester bool // MinInclusionDelay MinCurrentInclusionDelayAttestation *PendingAttestation MinPreviousInclusionDelayAttestation *PendingAttestation }
Validator, contains if we were on bellatrix/alteir/phase0 and transition epoch.
func (*Validator) DecodeSSZWithVersion ¶
func (*Validator) DutiesAttested ¶
DutiesAttested returns how many of its duties the validator attested and missed
func (*Validator) EncodingSizeSSZ ¶
func (*Validator) IsSlashable ¶
type VoluntaryExit ¶
func (*VoluntaryExit) DecodeSSZ ¶
func (e *VoluntaryExit) DecodeSSZ(buf []byte) error
func (*VoluntaryExit) EncodeSSZ ¶
func (e *VoluntaryExit) EncodeSSZ(buf []byte) []byte
func (*VoluntaryExit) EncodingSizeSSZ ¶
func (e *VoluntaryExit) EncodingSizeSSZ() int
func (*VoluntaryExit) HashSSZ ¶
func (e *VoluntaryExit) HashSSZ() ([32]byte, error)
Source Files ¶
- aggregate.go
- attestations.go
- beacon_block.go
- beacon_header.go
- block_requests.go
- bls_to_execution_change.go
- checkpoint.go
- clone.go
- eth1_block.go
- eth1_data.go
- eth1_header.go
- fork.go
- historical_summary.go
- justification_bits.go
- lightclient.go
- network.go
- participation_flags.go
- slashings.go
- types.go
- validator.go