feat(rpc): impl getAccountInfo RPC for accounts_db v2#1217
Open
feat(rpc): impl getAccountInfo RPC for accounts_db v2#1217
Conversation
40fae04 to
72d8727
Compare
faf136b to
ce30956
Compare
cf75dc5 to
e7172e5
Compare
40a15ee to
6afd364
Compare
e7172e5 to
0568f9e
Compare
6477dcb to
d912ade
Compare
7d84370 to
8279fe0
Compare
6945038 to
63d1d33
Compare
3cb9dd6 to
4c29a67
Compare
8667355 to
1f15cea
Compare
yewman
reviewed
Feb 19, 2026
yewman
reviewed
Feb 19, 2026
1f15cea to
e0f6005
Compare
yewman
previously approved these changes
Feb 23, 2026
288c270 to
b67e6b1
Compare
Implement the getAccountInfo RPC method with full support for all Solana account encodings: base58, base64, base64+zstd, and jsonParsed. - Add AccountHookContext with getAccountInfo method for reading account data - Support dataSlice parameter for partial account reads - Implement streaming zstd compression for base64+zstd encoding - Fall back to base64 encoding when no jsonParsed parser is available
- Agave v3.1.8 still supports it despite it being documented as deprected.
- Replace std.BoundedArray with inline buffer/len fields in JsonString and JsonArray - Add WriterError helper in base64.zig to support both GenericWriter and *std.io.Writer - Bridge base64+zstd path via adaptToNewApi for new Writer interface compatibility - Update JSON serialization: writeStream → Stringify, jw.stream → jw.writer - Change AccountData.jsonParsed from std.json.Value to []const u8 to avoid roundtrip parsing
b67e6b1 to
a0a5842
Compare
…ance - Remove redundant arena allocator in encodeJsonParsed; caller already provides per-request arena - Add errdefer for allocations in parse_vote.zig to prevent leaks with non-arena allocators - Pass dataSlice to jsonParsed base64 fallback path, matching Agave behavior (SPL tokens excluded) - Fix style violations: @this() in named structs, snake_case fn name, import ordering, container decl order - Rename parse_account to parseAccount, fix SlotNotFound -> SlotNotAvailable, remove stale TODOs
prestonsn
commented
Feb 27, 2026
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.
Implements
getAccountInfoRPC for accounts dbtwo. The PR is a bit large mostly due to porting over agave's account-decoder crate to zig. This also includes porting over all related unit tests.There's some quirkiness (specific to SPL token 22 metadata accounts) in the code due to us not having a borsh lib available. Instead of implementing one that we may not need all the functionality of, this PR hand-rolls deserialization for things like an array of strings. The number of cases we need to handle was pretty minimal, so it didn't make sense implementing something more complete/robust.
Testing done (against Agave testnet RPC @ v3.1.8):