Skip to content

feat(rpc): add getMultipleAccounts implementation#9068

Open
frank-temporal wants to merge 1 commit intofiredancer-io:mainfrom
frank-temporal:main
Open

feat(rpc): add getMultipleAccounts implementation#9068
frank-temporal wants to merge 1 commit intofiredancer-io:mainfrom
frank-temporal:main

Conversation

@frank-temporal
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings March 28, 2026 01:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an implementation of the Solana JSON-RPC getMultipleAccounts endpoint in Firedancer’s RPC tile, enabling batch account fetches from accdb with configurable encoding/slicing behavior.

Changes:

  • Implement getMultipleAccounts request validation, account lookup, and JSON response streaming.
  • Add support for per-account data slicing and base58/base64/binary encoding output (per shared config parsing).
Comment on lines +1533 to +1535
int is_base58 = !strncmp( encoding_cstr, "base58", 6 );
int is_binary = !strncmp( encoding_cstr, "binary", 6 );

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fd_rpc_validate_config allows encoding: "base64+zstd", but this implementation never performs ZSTD compression. As a result, responses may advertise "base64+zstd" while actually returning plain base64 (and it also doesn't error when ZSTD support is disabled). Add base64+zstd handling equivalent to getAccountInfo (including the FD_HAS_ZSTD gated error path), or explicitly reject base64+zstd for this method to avoid returning incorrectly encoded data.

Copilot uses AI. Check for mistakes.
Comment on lines +1558 to +1562
ulong data_sz = fd_accdb_ref_data_sz( ro );
uchar const * data = (uchar const *)fd_accdb_ref_data_const( ro ) + fd_ulong_if( slice_offset<data_sz, slice_offset, 0UL );
ulong snip_sz = fd_ulong_min( fd_ulong_if( slice_offset<data_sz, data_sz-slice_offset, 0UL ), slice_length );
ulong out_sz = snip_sz;

Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method duplicates the account encoding/serialization logic used by getAccountInfo. The duplication has already drifted (e.g., base64+zstd handling), which makes it easy for the two endpoints to become inconsistent over time. Consider extracting a shared helper for “emit UiAccount JSON + encoded data” so both methods stay in sync.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants