shared

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: GPL-3.0 Imports: 23 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttesterSlashingsToConsensus added in v4.1.0

func AttesterSlashingsToConsensus(src []*AttesterSlashing) ([]*eth.AttesterSlashing, error)

func AttsToConsensus added in v4.1.0

func AttsToConsensus(src []*Attestation) ([]*eth.Attestation, error)

func BlsChangesToConsensus added in v4.1.0

func BlsChangesToConsensus(src []*SignedBlsToExecutionChange) ([]*eth.SignedBLSToExecutionChange, error)

func DecodeHexWithLength added in v4.1.0

func DecodeHexWithLength(s string, length int) ([]byte, error)

DecodeHexWithLength takes a string and a length in bytes, and validates whether the string is a hex and has the correct length.

func DecodeHexWithMaxLength added in v4.1.0

func DecodeHexWithMaxLength(s string, maxLength int) ([]byte, error)

DecodeHexWithMaxLength takes a string and a length in bytes, and validates whether the string is a hex and has the correct length.

func DepositsToConsensus added in v4.1.0

func DepositsToConsensus(src []*Deposit) ([]*eth.Deposit, error)

func ExitsToConsensus added in v4.1.0

func ExitsToConsensus(src []*SignedVoluntaryExit) ([]*eth.SignedVoluntaryExit, error)

func IsOptimistic added in v4.1.0

func IsOptimistic(
	ctx context.Context,
	w http.ResponseWriter,
	optimisticModeFetcher blockchain.OptimisticModeFetcher,
) (bool, error)

IsOptimistic checks whether the beacon node is currently optimistic and writes it to the response.

func IsSyncing added in v4.1.0

func IsSyncing(
	ctx context.Context,
	w http.ResponseWriter,
	syncChecker sync.Checker,
	headFetcher blockchain.HeadFetcher,
	timeFetcher blockchain.TimeFetcher,
	optimisticModeFetcher blockchain.OptimisticModeFetcher,
) bool

IsSyncing checks whether the beacon node is currently syncing and writes out the sync status.

func ProposerSlashingsToConsensus added in v4.1.0

func ProposerSlashingsToConsensus(src []*ProposerSlashing) ([]*eth.ProposerSlashing, error)

func Uint256ToSSZBytes added in v4.1.0

func Uint256ToSSZBytes(num string) ([]byte, error)

func UintFromQuery added in v4.1.0

func UintFromQuery(w http.ResponseWriter, r *http.Request, name string) (bool, string, uint64)

func ValidateHex

func ValidateHex(w http.ResponseWriter, name string, s string, length int) ([]byte, bool)

func ValidateUint

func ValidateUint(w http.ResponseWriter, name string, s string) (uint64, bool)

func VerifyMaxLength added in v4.1.0

func VerifyMaxLength[T any](v []T, max int) error

VerifyMaxLength takes a slice and a maximum length and validates the length.

func WriteBlockFetchError added in v4.1.0

func WriteBlockFetchError(w http.ResponseWriter, blk interfaces.ReadOnlySignedBeaconBlock, err error) bool

WriteBlockFetchError writes an appropriate error based on the supplied argument. The argument error should be a result of fetching block.

func WriteStateFetchError added in v4.1.0

func WriteStateFetchError(w http.ResponseWriter, err error)

WriteStateFetchError writes an appropriate error based on the supplied argument. The argument error should be a result of fetching state.

Types

type AggregateAttestationAndProof

type AggregateAttestationAndProof struct {
	AggregatorIndex string       `json:"aggregator_index"`
	Aggregate       *Attestation `json:"aggregate"`
	SelectionProof  string       `json:"selection_proof"`
}

func (*AggregateAttestationAndProof) ToConsensus

type Attestation

type Attestation struct {
	AggregationBits string           `json:"aggregation_bits"`
	Data            *AttestationData `json:"data"`
	Signature       string           `json:"signature"`
}

func AttestationFromConsensus added in v4.1.0

func AttestationFromConsensus(a *eth.Attestation) *Attestation

func AttsFromConsensus added in v4.1.0

func AttsFromConsensus(src []*eth.Attestation) ([]*Attestation, error)

func (*Attestation) ToConsensus

func (a *Attestation) ToConsensus() (*eth.Attestation, error)

type AttestationData

type AttestationData struct {
	Slot            string      `json:"slot"`
	CommitteeIndex  string      `json:"index"`
	BeaconBlockRoot string      `json:"beacon_block_root"`
	Source          *Checkpoint `json:"source"`
	Target          *Checkpoint `json:"target"`
}

func AttestationDataFromConsensus added in v4.1.0

func AttestationDataFromConsensus(a *eth.AttestationData) *AttestationData

func (*AttestationData) ToConsensus

func (a *AttestationData) ToConsensus() (*eth.AttestationData, error)

type AttesterSlashing added in v4.1.0

type AttesterSlashing struct {
	Attestation1 *IndexedAttestation `json:"attestation_1" validate:"required"`
	Attestation2 *IndexedAttestation `json:"attestation_2" validate:"required"`
}

func AttesterSlashingsFromConsensus added in v4.1.0

func AttesterSlashingsFromConsensus(src []*eth.AttesterSlashing) ([]*AttesterSlashing, error)

type BeaconBlock added in v4.1.0

type BeaconBlock struct {
	Slot          string           `json:"slot" validate:"required"`
	ProposerIndex string           `json:"proposer_index" validate:"required"`
	ParentRoot    string           `json:"parent_root" validate:"required"`
	StateRoot     string           `json:"state_root" validate:"required"`
	Body          *BeaconBlockBody `json:"body" validate:"required"`
}

func BeaconBlockFromConsensus added in v4.1.0

func BeaconBlockFromConsensus(b *eth.BeaconBlock) (*BeaconBlock, error)

func (*BeaconBlock) ToConsensus added in v4.1.0

func (b *BeaconBlock) ToConsensus() (*eth.BeaconBlock, error)

func (*BeaconBlock) ToGeneric added in v4.1.0

func (b *BeaconBlock) ToGeneric() (*eth.GenericBeaconBlock, error)

type BeaconBlockAltair added in v4.1.0

