services

package
v1.24.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: GPL-3.0 Imports: 65 Imported by: 1

Documentation

Index

Constants

View Source
const BeaconClientSyncTimeout = 16 // 16 seconds
View Source
const EthClientSyncTimeout = 16 // 16 seconds

Settings

View Source
const MAX_WITHDRAWAL_SLOT_DISTANCE = 144000 // 20 days.

Variables

View Source
var ErrGloasBoundaryReached = errors.New("withdrawal scan reached the gloas activation slot")

ErrGloasBoundaryReached indicates a beacon-block withdrawal scan reached the Gloas activation slot without finding the target withdrawal

Functions

func CalculateMegapoolWithdrawalCredentials added in v1.18.0

func CalculateMegapoolWithdrawalCredentials(megapoolAddress common.Address) common.Hash

func CalculateRewards added in v1.18.0

func CalculateRewards(rp *rocketpool.RocketPool, amount *big.Int, nodeAccount common.Address) (api.MegapoolRewardSplitResponse, error)

func ConvertToFixedSize added in v1.18.0

func ConvertToFixedSize(proofBytes [][]byte) [][32]byte

func ConvertWithdrawalAmount added in v1.18.7

func ConvertWithdrawalAmount(amount uint64) *big.Int

func DissolveMegapoolWithProof added in v1.24.0

func DissolveMegapoolWithProof(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, slotTimestamp uint64, validatorProof megapool.ValidatorProof, slotProof megapool.SlotProof, opts *bind.TransactOpts) (*ethtypes.Transaction, error)

func EstimateMegapoolDissolveWithProofGas added in v1.24.0

func EstimateMegapoolDissolveWithProofGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, slotTimestamp uint64, validatorProof megapool.ValidatorProof, slotProof megapool.SlotProof, opts *bind.TransactOpts) (gaslimit.Limits, error)

func EstimateMegapoolNotifyExitGas added in v1.24.0

func EstimateMegapoolNotifyExitGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, slotTimestamp uint64, validatorProof megapool.ValidatorProof, slotProof megapool.SlotProof, opts *bind.TransactOpts) (gaslimit.Limits, error)

func EstimateMegapoolNotifyFinalBalanceGas added in v1.24.0

func EstimateMegapoolNotifyFinalBalanceGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, proof *MegapoolFinalBalanceProof, opts *bind.TransactOpts) (gaslimit.Limits, error)

func EstimateMegapoolNotifyNotExitGas added in v1.24.0

func EstimateMegapoolNotifyNotExitGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, slotTimestamp uint64, validatorProof megapool.ValidatorProof, slotProof megapool.SlotProof, opts *bind.TransactOpts) (gaslimit.Limits, error)

func EstimateMegapoolStakeGas added in v1.24.0

func EstimateMegapoolStakeGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, slotTimestamp uint64, validatorProof megapool.ValidatorProof, slotProof megapool.SlotProof, opts *bind.TransactOpts) (gaslimit.Limits, error)

func FindGloasWithdrawalSlotAndArrayPosition added in v1.20.8

func FindGloasWithdrawalSlotAndArrayPosition(slot uint64, validatorIndex uint64, ec *ExecutionClientManager, eth2Config beacon.Eth2Config) (uint64, int, *generic.Withdrawal, error)

FindGloasWithdrawalSlotAndArrayPosition locates the withdrawal for the given validator index by scanning execution-layer blocks, which still carry the withdrawals list in Gloas, and maps the execution block back to the consensus slot whose beacon state committed to its payload's withdrawals. Returns the consensus slot, the withdrawal's position in the payload's withdrawals list (identical to its position in the state's payload_expected_withdrawals) and the withdrawal itself.

func FindWithdrawalBlockAndArrayPosition added in v1.18.7

func FindWithdrawalBlockAndArrayPosition(slot uint64, validatorIndex uint64, bc beacon.Client) (uint64, eth2.SignedBeaconBlock, int, *generic.Withdrawal, *beacon.BeaconBlock, error)

func GetBeaconState added in v1.18.7

func GetBeaconState(bc beacon.Client) (eth2.BeaconState, error)

