debug

package
v4.0.0-...-ae7b6de Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package debug 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 BeaconState

type BeaconState struct {
	GenesisTime                 string                    `json:"genesis_time"`
	GenesisValidatorsRoot       string                    `json:"genesis_validators_root"`
	Slot                        string                    `json:"slot"`
	Fork                        *shared.Fork              `json:"fork"`
	LatestBlockHeader           *shared.BeaconBlockHeader `json:"latest_block_header"`
	BlockRoots                  []string                  `json:"block_roots"`
	StateRoots                  []string                  `json:"state_roots"`
	HistoricalRoots             []string                  `json:"historical_roots"`
	Eth1Data                    *shared.Eth1Data          `json:"eth1_data"`
	Eth1DataVotes               []*shared.Eth1Data        `json:"eth1_data_votes"`
	Eth1DepositIndex            string                    `json:"eth1_deposit_index"`
	Validators                  []*Validator              `json:"validators"`
	Balances                    []string                  `json:"balances"`
	RandaoMixes                 []string                  `json:"randao_mixes"`
	Slashings                   []string                  `json:"slashings"`
	PreviousEpochAttestations   []*PendingAttestation     `json:"previous_epoch_attestations"`
	CurrentEpochAttestations    []*PendingAttestation     `json:"current_epoch_attestations"`
	JustificationBits           string                    `json:"justification_bits"`
	PreviousJustifiedCheckpoint *shared.Checkpoint        `json:"previous_justified_checkpoint"`
	CurrentJustifiedCheckpoint  *shared.Checkpoint        `json:"current_justified_checkpoint"`
	FinalizedCheckpoint         *shared.Checkpoint        `json:"finalized_checkpoint"`
}

func BeaconStateFromConsensus

func BeaconStateFromConsensus(st beaconState.BeaconState) (*BeaconState, error)

type BeaconStateAltair

type BeaconStateAltair struct {
	GenesisTime                 string                    `json:"genesis_time"`
	GenesisValidatorsRoot       string                    `json:"genesis_validators_root"`
	Slot                        string                    `json:"slot"`
	Fork                        *shared.Fork              `json:"fork"`
	LatestBlockHeader           *shared.BeaconBlockHeader `json:"latest_block_header"`
	BlockRoots                  []string                  `json:"block_roots"`
	StateRoots                  []string                  `json:"state_roots"`
	HistoricalRoots             []string                  `json:"historical_roots"`
	Eth1Data                    *shared.Eth1Data          `json:"eth1_data"`
	Eth1DataVotes               []*shared.Eth1Data        `json:"eth1_data_votes"`
	Eth1DepositIndex            string                    `json:"eth1_deposit_index"`
	Validators                  []*Validator              `json:"validators"`
	Balances                    []string                  `json:"balances"`
	RandaoMixes                 []string                  `json:"randao_mixes"`
	Slashings                   []string                  `json:"slashings"`
	PreviousEpochParticipation  []string                  `json:"previous_epoch_participation"`
	CurrentEpochParticipation   []string                  `json:"current_epoch_participation"`
	JustificationBits           string                    `json:"justification_bits"`
	PreviousJustifiedCheckpoint *shared.Checkpoint        `json:"previous_justified_checkpoint"`
	CurrentJustifiedCheckpoint  *shared.Checkpoint        `json:"current_justified_checkpoint"`
	FinalizedCheckpoint         *shared.Checkpoint        `json:"finalized_checkpoint"`
	InactivityScores            []string                  `json:"inactivity_scores"`
	CurrentSyncCommittee        *SyncCommittee            `json:"current_sync_committee"`
	NextSyncCommittee           *SyncCommittee            `json:"next_sync_committee"`
}

func BeaconStateAltairFromConsensus

func BeaconStateAltairFromConsensus(st beaconState.BeaconState) (*BeaconStateAltair, error)

type BeaconStateBellatrix

