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, ec rocketpool.ExecutionClient) (*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 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
Constants ¶
const ( SmoothingPoolDetailsBatchSize uint64 = 20 RewardsFileVersion uint64 = 1 )
Settings
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, ec rocketpool.ExecutionClient) (*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 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) (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 MinipoolPerformanceFile ¶
type MinipoolPerformanceFile struct { Index uint64 `json:"index"` Network string `json:"network"` 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 SmoothingPoolEth *big.Int }
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"` 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:"-"` // contains filtered or unexported fields }
JSON struct for a complete rewards file
func NewRewardsFile ¶
func NewRewardsFile(log log.ColorLogger, logPrefix string, index uint64, startTime time.Time, endTime time.Time, consensusBlock uint64, elSnapshotHeader *types.Header, intervalsPassed uint64) *RewardsFile
Create a new rewards file
func (*RewardsFile) GenerateTree ¶
func (r *RewardsFile) GenerateTree(rp *rocketpool.RocketPool, cfg *config.RocketPoolConfig, bc beacon.Client) error
type SlotInfo ¶
type SlotInfo struct { Index uint64 Committees map[uint64]*CommitteeInfo }
type SmoothingPoolMinipoolPerformance ¶
type SmoothingPoolMinipoolPerformance struct { Pubkey string `json:"pubkey"` 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