func GetChildBlockTimestampForSlot added in v1.18.7

func GetChildBlockTimestampForSlot(c *cli.Command, slot uint64) (uint64, error)

func GetConfig

func GetConfig(c *cli.Command) (*config.RocketPoolConfig, error)

func GetDocker

func GetDocker(c *cli.Command) (*client.Client, error)

func GetFinalBalanceProofBundle added in v1.24.0

func GetFinalBalanceProofBundle(c *cli.Command, slotHint uint64, validatorIndex uint64, validatorPubkey types.ValidatorPubkey, megapoolAddress common.Address, w wallet.Wallet) (*big.Int, []byte, uint64, error)

GetFinalBalanceProofBundle builds the versioned proof payload for RocketMegapoolManager.notifyFinalBalance on 1.4.1+. Version 1 is used for pre-Gloas withdrawals; version 2 for post-Gloas withdrawals.

func GetFinalBalanceProofs added in v1.24.0

func GetFinalBalanceProofs(c *cli.Command, slotHint uint64, validatorIndex uint64, validatorPubkey types.ValidatorPubkey, megapoolAddress common.Address, w wallet.Wallet) (megapool.WithdrawalProof, megapool.ValidatorProof, megapool.SlotProof, uint64, error)

GetFinalBalanceProofs builds the 1.4.0 structured proofs for RocketMegapoolManager.notifyFinalBalance. Gloas withdrawals are not supported on 1.4.0 contracts.

func GetFinalizedBlockSlotAndFork added in v1.20.8

func GetFinalizedBlockSlotAndFork(bc beacon.Client) (uint64, string, error)

GetFinalizedBlockSlotAndFork resolves the slot and consensus fork version of the most recent finalized beacon block, walking back over skipped slots. The JSON block endpoint is intentionally avoided: it dereferences the execution payload, which no longer exists in Gloas blocks.

func GetHdWallet added in v1.15.7

func GetHdWallet(c *cli.Command) (wallet.Wallet, error)

func GetMegapoolQueueDetails added in v1.18.0

func GetMegapoolQueueDetails(rp *rocketpool.RocketPool) (api.QueueDetails, error)

func GetMegapoolValidatorDetails added in v1.18.0

func GetMegapoolValidatorDetails(rp *rocketpool.RocketPool, bc beacon.Client, megapoolAddress common.Address, opts *bind.CallOpts, useFinalizedBeaconState bool) ([]api.MegapoolValidatorDetails, error)

func GetNetworkStateProvider added in v1.20.4

func GetNetworkStateProvider(c *cli.Command) (state.NetworkStateProvider, error)

GetNetworkStateProvider returns a state.NetworkStateProvider backed by either the live NetworkStateManager (dialling the configured EC / CC) or by a StaticNetworkStateProvider loaded from --network-state, depending on the command-line flag.

In live mode, the returned provider reuses the memoized execution and consensus clients from GetRocketPool / GetBeaconClient so the daemon doesn't establish extra connections.

func GetNodeMegapoolDetails added in v1.18.0

func GetNodeMegapoolDetails(rp *rocketpool.RocketPool, bc beacon.Client, nodeAccount common.Address, opts *bind.CallOpts, useFinalizedBeaconState bool) (api.MegapoolDetails, error)

Get all node megapool details

func GetPasswordManager

func GetPasswordManager(c *cli.Command) (*passwords.PasswordManager, error)

func GetRocketPool

func GetRocketPool(c *cli.Command) (*rocketpool.RocketPool, error)

func GetRocketSignerRegistry added in v1.13.6

func GetRocketSignerRegistry(c *cli.Command) (*contracts.RocketSignerRegistry, error)

func GetStaticStatePath added in v1.20.4

func GetStaticStatePath(c *cli.Command) string

GetStaticStatePath returns the --network-state flag value on the root command, or the empty string if not set.

func GetValidatorProof added in v1.18.0

func GetValidatorProof(c *cli.Command, slot uint64, wallet wallet.Wallet, eth2Config beacon.Eth2Config, megapoolAddress common.Address, validatorPubkey types.ValidatorPubkey, beaconState eth2.BeaconState) (megapool.ValidatorProof, uint64, megapool.SlotProof, error)

func GetWallet

func GetWallet(c *cli.Command) (wallet.Wallet, error)

func GetWithdrawableEpochProof added in v1.18.0

func GetWithdrawableEpochProof(c *cli.Command, wallet *wallet.Wallet, eth2Config beacon.Eth2Config, megapoolAddress common.Address, validatorPubkey types.ValidatorPubkey) (api.ValidatorWithdrawableEpochProof, error)

func GetWithdrawalProofForSlot added in v1.18.0

func GetWithdrawalProofForSlot(c *cli.Command, slot uint64, validatorIndex uint64) (megapool.FinalBalanceProof, uint64, eth2.BeaconState, error)

func GetWithdrawalProofForSlotFromAPI added in v1.19.0

func GetWithdrawalProofForSlotFromAPI(c *cli.Command, finalizedSlot uint64, withdrawalSlot uint64, validatorIndex uint64, network cfgtypes.Network) (megapool.FinalBalanceProof, uint64, error)

func IsStaticStateMode added in v1.20.4

func IsStaticStateMode(c *cli.Command) bool

IsStaticStateMode reports whether the daemon has been asked to serve requests from a saved NetworkState snapshot instead of live EC/CC clients.

func IsSyncWithinThreshold added in v1.4.0

func IsSyncWithinThreshold(ec rocketpool.ExecutionClient) (bool, time.Time, error)

Confirm the EC's latest block is within the threshold of the current system clock

func NotifyMegapoolExit added in v1.24.0

func NotifyMegapoolExit(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, slotTimestamp uint64, validatorProof megapool.ValidatorProof, slotProof megapool.SlotProof, opts *bind.TransactOpts) (*ethtypes.Transaction, error)

func NotifyMegapoolFinalBalance added in v1.24.0

func NotifyMegapoolFinalBalance(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, proof *MegapoolFinalBalanceProof, opts *bind.TransactOpts) (*ethtypes.Transaction, error)

func NotifyMegapoolNotExit added in v1.24.0

func NotifyMegapoolNotExit(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, slotTimestamp uint64, validatorProof megapool.ValidatorProof, slotProof megapool.SlotProof, opts *bind.TransactOpts) (*ethtypes.Transaction, error)

func RequireBeaconClientSynced

func RequireBeaconClientSynced(c *cli.Command) error

func RequireEthClientSynced

func RequireEthClientSynced(c *cli.Command) error

func RequireNodeRegistered

func RequireNodeRegistered(c *cli.Command) error

func RequireNodeSecurityMember added in v1.13.0

func RequireNodeSecurityMember(c *cli.Command) error

func RequireNodeTrusted added in v1.0.0

func RequireNodeTrusted(c *cli.Command) error

func RequireNodeWallet

func RequireNodeWallet(c *cli.Command) error

func RequireRocketStorage

func RequireRocketStorage(c *cli.Command) error

func StakeMegapool added in v1.24.0

func StakeMegapool(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, slotTimestamp uint64, validatorProof megapool.ValidatorProof, slotProof megapool.SlotProof, opts *bind.TransactOpts) (*ethtypes.Transaction, error)

func WaitBeaconClientSynced

func WaitBeaconClientSynced(c *cli.Command, verbose bool) error

func WaitEthClientSynced

func WaitEthClientSynced(c *cli.Command, verbose bool) error

func WaitNodeHdPassword added in v1.15.7

func WaitNodeHdPassword(ctx context.Context, c *cli.Command, verbose bool) error

func WaitNodeHdWallet added in v1.15.7

func WaitNodeHdWallet(ctx context.Context, c *cli.Command, verbose bool) error

func WaitNodeRegistered

func WaitNodeRegistered(ctx context.Context, c *cli.Command, verbose bool) error

This check makes calls to GetHdWallet instead of GetWallet as it's used in node and watchtower

func WaitRocketStorage

func WaitRocketStorage(ctx context.Context, c *cli.Command, verbose bool) error

Types

type BeaconClientManager added in v1.5.0

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

