beacon

package
v0.0.0-...-bb812c9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0, GPL-3.0, MIT Imports: 65 Imported by: 0

Documentation

Overview

Package beacon defines a gRPC beacon service implementation, following the official API standards https://ethereum.github.io/beacon-apis/#/. This package includes the beacon and config endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attestation

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

type AttestationData

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

type AttesterSlashing

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

type BeaconBlock

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"`
}

type BeaconBlockAltair

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"`
}

type BeaconBlockBellatrix

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"`
}

type BeaconBlockBody

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

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"`
	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"`
	SyncAggregate     SyncAggregate         `json:"sync_aggregate" validate:"required"`
}

type BeaconBlockBodyBellatrix

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"`
	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"`
	SyncAggregate     SyncAggregate         `json:"sync_aggregate" validate:"required"`
	ExecutionPayload  ExecutionPayload      `json:"execution_payload" validate:"required"`
}

type BeaconBlockBodyCapella

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"`
	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"`
	SyncAggregate         SyncAggregate                `json:"sync_aggregate" validate:"required"`
	ExecutionPayload      ExecutionPayloadCapella      `json:"execution_payload" validate:"required"`
	BlsToExecutionChanges []SignedBlsToExecutionChange `json:"bls_to_execution_changes" validate:"required"`
}

type BeaconBlockCapella

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"`
}

type BeaconBlockHeader

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"`
}

type BlindedBeaconBlockBellatrix

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"`
}

type BlindedBeaconBlockBodyBellatrix

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"`
	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"`
	SyncAggregate          SyncAggregate          `json:"sync_aggregate" validate:"required"`
	ExecutionPayloadHeader ExecutionPayloadHeader `json:"execution_payload_header" validate:"required"`
}

type BlindedBeaconBlockBodyCapella

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"`
	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"`
	SyncAggregate          SyncAggregate                 `json:"sync_aggregate" validate:"required"`
	ExecutionPayloadHeader ExecutionPayloadHeaderCapella `json:"execution_payload_header" validate:"required"`
	BlsToExecutionChanges  []SignedBlsToExecutionChange  `json:"bls_to_execution_changes" validate:"required"`
}

type BlindedBeaconBlockCapella

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"`
}

type BlsToExecutionChange

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" validate:"required"`
	Root  string `json:"root" validate:"required"`
}

type Deposit

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

type DepositData

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

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

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"`
}

type ExecutionPayloadCapella

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"`
	Withdrawals   []Withdrawal `json:"withdrawals" validate:"required"`
}

type ExecutionPayloadHeader

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

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 IndexedAttestation

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

type ProposerSlashing

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

type Server

type Server struct {
	BeaconDB                      db.ReadOnlyDatabase
	ChainInfoFetcher              blockchain.ChainInfoFetcher
	GenesisTimeFetcher            blockchain.TimeFetcher
	BlockReceiver                 blockchain.BlockReceiver
	BlockNotifier                 blockfeed.Notifier
	OperationNotifier             operation.Notifier
	Broadcaster                   p2p.Broadcaster
	AttestationsPool              attestations.Pool
	SlashingsPool                 slashings.PoolManager
	VoluntaryExitsPool            voluntaryexits.PoolManager
	StateGenService               stategen.StateManager
	Stater                        lookup.Stater
	Blocker                       lookup.Blocker
	HeadFetcher                   blockchain.HeadFetcher
	TimeFetcher                   blockchain.TimeFetcher
	OptimisticModeFetcher         blockchain.OptimisticModeFetcher
	V1Alpha1ValidatorServer       eth.BeaconNodeValidatorServer
	SyncChecker                   sync.Checker
	CanonicalHistory              *stategen.CanonicalHistory
	ExecutionPayloadReconstructor execution.ExecutionPayloadReconstructor
	FinalizationFetcher           blockchain.FinalizationFetcher
	BLSChangesPool                blstoexec.PoolManager
	ForkchoiceFetcher             blockchain.ForkchoiceFetcher
}

Server defines a server implementation of the gRPC Beacon Chain service, providing RPC endpoints to access data relevant to the Ethereum Beacon Chain.

func (*Server) GetBlindedBlock

func (bs *Server) GetBlindedBlock(ctx context.Context, req *ethpbv1.BlockRequest) (*ethpbv2.BlindedBlockResponse, error)

GetBlindedBlock retrieves blinded block for given block id.

