feat: add bulk public account reads - #619
Open
3esmit wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a bulk public-account read pathway end-to-end (sequencer RPC → wallet core → wallet FFI), enabling consumers to fetch multiple full account states in a single network request while preserving input order and duplicate IDs.
Changes:
- Introduces sequencer RPC method
getAccounts(Vec<AccountId>) -> Vec<Account>with a 24-account batch limit. - Adds
WalletCore::get_accounts_publicand exposes the operation via wallet FFI, including a matching free function and an explicit invalid-argument error. - Adds integration and unit coverage for ordering, empty input, duplicate IDs, null/oversized FFI inputs, and nested allocation cleanup.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lez/wallet/src/lib.rs | Adds wallet-core bulk public account read method. |
| lez/wallet-ffi/wallet_ffi.h | Regenerates header to expose batch read API, free function, error code, and limit constant. |
| lez/wallet-ffi/src/types.rs | Adds FfiAccountDataList for returning bulk account data over FFI. |
| lez/wallet-ffi/src/lib.rs | Defines FFI batch limit and compile-time asserts it matches sequencer RPC. |
| lez/wallet-ffi/src/error.rs | Adds InvalidArgument error code for unsupported argument ranges. |
| lez/wallet-ffi/src/account.rs | Implements wallet_ffi_get_accounts_public and wallet_ffi_free_accounts_public, plus unit test for nested cleanup. |
| lez/wallet-ffi/cbindgen.toml | Exports the batch limit constant through cbindgen. |
| lez/sequencer/service/src/service.rs | Implements server-side get_accounts RPC handler with max-batch enforcement. |
| lez/sequencer/service/rpc/src/lib.rs | Extends RPC trait with getAccounts and defines MAX_ACCOUNTS_PER_REQUEST (+ size guard test). |
| lez/sequencer/service/rpc/Cargo.toml | Adds serde_json dev-dependency for RPC response sizing test. |
| integration_tests/tests/wallet_ffi.rs | Adds integration test coverage for FFI bulk public account reads and error cases. |
| integration_tests/tests/account.rs | Adds integration test coverage for RPC ordering/duplicates/unknown IDs/oversized batch behavior. |
| Cargo.lock | Records dependency graph update for new dev-dependency usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3esmit
force-pushed
the
617-bulk-public-account-reads
branch
3 times, most recently
from
July 14, 2026 22:34
b3070df to
c351ac1
Compare
Add ordered batched account lookup across sequencer RPC, wallet, and C FFI. Bound batch size to keep worst-case responses within transport limits and expose matching FFI ownership and error contracts. Closes logos-blockchain#617
3esmit
force-pushed
the
617-bulk-public-account-reads
branch
from
July 15, 2026 15:25
c351ac1 to
5362a12
Compare
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.
🎯 Purpose
Add bulk public-account reads across the sequencer RPC, wallet core, and wallet FFI.
Wallet consumers can now retrieve multiple full account states in one network request and one sequencer state-lock acquisition, instead of issuing one request per account.
Closes #617.
⚙️ Approach
getAccounts(Vec<AccountId>) -> Vec<Account>sequencer RPC.WalletCore::get_accounts_public.🧪 How to Test
The tests cover empty input, ordered multi-account results, duplicate IDs, unknown accounts, oversized requests, null FFI inputs, and nested FFI allocation cleanup.
🔗 Dependencies
None.
🔜 Future Work
Expose the new wallet FFI operation through higher-level execution-zone consumers as needed.
📋 PR Completion Checklist