This is a proxy for multiple Beacon clients, providing natural fallback support if one of them fails.

func GetBeaconClient

func GetBeaconClient(c *cli.Command) (*BeaconClientManager, error)

func NewBeaconClientManager added in v1.5.0

func NewBeaconClientManager(cfg *config.RocketPoolConfig) (*BeaconClientManager, error)

Creates a new BeaconClientManager instance based on the Rocket Pool config

func NewStaticBeaconClientManager added in v1.20.4

func NewStaticBeaconClientManager(static beacon.Client) *BeaconClientManager

NewStaticBeaconClientManager returns a BeaconClientManager whose public methods all delegate to the provided beacon.Client. No network connections are established.

func (*BeaconClientManager) ChangeWithdrawalCredentials added in v1.9.0

func (m *BeaconClientManager) ChangeWithdrawalCredentials(validatorIndex string, fromBlsPubkey types.ValidatorPubkey, toExecutionAddress common.Address, signature types.ValidatorSignature) error

Change the withdrawal credentials for a validator

func (*BeaconClientManager) CheckStatus added in v1.5.0

func (m *BeaconClientManager) CheckStatus() *api.ClientManagerStatus

func (*BeaconClientManager) Close added in v1.5.0

func (m *BeaconClientManager) Close() error

Close the connection to the Beacon client

func (*BeaconClientManager) ExitValidator added in v1.5.0

func (m *BeaconClientManager) ExitValidator(validatorIndex string, epoch uint64, signature types.ValidatorSignature) error

Voluntarily exit a validator

func (*BeaconClientManager) GetAllValidators added in v1.18.0

func (m *BeaconClientManager) GetAllValidators() ([]beacon.ValidatorStatus, error)

func (*BeaconClientManager) GetAttestations added in v1.6.0

func (m *BeaconClientManager) GetAttestations(blockId string) ([]beacon.AttestationInfo, bool, error)

Get the attestations in a Beacon chain block

func (*BeaconClientManager) GetBeaconBlock added in v1.5.0

func (m *BeaconClientManager) GetBeaconBlock(blockId string) (beacon.BeaconBlock, bool, error)

Get a Beacon chain block

func (*BeaconClientManager) GetBeaconBlockHeader added in v1.12.0

func (m *BeaconClientManager) GetBeaconBlockHeader(blockId string) (beacon.BeaconBlockHeader, bool, error)

func (*BeaconClientManager) GetBeaconBlockSSZ added in v1.18.0

func (m *BeaconClientManager) GetBeaconBlockSSZ(slot uint64) (*beacon.BeaconBlockSSZ, bool, error)

Get deneb beacon block by slot

func (*BeaconClientManager) GetBeaconHead added in v1.5.0

func (m *BeaconClientManager) GetBeaconHead() (beacon.BeaconHead, error)

Get the Beacon chain's head information

func (*BeaconClientManager) GetBeaconStateSSZ added in v1.18.0

func (m *BeaconClientManager) GetBeaconStateSSZ(slot uint64) (*beacon.BeaconStateSSZ, error)

Get the Beacon State information

func (*BeaconClientManager) GetClientType added in v1.5.0

func (m *BeaconClientManager) GetClientType() (beacon.BeaconClientType, error)

Get the client's process mode

func (*BeaconClientManager) GetCommitteesForEpoch added in v1.5.0

func (m *BeaconClientManager) GetCommitteesForEpoch(epoch *uint64) (beacon.Committees, error)

Get the attestation committees for an epoch

func (*BeaconClientManager) GetDomainData added in v1.5.0

func (m *BeaconClientManager) GetDomainData(domainType []byte, epoch uint64, useGenesisFork bool) ([]byte, error)

Get the Beacon chain's domain data

func (*BeaconClientManager) GetEth1DataForEth2Block added in v1.5.0

func (m *BeaconClientManager) GetEth1DataForEth2Block(blockId string) (beacon.Eth1Data, bool, error)

Get the EL data for a CL block

func (*BeaconClientManager) GetEth2Config added in v1.5.0

