beacon

package
v5.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-3.0 Imports: 57 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 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.PayloadReconstructor
	FinalizationFetcher           blockchain.FinalizationFetcher
	BLSChangesPool                blstoexec.PoolManager
	ForkchoiceFetcher             blockchain.ForkchoiceFetcher
	CoreService                   *core.Service
}

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) GetAttesterSlashings

func (s *Server) GetAttesterSlashings(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetBlindedBlock

func (s *Server) GetBlindedBlock(w http.ResponseWriter, r *http.Request)

GetBlindedBlock retrieves blinded block for given block id.

func (*Server) GetBlockAttestations

func (s *Server) GetBlockAttestations(w http.ResponseWriter, r *http.Request)

GetBlockAttestations retrieves attestation included in requested block.

func (*Server) GetBlockHeader

func (s *Server) GetBlockHeader(w http.ResponseWriter, r *http.Request)

GetBlockHeader retrieves block header for given block id.

func (*Server) GetBlockHeaders

func (s *Server) GetBlockHeaders(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetBlockRoot

func (s *Server) GetBlockRoot(w http.ResponseWriter, r *http.Request)

GetBlockRoot retrieves the root of a block.

func (*Server) GetBlockV2

func (s *Server) GetBlockV2(w http.ResponseWriter, r *http.Request)

GetBlockV2 retrieves block details for given block ID.

func (*Server) GetCommittees

func (s *Server) GetCommittees(w http.ResponseWriter, r *http.Request)

GetCommittees 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) GetDepositSnapshot

func (s *Server) GetDepositSnapshot(w http.ResponseWriter, r *http.Request)

GetDepositSnapshot retrieves the EIP-4881 Deposit Tree Snapshot. Either a JSON or, if the Accept header was added, bytes serialized by SSZ will be returned.

func (*Server) GetFinalityCheckpoints

func (s *Server) GetFinalityCheckpoints(w http.ResponseWriter, r *http.Request)

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) GetGenesis

func (s *Server) GetGenesis(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetProposerSlashings

func (s *Server) GetProposerSlashings(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetRandao

func (s *Server) GetRandao(w http.ResponseWriter, r *http.Request)

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) GetStateFork

func (s *Server) GetStateFork(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetStateRoot

func (s *Server) GetStateRoot(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetSyncCommittees

func (s *Server) GetSyncCommittees(w http.ResponseWriter, r *http.Request)

GetSyncCommittees 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) GetValidator

func (s *Server) GetValidator(w http.ResponseWriter, r *http.Request)

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

func (*Server) GetValidatorBalances

func (s *Server) GetValidatorBalances(w http.ResponseWriter, r *http.Request)

GetValidatorBalances returns a filterable list of validator balances.

func (*Server) GetValidators

func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request)

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

func (*Server) ListAttestations

func (s *Server) ListAttestations(w http.ResponseWriter, r *http.Request)

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

func (*Server) ListBLSToExecutionChanges

func (s *Server) ListBLSToExecutionChanges(w http.ResponseWriter, r *http.Request)

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

func (*Server) ListVoluntaryExits

func (s *Server) ListVoluntaryExits(w http.ResponseWriter, r *http.Request)

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

func (*Server) PublishBlindedBlock

func (s *Server) PublishBlindedBlock(w http.ResponseWriter, r *http.Request)

PublishBlindedBlock 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. After Deneb, this additionally instructs the beacon node to broadcast all given signed blobs.

func (*Server) PublishBlindedBlockV2

func (s *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`. After Deneb, this additionally instructs the beacon node to broadcast all given signed blobs. The broadcast behaviour may be adjusted via the `broadcast_validation` query parameter.

func (*Server) PublishBlock

func (s *Server) PublishBlock(w http.ResponseWriter, r *http.Request)

PublishBlock 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 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. After Deneb, this additionally instructs the beacon node to broadcast all given signed blobs.

func (*Server) PublishBlockV2

func (s *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. After Deneb, this additionally instructs the beacon node to broadcast all given signed blobs. The broadcast behaviour may be adjusted via the `broadcast_validation` query parameter.

func (*Server) SubmitAttestations

func (s *Server) SubmitAttestations(w http.ResponseWriter, r *http.Request)

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

func (*Server) SubmitAttesterSlashing

func (s *Server) SubmitAttesterSlashing(w http.ResponseWriter, r *http.Request)

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

func (*Server) SubmitBLSToExecutionChanges

func (s *Server) SubmitBLSToExecutionChanges(w http.ResponseWriter, r *http.Request)

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

func (*Server) SubmitProposerSlashing

func (s *Server) SubmitProposerSlashing(w http.ResponseWriter, r *http.Request)

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

func (*Server) SubmitSyncCommitteeSignatures

func (s *Server) SubmitSyncCommitteeSignatures(w http.ResponseWriter, r *http.Request)

SubmitSyncCommitteeSignatures submits sync committee signature objects to the node.

func (*Server) SubmitVoluntaryExit

func (s *Server) SubmitVoluntaryExit(w http.ResponseWriter, r *http.Request)

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

Jump to

Keyboard shortcuts

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