func (*Server) GetBlindedBlockSSZ

func (bs *Server) GetBlindedBlockSSZ(ctx context.Context, req *ethpbv1.BlockRequest) (*ethpbv2.SSZContainer, error)

GetBlindedBlockSSZ returns the SSZ-serialized version of the blinded beacon block for given block id.

func (*Server) GetBlock

func (bs *Server) GetBlock(ctx context.Context, req *ethpbv1.BlockRequest) (*ethpbv1.BlockResponse, error)

GetBlock retrieves block details for given block ID. DEPRECATED: please use GetBlockV2 instead

func (*Server) GetBlockHeader

func (bs *Server) GetBlockHeader(ctx context.Context, req *ethpbv1.BlockRequest) (*ethpbv1.BlockHeaderResponse, error)

GetBlockHeader retrieves block header for given block id.

func (*Server) GetBlockRoot

func (bs *Server) GetBlockRoot(ctx context.Context, req *ethpbv1.BlockRequest) (*ethpbv1.BlockRootResponse, error)

GetBlockRoot retrieves hashTreeRoot of ReadOnlyBeaconBlock/BeaconBlockHeader.

func (*Server) GetBlockSSZ

func (bs *Server) GetBlockSSZ(ctx context.Context, req *ethpbv1.BlockRequest) (*ethpbv1.BlockSSZResponse, error)

GetBlockSSZ returns the SSZ-serialized version of the becaon block for given block ID. DEPRECATED: please use GetBlockV2SSZ instead

func (*Server) GetBlockSSZV2

func (bs *Server) GetBlockSSZV2(ctx context.Context, req *ethpbv2.BlockRequestV2) (*ethpbv2.SSZContainer, error)

GetBlockSSZV2 returns the SSZ-serialized version of the beacon block for given block ID.

func (*Server) GetBlockV2

func (bs *Server) GetBlockV2(ctx context.Context, req *ethpbv2.BlockRequestV2) (*ethpbv2.BlockResponseV2, error)

GetBlockV2 retrieves block details for given block ID.

func (*Server) GetDepositContract

func (_ *Server) GetDepositContract(ctx context.Context, _ *emptypb.Empty) (*ethpb.DepositContractResponse, error)

GetDepositContract retrieves deposit contract address and genesis fork version.

func (*Server) GetFinalityCheckpoints

func (bs *Server) GetFinalityCheckpoints(ctx context.Context, req *ethpb.StateRequest) (*ethpb.StateFinalityCheckpointResponse, error)

GetFinalityCheckpoints returns finality checkpoints for state with given 'stateId'. In case finality is not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root.

func (*Server) GetForkSchedule

func (_ *Server) GetForkSchedule(ctx context.Context, _ *emptypb.Empty) (*ethpb.ForkScheduleResponse, error)

GetForkSchedule retrieve all scheduled upcoming forks this node is aware of.

func (*Server) GetGenesis

func (bs *Server) GetGenesis(ctx context.Context, _ *emptypb.Empty) (*ethpb.GenesisResponse, error)

GetGenesis retrieves details of the chain's genesis which can be used to identify chain.

func (*Server) GetRandao

func (bs *Server) GetRandao(ctx context.Context, req *eth2.RandaoRequest) (*eth2.RandaoResponse, error)

GetRandao fetches the RANDAO mix for the requested epoch from the state identified by state_id. If an epoch is not specified then the RANDAO mix for the state's current epoch will be returned. By adjusting the state_id parameter you can query for any historic value of the RANDAO mix. Ordinarily states from the same epoch will mutate the RANDAO mix for that epoch as blocks are applied.

func (*Server) GetSpec

func (_ *Server) GetSpec(ctx context.Context, _ *emptypb.Empty) (*ethpb.SpecResponse, error)

GetSpec retrieves specification configuration (without Phase 1 params) used on this node. Specification params list Values are returned with following format: - any value starting with 0x in the spec is returned as a hex string. - all other values are returned as number.

func (*Server) GetStateFork

func (bs *Server) GetStateFork(ctx context.Context, req *ethpb.StateRequest) (*ethpb.StateForkResponse, error)

GetStateFork returns Fork object for state with given 'stateId'.

func (*Server) GetStateRoot

func (bs *Server) GetStateRoot(ctx context.Context, req *ethpb.StateRequest) (*ethpb.StateRootResponse, error)

