Skip to content

feat(rpc): implement getBalance RPC method#1212

Draft
prestonsn wants to merge 10 commits intoadamw/implement-getSlot-in-rpcfrom
prestonsn/impl-get-balance-rpc
Draft

feat(rpc): implement getBalance RPC method#1212
prestonsn wants to merge 10 commits intoadamw/implement-getSlot-in-rpcfrom
prestonsn/impl-get-balance-rpc

Conversation

@prestonsn
Copy link
Contributor

  • Add getBalance handler with commitment level support in AccountsDB
  • Add getSlotForCommitment to SlotTracker for commitment-based slot resolution
  • Update registerRPCHooks signature to accept slot_tracker and snapshot_slot
  • Use snapshot slot as fallback when no live slot tracker is available

@github-project-automation github-project-automation bot moved this to 🏗 In progress in Sig Feb 6, 2026
@prestonsn prestonsn marked this pull request as draft February 6, 2026 00:25
@prestonsn prestonsn self-assigned this Feb 6, 2026
@prestonsn prestonsn force-pushed the prestonsn/impl-get-balance-rpc branch from b9f7b3e to a4546e2 Compare February 6, 2026 15:57
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 13.04348% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/accountsdb/db.zig 4.76% 20 Missing ⚠️

❌ Your patch check has failed because the patch coverage (13.04%) is below the target coverage (85.00%). You can increase the patch coverage or adjust the target coverage.

Files with missing lines Coverage Δ
src/rpc/server/server.zig 97.83% <100.00%> (ø)
src/accountsdb/db.zig 87.57% <4.76%> (-1.11%) ⬇️

... 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 force-pushed the adamw/implement-getSlot-in-rpc branch 3 times, most recently from cf75dc5 to e7172e5 Compare February 11, 2026 16:22
ajw221 and others added 9 commits February 12, 2026 22:07
- 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.
Condense nested if statements into single-line conditional return.
@prestonsn prestonsn force-pushed the adamw/implement-getSlot-in-rpc branch from e7172e5 to 0568f9e Compare February 12, 2026 22:08
@prestonsn prestonsn force-pushed the prestonsn/impl-get-balance-rpc branch from a4546e2 to 9d4321a Compare February 13, 2026 15:55
- Add getBalance handler with commitment level support in AccountsDB
- Add getSlotForCommitment to SlotTracker for commitment-based slot resolution
- Update registerRPCHooks signature to accept slot_tracker and snapshot_slot
- Use snapshot slot as fallback when no live slot tracker is available
@prestonsn prestonsn force-pushed the prestonsn/impl-get-balance-rpc branch from 9d4321a to 25cb22e Compare February 13, 2026 16:14
@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