Repository navigation
Add validator metrics RPC methods - #283
Open
NeerajGodiyal wants to merge 17 commits into
Open
NeerajGodiyal wants to merge 17 commits into
NeerajGodiyal wants to merge 17 commits into
Conversation
Serve the live replay slot for processed requests and the published rooted slot for confirmed and finalized requests. Decode minContextSlot as an exact uint64 and return the existing structured RPC errors. Add HTTP coverage for commitment selection, minimum-context boundaries, invalid inputs, numeric precision, missing roots and cancellation. Document the supported options.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
getVoteAccounts,getBalance,getLeaderSchedule, andgetBlockProductionso Solana Exporter can read validator metrics from Mithril.Maintain rooted stake totals and cache parsed vote records, invalidating them on account changes, recovery, and rewind. Epoch recalculation yields the cache mutex in bounded entry batches. Missing or deleted accounts return
nullfromgetAccountInfoand zero fromgetBalance.Preserve the v1 manifest undo boolean on new writes. Recovery derives vote candidates from validated account records. Previously written flag-style manifests remain readable by this version, but downgrading those existing stores requires rebuilding or canonicalizing them first.
Query behavior
Parse integer parameters without floating-point rounding and use defaults for null optional fields. Support
keepUnstakedDelinquentsand vote-account-keyed leader schedules. Theidentityfilter still selects a node identity. Vote-account keys come from the retained canonical schedule; requests return an error when only a node-keyed compatibility schedule is available.Account and validator reads use the published rooted state for
confirmedandfinalized. They rejectprocessedrather than return rooted data for that request. This does not add a separate optimistic confirmed account view. Existing processed counters ingetSlotandgetEpochInfoare unchanged.Related PRs
#280 supplies the correct epoch length for Alpenglow. Both PRs change
getEpochInfo; their integration must keep the schedule-derived epoch length and the commitment/minimum-context handling here.Complete exporter support also needs #282 for node information and #284 for retained block summaries. Inflation rewards from #285 are already merged. This PR does not depend on the separate full transaction-history work.
Validation
f521efcc, the unmodified Solana Exporter RPC client passed HTTP checks for all four methods before/after committed updates and durable rewind, under race detection.348704c4passed native race tests for replay, execution and RPC/account/reward behavior, followed by repository-wide vet, build and CLI compilation. All 1,152 parent test executions passed without Go skip events. The optional external program workloads were not enabled because their pinned arithmetic fixture was unavailable. These are isolated fixture tests, not a public-cluster throughput result.Performance
Local M4 Pro / ARM64, GOMAXPROCS=2: warm responses for 1,000 unchanged vote records improved from 2.78 to 0.66 ms including JSON encoding. Two-million-delegation recalculation improved from 103 to 60 ms, with temporary allocations reduced from 64.2 to 0.19 MB. Reusable benchmarks and methodology are in
docs/rooted-stake-rpc-cache.mdand the RPC test suite.These are component measurements, not live RPC p99 or validator voting results. Cache benefits depend on record reuse; bootstrap and epoch recalculation still visit stake delegations.