GetStateRoot calculates HashTreeRoot for state with given 'stateId'. If stateId is root, same value will be returned.

func (*Server) GetValidator

GetValidator returns a validator specified by state and id or public key along with status and balance.

func (*Server) GetWeakSubjectivity

func (bs *Server) GetWeakSubjectivity(ctx context.Context, _ *empty.Empty) (*ethpbv1.WeakSubjectivityResponse, error)

GetWeakSubjectivity computes the starting epoch of the current weak subjectivity period, and then also determines the best block root and state root to use for a Checkpoint Sync starting from that point. DEPRECATED: GetWeakSubjectivity endpoint will no longer be supported

func (*Server) ListBLSToExecutionChanges

func (bs *Server) ListBLSToExecutionChanges(ctx context.Context, _ *emptypb.Empty) (*ethpbv2.BLSToExecutionChangesPoolResponse, error)

ListBLSToExecutionChanges retrieves BLS to execution changes known by the node but not necessarily incorporated into any block

func (*Server) ListBlockAttestations

func (bs *Server) ListBlockAttestations(ctx context.Context, req *ethpbv1.BlockRequest) (*ethpbv1.BlockAttestationsResponse, error)

ListBlockAttestations retrieves attestation included in requested block.

func (*Server) ListBlockHeaders

func (bs *Server) ListBlockHeaders(ctx context.Context, req *ethpbv1.BlockHeadersRequest) (*ethpbv1.BlockHeadersResponse, error)

ListBlockHeaders retrieves block headers matching given query. By default it will fetch current head slot blocks.

func (*Server) ListCommittees

ListCommittees retrieves the committees for the given state at the given epoch. If the requested slot and index are defined, only those committees are returned.

func (*Server) ListPoolAttestations

ListPoolAttestations retrieves attestations known by the node but not necessarily incorporated into any block. Allows filtering by committee index or slot.

func (*Server) ListPoolAttesterSlashings

func (bs *Server) ListPoolAttesterSlashings(ctx context.Context, _ *emptypb.Empty) (*ethpbv1.AttesterSlashingsPoolResponse, error)

ListPoolAttesterSlashings retrieves attester slashings known by the node but not necessarily incorporated into any block.

func (*Server) ListPoolProposerSlashings

func (bs *Server) ListPoolProposerSlashings(ctx context.Context, _ *emptypb.Empty) (*ethpbv1.ProposerSlashingPoolResponse, error)

ListPoolProposerSlashings retrieves proposer slashings known by the node but not necessarily incorporated into any block.

func (*Server) ListPoolVoluntaryExits

func (bs *Server) ListPoolVoluntaryExits(ctx context.Context, _ *emptypb.Empty) (*ethpbv1.VoluntaryExitsPoolResponse, error)

ListPoolVoluntaryExits retrieves voluntary exits known by the node but not necessarily incorporated into any block.

func (*Server) ListSyncCommittees

ListSyncCommittees retrieves the sync committees for the given epoch. If the epoch is not passed in, then the sync committees for the epoch of the state will be obtained.

func (*Server) ListValidatorBalances

func (bs *Server) ListValidatorBalances(ctx context.Context, req *ethpb.ValidatorBalancesRequest) (*ethpb.ValidatorBalancesResponse, error)

ListValidatorBalances returns a filterable list of validator balances.

func (*Server) ListValidators

ListValidators returns filterable list of validators with their balance, status and index.

func (*Server) PublishBlindedBlockV2

func (bs *Server) PublishBlindedBlockV2(w http.ResponseWriter, r *http.Request)

PublishBlindedBlockV2 instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202). Pre-Bellatrix, this endpoint will accept a `SignedBeaconBlock`. The broadcast behaviour may be adjusted via the `broadcast_validation` query parameter.

func (*Server) PublishBlockV2

func (bs *Server) PublishBlockV2(w http.ResponseWriter, r *http.Request)

PublishBlockV2 instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. A success response (20x) indicates that the block passed gossip validation and was successfully broadcast onto the network. The beacon node is also expected to integrate the block into the state, but may broadcast it before doing so, so as to aid timely delivery of the block. Should the block fail full validation, a separate success response code (202) is used to indicate that the block was successfully broadcast but failed integration. The broadcast behaviour may be adjusted via the `broadcast_validation` query parameter.

func (*Server) SubmitAttestations

func (bs *Server) SubmitAttestations(ctx context.Context, req *ethpbv1.SubmitAttestationsRequest) (*emptypb.Empty, error)

SubmitAttestations submits Attestation object to node. If attestation passes all validation constraints, node MUST publish attestation on appropriate subnet.

func (*Server) SubmitAttesterSlashing

func (bs *Server) SubmitAttesterSlashing(ctx context.Context, req *ethpbv1.AttesterSlashing) (*emptypb.Empty, error)

SubmitAttesterSlashing submits AttesterSlashing object to node's pool and if passes validation node MUST broadcast it to network.

func (*Server) SubmitBlindedBlock

func (bs *Server) SubmitBlindedBlock(ctx context.Context, req *ethpbv2.SignedBlindedBeaconBlockContainer) (*emptypb.Empty, error)

SubmitBlindedBlock instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `ReadOnlySignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `ReadOnlySignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `ReadOnlyBeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202).

func (*Server) SubmitBlindedBlockSSZ

func (bs *Server) SubmitBlindedBlockSSZ(ctx context.Context, req *ethpbv2.SSZContainer) (*emptypb.Empty, error)

SubmitBlindedBlockSSZ instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct and publish a `ReadOnlySignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`. The beacon node should broadcast a newly constructed `ReadOnlySignedBeaconBlock` to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed `ReadOnlyBeaconBlock`, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202).

The provided block must be SSZ-serialized.

func (*Server) SubmitBlock

func (bs *Server) SubmitBlock(ctx context.Context, req *ethpbv2.SignedBeaconBlockContainer) (*emptypb.Empty, error)

SubmitBlock instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed ReadOnlyBeaconBlock, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202).

func (*Server) SubmitBlockSSZ

func (bs *Server) SubmitBlockSSZ(ctx context.Context, req *ethpbv2.SSZContainer) (*emptypb.Empty, error)

SubmitBlockSSZ instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be included in the beacon chain. The beacon node is not required to validate the signed ReadOnlyBeaconBlock, and a successful response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the new block into its state, and therefore validate the block internally, however blocks which fail the validation are still broadcast but a different status code is returned (202).

The provided block must be SSZ-serialized.

func (*Server) SubmitPoolSyncCommitteeSignatures

func (bs *Server) SubmitPoolSyncCommitteeSignatures(ctx context.Context, req *ethpbv2.SubmitPoolSyncCommitteeSignatures) (*empty.Empty, error)

SubmitPoolSyncCommitteeSignatures submits sync committee signature objects to the node.

func (*Server) SubmitProposerSlashing

func (bs *Server) SubmitProposerSlashing(ctx context.Context, req *ethpbv1.ProposerSlashing) (*emptypb.Empty, error)

SubmitProposerSlashing submits AttesterSlashing object to node's pool and if passes validation node MUST broadcast it to network.

func (*Server) SubmitSignedBLSToExecutionChanges

func (bs *Server) SubmitSignedBLSToExecutionChanges(ctx context.Context, req *ethpbv2.SubmitBLSToExecutionChangesRequest) (*emptypb.Empty, error)

SubmitSignedBLSToExecutionChanges submits said object to the node's pool if it passes validation the node must broadcast it to the network.

func (*Server) SubmitVoluntaryExit

func (bs *Server) SubmitVoluntaryExit(ctx context.Context, req *ethpbv1.SignedVoluntaryExit) (*emptypb.Empty, error)

SubmitVoluntaryExit submits SignedVoluntaryExit object to node's pool and if passes validation node MUST broadcast it to network.

type SignedBeaconBlock

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

func (*SignedBeaconBlock) ToGeneric

type SignedBeaconBlockAltair

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

func (*SignedBeaconBlockAltair) ToGeneric

type SignedBeaconBlockBellatrix

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

func (*SignedBeaconBlockBellatrix) ToGeneric

type SignedBeaconBlockCapella

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

func (*SignedBeaconBlockCapella) ToGeneric

type SignedBeaconBlockHeader

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

type SignedBlindedBeaconBlockBellatrix

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

func (*SignedBlindedBeaconBlockBellatrix) ToGeneric

type SignedBlindedBeaconBlockCapella

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

func (*SignedBlindedBeaconBlockCapella) ToGeneric

type SignedBlsToExecutionChange

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

type SignedVoluntaryExit

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

type SyncAggregate

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

type VoluntaryExit

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

type Withdrawal

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"`
}

Jump to

Keyboard shortcuts

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