megapool

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: GPL-3.0, GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BeaconStateVerifierLock sync.Mutex
View Source
var ValidatorBatchSize = uint32(50)

Functions

func ChallengeExit

func ChallengeExit(rp *rocketpool.RocketPool, exitChallenge []ExitChallenge, opts *bind.TransactOpts) (*types.Transaction, error)

Used to challenge a validator that is exiting without an exit notification

func DissolveWithProof

func DissolveWithProof(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, validatorProof ValidatorProof, opts *bind.TransactOpts) (*types.Transaction, error)

Dissolve a validator using a proof that it used wrong credentials

func EstimateChallengeExitGas

func EstimateChallengeExitGas(rp *rocketpool.RocketPool, exitChallenge []ExitChallenge, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas to call ChallengeExit

func EstimateDissolveWithProof

func EstimateDissolveWithProof(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, validatorProof ValidatorProof, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas to call DissolveWithProof

func EstimateNotifyExitGas

func EstimateNotifyExitGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, validatorProof ValidatorProof, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas to call NotifyExit

func EstimateNotifyFinalBalance

func EstimateNotifyFinalBalance(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, withdrawalProof WithdrawalProof, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas to call NotifyFinalBalance

func EstimateNotifyNotExitGas

func EstimateNotifyNotExitGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, validatorProof ValidatorProof, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas to call NotifyNotExit

func EstimatePenaliseGas

func EstimatePenaliseGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, block *big.Int, amount *big.Int, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

func EstimateStakeGas

func EstimateStakeGas(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, validatorProof ValidatorProof, opts *bind.TransactOpts) (rocketpool.GasInfo, error)

Estimate the gas of Stake

func GetDelegate

func GetDelegate(rp *rocketpool.RocketPool, opts *bind.CallOpts) (common.Address, error)

Returns the address of the megapool's stored delegate

func GetDelegateExpired

func GetDelegateExpired(rp *rocketpool.RocketPool, opts *bind.CallOpts) (bool, error)

Returns true if the megapools current delegate has expired

func GetEffectiveDelegate

func GetEffectiveDelegate(rp *rocketpool.RocketPool, opts *bind.CallOpts) (common.Address, error)

Returns the delegate which will be used when calling this megapool taking into account useLatestDelegate setting

func GetMegapoolDelegateExpiry

func GetMegapoolDelegateExpiry(rp *rocketpool.RocketPool, delegateAddress common.Address, opts *bind.CallOpts) (uint64, error)

Get a megapool delegate expiration block

func GetMegapoolDeployed

func GetMegapoolDeployed(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (bool, error)

Get a megapool deployment state

func GetMegapoolExpectedAddress

func GetMegapoolExpectedAddress(rp *rocketpool.RocketPool, nodeAddress common.Address, opts *bind.CallOpts) (common.Address, error)

Get a megapool expected address

func GetUseLatestDelegate

func GetUseLatestDelegate(rp *rocketpool.RocketPool, opts *bind.CallOpts) (bool, error)

Returns true if this megapool always uses the latest delegate contract

func GetValidatorCount

func GetValidatorCount(rp *rocketpool.RocketPool, opts *bind.CallOpts) (uint32, error)

func NotifyExit

func NotifyExit(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, validatorProof ValidatorProof, opts *bind.TransactOpts) (*types.Transaction, error)

Notify the megapool that one of its validators is exiting

func NotifyFinalBalance

func NotifyFinalBalance(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, withdrawalProof WithdrawalProof, opts *bind.TransactOpts) (*types.Transaction, error)

Notify the megapool of the final balance of an exited validator

func NotifyNotExit

func NotifyNotExit(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, proof ValidatorProof, opts *bind.TransactOpts) (*types.Transaction, error)

Used to prove a validator is not exiting after a challenge-exit

func Penalise

func Penalise(rp *rocketpool.RocketPool, megapoolAddress common.Address, block *big.Int, amount *big.Int, opts *bind.TransactOpts) (common.Hash, error)

func Stake

func Stake(rp *rocketpool.RocketPool, megapoolAddress common.Address, validatorId uint32, validatorProof ValidatorProof, opts *bind.TransactOpts) (*types.Transaction, error)

Progress the prelaunch megapool to staking

Types

type ExitChallenge

type ExitChallenge struct {
	Megapool     common.Address `json:"megapool"`
	ValidatorIds []uint32       `json:"validatorIds"`
}

type FinalBalanceProof

type FinalBalanceProof struct {
	Slot           uint64
	WithdrawalSlot uint64
	ValidatorIndex uint64
	Amount         *big.Int
	Witnesses      [][32]byte

	// Contract refers to this as _withdrawalNum
	IndexInWithdrawalsArray uint
	// Part of the Withdrawal calldata
	WithdrawalIndex   uint64
	WithdrawalAddress common.Address
}

type Megapool

type Megapool interface {
	GetContract() *rocketpool.Contract
	GetAddress() common.Address
	GetVersion() uint8
	GetValidatorCount(opts *bind.CallOpts) (uint32, error)
	GetActiveValidatorCount(opts *bind.CallOpts) (uint32, error)
	GetLockedValidatorCount(opts *bind.CallOpts) (uint32, error)
	GetExitingValidatorCount(opts *bind.CallOpts) (uint32, error)
	GetSoonestWithdrawableEpoch(opts *bind.CallOpts) (uint32, error)
	GetValidatorInfo(validatorId uint32, opts *bind.CallOpts) (ValidatorInfo, error)
	GetValidatorPubkey(validatorId uint32, opts *bind.CallOpts) (rptypes.ValidatorPubkey, error)
	GetValidatorInfoAndPubkey(validatorId uint32, opts *bind.CallOpts) (ValidatorInfoWithPubkey, error)
	GetLastDistributionBlock(opts *bind.CallOpts) (uint64, error)
	GetAssignedValue(opts *bind.CallOpts) (*big.Int, error)
	GetDebt(opts *bind.CallOpts) (*big.Int, error)
	GetRefundValue(opts *bind.CallOpts) (*big.Int, error)
	GetNodeBond(opts *bind.CallOpts) (*big.Int, error)
	GetUserCapital(opts *bind.CallOpts) (*big.Int, error)
	CalculatePendingRewards(opts *bind.CallOpts) (RewardSplit, error)
	CalculateRewards(amount *big.Int, opts *bind.CallOpts) (RewardSplit, error)
	GetPendingRewards(opts *bind.CallOpts) (*big.Int, error)
	GetNodeAddress(opts *bind.CallOpts) (common.Address, error)
	EstimateNewValidatorGas(validatorId uint32, validatorSignature rptypes.ValidatorSignature, depositDataRoot common.Hash, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	NewValidator(bondAmount *big.Int, useExpressTicket bool, validatorPubkey rptypes.ValidatorPubkey, validatorSignature rptypes.ValidatorSignature, opts *bind.TransactOpts) (common.Hash, error)
	EstimateDequeueGas(validatorId uint32, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	Dequeue(validatorId uint32, opts *bind.TransactOpts) (common.Hash, error)
	EstimateDistributeGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	Distribute(opts *bind.TransactOpts) (common.Hash, error)
	EstimateAssignFundsGas(validatorId uint32, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	AssignFunds(validatorId uint32, opts *bind.TransactOpts) (common.Hash, error)
	EstimateDissolveValidatorGas(validatorId uint32, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	DissolveValidator(validatorId uint32, opts *bind.TransactOpts) (common.Hash, error)
	EstimateClaimRefundGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	ClaimRefund(opts *bind.TransactOpts) (common.Hash, error)
	EstimateRepayDebtGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	RepayDebt(opts *bind.TransactOpts) (common.Hash, error)
	EstimateReduceBondGas(amount *big.Int, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	ReduceBond(amount *big.Int, opts *bind.TransactOpts) (common.Hash, error)
	GetWithdrawalCredentials(opts *bind.CallOpts) (common.Hash, error)
	EstimateRequestUnstakeRPL(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	RequestUnstakeRPL(opts *bind.TransactOpts) (common.Hash, error)
	EstimateSetUseLatestDelegateGas(setting bool, opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	SetUseLatestDelegate(setting bool, opts *bind.TransactOpts) (common.Hash, error)
	GetUseLatestDelegate(opts *bind.CallOpts) (bool, error)
	GetDelegate(opts *bind.CallOpts) (common.Address, error)
	GetDelegateExpired(rp *rocketpool.RocketPool, opts *bind.CallOpts) (bool, error)
	GetEffectiveDelegate(opts *bind.CallOpts) (common.Address, error)
	EstimateDelegateUpgradeGas(opts *bind.TransactOpts) (rocketpool.GasInfo, error)
	DelegateUpgrade(opts *bind.TransactOpts) (common.Hash, error)
	GetMegapoolPubkeys(opts *bind.CallOpts) ([]rptypes.ValidatorPubkey, error)
}

func NewMegaPoolV1

func NewMegaPoolV1(rp *rocketpool.RocketPool, address common.Address, opts *bind.CallOpts) (Megapool, error)

Create new megapool contract

type MegapoolV1

type MegapoolV1 interface {
	Megapool
}

type ProvedValidator

type ProvedValidator struct {
	Pubkey                     []byte   `json:"pubkey" ssz-size:"48"`
	WithdrawalCredentials      [32]byte `json:"withdrawal_credentials" ssz-size:"32"`
	EffectiveBalance           uint64   `json:"effective_balance"`
	Slashed                    bool     `json:"slashed"`
	ActivationEligibilityEpoch uint64   `json:"activation_eligibility_epoch"`
	ActivationEpoch            uint64   `json:"activation_epoch"`
	ExitEpoch                  uint64   `json:"exit_epoch"`
	WithdrawableEpoch          uint64   `json:"withdrawable_epoch"`
}

type RewardSplit

type RewardSplit struct {
	NodeRewards        *big.Int `abi:"nodeRewards"`
	VoterRewards       *big.Int `abi:"voterRewards"`
	ProtocolDAORewards *big.Int `abi:"protocolDAORewards"`
	RethRewards        *big.Int `abi:"rethRewards"`
}

type ValidatorInfo

type ValidatorInfo struct {
	LastAssignmentTime uint32 `abi:"lastAssignmentTime"`
	LastRequestedValue uint32 `abi:"lastRequestedValue"`
	LastRequestedBond  uint32 `abi:"lastRequestedBond"`
	DepositValue       uint32 `abi:"depositValue"`
	Staked             bool   `abi:"staked"`
	Exited             bool   `abi:"exited"`
	InQueue            bool   `abi:"inQueue"`
	InPrestake         bool   `abi:"inPrestake"`
	ExpressUsed        bool   `abi:"expressUsed"`
	Dissolved          bool   `abi:"dissolved"`
	Exiting            bool   `abi:"exiting"`
	Locked             bool   `abi:"locked"`
	ValidatorIndex     uint64 `abi:"validatorIndex"`
	ExitBalance        uint64 `abi:"exitBalance"`
	WithdrawableEpoch  uint64 `abi:"withdrawableEpoch"`
	LockedSlot         uint64 `abi:"lockedSlot"`
}

type ValidatorInfoFromGlobalIndex

type ValidatorInfoFromGlobalIndex struct {
	Pubkey          []byte         `abi:"pubkey"`
	ValidatorInfo   ValidatorInfo  `abi:"validatorInfo"`
	MegapoolAddress common.Address `abi:"megapoolAddress"`
	ValidatorId     uint32         `abi:"validatorId"`
}

type ValidatorInfoWithPubkey

type ValidatorInfoWithPubkey struct {
	Pubkey        []byte `abi:"pubkey"`
	ValidatorInfo `abi:"validatorInfo"`
}

type ValidatorProof

type ValidatorProof struct {
	Slot           uint64
	ValidatorIndex *big.Int
	Validator      ProvedValidator
	Witnesses      [][32]byte
}

type Withdrawal

type Withdrawal struct {
	Index                 uint64   `json:"index"`
	ValidatorIndex        uint64   `json:"validatorIndex"`
	WithdrawalCredentials [20]byte `json:"withdrawalCredentials"`
	AmountInGwei          uint64   `json:"amountInGwei"`
}

type WithdrawalProof

type WithdrawalProof struct {
	Slot           uint64     `json:"slot"`
	WithdrawalSlot uint64     `json:"withdrawalSlot"`
	WithdrawalNum  uint16     `json:"withdrawalNum"`
	Withdrawal     Withdrawal `json:"withdrawal"`
	Witnesses      [][32]byte `json:"witnesses"`
}

Jump to

Keyboard shortcuts

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