type BeaconBlockAltair struct {
	Slot          string                 `json:"slot" validate:"required"`
	ProposerIndex string                 `json:"proposer_index" validate:"required"`
	ParentRoot    string                 `json:"parent_root" validate:"required"`
	StateRoot     string                 `json:"state_root" validate:"required"`
	Body          *BeaconBlockBodyAltair `json:"body" validate:"required"`
}

func BeaconBlockAltairFromConsensus added in v4.1.0

func BeaconBlockAltairFromConsensus(b *eth.BeaconBlockAltair) (*BeaconBlockAltair, error)

func (*BeaconBlockAltair) ToConsensus added in v4.1.0

func (b *BeaconBlockAltair) ToConsensus() (*eth.BeaconBlockAltair, error)

func (*BeaconBlockAltair) ToGeneric added in v4.1.0

func (b *BeaconBlockAltair) ToGeneric() (*eth.GenericBeaconBlock, error)

type BeaconBlockBellatrix added in v4.1.0

type BeaconBlockBellatrix struct {
	Slot          string                    `json:"slot" validate:"required"`
	ProposerIndex string                    `json:"proposer_index" validate:"required"`
	ParentRoot    string                    `json:"parent_root" validate:"required"`
	StateRoot     string                    `json:"state_root" validate:"required"`
	Body          *BeaconBlockBodyBellatrix `json:"body" validate:"required"`
}

func BeaconBlockBellatrixFromConsensus added in v4.1.0

func BeaconBlockBellatrixFromConsensus(b *eth.BeaconBlockBellatrix) (*BeaconBlockBellatrix, error)

func (*BeaconBlockBellatrix) ToConsensus added in v4.1.0

func (b *BeaconBlockBellatrix) ToConsensus() (*eth.BeaconBlockBellatrix, error)

func (*BeaconBlockBellatrix) ToGeneric added in v4.1.0

func (b *BeaconBlockBellatrix) ToGeneric() (*eth.GenericBeaconBlock, error)

type BeaconBlockBody added in v4.1.0

type BeaconBlockBody struct {
	RandaoReveal      string                 `json:"randao_reveal" validate:"required"`
	Eth1Data          *Eth1Data              `json:"eth1_data" validate:"required"`
	Graffiti          string                 `json:"graffiti" validate:"required"`
	ProposerSlashings []*ProposerSlashing    `json:"proposer_slashings" validate:"required"`
	AttesterSlashings []*AttesterSlashing    `json:"attester_slashings" validate:"required"`
	Attestations      []*Attestation         `json:"attestations" validate:"required"`
	Deposits          []*Deposit             `json:"deposits" validate:"required"`
	VoluntaryExits    []*SignedVoluntaryExit `json:"voluntary_exits" validate:"required"`
}

type BeaconBlockBodyAltair added in v4.1.0

type BeaconBlockBodyAltair struct {
	RandaoReveal      string                 `json:"randao_reveal" validate:"required"`
	Eth1Data          *Eth1Data              `json:"eth1_data" validate:"required"`
	Graffiti          string                 `json:"graffiti" validate:"required"`
	ProposerSlashings []*ProposerSlashing    `json:"proposer_slashings" validate:"required,dive"`
	AttesterSlashings []*AttesterSlashing    `json:"attester_slashings" validate:"required,dive"`
	Attestations      []*Attestation         `json:"attestations" validate:"required,dive"`
	Deposits          []*Deposit             `json:"deposits" validate:"required,dive"`
	VoluntaryExits    []*SignedVoluntaryExit `json:"voluntary_exits" validate:"required,dive"`
	SyncAggregate     *SyncAggregate         `json:"sync_aggregate" validate:"required"`
}

type BeaconBlockBodyBellatrix added in v4.1.0

type BeaconBlockBodyBellatrix struct {
	RandaoReveal      string                 `json:"randao_reveal" validate:"required"`
	Eth1Data          *Eth1Data              `json:"eth1_data" validate:"required"`
	Graffiti          string                 `json:"graffiti" validate:"required"`
	ProposerSlashings []*ProposerSlashing    `json:"proposer_slashings" validate:"required,dive"`
	AttesterSlashings []*AttesterSlashing    `json:"attester_slashings" validate:"required,dive"`
	Attestations      []*Attestation         `json:"attestations" validate:"required,dive"`
	Deposits          []*Deposit             `json:"deposits" validate:"required,dive"`
	VoluntaryExits    []*SignedVoluntaryExit `json:"voluntary_exits" validate:"required,dive"`
	SyncAggregate     *SyncAggregate         `json:"sync_aggregate" validate:"required"`
	ExecutionPayload  *ExecutionPayload      `json:"execution_payload" validate:"required"`
}

type BeaconBlockBodyCapella added in v4.1.0

type BeaconBlockBodyCapella struct {
	RandaoReveal          string                        `json:"randao_reveal" validate:"required"`
	Eth1Data              *Eth1Data                     `json:"eth1_data" validate:"required"`
	Graffiti              string                        `json:"graffiti" validate:"required"`
	ProposerSlashings     []*ProposerSlashing           `json:"proposer_slashings" validate:"required,dive"`
	AttesterSlashings     []*AttesterSlashing           `json:"attester_slashings" validate:"required,dive"`
	Attestations          []*Attestation                `json:"attestations" validate:"required,dive"`
	Deposits              []*Deposit                    `json:"deposits" validate:"required,dive"`
	VoluntaryExits        []*SignedVoluntaryExit        `json:"voluntary_exits" validate:"required,dive"`
	SyncAggregate         *SyncAggregate                `json:"sync_aggregate" validate:"required"`
	ExecutionPayload      *ExecutionPayloadCapella      `json:"execution_payload" validate:"required"`
	BlsToExecutionChanges []*SignedBlsToExecutionChange `json:"bls_to_execution_changes" validate:"required,dive"`
}

type BeaconBlockBodyDeneb added in v4.1.0

