Documentation ¶
Index ¶
- Variables
- func CapellaExecutionPayloadToScale(e *state.ExecutionPayloadCapella) (scale.ExecutionPayloadHeaderCapella, error)
- func CapellaJsonExecutionPayloadHeaderToScale(e *beaconjson.FullExecutionPayloadHeaderJson) (scale.ExecutionPayloadHeaderCapella, error)
- func DenebExecutionPayloadToScale(e *state.ExecutionPayloadDeneb) (scale.ExecutionPayloadHeaderDeneb, error)
- func DenebJsonExecutionPayloadHeaderToScale(e *beaconjson.FullExecutionPayloadHeaderJson) (scale.ExecutionPayloadHeaderDeneb, error)
- type AttestationDataResponse
- type AttestationResponse
- type AttesterSlashingResponse
- type BLSToExecutionChangeResponse
- type BeaconAPI
- type BeaconBlock
- type BeaconBlockResponse
- type BeaconBlockResponseBody
- type BeaconBlockResponseData
- type BeaconBlockResponseMessage
- type BeaconClient
- func (b *BeaconClient) GetBeaconBlock(blockID common.Hash) (BeaconBlockResponse, error)
- func (b *BeaconClient) GetBeaconBlockBySlot(slot uint64) (BeaconBlockResponse, error)
- func (b *BeaconClient) GetBeaconBlockRoot(slot uint64) (common.Hash, error)
- func (b *BeaconClient) GetBeaconState(stateIdOrSlot string) ([]byte, error)
- func (b *BeaconClient) GetBootstrap(blockRoot common.Hash) (BootstrapResponse, error)
- func (b *BeaconClient) GetFinalizedCheckpoint() (FinalizedCheckpoint, error)
- func (b *BeaconClient) GetGenesis() (Genesis, error)
- func (b *BeaconClient) GetHeader(qualifier string) (BeaconHeader, error)
- func (b *BeaconClient) GetHeaderAtHead() (BeaconHeader, error)
- func (b *BeaconClient) GetHeaderByBlockRoot(blockRoot common.Hash) (BeaconHeader, error)
- func (b *BeaconClient) GetHeaderBySlot(slot uint64) (BeaconHeader, error)
- func (b *BeaconClient) GetLatestFinalizedUpdate() (LatestFinalisedUpdateResponse, error)
- func (b *BeaconClient) GetSyncCommitteePeriodUpdate(from uint64) (SyncCommitteePeriodUpdateResponse, error)
- type BeaconHeader
- type BeaconHeaderResponse
- type Bootstrap
- type BootstrapResponse
- type BranchResponse
- type CheckpointResponse
- type DepositDataResponse
- type DepositResponse
- type ErrorMessage
- type FinalizedCheckpoint
- type FinalizedCheckpointResponse
- type ForkResponse
- type Genesis
- type GenesisResponse
- type HeaderResponse
- type IndexedAttestationResponse
- type LatestFinalisedUpdateResponse
- type LatestHeaderUpdateResponse
- type ProposerSlashingResponse
- type SignedBLSToExecutionChangeResponse
- type SignedHeaderResponse
- type SignedVoluntaryExitResponse
- type SyncAggregateResponse
- type SyncCommitteePeriodUpdateResponse
- type SyncCommitteeResponse
- type VoluntaryExitResponse
- type WithdrawalResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrSyncCommitteeUpdateNotAvailable = errors.New("no sync committee update available") ConstructRequestErrorMessage = "construct header request" DoHTTPRequestErrorMessage = "do http request" HTTPStatusNotOKErrorMessage = "http status not ok" ReadResponseBodyErrorMessage = "read response body" UnmarshalBodyErrorMessage = "unmarshal body" )
Functions ¶
func CapellaExecutionPayloadToScale ¶
func CapellaExecutionPayloadToScale(e *state.ExecutionPayloadCapella) (scale.ExecutionPayloadHeaderCapella, error)
func CapellaJsonExecutionPayloadHeaderToScale ¶
func CapellaJsonExecutionPayloadHeaderToScale(e *beaconjson.FullExecutionPayloadHeaderJson) (scale.ExecutionPayloadHeaderCapella, error)
func DenebExecutionPayloadToScale ¶
func DenebExecutionPayloadToScale(e *state.ExecutionPayloadDeneb) (scale.ExecutionPayloadHeaderDeneb, error)
func DenebJsonExecutionPayloadHeaderToScale ¶
func DenebJsonExecutionPayloadHeaderToScale(e *beaconjson.FullExecutionPayloadHeaderJson) (scale.ExecutionPayloadHeaderDeneb, error)
Types ¶
type AttestationDataResponse ¶
type AttestationDataResponse struct { Slot string `json:"slot"` Index string `json:"index"` BeaconBlockRoot string `json:"beacon_block_root"` Source CheckpointResponse `json:"source"` Target CheckpointResponse `json:"target"` }
func (AttestationDataResponse) ToFastSSZ ¶
func (a AttestationDataResponse) ToFastSSZ() (*state.AttestationData, error)
type AttestationResponse ¶
type AttestationResponse struct { AggregationBits string `json:"aggregation_bits"` Data AttestationDataResponse `json:"data"` Signature string `json:"signature"` }
func (AttestationResponse) ToFastSSZ ¶
func (a AttestationResponse) ToFastSSZ() (*state.Attestation, error)
type AttesterSlashingResponse ¶
type AttesterSlashingResponse struct { Attestation1 IndexedAttestationResponse `json:"attestation_1"` Attestation2 IndexedAttestationResponse `json:"attestation_2"` }
func (AttesterSlashingResponse) ToFastSSZ ¶
func (a AttesterSlashingResponse) ToFastSSZ() (*state.AttesterSlashing, error)
type BeaconAPI ¶
type BeaconAPI interface { GetBootstrap(blockRoot common.Hash) (BootstrapResponse, error) GetGenesis() (Genesis, error) GetFinalizedCheckpoint() (FinalizedCheckpoint, error) GetHeaderBySlot(slot uint64) (BeaconHeader, error) GetHeaderAtHead() (BeaconHeader, error) GetHeaderByBlockRoot(blockRoot common.Hash) (BeaconHeader, error) GetBeaconBlockBySlot(slot uint64) (BeaconBlockResponse, error) GetBeaconBlockRoot(slot uint64) (common.Hash, error) GetBeaconBlock(blockID common.Hash) (BeaconBlockResponse, error) GetSyncCommitteePeriodUpdate(from uint64) (SyncCommitteePeriodUpdateResponse, error) GetLatestFinalizedUpdate() (LatestFinalisedUpdateResponse, error) GetBeaconState(stateIdOrSlot string) ([]byte, error) }
type BeaconBlock ¶
type BeaconBlockResponse ¶
type BeaconBlockResponse struct {
Data BeaconBlockResponseData `json:"data"`
}
func (BeaconBlockResponse) ToFastSSZ ¶
func (b BeaconBlockResponse) ToFastSSZ(isDeneb bool) (state.BeaconBlock, error)
ToFastSSZ can be removed once Lodestar supports returning block data as SSZ instead of JSON only. Because it only returns JSON, we need this interim step where we convert the block JSON to the data types that the FastSSZ lib expects. When Lodestar supports SSZ block response, we can remove all these and directly unmarshal SSZ bytes to state.BeaconBlock.
type BeaconBlockResponseBody ¶
type BeaconBlockResponseBody struct { RandaoReveal string `json:"randao_reveal"` Eth1Data struct { DepositRoot string `json:"deposit_root"` DepositCount string `json:"deposit_count"` BlockHash string `json:"block_hash"` } `json:"eth1_data"` Graffiti string `json:"graffiti"` ProposerSlashings []ProposerSlashingResponse `json:"proposer_slashings"` AttesterSlashings []AttesterSlashingResponse `json:"attester_slashings"` Attestations []AttestationResponse `json:"attestations"` Deposits []DepositResponse `json:"deposits"` VoluntaryExits []SignedVoluntaryExitResponse `json:"voluntary_exits"` SyncAggregate SyncAggregateResponse `json:"sync_aggregate"` ExecutionPayload struct { ParentHash string `json:"parent_hash"` FeeRecipient string `json:"fee_recipient"` StateRoot string `json:"state_root"` ReceiptsRoot string `json:"receipts_root"` LogsBloom string `json:"logs_bloom"` PrevRandao string `json:"prev_randao"` BlockNumber string `json:"block_number"` GasLimit string `json:"gas_limit"` GasUsed string `json:"gas_used"` Timestamp string `json:"timestamp"` ExtraData string `json:"extra_data"` BaseFeePerGas string `json:"base_fee_per_gas"` BlockHash string `json:"block_hash"` Transactions []string `json:"transactions"` Withdrawals []WithdrawalResponse `json:"withdrawals"` BlobGasUsed string `json:"blob_gas_used,omitempty"` ExcessBlobGas string `json:"excess_blob_gas,omitempty"` } `json:"execution_payload"` BlsToExecutionChanges []SignedBLSToExecutionChangeResponse `json:"bls_to_execution_changes"` BlobKzgCommitments []string `json:"blob_kzg_commitments"` }
type BeaconBlockResponseData ¶
type BeaconBlockResponseData struct {
Message BeaconBlockResponseMessage `json:"message"`
}
type BeaconBlockResponseMessage ¶
type BeaconBlockResponseMessage struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` ParentRoot string `json:"parent_root"` StateRoot string `json:"state_root"` Body BeaconBlockResponseBody `json:"body"` }
type BeaconClient ¶
type BeaconClient struct {
// contains filtered or unexported fields
}
func NewBeaconClient ¶
func NewBeaconClient(endpoint, stateEndpoint string) *BeaconClient
func (*BeaconClient) GetBeaconBlock ¶
func (b *BeaconClient) GetBeaconBlock(blockID common.Hash) (BeaconBlockResponse, error)
func (*BeaconClient) GetBeaconBlockBySlot ¶
func (b *BeaconClient) GetBeaconBlockBySlot(slot uint64) (BeaconBlockResponse, error)
func (*BeaconClient) GetBeaconBlockRoot ¶
func (b *BeaconClient) GetBeaconBlockRoot(slot uint64) (common.Hash, error)
func (*BeaconClient) GetBeaconState ¶
func (b *BeaconClient) GetBeaconState(stateIdOrSlot string) ([]byte, error)
func (*BeaconClient) GetBootstrap ¶
func (b *BeaconClient) GetBootstrap(blockRoot common.Hash) (BootstrapResponse, error)
func (*BeaconClient) GetFinalizedCheckpoint ¶
func (b *BeaconClient) GetFinalizedCheckpoint() (FinalizedCheckpoint, error)
func (*BeaconClient) GetGenesis ¶
func (b *BeaconClient) GetGenesis() (Genesis, error)
func (*BeaconClient) GetHeader ¶
func (b *BeaconClient) GetHeader(qualifier string) (BeaconHeader, error)
func (*BeaconClient) GetHeaderAtHead ¶
func (b *BeaconClient) GetHeaderAtHead() (BeaconHeader, error)
func (*BeaconClient) GetHeaderByBlockRoot ¶
func (b *BeaconClient) GetHeaderByBlockRoot(blockRoot common.Hash) (BeaconHeader, error)
func (*BeaconClient) GetHeaderBySlot ¶
func (b *BeaconClient) GetHeaderBySlot(slot uint64) (BeaconHeader, error)
func (*BeaconClient) GetLatestFinalizedUpdate ¶
func (b *BeaconClient) GetLatestFinalizedUpdate() (LatestFinalisedUpdateResponse, error)
func (*BeaconClient) GetSyncCommitteePeriodUpdate ¶
func (b *BeaconClient) GetSyncCommitteePeriodUpdate(from uint64) (SyncCommitteePeriodUpdateResponse, error)
type BeaconHeader ¶
type BeaconHeader struct { Slot uint64 `json:"slot"` ProposerIndex uint64 `json:"proposer_index"` ParentRoot common.Hash `json:"parent_root"` StateRoot common.Hash `json:"state_root"` BodyRoot common.Hash `json:"body_root"` }
func (BeaconHeader) ToScale ¶
func (h BeaconHeader) ToScale() (scale.BeaconHeader, error)
type BeaconHeaderResponse ¶
type BeaconHeaderResponse struct { Data struct { Root string `json:"root"` Canonical bool `json:"canonical"` Header struct { Message HeaderResponse `json:"message"` Signature string `json:"signature"` } `json:"header"` } `json:"data"` }
type Bootstrap ¶
type Bootstrap struct { Header HeaderResponse CurrentSyncCommittee beaconjson.SyncCommittee CurrentSyncCommitteeBranch []string }
type BootstrapResponse ¶
type BootstrapResponse struct { Data struct { Header struct { Beacon HeaderResponse `json:"beacon"` } `json:"header"` CurrentSyncCommittee SyncCommitteeResponse `json:"current_sync_committee"` CurrentSyncCommitteeBranch []string `json:"current_sync_committee_branch"` } `json:"data"` }
type BranchResponse ¶
type BranchResponse []string
type CheckpointResponse ¶
func (CheckpointResponse) ToFastSSZ ¶
func (c CheckpointResponse) ToFastSSZ() (*state.Checkpoint, error)
func (CheckpointResponse) ToScale ¶
func (c CheckpointResponse) ToScale() (scale.Checkpoint, error)
type DepositDataResponse ¶
type DepositResponse ¶
type DepositResponse struct { Proof []string `json:"proof"` Data DepositDataResponse `json:"data"` }
type ErrorMessage ¶
type FinalizedCheckpoint ¶
type FinalizedCheckpointResponse ¶
type FinalizedCheckpointResponse struct { Data struct { Finalized struct { Root string `json:"root"` } `json:"finalized"` } `json:"data"` }
type ForkResponse ¶
type GenesisResponse ¶
type HeaderResponse ¶
type HeaderResponse struct { Slot string `json:"slot"` ProposerIndex string `json:"proposer_index"` ParentRoot string `json:"parent_root"` StateRoot string `json:"state_root"` BodyRoot string `json:"body_root"` }
func (*HeaderResponse) ToBeaconHeader ¶
func (h *HeaderResponse) ToBeaconHeader() (BeaconHeader, error)
func (*HeaderResponse) ToFastSSZ ¶
func (h *HeaderResponse) ToFastSSZ() (*state.BeaconBlockHeader, error)
func (*HeaderResponse) ToScale ¶
func (h *HeaderResponse) ToScale() (scale.BeaconHeader, error)
type IndexedAttestationResponse ¶
type IndexedAttestationResponse struct { AttestingIndices []string `json:"attesting_indices"` Data AttestationDataResponse `json:"data"` Signature string `json:"signature"` }
func (IndexedAttestationResponse) ToFastSSZ ¶
func (i IndexedAttestationResponse) ToFastSSZ() (*state.IndexedAttestation, error)
type LatestFinalisedUpdateResponse ¶
type LatestFinalisedUpdateResponse struct { Data struct { AttestedHeader struct { Beacon HeaderResponse `json:"beacon"` } `json:"attested_header"` FinalizedHeader struct { Beacon HeaderResponse `json:"beacon"` } `json:"finalized_header"` FinalityBranch []string `json:"finality_branch"` SyncAggregate SyncAggregateResponse `json:"sync_aggregate"` SignatureSlot string `json:"signature_slot"` } `json:"data"` }
type LatestHeaderUpdateResponse ¶
type LatestHeaderUpdateResponse struct { Data struct { AttestedHeader HeaderResponse `json:"attested_header"` SyncAggregate SyncAggregateResponse `json:"sync_aggregate"` } `json:"data"` }
type ProposerSlashingResponse ¶
type ProposerSlashingResponse struct { SignedHeader1 SignedHeaderResponse `json:"signed_header_1"` SignedHeader2 SignedHeaderResponse `json:"signed_header_2"` }
func (ProposerSlashingResponse) ToFastSSZ ¶
func (p ProposerSlashingResponse) ToFastSSZ() (*state.ProposerSlashing, error)
type SignedBLSToExecutionChangeResponse ¶
type SignedBLSToExecutionChangeResponse struct { Message *BLSToExecutionChangeResponse `json:"message,omitempty"` Signature string `json:"signature,omitempty"` }
func (*SignedBLSToExecutionChangeResponse) ToFastSSZ ¶
func (s *SignedBLSToExecutionChangeResponse) ToFastSSZ() (*state.SignedBLSToExecutionChange, error)
type SignedHeaderResponse ¶
type SignedHeaderResponse struct { Message HeaderResponse `json:"message"` Signature string `json:"signature"` }
func (SignedHeaderResponse) ToFastSSZ ¶
func (s SignedHeaderResponse) ToFastSSZ() (*state.SignedBeaconBlockHeader, error)
type SignedVoluntaryExitResponse ¶
type SignedVoluntaryExitResponse struct { Message VoluntaryExitResponse `json:"message"` Signature string `json:"signature"` }
func (SignedVoluntaryExitResponse) ToFastSSZ ¶
func (d SignedVoluntaryExitResponse) ToFastSSZ() (*state.SignedVoluntaryExit, error)
type SyncAggregateResponse ¶
type SyncAggregateResponse struct { SyncCommitteeBits string `json:"sync_committee_bits"` SyncCommitteeSignature string `json:"sync_committee_signature"` }
func (SyncAggregateResponse) ToScale ¶
func (s SyncAggregateResponse) ToScale() (scale.SyncAggregate, error)
type SyncCommitteePeriodUpdateResponse ¶
type SyncCommitteePeriodUpdateResponse struct { Data struct { AttestedHeader struct { Beacon HeaderResponse `json:"beacon"` } `json:"attested_header"` NextSyncCommittee SyncCommitteeResponse `json:"next_sync_committee"` NextSyncCommitteeBranch []string `json:"next_sync_committee_branch"` FinalizedHeader struct { Beacon HeaderResponse `json:"beacon"` } `json:"finalized_header"` FinalityBranch []string `json:"finality_branch"` SyncAggregate SyncAggregateResponse `json:"sync_aggregate"` SignatureSlot string `json:"signature_slot"` } `json:"data"` }
type SyncCommitteeResponse ¶
type SyncCommitteeResponse struct { Pubkeys []string `json:"pubkeys"` AggregatePubkey string `json:"aggregate_pubkey"` }
func (SyncCommitteeResponse) ToScale ¶
func (s SyncCommitteeResponse) ToScale() (scale.SyncCommittee, error)
type VoluntaryExitResponse ¶
type WithdrawalResponse ¶
type WithdrawalResponse struct { Index string `json:"index"` ValidatorIndex string `json:"validator_index"` Address string `json:"address"` Amount string `json:"amount"` }
func (*WithdrawalResponse) ToFastSSZ ¶
func (w *WithdrawalResponse) ToFastSSZ() (*state.Withdrawal, error)
Click to show internal directories.
Click to hide internal directories.