scale

package
v0.0.0-...-2eef473 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEncodeVersionedExecutionPayloadHeader = errors.New("error scale encode VersionedExecutionPayloadHeader")
)

Functions

This section is empty.

Types

type AncestryProof

type AncestryProof struct {
	HeaderBranch       []types.H256
	FinalizedBlockRoot types.H256
}

type Attestation

type Attestation struct {
	AggregationBits []byte
	Data            AttestationData
	Signature       []byte
}

type AttestationData

type AttestationData struct {
	Slot            types.U64
	Index           types.U64
	BeaconBlockRoot types.H256
	Source          Checkpoint
	Target          Checkpoint
}

type AttesterSlashing

type AttesterSlashing struct {
	Attestation1 IndexedAttestation
	Attestation2 IndexedAttestation
}

type BLSToExecutionChange

type BLSToExecutionChange struct {
	ValidatorIndex     types.U64
	FromBlsPubkey      []byte
	ToExecutionAddress []byte
}

type BeaconBlock

type BeaconBlock struct {
	Slot          types.U64
	ProposerIndex types.U64
	ParentRoot    types.H256
	StateRoot     types.H256
	Body          Body
}

type BeaconCheckpoint

type BeaconCheckpoint struct {
	Header                     BeaconHeader
	CurrentSyncCommittee       SyncCommittee
	CurrentSyncCommitteeBranch []types.H256
	ValidatorsRoot             types.H256
	BlockRootsRoot             types.H256
	BlockRootsBranch           []types.H256
}

func (BeaconCheckpoint) ToJSON

func (p BeaconCheckpoint) ToJSON() json.CheckPoint

type BeaconHeader

type BeaconHeader struct {
	Slot          types.U64
	ProposerIndex types.U64
	ParentRoot    types.H256
	StateRoot     types.H256
	BodyRoot      types.H256
}

func (*BeaconHeader) ToJSON

func (b *BeaconHeader) ToJSON() json.BeaconHeader

func (*BeaconHeader) ToSSZ

func (b *BeaconHeader) ToSSZ() *state.BeaconBlockHeader

type BeaconState

type BeaconState struct {
	CompactBeaconState
	BlockRoot types.H256
}

type BlockRootProof

type BlockRootProof struct {
	Leaf  types.H256
	Proof []types.H256
	Tree  *ssz.Node
}

type Body

type Body struct {
	RandaoReveal      []byte
	Eth1Data          Eth1Data
	Graffiti          types.H256
	ProposerSlashings []ProposerSlashing
	AttesterSlashings []AttesterSlashing
	Attestations      []Attestation
	Deposits          []Deposit
	VoluntaryExits    []SignedVoluntaryExit
	SyncAggregate     SyncAggregate
	ExecutionPayload  ExecutionPayloadHeaderCapella
}

type BodyCapella

type BodyCapella struct {
	RandaoReveal          []byte
	Eth1Data              Eth1Data
	Graffiti              types.H256
	ProposerSlashings     []ProposerSlashing
	AttesterSlashings     []AttesterSlashing
	Attestations          []Attestation
	Deposits              []Deposit
	VoluntaryExits        []SignedVoluntaryExit
	SyncAggregate         SyncAggregate
	ExecutionPayload      ExecutionPayloadHeaderCapella
	BlsToExecutionChanges []*SignedBLSToExecutionChange
}

type Checkpoint

type Checkpoint struct {
	Epoch types.U64
	Root  types.H256
}

type CompactBeaconState

type CompactBeaconState struct {
	Slot           types.UCompact
	BlockRootsRoot types.H256
}

type CompactExecutionHeader

type CompactExecutionHeader struct {
	ParentHash   types.H256
	BlockNumber  types.UCompact
	StateRoot    types.H256
	ReceiptsRoot types.H256
}

type Deposit

type Deposit struct {
	Proof []types.H256
	Data  DepositData
}

type DepositData

type DepositData struct {
	Pubkey                []byte
	WithdrawalCredentials types.H256
	Amount                types.U64
	Signature             []byte
}

type Eth1Data

type Eth1Data struct {
	DepositRoot  types.H256
	DepositCount types.U64
	BlockHash    types.H256
}

type ExecutionPayloadHeaderCapella

type ExecutionPayloadHeaderCapella struct {
	ParentHash       types.H256
	FeeRecipient     types.H160
	StateRoot        types.H256
	ReceiptsRoot     types.H256
	LogsBloom        []byte
	PrevRandao       types.H256
	BlockNumber      types.U64
	GasLimit         types.U64
	GasUsed          types.U64
	Timestamp        types.U64
	ExtraData        []byte
	BaseFeePerGas    types.U256
	BlockHash        types.H256
	TransactionsRoot types.H256
	WithdrawalsRoot  types.H256
}