type BeaconBlockBodyDeneb struct {
	RandaoReveal          string                        `json:"randao_reveal" validate:"required"`
	Eth1Data              *Eth1Data                     `json:"eth1_data" validate:"required"`
	Graffiti              string                        `json:"graffiti" validate:"required"`
	ProposerSlashings     []*ProposerSlashing           `json:"proposer_slashings" validate:"required,dive"`
	AttesterSlashings     []*AttesterSlashing           `json:"attester_slashings" validate:"required,dive"`
	Attestations          []*Attestation                `json:"attestations" validate:"required,dive"`
	Deposits              []*Deposit                    `json:"deposits" validate:"required,dive"`
	VoluntaryExits        []*SignedVoluntaryExit        `json:"voluntary_exits" validate:"required,dive"`
	SyncAggregate         *SyncAggregate                `json:"sync_aggregate" validate:"required"`
	ExecutionPayload      *ExecutionPayloadDeneb        `json:"execution_payload" validate:"required"`
	BlsToExecutionChanges []*SignedBlsToExecutionChange `json:"bls_to_execution_changes" validate:"required,dive"`
	BlobKzgCommitments    []string                      `json:"blob_kzg_commitments" validate:"required,dive"`
}

type BeaconBlockCapella added in v4.1.0

type BeaconBlockCapella struct {
	Slot          string                  `json:"slot" validate:"required"`
	ProposerIndex string                  `json:"proposer_index" validate:"required"`
	ParentRoot    string                  `json:"parent_root" validate:"required"`
	StateRoot     string                  `json:"state_root" validate:"required"`
	Body          *BeaconBlockBodyCapella `json:"body" validate:"required"`
}

func BeaconBlockCapellaFromConsensus added in v4.1.0

func BeaconBlockCapellaFromConsensus(b *eth.BeaconBlockCapella) (*BeaconBlockCapella, error)

func (*BeaconBlockCapella) ToConsensus added in v4.1.0

func (b *BeaconBlockCapella) ToConsensus() (*eth.BeaconBlockCapella, error)

func (*BeaconBlockCapella) ToGeneric added in v4.1.0

func (b *BeaconBlockCapella) ToGeneric() (*eth.GenericBeaconBlock, error)

type BeaconBlockContentsDeneb added in v4.1.0

type BeaconBlockContentsDeneb struct {
	Block        *BeaconBlockDeneb `json:"block" validate:"required"`
	BlobSidecars []*BlobSidecar    `json:"blob_sidecars" validate:"dive"`
}

func BeaconBlockContentsDenebFromConsensus added in v4.1.0

func BeaconBlockContentsDenebFromConsensus(b *eth.BeaconBlockAndBlobsDeneb) (*BeaconBlockContentsDeneb, error)

func (*BeaconBlockContentsDeneb) ToConsensus added in v4.1.0

func (*BeaconBlockContentsDeneb) ToGeneric added in v4.1.0

type BeaconBlockDeneb added in v4.1.0

type BeaconBlockDeneb struct {
	Slot          string                `json:"slot" validate:"required"`
	ProposerIndex string                `json:"proposer_index" validate:"required"`
	ParentRoot    string                `json:"parent_root" validate:"required"`
	StateRoot     string                `json:"state_root" validate:"required"`
	Body          *BeaconBlockBodyDeneb `json:"body" validate:"required"`
}

func BeaconBlockDenebFromConsensus added in v4.1.0

func BeaconBlockDenebFromConsensus(b *eth.BeaconBlockDeneb) (*BeaconBlockDeneb, error)

func (*BeaconBlockDeneb) ToConsensus added in v4.1.0

func (b *BeaconBlockDeneb) ToConsensus() (*eth.BeaconBlockDeneb, error)

type BeaconBlockHeader added in v4.1.0

type BeaconBlockHeader struct {
	Slot          string `json:"slot" validate:"required"`
	ProposerIndex string `json:"proposer_index" validate:"required"`
	ParentRoot    string `json:"parent_root" validate:"required"`
	StateRoot     string `json:"state_root" validate:"required"`
	BodyRoot      string `json:"body_root" validate:"required"`
}

func BeaconBlockHeaderFromConsensus added in v4.1.0

func BeaconBlockHeaderFromConsensus(h *eth.BeaconBlockHeader) *BeaconBlockHeader

type BeaconCommitteeSubscription added in v4.1.0

type BeaconCommitteeSubscription struct {
	ValidatorIndex   string `json:"validator_index"`
	CommitteeIndex   string `json:"committee_index"`
	CommitteesAtSlot string `json:"committees_at_slot"`
	Slot             string `json:"slot"`
	IsAggregator     bool   `json:"is_aggregator"`
}

func (*BeaconCommitteeSubscription) ToConsensus added in v4.1.0

type BlindedBeaconBlockBellatrix added in v4.1.0

type BlindedBeaconBlockBellatrix struct {
	Slot          string                           `json:"slot" validate:"required"`
	ProposerIndex string                           `json:"proposer_index" validate:"required"`
	ParentRoot    string                           `json:"parent_root" validate:"required"`
	StateRoot     string                           `json:"state_root" validate:"required"`
	Body          *BlindedBeaconBlockBodyBellatrix `json:"body" validate:"required"`
}

func BlindedBeaconBlockBellatrixFromConsensus added in v4.1.0

func BlindedBeaconBlockBellatrixFromConsensus(b *eth.BlindedBeaconBlockBellatrix) (*BlindedBeaconBlockBellatrix, error)

func (*BlindedBeaconBlockBellatrix) ToConsensus added in v4.1.0

func (*BlindedBeaconBlockBellatrix) ToGeneric added in v4.1.0

type BlindedBeaconBlockBodyBellatrix added in v4.1.0

type BlindedBeaconBlockBodyBellatrix struct {
	RandaoReveal           string                  `json:"randao_reveal" validate:"required"`
	Eth1Data               *Eth1Data               `json:"eth1_data" validate:"required"`
	Graffiti               string                  `json:"graffiti" validate:"required"`
	ProposerSlashings      []*ProposerSlashing     `json:"proposer_slashings" validate:"required,dive"`
	AttesterSlashings      []*AttesterSlashing     `json:"attester_slashings" validate:"required,dive"`
	Attestations           []*Attestation          `json:"attestations" validate:"required,dive"`
	Deposits               []*Deposit              `json:"deposits" validate:"required,dive"`
	VoluntaryExits         []*SignedVoluntaryExit  `json:"voluntary_exits" validate:"required,dive"`
	SyncAggregate          *SyncAggregate          `json:"sync_aggregate" validate:"required"`
	ExecutionPayloadHeader *ExecutionPayloadHeader `json:"execution_payload_header" validate:"required"`
}

type BlindedBeaconBlockBodyCapella added in v4.1.0

type BlindedBeaconBlockBodyCapella struct {
	RandaoReveal           string                         `json:"randao_reveal" validate:"required"`
	Eth1Data               *Eth1Data                      `json:"eth1_data" validate:"required"`
	Graffiti               string                         `json:"graffiti" validate:"required"`
	ProposerSlashings      []*ProposerSlashing            `json:"proposer_slashings" validate:"required,dive"`
	AttesterSlashings      []*AttesterSlashing            `json:"attester_slashings" validate:"required,dive"`
	Attestations           []*Attestation                 `json:"attestations" validate:"required,dive"`
	Deposits               []*Deposit                     `json:"deposits" validate:"required,dive"`
	VoluntaryExits         []*SignedVoluntaryExit         `json:"voluntary_exits" validate:"required,dive"`
	SyncAggregate          *SyncAggregate                 `json:"sync_aggregate" validate:"required"`
	ExecutionPayloadHeader *ExecutionPayloadHeaderCapella `json:"execution_payload_header" validate:"required"`
	BlsToExecutionChanges  []*SignedBlsToExecutionChange  `json:"bls_to_execution_changes" validate:"required,dive"`
}

type BlindedBeaconBlockBodyDeneb added in v4.1.0

type BlindedBeaconBlockBodyDeneb struct {
	RandaoReveal           string                        `json:"randao_reveal" validate:"required"`
	Eth1Data               *Eth1Data                     `json:"eth1_data" validate:"required"`
	Graffiti               string                        `json:"graffiti" validate:"required"`
	ProposerSlashings      []*ProposerSlashing           `json:"proposer_slashings" validate:"required,dive"`
	AttesterSlashings      []*AttesterSlashing           `json:"attester_slashings" validate:"required,dive"`
	Attestations           []*Attestation                `json:"attestations" validate:"required,dive"`
	Deposits               []*Deposit                    `json:"deposits" validate:"required,dive"`
	VoluntaryExits         []*SignedVoluntaryExit        `json:"voluntary_exits" validate:"required,dive"`
	SyncAggregate          *SyncAggregate                `json:"sync_aggregate" validate:"required"`
	ExecutionPayloadHeader *ExecutionPayloadHeaderDeneb  `json:"execution_payload_header" validate:"required"`
	BlsToExecutionChanges  []*SignedBlsToExecutionChange `json:"bls_to_execution_changes" validate:"required,dive"`
	BlobKzgCommitments     []string                      `json:"blob_kzg_commitments" validate:"required,dive,hexadecimal"`
}

type BlindedBeaconBlockCapella added in v4.1.0

type BlindedBeaconBlockCapella struct {
	Slot          string                         `json:"slot" validate:"required"`
	ProposerIndex string                         `json:"proposer_index" validate:"required"`
	ParentRoot    string                         `json:"parent_root" validate:"required"`
	StateRoot     string                         `json:"state_root" validate:"required"`
	Body          *BlindedBeaconBlockBodyCapella `json:"body" validate:"required"`
}

func BlindedBeaconBlockCapellaFromConsensus added in v4.1.0

func BlindedBeaconBlockCapellaFromConsensus(b *eth.BlindedBeaconBlockCapella) (*BlindedBeaconBlockCapella, error)

func (*BlindedBeaconBlockCapella) ToConsensus added in v4.1.0

func (*BlindedBeaconBlockCapella) ToGeneric added in v4.1.0

type BlindedBeaconBlockContentsDeneb added in v4.1.0

type BlindedBeaconBlockContentsDeneb struct {
	BlindedBlock        *BlindedBeaconBlockDeneb `json:"blinded_block" validate:"required"`
	BlindedBlobSidecars []*BlindedBlobSidecar    `json:"blinded_blob_sidecars" validate:"dive"`
}

func BlindedBeaconBlockContentsDenebFromConsensus added in v4.1.0

func BlindedBeaconBlockContentsDenebFromConsensus(b *eth.BlindedBeaconBlockAndBlobsDeneb) (*BlindedBeaconBlockContentsDeneb, error)

func (*BlindedBeaconBlockContentsDeneb) ToGeneric added in v4.1.0

type BlindedBeaconBlockDeneb added in v4.1.0

type BlindedBeaconBlockDeneb struct {
	Slot          string                       `json:"slot" validate:"required"`
	ProposerIndex string                       `json:"proposer_index" validate:"required"`
	ParentRoot    string                       `json:"parent_root" validate:"required"`
	StateRoot     string                       `json:"state_root" validate:"required"`
	Body          *BlindedBeaconBlockBodyDeneb `json:"body" validate:"required"`
}

func BlindedBeaconBlockDenebFromConsensus added in v4.1.0

func BlindedBeaconBlockDenebFromConsensus(b *eth.BlindedBeaconBlockDeneb) (*BlindedBeaconBlockDeneb, error)

func (*BlindedBeaconBlockDeneb) ToConsensus added in v4.1.0

type BlindedBlobSidecar added in v4.1.0

type BlindedBlobSidecar struct {
	BlockRoot       string `json:"block_root" validate:"required"`
	Index           string `json:"index" validate:"required"`
	Slot            string `json:"slot" validate:"required"`
	BlockParentRoot string `json:"block_parent_root" validate:"required"`
	ProposerIndex   string `json:"proposer_index" validate:"required"`
	BlobRoot        string `json:"blob_root" validate:"required"`
	KzgCommitment   string `json:"kzg_commitment" validate:"required"` // pattern: "^0x[a-fA-F0-9]{96}$" ssz-size:"48"
	KzgProof        string `json:"kzg_proof" validate:"required"`      // pattern: "^0x[a-fA-F0-9]{96}$" ssz-size:"48"
}

func BlindedBlobSidecarFromConsensus added in v4.1.0

func BlindedBlobSidecarFromConsensus(b *eth.BlindedBlobSidecar) (*BlindedBlobSidecar, error)

func (*BlindedBlobSidecar) ToConsensus added in v4.1.0

func (s *BlindedBlobSidecar) ToConsensus() (*eth.BlindedBlobSidecar, error)

type BlobSidecar added in v4.1.0

type BlobSidecar struct {
	BlockRoot       string `json:"block_root" validate:"required"`
	Index           string `json:"index" validate:"required"`
	Slot            string `json:"slot" validate:"required"`
	BlockParentRoot string `json:"block_parent_root" validate:"required"`
	ProposerIndex   string `json:"proposer_index" validate:"required"`
	Blob            string `json:"blob" validate:"required"`           // pattern: "^0x[a-fA-F0-9]{262144}$"
	KzgCommitment   string `json:"kzg_commitment" validate:"required"` // pattern: "^0x[a-fA-F0-9]{96}$" ssz-size:"48"
	KzgProof        string `json:"kzg_proof" validate:"required"`      // pattern: "^0x[a-fA-F0-9]{96}$" ssz-size:"48"
}

func BlobSidecarFromConsensus added in v4.1.0

func BlobSidecarFromConsensus(b *eth.BlobSidecar) (*BlobSidecar, error)

func (*BlobSidecar) ToConsensus added in v4.1.0

func (s *BlobSidecar) ToConsensus() (*eth.BlobSidecar, error)

type BlsToExecutionChange added in v4.1.0

type BlsToExecutionChange struct {
	ValidatorIndex     string `json:"validator_index" validate:"required"`
	FromBlsPubkey      string `json:"from_bls_pubkey" validate:"required"`
	ToExecutionAddress string `json:"to_execution_address" validate:"required"`
}

type Checkpoint

type Checkpoint struct {
	Epoch string `json:"epoch"`
	Root  string `json:"root"`
}

func CheckpointFromConsensus added in v4.1.0

func CheckpointFromConsensus(c *eth.Checkpoint) *Checkpoint

func (*Checkpoint) ToConsensus

func (c *Checkpoint) ToConsensus() (*eth.Checkpoint, error)

type Committee added in v4.1.0

type Committee struct {
	Index      string   `json:"index"`
	Slot       string   `json:"slot"`
	Validators []string `json:"validators"`
}

type ContributionAndProof

type ContributionAndProof struct {
	AggregatorIndex string                     `json:"aggregator_index"`
	Contribution    *SyncCommitteeContribution `json:"contribution"`
	SelectionProof  string                     `json:"selection_proof"`
}

func (*ContributionAndProof) ToConsensus

func (c *ContributionAndProof) ToConsensus() (*eth.ContributionAndProof, error)

type DecodeError

type DecodeError struct {
	// contains filtered or unexported fields
}

DecodeError represents an error resulting from trying to decode an HTTP request. It tracks the full field name for which decoding failed.

func NewDecodeError

func NewDecodeError(err error, field string) *DecodeError

NewDecodeError wraps an error (either the initial decoding error or another DecodeError). The current field that failed decoding must be passed in.

func (*DecodeError) Error

func (e *DecodeError) Error() string

Error returns the formatted error message which contains the full field name and the actual decoding error.

type Deposit added in v4.1.0

type Deposit struct {
	Proof []string     `json:"proof" validate:"required,dive,hexadecimal"`
	Data  *DepositData `json:"data" validate:"required"`
}

func DepositsFromConsensus added in v4.1.0

func DepositsFromConsensus(src []*eth.Deposit) ([]*Deposit, error)

type DepositData added in v4.1.0

type DepositData struct {
	Pubkey                string `json:"pubkey" validate:"required"`
	WithdrawalCredentials string `json:"withdrawal_credentials" validate:"required"`
	Amount                string `json:"amount" validate:"required"`
	Signature             string `json:"signature" validate:"required"`
}

type Eth1Data added in v4.1.0

type Eth1Data struct {
	DepositRoot  string `json:"deposit_root" validate:"required"`
	DepositCount string `json:"deposit_count" validate:"required"`
	BlockHash    string `json:"block_hash" validate:"required"`
}

type ExecutionPayload added in v4.1.0

type ExecutionPayload struct {
	ParentHash    string   `json:"parent_hash" validate:"required"`
	FeeRecipient  string   `json:"fee_recipient" validate:"required"`
	StateRoot     string   `json:"state_root" validate:"required"`
	ReceiptsRoot  string   `json:"receipts_root" validate:"required"`
	LogsBloom     string   `json:"logs_bloom" validate:"required"`
	PrevRandao    string   `json:"prev_randao" validate:"required"`
	BlockNumber   string   `json:"block_number" validate:"required"`
	GasLimit      string   `json:"gas_limit" validate:"required"`
	GasUsed       string   `json:"gas_used" validate:"required"`
	Timestamp     string   `json:"timestamp" validate:"required"`
	ExtraData     string   `json:"extra_data" validate:"required"`
	BaseFeePerGas string   `json:"base_fee_per_gas" validate:"required"`
	BlockHash     string   `json:"block_hash" validate:"required"`
	Transactions  []string `json:"transactions" validate:"required,dive,hexadecimal"`
}

type ExecutionPayloadCapella added in v4.1.0

type ExecutionPayloadCapella struct {
	ParentHash    string        `json:"parent_hash" validate:"required"`
	FeeRecipient  string        `json:"fee_recipient" validate:"required"`
	StateRoot     string        `json:"state_root" validate:"required"`
	ReceiptsRoot  string        `json:"receipts_root" validate:"required"`
	LogsBloom     string        `json:"logs_bloom" validate:"required"`
	PrevRandao    string        `json:"prev_randao" validate:"required"`
	BlockNumber   string        `json:"block_number" validate:"required"`
	GasLimit      string        `json:"gas_limit" validate:"required"`
	GasUsed       string        `json:"gas_used" validate:"required"`
	Timestamp     string        `json:"timestamp" validate:"required"`
	ExtraData     string        `json:"extra_data" validate:"required"`
	BaseFeePerGas string        `json:"base_fee_per_gas" validate:"required"`
	BlockHash     string        `json:"block_hash" validate:"required"`
	Transactions  []string      `json:"transactions" validate:"required,dive"`
	Withdrawals   []*Withdrawal `json:"withdrawals" validate:"required,dive"`
}

type ExecutionPayloadDeneb added in v4.1.0

type ExecutionPayloadDeneb struct {
	ParentHash    string        `json:"parent_hash" validate:"required"`
	FeeRecipient  string        `json:"fee_recipient" validate:"required"`
	StateRoot     string        `json:"state_root" validate:"required"`
	ReceiptsRoot  string        `json:"receipts_root" validate:"required"`
	LogsBloom     string        `json:"logs_bloom" validate:"required"`
	PrevRandao    string        `json:"prev_randao" validate:"required"`
	BlockNumber   string        `json:"block_number" validate:"required"`
	GasLimit      string        `json:"gas_limit" validate:"required"`
	GasUsed       string        `json:"gas_used" validate:"required"`
	Timestamp     string        `json:"timestamp" validate:"required"`
	ExtraData     string        `json:"extra_data" validate:"required"`
	BaseFeePerGas string        `json:"base_fee_per_gas" validate:"required"`
	BlobGasUsed   string        `json:"blob_gas_used" validate:"required"`   // new in deneb
	ExcessBlobGas string        `json:"excess_blob_gas" validate:"required"` // new in deneb
	BlockHash     string        `json:"block_hash" validate:"required"`
	Transactions  []string      `json:"transactions" validate:"required,dive,hexadecimal"`
	Withdrawals   []*Withdrawal `json:"withdrawals" validate:"required,dive"`
}

type ExecutionPayloadHeader added in v4.1.0

type ExecutionPayloadHeader struct {
	ParentHash       string `json:"parent_hash" validate:"required"`
	FeeRecipient     string `json:"fee_recipient" validate:"required"`
	StateRoot        string `json:"state_root" validate:"required"`
	ReceiptsRoot     string `json:"receipts_root" validate:"required"`
	LogsBloom        string `json:"logs_bloom" validate:"required"`
	PrevRandao       string `json:"prev_randao" validate:"required"`
	BlockNumber      string `json:"block_number" validate:"required"`
	GasLimit         string `json:"gas_limit" validate:"required"`
	GasUsed          string `json:"gas_used" validate:"required"`
	Timestamp        string `json:"timestamp" validate:"required"`
	ExtraData        string `json:"extra_data" validate:"required"`
	BaseFeePerGas    string `json:"base_fee_per_gas" validate:"required"`
	BlockHash        string `json:"block_hash" validate:"required"`
	TransactionsRoot string `json:"transactions_root" validate:"required"`
}

type ExecutionPayloadHeaderCapella added in v4.1.0

type ExecutionPayloadHeaderCapella struct {
	ParentHash       string `json:"parent_hash" validate:"required"`
	FeeRecipient     string `json:"fee_recipient" validate:"required"`
	StateRoot        string `json:"state_root" validate:"required"`
	ReceiptsRoot     string `json:"receipts_root" validate:"required"`
	LogsBloom        string `json:"logs_bloom" validate:"required"`
	PrevRandao       string `json:"prev_randao" validate:"required"`
	BlockNumber      string `json:"block_number" validate:"required"`
	GasLimit         string `json:"gas_limit" validate:"required"`
	GasUsed          string `json:"gas_used" validate:"required"`
	Timestamp        string `json:"timestamp" validate:"required"`
	ExtraData        string `json:"extra_data" validate:"required"`
	BaseFeePerGas    string `json:"base_fee_per_gas" validate:"required"`
	BlockHash        string `json:"block_hash" validate:"required"`
	TransactionsRoot string `json:"transactions_root" validate:"required"`
	WithdrawalsRoot  string `json:"withdrawals_root" validate:"required"`
}

type ExecutionPayloadHeaderDeneb added in v4.1.0

type ExecutionPayloadHeaderDeneb struct {
	ParentHash       string `json:"parent_hash" validate:"required"`
	FeeRecipient     string `json:"fee_recipient" validate:"required"`
	StateRoot        string `json:"state_root" validate:"required"`
	ReceiptsRoot     string `json:"receipts_root" validate:"required"`
	LogsBloom        string `json:"logs_bloom" validate:"required"`
	PrevRandao       string `json:"prev_randao" validate:"required"`
	BlockNumber      string `json:"block_number" validate:"required"`
	GasLimit         string `json:"gas_limit" validate:"required"`
	GasUsed          string `json:"gas_used" validate:"required"`
	Timestamp        string `json:"timestamp" validate:"required"`
	ExtraData        string `json:"extra_data" validate:"required"`
	BaseFeePerGas    string `json:"base_fee_per_gas" validate:"required"`
	BlobGasUsed      string `json:"blob_gas_used" validate:"required"`   // new in deneb
	ExcessBlobGas    string `json:"excess_blob_gas" validate:"required"` // new in deneb
	BlockHash        string `json:"block_hash" validate:"required"`
	TransactionsRoot string `json:"transactions_root" validate:"required"`
	WithdrawalsRoot  string `json:"withdrawals_root" validate:"required"`
}

type FeeRecipient added in v4.1.0

type FeeRecipient struct {
	ValidatorIndex string `json:"validator_index"`
	FeeRecipient   string `json:"fee_recipient"`
}

type Fork added in v4.1.0

type Fork struct {
	PreviousVersion string `json:"previous_version"`
	CurrentVersion  string `json:"current_version"`
	Epoch           string `json:"epoch"`
}

func (*Fork) ToConsensus added in v4.1.0

func (s *Fork) ToConsensus() (*eth.Fork, error)

type IndexedAttestation added in v4.1.0

type IndexedAttestation struct {
	AttestingIndices []string         `json:"attesting_indices" validate:"required,dive"`
	Data             *AttestationData `json:"data" validate:"required"`
	Signature        string           `json:"signature" validate:"required"`
}

type IndexedVerificationFailure added in v4.1.0

type IndexedVerificationFailure struct {
	Index   int    `json:"index"`
	Message string `json:"message"`
}

IndexedVerificationFailure represents an issue when verifying a single indexed object e.g. an item in an array.

type IndexedVerificationFailureError added in v4.1.0

type IndexedVerificationFailureError struct {
	Message  string                        `json:"message"`
	Code     int                           `json:"code"`
	Failures []*IndexedVerificationFailure `json:"failures"`
}

IndexedVerificationFailureError wraps a collection of verification failures.

func (*IndexedVerificationFailureError) StatusCode added in v4.1.0

func (e *IndexedVerificationFailureError) StatusCode() int

type ProposerSlashing added in v4.1.0

type ProposerSlashing struct {
	SignedHeader1 *SignedBeaconBlockHeader `json:"signed_header_1" validate:"required"`
	SignedHeader2 *SignedBeaconBlockHeader `json:"signed_header_2" validate:"required"`
}

func ProposerSlashingsFromConsensus added in v4.1.0

func ProposerSlashingsFromConsensus(src []*eth.ProposerSlashing) ([]*ProposerSlashing, error)

type SignedAggregateAttestationAndProof

type SignedAggregateAttestationAndProof struct {
	Message   *AggregateAttestationAndProof `json:"message"`
	Signature string                        `json:"signature"`
}

func (*SignedAggregateAttestationAndProof) ToConsensus

type SignedBeaconBlock added in v4.1.0

type SignedBeaconBlock struct {
	Message   *BeaconBlock `json:"message" validate:"required"`
	Signature string       `json:"signature" validate:"required"`
}

func (*SignedBeaconBlock) ToGeneric added in v4.1.0

type SignedBeaconBlockAltair added in v4.1.0

type SignedBeaconBlockAltair struct {
	Message   *BeaconBlockAltair `json:"message" validate:"required"`
	Signature string             `json:"signature" validate:"required"`
}

func (*SignedBeaconBlockAltair) ToGeneric added in v4.1.0

type SignedBeaconBlockBellatrix added in v4.1.0

type SignedBeaconBlockBellatrix struct {
	Message   *BeaconBlockBellatrix `json:"message" validate:"required"`
	Signature string                `json:"signature" validate:"required"`
}

func (*SignedBeaconBlockBellatrix) ToGeneric added in v4.1.0

type SignedBeaconBlockCapella added in v4.1.0

type SignedBeaconBlockCapella struct {
	Message   *BeaconBlockCapella `json:"message" validate:"required"`
	Signature string              `json:"signature" validate:"required"`
}

func (*SignedBeaconBlockCapella) ToGeneric added in v4.1.0

type SignedBeaconBlockContentsDeneb added in v4.1.0

type SignedBeaconBlockContentsDeneb struct {
	SignedBlock        *SignedBeaconBlockDeneb `json:"signed_block" validate:"required"`
	SignedBlobSidecars []*SignedBlobSidecar    `json:"signed_blob_sidecars"  validate:"dive"`
}

func SignedBeaconBlockContentsDenebFromConsensus added in v4.1.0

func SignedBeaconBlockContentsDenebFromConsensus(b *eth.SignedBeaconBlockAndBlobsDeneb) (*SignedBeaconBlockContentsDeneb, error)

func (*SignedBeaconBlockContentsDeneb) ToGeneric added in v4.1.0

func (*SignedBeaconBlockContentsDeneb) ToUnsigned added in v4.1.0

type SignedBeaconBlockDeneb added in v4.1.0

type SignedBeaconBlockDeneb struct {
	Message   *BeaconBlockDeneb `json:"message" validate:"required"`
	Signature string            `json:"signature" validate:"required"`
}

func SignedBeaconBlockDenebFromConsensus added in v4.1.0

func SignedBeaconBlockDenebFromConsensus(b *eth.SignedBeaconBlockDeneb) (*SignedBeaconBlockDeneb, error)

func (*SignedBeaconBlockDeneb) ToConsensus added in v4.1.0

type SignedBeaconBlockHeader added in v4.1.0

type SignedBeaconBlockHeader struct {
	Message   *BeaconBlockHeader `json:"message" validate:"required"`
	Signature string             `json:"signature" validate:"required"`
}

type SignedBeaconBlockHeaderContainer added in v4.1.0

type SignedBeaconBlockHeaderContainer struct {
	Header    *SignedBeaconBlockHeader `json:"header"`
	Root      string                   `json:"root"`
	Canonical bool                     `json:"canonical"`
}

type SignedBlindedBeaconBlockBellatrix added in v4.1.0

type SignedBlindedBeaconBlockBellatrix struct {
	Message   *BlindedBeaconBlockBellatrix `json:"message" validate:"required"`
	Signature string                       `json:"signature" validate:"required"`
}

func SignedBlindedBeaconBlockBellatrixFromConsensus added in v4.1.0

func SignedBlindedBeaconBlockBellatrixFromConsensus(b *eth.SignedBlindedBeaconBlockBellatrix) (*SignedBlindedBeaconBlockBellatrix, error)

func (*SignedBlindedBeaconBlockBellatrix) ToGeneric added in v4.1.0

type SignedBlindedBeaconBlockCapella added in v4.1.0

type SignedBlindedBeaconBlockCapella struct {
	Message   *BlindedBeaconBlockCapella `json:"message" validate:"required"`
	Signature string                     `json:"signature" validate:"required"`
}

func SignedBlindedBeaconBlockCapellaFromConsensus added in v4.1.0

func SignedBlindedBeaconBlockCapellaFromConsensus(b *eth.SignedBlindedBeaconBlockCapella) (*SignedBlindedBeaconBlockCapella, error)

func (*SignedBlindedBeaconBlockCapella) ToGeneric added in v4.1.0

type SignedBlindedBeaconBlockContentsDeneb added in v4.1.0

type SignedBlindedBeaconBlockContentsDeneb struct {
	SignedBlindedBlock        *SignedBlindedBeaconBlockDeneb `json:"signed_blinded_block" validate:"required"`
	SignedBlindedBlobSidecars []*SignedBlindedBlobSidecar    `json:"signed_blinded_blob_sidecars" validate:"dive"`
}

func SignedBlindedBeaconBlockContentsDenebFromConsensus added in v4.1.0

func SignedBlindedBeaconBlockContentsDenebFromConsensus(b *eth.SignedBlindedBeaconBlockAndBlobsDeneb) (*SignedBlindedBeaconBlockContentsDeneb, error)

func (*SignedBlindedBeaconBlockContentsDeneb) ToGeneric added in v4.1.0

func (*SignedBlindedBeaconBlockContentsDeneb) ToUnsigned added in v4.1.0

type SignedBlindedBeaconBlockDeneb added in v4.1.0

type SignedBlindedBeaconBlockDeneb struct {
	Message   *BlindedBeaconBlockDeneb `json:"message" validate:"required"`
	Signature string                   `json:"signature" validate:"required"`
}

func SignedBlindedBeaconBlockDenebFromConsensus added in v4.1.0

func SignedBlindedBeaconBlockDenebFromConsensus(b *eth.SignedBlindedBeaconBlockDeneb) (*SignedBlindedBeaconBlockDeneb, error)

func (*SignedBlindedBeaconBlockDeneb) ToConsensus added in v4.1.0

type SignedBlindedBlobSidecar added in v4.1.0

type SignedBlindedBlobSidecar struct {
	Message   *BlindedBlobSidecar `json:"message" validate:"required"`
	Signature string              `json:"signature" validate:"required"`
}

func SignedBlindedBlobSidecarFromConsensus added in v4.1.0

func SignedBlindedBlobSidecarFromConsensus(b *eth.SignedBlindedBlobSidecar) (*SignedBlindedBlobSidecar, error)

func (*SignedBlindedBlobSidecar) ToConensus added in v4.1.0

type SignedBlobSidecar added in v4.1.0

type SignedBlobSidecar struct {
	Message   *BlobSidecar `json:"message" validate:"required"`
	Signature string       `json:"signature" validate:"required"`
}

func SignedBlobSidecarFromConsensus added in v4.1.0

func SignedBlobSidecarFromConsensus(b *eth.SignedBlobSidecar) (*SignedBlobSidecar, error)

func (*SignedBlobSidecar) ToConsensus added in v4.1.0

func (s *SignedBlobSidecar) ToConsensus() (*eth.SignedBlobSidecar, error)

type SignedBlsToExecutionChange added in v4.1.0

type SignedBlsToExecutionChange struct {
	Message   *BlsToExecutionChange `json:"message" validate:"required"`
	Signature string                `json:"signature" validate:"required"`
}

func BlsChangesFromConsensus added in v4.1.0

func BlsChangesFromConsensus(src []*eth.SignedBLSToExecutionChange) ([]*SignedBlsToExecutionChange, error)

type SignedContributionAndProof

type SignedContributionAndProof struct {
	Message   *ContributionAndProof `json:"message"`
	Signature string                `json:"signature"`
}

func (*SignedContributionAndProof) ToConsensus

type SignedValidatorRegistration added in v4.1.0

type SignedValidatorRegistration struct {
	Message   *ValidatorRegistration `json:"message"`
	Signature string                 `json:"signature"`
}

func SignedValidatorRegistrationFromConsensus added in v4.1.0

func SignedValidatorRegistrationFromConsensus(vr *eth.SignedValidatorRegistrationV1) (*SignedValidatorRegistration, error)

func (*SignedValidatorRegistration) ToConsensus added in v4.1.0

type SignedVoluntaryExit added in v4.1.0

type SignedVoluntaryExit struct {
	Message   *VoluntaryExit `json:"message"`
	Signature string         `json:"signature"`
}

func ExitsFromConsensus added in v4.1.0

func ExitsFromConsensus(src []*eth.SignedVoluntaryExit) ([]*SignedVoluntaryExit, error)

func SignedVoluntaryExitFromConsensus added in v4.1.0

func SignedVoluntaryExitFromConsensus(e *eth.SignedVoluntaryExit) *SignedVoluntaryExit

func (*SignedVoluntaryExit) ToConsensus added in v4.1.0

func (e *SignedVoluntaryExit) ToConsensus() (*eth.SignedVoluntaryExit, error)

type SyncAggregate added in v4.1.0

type SyncAggregate struct {
	SyncCommitteeBits      string `json:"sync_committee_bits" validate:"required"`
	SyncCommitteeSignature string `json:"sync_committee_signature" validate:"required"`
}

type SyncCommitteeContribution

type SyncCommitteeContribution struct {
	Slot              string `json:"slot"`
	BeaconBlockRoot   string `json:"beacon_block_root"`
	SubcommitteeIndex string `json:"subcommittee_index"`
	AggregationBits   string `json:"aggregation_bits"`
	Signature         string `json:"signature"`
}

func (*SyncCommitteeContribution) ToConsensus

type SyncCommitteeMessage added in v4.1.0

type SyncCommitteeMessage struct {
	Slot            string `json:"slot"`
	BeaconBlockRoot string `json:"beacon_block_root"`
	ValidatorIndex  string `json:"validator_index"`
	Signature       string `json:"signature"`
}

func (*SyncCommitteeMessage) ToConsensus added in v4.1.0

func (m *SyncCommitteeMessage) ToConsensus() (*eth.SyncCommitteeMessage, error)

type SyncCommitteeSubscription added in v4.1.0

type SyncCommitteeSubscription struct {
	ValidatorIndex       string   `json:"validator_index"`
	SyncCommitteeIndices []string `json:"sync_committee_indices"`
	UntilEpoch           string   `json:"until_epoch"`
}

func (*SyncCommitteeSubscription) ToConsensus added in v4.1.0

type SyncDetails added in v4.1.0

type SyncDetails struct {
	HeadSlot     string `json:"head_slot"`
	SyncDistance string `json:"sync_distance"`
	IsSyncing    bool   `json:"is_syncing"`
	IsOptimistic bool   `json:"is_optimistic"`
	ElOffline    bool   `json:"el_offline"`
}

SyncDetails contains information about node sync status.

type SyncDetailsContainer added in v4.1.0

type SyncDetailsContainer struct {
	Data *SyncDetails `json:"data"`
}

SyncDetailsContainer is a wrapper for Data.

type ValidatorRegistration added in v4.1.0

type ValidatorRegistration struct {
	FeeRecipient string `json:"fee_recipient"`
	GasLimit     string `json:"gas_limit"`
	Timestamp    string `json:"timestamp"`
	Pubkey       string `json:"pubkey"`
}

func ValidatorRegistrationFromConsensus added in v4.1.0

func ValidatorRegistrationFromConsensus(vr *eth.ValidatorRegistrationV1) (*ValidatorRegistration, error)

func (*ValidatorRegistration) ToConsensus added in v4.1.0

type VoluntaryExit added in v4.1.0

type VoluntaryExit struct {
	Epoch          string `json:"epoch"`
	ValidatorIndex string `json:"validator_index"`
}

func VoluntaryExitFromConsensus added in v4.1.0

func VoluntaryExitFromConsensus(e *eth.VoluntaryExit) *VoluntaryExit

func (*VoluntaryExit) ToConsensus added in v4.1.0

func (e *VoluntaryExit) ToConsensus() (*eth.VoluntaryExit, error)

type Withdrawal added in v4.1.0

type Withdrawal struct {
	WithdrawalIndex  string `json:"index" validate:"required"`
	ValidatorIndex   string `json:"validator_index" validate:"required"`
	ExecutionAddress string `json:"address" validate:"required"`
	Amount           string `json:"amount" validate:"required"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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