Skip to content

fix(deepbook-v3): set sender on read-only query transactions#1023

Merged
tonylee08 merged 1 commit intomainfrom
tlee/deepbook-jsonrpc-setsender
Apr 16, 2026
Merged

fix(deepbook-v3): set sender on read-only query transactions#1023
tonylee08 merged 1 commit intomainfrom
tlee/deepbook-jsonrpc-setsender

Conversation

@tonylee08
Copy link
Copy Markdown
Contributor

Description

Every read-only query method in packages/deepbook-v3/src/queries/ builds its own Transaction, adds a Move call, and simulates it — but none of them ever call tx.setSender(...). This is tolerated under SuiGrpcClient because its core resolution plugin silently substitutes 0x0 for a missing sender. SuiJsonRpcClient has no such substitution, so every single query (e.g. client.deepbook.whitelisted('SUI_USDC')) throws:

Error: Missing transaction sender
  at TransactionDataBuilder.build
  at JSONRpcCoreClient.simulateTransaction
  at PoolQueries.whitelisted

This affects real users today (e.g. market-maker setups still on JSON-RPC) and will continue to until the JSON-RPC sunset on July 31, 2026.

The fix is a one-liner per internal Transaction construction:

const tx = new Transaction();
tx.setSender(this.#ctx.address);

applied to every query method across the ten affected modules (88 total insertions). QueryContext.address is already populated via normalizeSuiAddress(address) in DeepBookConfig, so no new plumbing is needed. The gRPC path is unchanged (an explicit sender takes precedence over the resolution plugin's default).

Follows the pattern of #1018, but applied consistently across all query modules rather than a subset.

Test plan

  • pnpm --filter @mysten/deepbook-v3 tsc --noEmit passes.
  • pnpm exec prettier -c clean.
  • Manually re-run a JSON-RPC reproduction of client.deepbook.whitelisted('SUI_USDC') on mainnet — should return true instead of throwing Missing transaction sender.
  • Spot-check gRPC parity (one read-only query from each module) to confirm no behavioral regression.

AI Assistance Notice

Please disclose the usage of AI. This is primarily to help inform reviewers of how careful they need to review PRs, and to keep track of AI usage across our team. Please fill this out accurately, and do not modify the content or heading for this section!

  • This PR was primarily written by AI.
  • I used AI for docs / tests, but manually wrote the source code.
  • I used AI to understand the problem space / repository.
  • I did not use AI for this PR.

Every query method in src/queries/ builds a Transaction, adds a move
call, and simulates — but never calls tx.setSender. This was tolerated
under SuiGrpcClient because its core resolution plugin substitutes 0x0
for a missing sender. SuiJsonRpcClient has no such substitution and
throws "Missing transaction sender" on every read-only query.

Add tx.setSender(this.#ctx.address) directly after each internal
Transaction construction in the query modules so the queries work
consistently across both transports ahead of the JSON-RPC sunset on
July 31, 2026.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tonylee08 tonylee08 requested a review from a team as a code owner April 16, 2026 14:24
@tonylee08 tonylee08 temporarily deployed to sui-typescript-aws-kms-test-env April 16, 2026 14:25 — with GitHub Actions Inactive
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-typescript-docs Ready Ready Preview, Comment Apr 16, 2026 2:26pm

Request Review

@tonylee08 tonylee08 merged commit e149b58 into main Apr 16, 2026
9 checks passed
@tonylee08 tonylee08 deleted the tlee/deepbook-jsonrpc-setsender branch April 16, 2026 20:55
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