Skip to content

feat(rpc): implement getVoteAccounts RPC#1208

Open
prestonsn wants to merge 4 commits intoadamw/implement-getSlot-in-rpcfrom
prestonsn/impl-get-vote-accounts-rpc
Open

feat(rpc): implement getVoteAccounts RPC#1208
prestonsn wants to merge 4 commits intoadamw/implement-getSlot-in-rpcfrom
prestonsn/impl-get-vote-accounts-rpc

Conversation

@prestonsn
Copy link
Contributor

@prestonsn prestonsn commented Feb 4, 2026

Intent

  • ImplementgetVoteAccounts RPC method

Implementation

  • Added getVoteAccounts handler to RpcHookContext with full parameter support (commitment votePubkey filter, keepUnstakedDelinquents, delinquentSlotDistance)
  • Wired epoch_tracker to RPC hooks for epoch vote account lookups
  • Partitions validators into current/delinquent based on last vote slot relative to delinquentSlotDistance (default 128)
  • Limits epoch credits to last 5 entries per Agave's MAX_RPC_VOTE_ACCOUNT_INFO_EPOCH_CREDITS_HISTORY
  • Renamed SlotHookContext to RpcHookContext for broader RPC method support

Ramifications

  • Reads from stakes_cache with a read lock to access vote accounts and their stake
  • Uses epoch_tracker.getPtrForSlot() to determine if a vote account is active in the current epoch

Tests

  • Compared response from our impl with Agave's, they seem to match at each commitment level
  • TODO: unit tests

ajw221 and others added 3 commits February 2, 2026 18:54
- Add SlotTree.tip() to get highest slot among fork leaves (bypass mode)
- Update latest_processed_slot inside vote handling to match Agave behavior
- Update latest_processed_slot in bypassConsensus() from SlotTree.tip()
- Change ForkChoiceProcessedSlot to use store() since slot can decrease
Note: Bypass mode uses highest fork tip, while consensus mode matches
Agave's semantics where processed slot only updates when voting.
@github-project-automation github-project-automation bot moved this to 🏗 In progress in Sig Feb 4, 2026
@prestonsn prestonsn self-assigned this Feb 4, 2026
- Add getVoteAccounts handler to RpcHookContext with full parameter support
- Wire epoch_tracker to RPC hooks for epoch vote account lookups
- Limit epoch credits to last 5 entries (matches Agave MAX_RPC_VOTE_ACCOUNT_INFO_EPOCH_CREDITS_HISTORY)
- Support commitment levels, votePubkey filter, keepUnstakedDelinquents, and delinquentSlotDistance
- Partition validators into current/delinquent based on last vote slot
- Rename SlotHookContext to RpcHookContext for broader RPC method support
- Fix typo: delinquintSlotDistance -> delinquentSlotDistance
@prestonsn prestonsn force-pushed the prestonsn/impl-get-vote-accounts-rpc branch from 47bc7a6 to 0654ea6 Compare February 4, 2026 22:33
@prestonsn prestonsn changed the title feat(rpc): impl getVoteAccounts() RPC feat(rpc): impl getVoteAccounts RPC Feb 4, 2026
@prestonsn prestonsn changed the title feat(rpc): impl getVoteAccounts RPC feat(rpc): implement getVoteAccounts RPC Feb 4, 2026
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/rpc/methods.zig 79.66% <ø> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@prestonsn prestonsn requested a review from kprotty February 5, 2026 15:03
@prestonsn prestonsn force-pushed the adamw/implement-getSlot-in-rpc branch 4 times, most recently from e7172e5 to 0568f9e Compare February 12, 2026 22:08
@ajw221 ajw221 force-pushed the adamw/implement-getSlot-in-rpc branch from 7d84370 to 8279fe0 Compare February 14, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants