Skip to content

Commit 1f6e1e6

Browse files
mystenmarkmloganclaude
authored
Bound accumulator amounts to representable limits before charging gas (#26956)
## Summary - Reject transactions whose per-key accumulator totals are not representable before charging gas: SUI balance keys are bounded by the total SUI supply, other balances by `u64::MAX` - Bound the cross-key total SUI withdrawn (gross Split) by the total supply, since withdrawn SUI can be recombined outside the accumulator (e.g. merged into the PTB gas coin) - Accumulate SUI-conservation input/output totals in `u128` so intermediate sums stay exact regardless of individual event amounts - The guard turns a would-be arithmetic failure into a deterministic `CoinBalanceOverflow` abort; it is ungated and applies uniformly across protocol versions ## Test plan - [ ] Added e2e regression tests covering per-key SUI/custom-coin merges, single-withdrawal conservation, the gas-refund path, and gas-coin recombination via `MergeCoins` - [ ] `cargo simtest -p sui-e2e-tests address_balance` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Mark Logan <mark@marklgn.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 086c222 commit 1f6e1e6

4 files changed

Lines changed: 612 additions & 11 deletions

File tree

0 commit comments

Comments
 (0)