type BeaconStateBellatrix struct {
	GenesisTime                  string                         `json:"genesis_time"`
	GenesisValidatorsRoot        string                         `json:"genesis_validators_root"`
	Slot                         string                         `json:"slot"`
	Fork                         *shared.Fork                   `json:"fork"`
	LatestBlockHeader            *shared.BeaconBlockHeader      `json:"latest_block_header"`
	BlockRoots                   []string                       `json:"block_roots"`
	StateRoots                   []string                       `json:"state_roots"`
	HistoricalRoots              []string                       `json:"historical_roots"`
	Eth1Data                     *shared.Eth1Data               `json:"eth1_data"`
	Eth1DataVotes                []*shared.Eth1Data             `json:"eth1_data_votes"`
	Eth1DepositIndex             string                         `json:"eth1_deposit_index"`
	Validators                   []*Validator                   `json:"validators"`
	Balances                     []string                       `json:"balances"`
	RandaoMixes                  []string                       `json:"randao_mixes"`
	Slashings                    []string                       `json:"slashings"`
	PreviousEpochParticipation   []string                       `json:"previous_epoch_participation"`
	CurrentEpochParticipation    []string                       `json:"current_epoch_participation"`
	JustificationBits            string                         `json:"justification_bits"`
	PreviousJustifiedCheckpoint  *shared.Checkpoint             `json:"previous_justified_checkpoint"`
	CurrentJustifiedCheckpoint   *shared.Checkpoint             `json:"current_justified_checkpoint"`
	FinalizedCheckpoint          *shared.Checkpoint             `json:"finalized_checkpoint"`
	InactivityScores             []string                       `json:"inactivity_scores"`
	CurrentSyncCommittee         *SyncCommittee                 `json:"current_sync_committee"`
	NextSyncCommittee            *SyncCommittee                 `json:"next_sync_committee"`
	LatestExecutionPayloadHeader *shared.ExecutionPayloadHeader `json:"latest_execution_payload_header"`
}

func BeaconStateBellatrixFromConsensus

func BeaconStateBellatrixFromConsensus(st beaconState.BeaconState) (*BeaconStateBellatrix, error)

type BeaconStateCapella

type BeaconStateCapella struct {
	GenesisTime                  string                                `json:"genesis_time"`
	GenesisValidatorsRoot        string                                `json:"genesis_validators_root"`
	Slot                         string                                `json:"slot"`
	Fork                         *shared.Fork                          `json:"fork"`
	LatestBlockHeader            *shared.BeaconBlockHeader             `json:"latest_block_header"`
	BlockRoots                   []string                              `json:"block_roots"`
	StateRoots                   []string                              `json:"state_roots"`
	HistoricalRoots              []string                              `json:"historical_roots"`
	Eth1Data                     *shared.Eth1Data                      `json:"eth1_data"`
	Eth1DataVotes                []*shared.Eth1Data                    `json:"eth1_data_votes"`
	Eth1DepositIndex             string                                `json:"eth1_deposit_index"`
	Validators                   []*Validator                          `json:"validators"`
	Balances                     []string                              `json:"balances"`
	RandaoMixes                  []string                              `json:"randao_mixes"`
	Slashings                    []string                              `json:"slashings"`
	PreviousEpochParticipation   []string                              `json:"previous_epoch_participation"`
	CurrentEpochParticipation    []string                              `json:"current_epoch_participation"`
	JustificationBits            string                                `json:"justification_bits"`
	PreviousJustifiedCheckpoint  *shared.Checkpoint                    `json:"previous_justified_checkpoint"`
	CurrentJustifiedCheckpoint   *shared.Checkpoint                    `json:"current_justified_checkpoint"`
	FinalizedCheckpoint          *shared.Checkpoint                    `json:"finalized_checkpoint"`
	InactivityScores             []string                              `json:"inactivity_scores"`
	CurrentSyncCommittee         *SyncCommittee                        `json:"current_sync_committee"`
	NextSyncCommittee            *SyncCommittee                        `json:"next_sync_committee"`
	LatestExecutionPayloadHeader *shared.ExecutionPayloadHeaderCapella `json:"latest_execution_payload_header"`
	NextWithdrawalIndex          string                                `json:"next_withdrawal_index"`
	NextWithdrawalValidatorIndex string                                `json:"next_withdrawal_validator_index"`
	HistoricalSummaries          []*HistoricalSummary                  `json:"historical_summaries"`
}

func BeaconStateCapellaFromConsensus

func BeaconStateCapellaFromConsensus(st beaconState.BeaconState) (*BeaconStateCapella, error)

type BeaconStateDeneb

type BeaconStateDeneb struct {
	GenesisTime                  string                              `json:"genesis_time"`
	GenesisValidatorsRoot        string                              `json:"genesis_validators_root"`
	Slot                         string                              `json:"slot"`
	Fork                         *shared.Fork                        `json:"fork"`
	LatestBlockHeader            *shared.BeaconBlockHeader           `json:"latest_block_header"`
	BlockRoots                   []string                            `json:"block_roots"`
	StateRoots                   []string                            `json:"state_roots"`
	HistoricalRoots              []string                            `json:"historical_roots"`
	Eth1Data                     *shared.Eth1Data                    `json:"eth1_data"`
	Eth1DataVotes                []*shared.Eth1Data                  `json:"eth1_data_votes"`
	Eth1DepositIndex             string                              `json:"eth1_deposit_index"`
	Validators                   []*Validator                        `json:"validators"`
	Balances                     []string                            `json:"balances"`
	RandaoMixes                  []string                            `json:"randao_mixes"`
	Slashings                    []string                            `json:"slashings"`
	PreviousEpochParticipation   []string                            `json:"previous_epoch_participation"`
	CurrentEpochParticipation    []string                            `json:"current_epoch_participation"`
	JustificationBits            string                              `json:"justification_bits"`
	PreviousJustifiedCheckpoint  *shared.Checkpoint                  `json:"previous_justified_checkpoint"`
	CurrentJustifiedCheckpoint   *shared.Checkpoint                  `json:"current_justified_checkpoint"`
	FinalizedCheckpoint          *shared.Checkpoint                  `json:"finalized_checkpoint"`
	InactivityScores             []string                            `json:"inactivity_scores"`
	CurrentSyncCommittee         *SyncCommittee                      `json:"current_sync_committee"`
	NextSyncCommittee            *SyncCommittee                      `json:"next_sync_committee"`
	LatestExecutionPayloadHeader *shared.ExecutionPayloadHeaderDeneb `json:"latest_execution_payload_header"`
	NextWithdrawalIndex          string                              `json:"next_withdrawal_index"`
	NextWithdrawalValidatorIndex string                              `json:"next_withdrawal_validator_index"`
	HistoricalSummaries          []*HistoricalSummary                `json:"historical_summaries"`
}

func BeaconStateDenebFromConsensus

func BeaconStateDenebFromConsensus(st beaconState.BeaconState) (*BeaconStateDeneb, error)

type ForkChoiceDumpExtraData

type ForkChoiceDumpExtraData struct {
	UnrealizedJustifiedCheckpoint *shared.Checkpoint `json:"unrealized_justified_checkpoint"`
	UnrealizedFinalizedCheckpoint *shared.Checkpoint `json:"unrealized_finalized_checkpoint"`
	ProposerBoostRoot             string             `json:"proposer_boost_root"`
	PreviousProposerBoostRoot     string             `json:"previous_proposer_boost_root"`
	HeadRoot                      string             `json:"head_root"`
}

type ForkChoiceHead

type ForkChoiceHead struct {
	Root                string `json:"root"`
	Slot                string `json:"slot"`
	ExecutionOptimistic bool   `json:"execution_optimistic"`
}

type ForkChoiceNode

type ForkChoiceNode struct {
	Slot               string                   `json:"slot"`
	BlockRoot          string                   `json:"block_root"`
	ParentRoot         string                   `json:"parent_root"`
	JustifiedEpoch     string                   `json:"justified_epoch"`
	FinalizedEpoch     string                   `json:"finalized_epoch"`
	Weight             string                   `json:"weight"`
	Validity           string                   `json:"validity"`
	ExecutionBlockHash string                   `json:"execution_block_hash"`
	ExtraData          *ForkChoiceNodeExtraData `json:"extra_data"`
}

type ForkChoiceNodeExtraData

type ForkChoiceNodeExtraData struct {
	UnrealizedJustifiedEpoch string `json:"unrealized_justified_epoch"`
	UnrealizedFinalizedEpoch string `json:"unrealized_finalized_epoch"`
	Balance                  string `json:"balance"`
	ExecutionOptimistic      bool   `json:"execution_optimistic"`
	TimeStamp                string `json:"timestamp"`
}

type GetBeaconStateV2Response

type GetBeaconStateV2Response struct {
	Version             string          `json:"version"`
	ExecutionOptimistic bool            `json:"execution_optimistic"`
	Finalized           bool            `json:"finalized"`
	Data                json.RawMessage `json:"data"` // represents the state values based on the version
}

type GetForkChoiceDumpResponse

type GetForkChoiceDumpResponse struct {
	JustifiedCheckpoint *shared.Checkpoint       `json:"justified_checkpoint"`
	FinalizedCheckpoint *shared.Checkpoint       `json:"finalized_checkpoint"`
	ForkChoiceNodes     []*ForkChoiceNode        `json:"fork_choice_nodes"`
	ExtraData           *ForkChoiceDumpExtraData `json:"extra_data"`
}

type GetForkChoiceHeadsV2Response

type GetForkChoiceHeadsV2Response struct {
	Data []*ForkChoiceHead `json:"data"`
}

type HistoricalSummary

type HistoricalSummary struct {
	BlockSummaryRoot string `json:"block_summary_root"`
	StateSummaryRoot string `json:"state_summary_root"`
}

func HistoricalSummaryFromConsensus

func HistoricalSummaryFromConsensus(summary *eth.HistoricalSummary) (*HistoricalSummary, error)

type PendingAttestation

type PendingAttestation struct {
	AggregationBits string                  `json:"aggregation_bits"`
	Data            *shared.AttestationData `json:"data"`
	InclusionDelay  string                  `json:"inclusion_delay"`
	ProposerIndex   string                  `json:"proposer_index"`
}

func PendingAttestationFromConsensus

func PendingAttestationFromConsensus(a *eth.PendingAttestation) (*PendingAttestation, error)

type Server

type Server struct {
	BeaconDB              db.ReadOnlyDatabase
	HeadFetcher           blockchain.HeadFetcher
	Stater                lookup.Stater
	OptimisticModeFetcher blockchain.OptimisticModeFetcher
	ForkFetcher           blockchain.ForkFetcher
	ForkchoiceFetcher     blockchain.ForkchoiceFetcher
	FinalizationFetcher   blockchain.FinalizationFetcher
	ChainInfoFetcher      blockchain.ChainInfoFetcher
}

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

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

GetBeaconStateSSZ returns the SSZ-serialized version of the full beacon state object for given state ID.

DEPRECATED: please use GetBeaconStateV2 instead

func (*Server) GetBeaconStateV2

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

GetBeaconStateV2 returns the full beacon state for a given state ID.

func (*Server) GetForkChoice

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

GetForkChoice returns a dump fork choice store.

func (*Server) GetForkChoiceHeadsV2

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

GetForkChoiceHeadsV2 retrieves the leaves of the current fork choice tree.

type SyncCommittee

type SyncCommittee struct {
	Pubkeys         []string `json:"pubkeys"`
	AggregatePubkey string   `json:"aggregate_pubkey"`
}

func SyncCommitteeFromConsensus

func SyncCommitteeFromConsensus(sc *eth.SyncCommittee) (*SyncCommittee, error)

type Validator

type Validator struct {
	PublicKey                  string `json:"pubkey"`
	WithdrawalCredentials      string `json:"withdrawal_credentials"`
	EffectiveBalance           string `json:"effective_balance"`
	Slashed                    bool   `json:"slashed"`
	ActivationEligibilityEpoch string `json:"activation_eligibility_epoch"`
	ActivationEpoch            string `json:"activation_epoch"`
	ExitEpoch                  string `json:"exit_epoch"`
	WithdrawableEpoch          string `json:"withdrawable_epoch"`
}

func ValidatorFromConsensus

func ValidatorFromConsensus(v *eth.Validator) (*Validator, error)

Jump to

Keyboard shortcuts

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