func (m *BeaconClientManager) GetEth2Config() (beacon.Eth2Config, error)

Get the Beacon configuration

func (*BeaconClientManager) GetEth2DepositContract added in v1.5.0

func (m *BeaconClientManager) GetEth2DepositContract() (beacon.Eth2DepositContract, error)

Get the Beacon configuration

func (*BeaconClientManager) GetHistoricalCommitteesForEpoch added in v1.24.0

func (m *BeaconClientManager) GetHistoricalCommitteesForEpoch(epoch uint64) (beacon.Committees, error)

func (*BeaconClientManager) GetSyncStatus added in v1.5.0

func (m *BeaconClientManager) GetSyncStatus() (beacon.SyncStatus, error)

Get the client's sync status

func (*BeaconClientManager) GetValidatorBalances added in v1.15.0

func (m *BeaconClientManager) GetValidatorBalances(indices []string, opts *beacon.ValidatorStatusOptions) (map[string]*big.Int, error)

Get the validator balances for a set of validators at a given slot

func (*BeaconClientManager) GetValidatorBalancesSafe added in v1.15.0

func (m *BeaconClientManager) GetValidatorBalancesSafe(indices []string, opts *beacon.ValidatorStatusOptions) (map[string]*big.Int, error)

Get the validator balances for a set of validators at a given slot, with backoff.

func (*BeaconClientManager) GetValidatorIndex added in v1.5.0

func (m *BeaconClientManager) GetValidatorIndex(pubkey types.ValidatorPubkey) (string, error)

Get a validator's index

func (*BeaconClientManager) GetValidatorProposerDuties added in v1.5.0

func (m *BeaconClientManager) GetValidatorProposerDuties(indices []string, epoch uint64) (map[string]uint64, error)

Get a validator's proposer duties

func (*BeaconClientManager) GetValidatorStatus added in v1.5.0

Get a validator's status by its pubkey

func (*BeaconClientManager) GetValidatorStatusByIndex added in v1.5.0

func (m *BeaconClientManager) GetValidatorStatusByIndex(index string, opts *beacon.ValidatorStatusOptions) (beacon.ValidatorStatus, error)

Get a validator's status by its index

func (*BeaconClientManager) GetValidatorStatuses added in v1.5.0

Get the statuses of multiple validators by their pubkeys

func (*BeaconClientManager) GetValidatorSyncDuties added in v1.5.0

func (m *BeaconClientManager) GetValidatorSyncDuties(indices []string, epoch uint64) (map[string]bool, error)

Get a validator's sync duties

type EthClient added in v1.20.1

type EthClient struct {
	*ethclient.Client
}

func NewEthClient added in v1.18.0

func NewEthClient(url string) (*EthClient, error)

func (*EthClient) LatestBlockTime added in v1.20.1

func (c *EthClient) LatestBlockTime(ctx context.Context) (time.Time, error)

type ExecutionClientManager added in v1.4.0

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

This is a proxy for multiple ETH clients, providing natural fallback support if one of them fails.

func GetEthClient

func GetEthClient(c *cli.Command) (*ExecutionClientManager, error)

func NewExecutionClientManager added in v1.4.0

func NewExecutionClientManager(cfg *config.RocketPoolConfig) (*ExecutionClientManager, error)

Creates a new ExecutionClientManager instance based on the Rocket Pool config

func NewStaticExecutionClientManager added in v1.20.4

func NewStaticExecutionClientManager(static rocketpool.ExecutionClient) *ExecutionClientManager

NewStaticExecutionClientManager returns an ExecutionClientManager whose public methods all delegate to the provided ExecutionClient. No network connections are established.

func (*ExecutionClientManager) BalanceAt added in v1.4.0

func (p *ExecutionClientManager) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)

BalanceAt returns the wei balance of the given account. The block number can be nil, in which case the balance is taken from the latest known block.

func (*ExecutionClientManager) BlockByNumber added in v1.20.8

func (p *ExecutionClientManager) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

BlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.

func (*ExecutionClientManager) BlockNumber added in v1.4.0

func (p *ExecutionClientManager) BlockNumber(ctx context.Context) (uint64, error)

