Skip to content

fix(core): honor commitment for remote account batches - #762

Merged
MicaiahReid merged 1 commit into
solana-foundation:mainfrom
xternet:agent/honor-account-commitment
Aug 28, 2026
Merged

fix(core): honor commitment for remote account batches#762
MicaiahReid merged 1 commit into
solana-foundation:mainfrom
xternet:agent/honor-account-commitment

Conversation

@xternet

@xternet xternet commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

SurfnetRemoteClient::get_multiple_accounts accepts a caller-selected commitment, but its primary account batch used RpcClient::get_multiple_accounts, which silently applied the client's default commitment. Companion mint/program-account fetches in the same method already used the requested commitment.

Use get_multiple_accounts_with_commitment for the primary batch as well, then extract the contextual response value. This keeps every remote account fetched by the operation at the same requested commitment.

Regression test

The new test records the outgoing JSON-RPC request through a custom RpcSender. It requests confirmed and asserts that the getMultipleAccounts config actually contains "commitment": "confirmed"; before this patch it observed "finalized".

Validation

  • cargo +nightly fmt --all -- --check
  • cargo test -p surfpool-core surfnet::remote::tests -- --test-threads=1 — 3 passed
  • cargo clippy -p surfpool-core --lib --no-default-features — completed with existing repository warnings only
  • git diff --check

I also attempted the complete surfpool-core lib suite locally. It reached 469 passing tests before the shared runner exhausted its open-file limit; the remaining failures reported Too many open files, rather than assertion failures from this change. GitHub CI can run the full suite in its normal environment.

@xternet
xternet marked this pull request as ready for review August 13, 2026 19:37
@greptile-apps

greptile-apps Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR updates remote batch account fetching to propagate the caller-selected commitment and adds a regression test that inspects the outgoing JSON-RPC request.

  • Replaces the default-commitment batch request with get_multiple_accounts_with_commitment.
  • Extracts the account list from the contextual RPC response.
  • Verifies that a confirmed request sends "commitment": "confirmed".

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/core/src/surfnet/remote.rs The primary remote account batch now uses the same requested commitment as related account fetches, with focused request-level regression coverage.

Reviews (3): Last reviewed commit: "fix(core): honor commitment for remote a..." | Re-trigger Greptile

@MicaiahReid MicaiahReid left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@xternet I'll need commit signature verification here as well.

@xternet
xternet force-pushed the agent/honor-account-commitment branch from 66f2a0c to 242be50 Compare August 24, 2026 20:40
@xternet

xternet commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

@MicaiahReid The updated commit is now SSH-signed and shown as Verified by GitHub. Thanks.

@MicaiahReid

Copy link
Copy Markdown
Collaborator

@xternet can we get a rebase?

@xternet
xternet force-pushed the agent/honor-account-commitment branch from 242be50 to 09c640b Compare August 27, 2026 14:12
@xternet

xternet commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

@MicaiahReid Rebased onto the latest main and resolved the overlap with #764. The commit is verified, and fmt plus all 7 focused remote tests pass locally. Thanks.

@MicaiahReid
MicaiahReid merged commit 4afc15d into solana-foundation:main Aug 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants