Documentation
¶
Overview ¶
Experimenting with an alternate language style - named return params
Index ¶
- Constants
- func DownloadRewardsFile(cfg *config.RocketPoolConfig, interval uint64, cid string, isDaemon bool) error
- func GetClaimIntervalTime(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (time.Duration, error)
- func GetClaimStatus(rp *rocketpool.RocketPool, nodeAddress common.Address) (unclaimed []uint64, claimed []uint64, err error)
- func GetELBlockHeaderForTime(targetTime time.Time, rp *rocketpool.RocketPool) (*types.Header, error)
- func GetNodeOperatorRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (*big.Int, error)
- func GetPendingRPLRewards(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (*big.Int, error)
- func GetProtocolDaoRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (*big.Int, error)
- func GetRewardSnapshotEvent(rp *rocketpool.RocketPool, cfg *config.RocketPoolConfig, interval uint64) (rewards.RewardsEvent, error)
- func GetTrustedNodeOperatorRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, ...) (*big.Int, error)
- func GetUpgradedRewardSnapshotEvent(cfg *config.RocketPoolConfig, rp *rocketpool.RocketPool, index uint64, ...) (rewards.RewardsEvent, error)
- type CommitteeInfo
- type IntervalDutiesInfo
- type IntervalInfo
- type MinipoolInfo
- type MinipoolPerformanceFile
- type NetworkRewardsInfo
- type NodeRewardsInfo
- type NodeSmoothingDetails
- type QuotedBigInt
- type RewardsFile
- type SlotInfo
- type SmoothingPoolMinipoolPerformance
- type TotalRewards
- type TreeGenerator
Constants ¶
const ( SmoothingPoolDetailsBatchSize uint64 = 8 MainnetV2Interval uint64 = 4 PraterV2Interval uint64 = 37 )
Settings
const (
FarEpoch uint64 = 18446744073709551615
)
Variables ¶
This section is empty.
Functions ¶
func DownloadRewardsFile ¶
func DownloadRewardsFile(cfg *config.RocketPoolConfig, interval uint64, cid string, isDaemon bool) error
Downloads a single rewards file
func GetClaimIntervalTime ¶
func GetClaimIntervalTime(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (time.Duration, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetClaimStatus ¶
func GetClaimStatus(rp *rocketpool.RocketPool, nodeAddress common.Address) (unclaimed []uint64, claimed []uint64, err error)
Gets the intervals the node can claim and the intervals that have already been claimed
func GetELBlockHeaderForTime ¶
func GetELBlockHeaderForTime(targetTime time.Time, rp *rocketpool.RocketPool) (*types.Header, error)
Get the number of the latest EL block that was created before the given timestamp
func GetNodeOperatorRewardsPercent ¶
func GetNodeOperatorRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetPendingRPLRewards ¶
func GetPendingRPLRewards(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetProtocolDaoRewardsPercent ¶
func GetProtocolDaoRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetRewardSnapshotEvent ¶ added in v1.6.2
func GetRewardSnapshotEvent(rp *rocketpool.RocketPool, cfg *config.RocketPoolConfig, interval uint64) (rewards.RewardsEvent, error)
Get the event for a rewards snapshot
func GetTrustedNodeOperatorRewardsPercent ¶
func GetTrustedNodeOperatorRewardsPercent(cfg *config.RocketPoolConfig, index uint64, rp *rocketpool.RocketPool, opts *bind.CallOpts) (*big.Int, error)
TODO: temp until rocketpool-go supports RocketStorage contract address lookups per block
func GetUpgradedRewardSnapshotEvent ¶
func GetUpgradedRewardSnapshotEvent(cfg *config.RocketPoolConfig, rp *rocketpool.RocketPool, index uint64, intervalSize *big.Int, startBlock *big.Int, endBlock *big.Int) (rewards.RewardsEvent, error)
This retrieves the rewards snapshot event from a set of contracts, upgrading it to the latest struct version
Types ¶
type CommitteeInfo ¶
type CommitteeInfo struct {
Index uint64
Positions map[int]*MinipoolInfo
}
type IntervalDutiesInfo ¶
type IntervalInfo ¶
type IntervalInfo struct {
Index uint64 `json:"index"`
TreeFilePath string `json:"treeFilePath"`
TreeFileExists bool `json:"treeFileExists"`
MerkleRootValid bool `json:"merkleRootValid"`
CID string `json:"cid"`
StartTime time.Time `json:"startTime"`
EndTime time.Time `json:"endTime"`
NodeExists bool `json:"nodeExists"`
CollateralRplAmount *QuotedBigInt `json:"collateralRplAmount"`
ODaoRplAmount *QuotedBigInt `json:"oDaoRplAmount"`
SmoothingPoolEthAmount *QuotedBigInt `json:"smoothingPoolEthAmount"`
MerkleProof []common.Hash `json:"merkleProof"`
}
Information about an interval
func GetIntervalInfo ¶
func GetIntervalInfo(rp *rocketpool.RocketPool, cfg *config.RocketPoolConfig, nodeAddress common.Address, interval uint64) (info IntervalInfo, err error)
Gets the information for an interval including the file status, the validity, and the node's rewards
type MinipoolInfo ¶
type MinipoolInfo struct {
Address common.Address
ValidatorPubkey types.ValidatorPubkey
ValidatorIndex uint64
NodeAddress common.Address
NodeIndex uint64
Fee *big.Int
MissedAttestations uint64
GoodAttestations uint64
MissingAttestationSlots map[uint64]bool
WasActive bool
StartSlot uint64
EndSlot uint64
}
type MinipoolPerformanceFile ¶
type MinipoolPerformanceFile struct {
Index uint64 `json:"index"`
Network string `json:"network"`
StartTime time.Time `json:"startTime,omitempty"`
EndTime time.Time `json:"endTime,omitempty"`
ConsensusStartBlock uint64 `json:"consensusStartBlock,omitempty"`
ConsensusEndBlock uint64 `json:"consensusEndBlock,omitempty"`
ExecutionStartBlock uint64 `json:"executionStartBlock,omitempty"`
ExecutionEndBlock uint64 `json:"executionEndBlock,omitempty"`
MinipoolPerformance map[common.Address]*SmoothingPoolMinipoolPerformance `json:"minipoolPerformance"`
}
Holds information
type NetworkRewardsInfo ¶
type NetworkRewardsInfo struct {
CollateralRpl *QuotedBigInt `json:"collateralRpl"`
OracleDaoRpl *QuotedBigInt `json:"oracleDaoRpl"`
SmoothingPoolEth *QuotedBigInt `json:"smoothingPoolEth"`
}
Rewards per network
type NodeRewardsInfo ¶
type NodeRewardsInfo struct {
RewardNetwork uint64 `json:"rewardNetwork"`
CollateralRpl *QuotedBigInt `json:"collateralRpl"`
OracleDaoRpl *QuotedBigInt `json:"oracleDaoRpl"`
SmoothingPoolEth *QuotedBigInt `json:"smoothingPoolEth"`
SmoothingPoolEligibilityRate float64 `json:"smoothingPoolEligibilityRate"`
MerkleData []byte `json:"-"`
MerkleProof []string `json:"merkleProof"`
}
Node operator rewards
func (*NodeRewardsInfo) GetMerkleProof ¶
func (n *NodeRewardsInfo) GetMerkleProof() ([]common.Hash, error)
Get the deserialized Merkle Proof bytes
type NodeSmoothingDetails ¶
type NodeSmoothingDetails struct {
Address common.Address
IsEligible bool
IsOptedIn bool
StatusChangeTime time.Time
Minipools []*MinipoolInfo
EligibleSeconds *big.Int
StartSlot uint64
EndSlot uint64
SmoothingPoolEth *big.Int
RewardsNetwork uint64
}
Details about a node for the Smoothing Pool
type QuotedBigInt ¶
func NewQuotedBigInt ¶
func NewQuotedBigInt(x int64) *QuotedBigInt
func (*QuotedBigInt) MarshalJSON ¶
func (b *QuotedBigInt) MarshalJSON() ([]byte, error)
func (*QuotedBigInt) UnmarshalJSON ¶
func (b *QuotedBigInt) UnmarshalJSON(p []byte) error
type RewardsFile ¶
type RewardsFile struct {
// Serialized fields
RewardsFileVersion uint64 `json:"rewardsFileVersion"`
RulesetVersion uint64 `json:"rulesetVersion,omitempty"`
Index uint64 `json:"index"`
Network string `json:"network"`
StartTime time.Time `json:"startTime,omitempty"`
EndTime time.Time `json:"endTime"`
ConsensusStartBlock uint64 `json:"consensusStartBlock,omitempty"`
ConsensusEndBlock uint64 `json:"consensusEndBlock"`
ExecutionStartBlock uint64 `json:"executionStartBlock,omitempty"`
ExecutionEndBlock uint64 `json:"executionEndBlock"`
IntervalsPassed uint64 `json:"intervalsPassed"`
MerkleRoot string `json:"merkleRoot,omitempty"`
MinipoolPerformanceFileCID string `json:"minipoolPerformanceFileCid,omitempty"`
TotalRewards *TotalRewards `json:"totalRewards"`
NetworkRewards map[uint64]*NetworkRewardsInfo `json:"networkRewards"`
NodeRewards map[common.Address]*NodeRewardsInfo `json:"nodeRewards"`
MinipoolPerformanceFile MinipoolPerformanceFile `json:"-"`
// Non-serialized fields
MerkleTree *merkletree.MerkleTree `json:"-"`
InvalidNetworkNodes map[common.Address]uint64 `json:"-"`
}
JSON struct for a complete rewards file
type SlotInfo ¶
type SlotInfo struct {
Index uint64
Committees map[uint64]*CommitteeInfo
}
type SmoothingPoolMinipoolPerformance ¶
type SmoothingPoolMinipoolPerformance struct {
Pubkey string `json:"pubkey"`
StartSlot uint64 `json:"startSlot,omitempty"`
EndSlot uint64 `json:"endSlot,omitempty"`
ActiveFraction float64 `json:"activeFraction,omitempty"`
SuccessfulAttestations uint64 `json:"successfulAttestations"`
MissedAttestations uint64 `json:"missedAttestations"`
ParticipationRate float64 `json:"participationRate"`
MissingAttestationSlots []uint64 `json:"missingAttestationSlots"`
EthEarned float64 `json:"ethEarned"`
}
Minipool stats
type TotalRewards ¶
type TotalRewards struct {
ProtocolDaoRpl *QuotedBigInt `json:"protocolDaoRpl"`
TotalCollateralRpl *QuotedBigInt `json:"totalCollateralRpl"`
TotalOracleDaoRpl *QuotedBigInt `json:"totalOracleDaoRpl"`
TotalSmoothingPoolEth *QuotedBigInt `json:"totalSmoothingPoolEth"`
PoolStakerSmoothingPoolEth *QuotedBigInt `json:"poolStakerSmoothingPoolEth"`
NodeOperatorSmoothingPoolEth *QuotedBigInt `json:"nodeOperatorSmoothingPoolEth"`
}
Total cumulative rewards for an interval
type TreeGenerator ¶ added in v1.7.1
type TreeGenerator struct {
// contains filtered or unexported fields
}
func NewTreeGenerator ¶ added in v1.7.1
func NewTreeGenerator(log log.ColorLogger, logPrefix string, rp *rocketpool.RocketPool, cfg *config.RocketPoolConfig, bc beacon.Client, index uint64, startTime time.Time, endTime time.Time, consensusBlock uint64, elSnapshotHeader *types.Header, intervalsPassed uint64) (*TreeGenerator, error)
func (*TreeGenerator) ApproximateStakerShareOfSmoothingPool ¶ added in v1.7.1
func (t *TreeGenerator) ApproximateStakerShareOfSmoothingPool() (*big.Int, error)
func (*TreeGenerator) GenerateTree ¶ added in v1.7.1
func (t *TreeGenerator) GenerateTree() (*RewardsFile, error)