BlockNumber returns the most recent block number

func (*ExecutionClientManager) CallContract added in v1.4.0

func (p *ExecutionClientManager) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

CallContract executes an Ethereum contract call with the specified data as the input.

func (*ExecutionClientManager) ChainID added in v1.16.0

func (p *ExecutionClientManager) ChainID(ctx context.Context) (*big.Int, error)

BlockNumber returns the most recent block number

func (*ExecutionClientManager) CheckStatus added in v1.4.0

func (*ExecutionClientManager) CodeAt added in v1.4.0

func (p *ExecutionClientManager) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)

CodeAt returns the code of the given account. This is needed to differentiate between contract internal errors and the local chain being out of sync.

func (*ExecutionClientManager) EstimateGas added in v1.4.0

func (p *ExecutionClientManager) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)

EstimateGas tries to estimate the gas needed to execute a specific transaction based on the current pending state of the backend blockchain. There is no guarantee that this is the true gas limit requirement as other transactions may be added or removed by miners, but it should provide a basis for setting a reasonable default.

func (*ExecutionClientManager) FilterLogs added in v1.4.0

func (p *ExecutionClientManager) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)

FilterLogs executes a log filter operation, blocking during execution and returning all the results in one batch.

TODO(karalabe): Deprecate when the subscription one can return past data too.

func (*ExecutionClientManager) HeaderByHash added in v1.5.0

func (p *ExecutionClientManager) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)

HeaderByHash returns the block header with the given hash.

func (*ExecutionClientManager) HeaderByNumber added in v1.4.0

func (p *ExecutionClientManager) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

HeaderByNumber returns a block header from the current canonical chain. If number is nil, the latest known header is returned.

func (*ExecutionClientManager) LatestBlockTime added in v1.18.0

func (p *ExecutionClientManager) LatestBlockTime(ctx context.Context) (time.Time, error)

func (*ExecutionClientManager) NonceAt added in v1.4.0

func (p *ExecutionClientManager) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)

NonceAt returns the account nonce of the given account. The block number can be nil, in which case the nonce is taken from the latest known block.

func (*ExecutionClientManager) PendingCodeAt added in v1.4.0

func (p *ExecutionClientManager) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

PendingCodeAt returns the code of the given account in the pending state.

func (*ExecutionClientManager) PendingNonceAt added in v1.4.0

func (p *ExecutionClientManager) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

PendingNonceAt retrieves the current pending nonce associated with an account.

func (*ExecutionClientManager) SendTransaction added in v1.4.0

func (p *ExecutionClientManager) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction injects the transaction into the pending pool for execution.

func (*ExecutionClientManager) SubscribeFilterLogs added in v1.4.0

func (p *ExecutionClientManager) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)

SubscribeFilterLogs creates a background log filtering operation, returning a subscription immediately, which can be used to stream the found events.

func (*ExecutionClientManager) SuggestGasPrice added in v1.4.0

func (p *ExecutionClientManager) SuggestGasPrice(ctx context.Context) (*big.Int, error)

SuggestGasPrice retrieves the currently suggested gas price to allow a timely execution of a transaction.

func (*ExecutionClientManager) SuggestGasTipCap added in v1.4.0

func (p *ExecutionClientManager) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

SuggestGasTipCap retrieves the currently suggested 1559 priority fee to allow a timely execution of a transaction.

func (*ExecutionClientManager) SyncProgress added in v1.4.0

SyncProgress retrieves the current progress of the sync algorithm. If there's no sync currently running, it returns nil.

func (*ExecutionClientManager) TransactionByHash added in v1.4.0

func (p *ExecutionClientManager) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)

TransactionByHash returns the transaction with the given hash.

func (*ExecutionClientManager) TransactionReceipt added in v1.4.0

func (p *ExecutionClientManager) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

TransactionReceipt returns the receipt of a transaction by transaction hash. Note that the receipt is not available for pending transactions.

type MegapoolFinalBalanceProof added in v1.24.0

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

MegapoolFinalBalanceProof is a version-selected payload for notifyFinalBalance. Build it once with BuildMegapoolFinalBalanceProof and reuse for gas estimate and submit.

func BuildMegapoolFinalBalanceProof added in v1.24.0

func BuildMegapoolFinalBalanceProof(c *cli.Command, rp *rocketpool.RocketPool, megapoolAddress common.Address, slotHint uint64, validatorIndex uint64, validatorPubkey rptypes.ValidatorPubkey, w wallet.Wallet) (*MegapoolFinalBalanceProof, error)

type PerformanceDefenseProofs added in v1.24.0

type PerformanceDefenseProofs struct {
	// Offset is the epoch offset of the disproven epoch from the challenge's
	// start epoch (challengedEpoch = startEpoch + Offset)
	Offset uint64
	// ChallengeLeaf is the word of the challenge participation bitmap that
	// contains the Offset bit (LSB-first: bit Offset % 256 must be set,
	// meaning the epoch was challenged as missed)
	ChallengeLeaf *big.Int
	// ChallengeWitness is the sha256 merkle branch proving ChallengeLeaf is
	// part of the challenge bitmap root stored on-chain
	ChallengeWitness []common.Hash
	SlotTimestamp    uint64
	// Validator ties the beacon validator index to the challenged validator's
	// pubkey, anchored to the same slot as the participation proof
	Validator megapool.ValidatorProof
	// Participation carries the participation metadata
	Participation megapool.ParticipationProof
	Slot          megapool.SlotProof
}

PerformanceDefenseProofs bundles everything the RespondWithParticipation call of a megapool performance challenge needs.

func GetParticipationProof added in v1.24.0

func GetParticipationProof(c *cli.Command, validatorIndex uint64, validatorPubkey types.ValidatorPubkey, challengedEpoch uint64, startEpoch uint64, participation []*big.Int) (PerformanceDefenseProofs, error)

GetParticipationProof builds the proofs needed to respond to a performance challenge with a validator's timely target vote in challengedEpoch. The challenge is identified by its start epoch and participation bitmap (challengedEpoch must be marked as missed in the bitmap). The participation state is the post-state of the last block in epoch challengedEpoch+1: attestations only enter the state via blocks, so that state holds the final previous_epoch_participation flags for the challenged epoch. All proofs are anchored at a recent finalized state: the participation state's root is proven through the anchor's state_roots vector when it is at most 8192 slots old, or through historical_summaries otherwise.

type Withdrawal added in v1.19.0

type Withdrawal struct {
	Index                 uint64         `json:"index"`
	ValidatorIndex        uint64         `json:"validatorIndex"`
	WithdrawalCredentials common.Address `json:"withdrawalCredentials"`
	AmountInGwei          uint64         `json:"amountInGwei"`
}

type WithdrawalFinder added in v1.21.0

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

WithdrawalFinder locates validator withdrawals in a fork-aware way. Searches starting before Gloas activation scan beacon blocks; searches starting at or after it scan execution-layer blocks instead (Gloas/ePBS removed the execution payload from beacon blocks). A pre-Gloas search that reaches the fork without finding its withdrawal continues on the execution layer from the activation slot.

func NewWithdrawalFinder added in v1.21.0

func NewWithdrawalFinder(bc beacon.Client, ec *ExecutionClientManager, eth2Config beacon.Eth2Config) *WithdrawalFinder

func (*WithdrawalFinder) FindWithdrawal added in v1.21.0

func (f *WithdrawalFinder) FindWithdrawal(slot uint64, validatorIndex uint64) (*generic.Withdrawal, error)

FindWithdrawal returns the first withdrawal for the given validator index at or after the given slot, scanning up to MAX_WITHDRAWAL_SLOT_DISTANCE slots.

type WithdrawalProofResponse added in v1.19.0

type WithdrawalProofResponse struct {
	Slot           uint64        `json:"slot"`
	WithdrawalSlot uint64        `json:"withdrawalSlot"`
	WithdrawalNum  uint16        `json:"withdrawalNum"`
	Withdrawal     Withdrawal    `json:"withdrawal"`
	Witnesses      []common.Hash `json:"witnesses"`
}

Jump to

Keyboard shortcuts

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