func (*ExecutionPayloadHeaderCapella) ToJSON

type ExecutionPayloadHeaderDeneb

type ExecutionPayloadHeaderDeneb struct {
	ParentHash       types.H256
	FeeRecipient     types.H160
	StateRoot        types.H256
	ReceiptsRoot     types.H256
	LogsBloom        []byte
	PrevRandao       types.H256
	BlockNumber      types.U64
	GasLimit         types.U64
	GasUsed          types.U64
	Timestamp        types.U64
	ExtraData        []byte
	BaseFeePerGas    types.U256
	BlockHash        types.H256
	TransactionsRoot types.H256
	WithdrawalsRoot  types.H256
	BlobGasUsed      types.U64
	ExcessBlobGas    types.U64
}

func (*ExecutionPayloadHeaderDeneb) ToJSON

type HeaderUpdatePayload

type HeaderUpdatePayload struct {
	Header          BeaconHeader
	AncestryProof   OptionAncestryProof
	ExecutionHeader VersionedExecutionPayloadHeader
	ExecutionBranch []types.H256
}

func (HeaderUpdatePayload) ToJSON

type IndexedAttestation

type IndexedAttestation struct {
	AttestingIndices []types.U64
	Data             AttestationData
	Signature        []byte
}

type NextSyncCommitteeUpdatePayload

type NextSyncCommitteeUpdatePayload struct {
	NextSyncCommittee       SyncCommittee
	NextSyncCommitteeBranch []types.H256
}

type OptionAncestryProof

type OptionAncestryProof struct {
	HasValue bool
	Value    AncestryProof
}

func (*OptionAncestryProof) Decode

func (o *OptionAncestryProof) Decode(decoder scale.Decoder) error

func (OptionAncestryProof) Encode

func (o OptionAncestryProof) Encode(encoder scale.Encoder) error

type OptionNextSyncCommitteeUpdatePayload

type OptionNextSyncCommitteeUpdatePayload struct {
	HasValue bool
	Value    NextSyncCommitteeUpdatePayload
}

func (*OptionNextSyncCommitteeUpdatePayload) Decode

func (OptionNextSyncCommitteeUpdatePayload) Encode

type ProposerSlashing

type ProposerSlashing struct {
	SignedHeader1 SignedHeader
	SignedHeader2 SignedHeader
}

type SignedBLSToExecutionChange

type SignedBLSToExecutionChange struct {
	Message   *BLSToExecutionChange
	Signature []byte
}

type SignedHeader

type SignedHeader struct {
	Message   BeaconHeader
	Signature []byte
}

type SignedVoluntaryExit

type SignedVoluntaryExit struct {
	Exit      VoluntaryExit
	Signature []byte
}

type SyncAggregate

type SyncAggregate struct {
	SyncCommitteeBits      []byte
	SyncCommitteeSignature [96]byte
}

func (SyncAggregate) Encode

func (s SyncAggregate) Encode(encoder scale.Encoder) error

Use a custom SCALE encoder to encode SyncCommitteeBits as fixed array

func (*SyncAggregate) ToJSON

func (s *SyncAggregate) ToJSON() json.SyncAggregate

type SyncCommittee

type SyncCommittee struct {
	Pubkeys         [][48]byte
	AggregatePubkey [48]byte
}

func (SyncCommittee) Encode

func (s SyncCommittee) Encode(encoder scale.Encoder) error

Use a custom SCALE encoder to encode SyncCommitteeBits as fixed array

func (*SyncCommittee) ToJSON

func (s *SyncCommittee) ToJSON() json.SyncCommittee

type Update

type Update struct {
	Payload                  UpdatePayload
	FinalizedHeaderBlockRoot common.Hash
	BlockRootsTree           *ssz.Node
}

type UpdatePayload

type UpdatePayload struct {
	AttestedHeader          BeaconHeader
	SyncAggregate           SyncAggregate
	SignatureSlot           types.U64
	NextSyncCommitteeUpdate OptionNextSyncCommitteeUpdatePayload
	FinalizedHeader         BeaconHeader
	FinalityBranch          []types.H256
	BlockRootsRoot          types.H256
	BlockRootsBranch        []types.H256
}

func (UpdatePayload) ToJSON

func (p UpdatePayload) ToJSON() json.Update

type VersionedExecutionPayloadHeader

type VersionedExecutionPayloadHeader struct {
	Capella *ExecutionPayloadHeaderCapella
	Deneb   *ExecutionPayloadHeaderDeneb
}

func (VersionedExecutionPayloadHeader) Encode

func (*VersionedExecutionPayloadHeader) ToJSON

type VoluntaryExit

type VoluntaryExit struct {
	Epoch          types.U64
	ValidaterIndex types.U64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL