Documentation
¶
Overview ¶
Package verifyperformance contains shared CLI helpers for the `rocketpool minipool verify-performance` and `rocketpool megapool verify-performance` commands.
Index ¶
- Constants
- func ConfirmLargeRange(total uint64) bool
- func PrintBatchResults(resp api.VerifyPerformanceBatchResponse, ...)
- func PrintCancelled() error
- func PrintElapsed(elapsed time.Duration)
- func PrintResult(resp api.VerifyPerformanceResponse, label string)
- func ResolveEpochRange(rp *rocketpool.Client, startEpoch, epochs uint64) (uint64, uint64, error)
- type ChallengeGroup
Constants ¶
const LargeEpochRangeWarning uint64 = 256
LargeEpochRangeWarning is the number of epochs above which the CLI prompts the user to confirm, because each epoch issues a committees fetch plus a few-dozen block fetches against the beacon node.
Variables ¶
This section is empty.
Functions ¶
func ConfirmLargeRange ¶
ConfirmLargeRange prompts the user when the requested epoch range exceeds LargeEpochRangeWarning and returns true if the user accepts the warning.
func PrintBatchResults ¶
func PrintBatchResults(resp api.VerifyPerformanceBatchResponse, labelFor func(api.VerifyPerformanceResult) string)
PrintBatchResults writes a batch of verify-performance results to stdout. For each result it prints the per-validator detail (or the per-validator error), then a closing summary. labelFor produces the human-facing label for a result, e.g. "minipool 0x..." or "megapool validator 3".
func PrintCancelled ¶
func PrintCancelled() error
PrintCancelled prints a generic cancellation message and returns nil so it can be returned directly from a CLI Action.
func PrintElapsed ¶
PrintElapsed prints the wall-clock time the verification took, rounded to the millisecond.
func PrintResult ¶
func PrintResult(resp api.VerifyPerformanceResponse, label string)
PrintResult writes a VerifyPerformanceResponse to stdout in a human-readable format. `label` is the human-facing string identifying the validator being verified, e.g. "minipool 0x...".
func ResolveEpochRange ¶
ResolveEpochRange fills in defaults for the start/length range. If epochs is 0, it defaults to the on-chain performance_period setting. Returns the inclusive [startEpoch, endEpoch] range.
Types ¶
type ChallengeGroup ¶
type ChallengeGroup struct {
ValidatorIds []uint32
StartEpoch uint64
Participation []*big.Int
MissedEpochs []uint64
}
ChallengeGroup is a set of validators sharing an identical missed-epoch set, challengeable together in a single challengeMegapool call.
func GroupChallengeable ¶
func GroupChallengeable(results []api.VerifyPerformanceResult) []ChallengeGroup
GroupChallengeable groups the challengeable validators of a batch result by identical missed-epoch sets, preserving the order in which they appear in the results. Errored, passing, and non-challengeable validators are excluded.