Consolidate tx checking in signing and simulate#25624
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3f3492a to
de2e0ae
Compare
de2e0ae to
b722f84
Compare
Contributor
|
should we add a test? |
Contributor
Author
done |
`simulate_transaction` duplicated validation logic from the signing path but had diverged: it called `process_funds_withdrawals_for_execution` (which uses `.unwrap()`) instead of the safe `process_funds_withdrawals_for_signing` (which returns `Result`), meaning a malformed transaction could panic a fullnode during simulation. This extracts the shared pre-object-load validation — deny checks, funds withdrawal parsing, and balance availability checks — into `pre_object_load_checks`, called by both `handle_transaction_deny_checks` and `simulate_transaction`, fixing the panic and ensuring the two paths stay in sync.
dc393bf to
c1ccf4d
Compare
mystenmark
approved these changes
Feb 27, 2026
jessiemongeon1
pushed a commit
to jessiemongeon1/sui
that referenced
this pull request
Mar 5, 2026
## Description `simulate_transaction` duplicated validation logic from the signing path but had diverged: it called `process_funds_withdrawals_for_execution` (which uses `.unwrap()`) instead of the safe `process_funds_withdrawals_for_signing` (which returns `Result`), meaning a malformed transaction could panic a fullnode during simulation. This extracts the shared pre-object-load validation — deny checks, funds withdrawal parsing, and balance availability checks — into `pre_object_load_checks`, called by both `handle_transaction_deny_checks` and `simulate_transaction`, fixing the panic and ensuring the two paths stay in sync. ## Test plan - `cargo check -p sui-core` — compiles cleanly - `SUI_SKIP_SIMTESTS=1 cargo nextest run -p sui-core` — all tests pass - `cargo xclippy` — no warnings --- ## 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: - [x] Nodes (Validators and Full nodes): Fixes a potential fullnode panic when simulating a malformed transaction with invalid funds withdrawals. - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] Indexing Framework:
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.
Description
simulate_transactionduplicated validation logic from the signing path but had diverged: it calledprocess_funds_withdrawals_for_execution(which uses.unwrap()) instead of the safeprocess_funds_withdrawals_for_signing(which returnsResult), meaning a malformed transaction could panic a fullnode during simulation. This extracts the shared pre-object-load validation — deny checks, funds withdrawal parsing, and balance availability checks — intopre_object_load_checks, called by bothhandle_transaction_deny_checksandsimulate_transaction, fixing the panic and ensuring the two paths stay in sync.Test plan
cargo check -p sui-core— compiles cleanlySUI_SKIP_SIMTESTS=1 cargo nextest run -p sui-core— all tests passcargo xclippy— no warningsRelease 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.