Skip to content

fix(kvstore): decode balance_changes and unchanged_loaded_runtime_objects from KV store - #25828

Merged
nickvikeras merged 8 commits into
MystenLabs:mainfrom
dongowu:dev
Mar 24, 2026
Merged

fix(kvstore): decode balance_changes and unchanged_loaded_runtime_objects from KV store#25828
nickvikeras merged 8 commits into
MystenLabs:mainfrom
dongowu:dev

Conversation

@dongowu

@dongowu dongowu commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Description

This PR plumbs balance_changes through the KV-backed transaction read path and exposes it in the v2 transaction RPC response.

Previously, balance_changes could be written into KV storage but were dropped during decode, and the RPC layer did not return them. This caused KV-backed transaction results to
be incomplete and out of parity with fullnode gRPC.

Changes

  • decode bc into TransactionData.balance_changes in sui-kvstore
  • return balance_changes from sui-kv-rpc v2 when requested via field mask
  • add unit tests for decode and response rendering
  • add e2e parity coverage against fullnode batch_get_transactions

Impact

  • fixes missing balance_changes in KV-backed transaction reads
  • improves parity with fullnode gRPC
  • adds regression coverage for the end-to-end path

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC: Wire up balance changes and object set for archival
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@vercel

vercel Bot commented Mar 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Mar 24, 2026 5:44pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Mar 24, 2026 5:44pm
sui-kiosk Ignored Ignored Preview Mar 24, 2026 5:44pm

Request Review

dongowu added 2 commits March 24, 2026 09:29
…jects from KV store

Previously, encode() wrote both "bc" (balance_changes) and "ul"
  (unchanged_loaded_runtime_objects) columns to BigTable, but decode()
  silently ignored them, always returning empty Vec. This caused the gRPC
  transaction query API to return empty balance_changes to downstream
  consumers (explorers, wallets, indexers).

  - Resolve TODO: wire balance_changes through to gRPC response
  - Add "bc" and "ul" match arms in decode()
  - Add unit tests for encode/decode round-trip
  - Add e2e parity test for batch_get_transactions balance_changes
Extract duplicated read_mask validation logic into a common function
to reduce code duplication between get_transaction and batch_get_transactions.
@dongowu

dongowu commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

@stefan-mysten this pr anyone reviewed ?

@dongowu
dongowu temporarily deployed to sui-typescript-aws-kms-test-env March 24, 2026 16:48 — with GitHub Actions Inactive
@nickvikeras

Copy link
Copy Markdown
Contributor

Thanks. This was actually the next task on my todo list. I tacked on one more change to wire up the unchanged loaded runtime objects all the way to the grpc response as well.

@nickvikeras
nickvikeras merged commit 82b30eb into MystenLabs:main Mar 24, 2026
57 of 58 checks passed
@dongowu

dongowu commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback, I’ll improve this and make it more complete next time.

@dongowu
dongowu deleted the dev branch March 25, 2026 01:39
jordanjennings-mysten pushed a commit that referenced this pull request Apr 16, 2026
…jects from KV store (#25828)

## Description 

This PR plumbs `balance_changes` through the KV-backed transaction read
path and exposes it in the v2 transaction RPC response.

Previously, `balance_changes` could be written into KV storage but were
dropped during decode, and the RPC layer did not return them. This
caused KV-backed transaction results to
  be incomplete and out of parity with fullnode gRPC.

  ## Changes
  - decode `bc` into `TransactionData.balance_changes` in `sui-kvstore`
- return `balance_changes` from `sui-kv-rpc` v2 when requested via field
mask
  - add unit tests for decode and response rendering
  - add e2e parity coverage against fullnode `batch_get_transactions`

  ## Impact
  - fixes missing `balance_changes` in KV-backed transaction reads
  - improves parity with fullnode gRPC
  - adds regression coverage for the end-to-end path

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [x] gRPC: Wire up balance changes and object set for archival 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:

---------

Co-authored-by: Nick <nickvikeras@gmail.com>
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