Skip to content

consistent error reporting across run-mode#25361

Merged
dariorussi merged 1 commit intomainfrom
dario/consistent_checks
Feb 9, 2026
Merged

consistent error reporting across run-mode#25361
dariorussi merged 1 commit intomainfrom
dario/consistent_checks

Conversation

@dariorussi
Copy link
Copy Markdown
Contributor

@dariorussi dariorussi commented Feb 9, 2026

Description

Gas data and metadata did not have consistent error behavior across different code paths. Particularly the difference between dev inspect, dry run and execution do not help developers or ptb builders.
Making the behavior consistent across different code path

Test plan

Locally and changes to the fuzzer/proptest framework and tests are coming in a next PR as they are pretty involving


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: in version 111 error from dev inspect, dry run and execution are more consistent and the same for transaction data checks
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 9, 2026

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

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Feb 9, 2026 3:21pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Feb 9, 2026 3:21pm
sui-kiosk Ignored Ignored Feb 9, 2026 3:21pm

Request Review

@dariorussi dariorussi merged commit c8d483f into main Feb 9, 2026
79 of 85 checks passed
@dariorussi dariorussi deleted the dario/consistent_checks branch February 9, 2026 16:03
dariorussi added a commit that referenced this pull request Feb 9, 2026
Gas data and metadata did not even consistent error behavior across
different code path. Particularly the difference between dev inspect,
dry run and execution do not help developers or ptb builders.
Making the behavior consistent across different code path

Locally and changes to the fuzzer/proptest framework and tests are
coming in a next PR as they are pretty involving

---

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.

- [x] Protocol: in version 111 error from dev inspect, dry run and
execution are more consistent and the same for transaction data checks
- [ ] Nodes (Validators and Full nodes):
- [ ] gRPC:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] Indexing Framework:
ebmifa pushed a commit that referenced this pull request Feb 9, 2026
## Description 

Cherry pick and updated snapshots

## 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.

- [x] Protocol: 111 makes more consistent check across execution mode
and transaction data
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:
akmysti added a commit that referenced this pull request Mar 3, 2026
…ct (#25541)

## Description 

Extend the transaction-fuzzer crate to test gas data handling across all
four execution modes: normal (validator), dry-run (fullnode),
dev-inspect
with skip_checks=true, and dev-inspect with skip_checks=false. This
exercises the gas validation paths fixed in #25361 where (1) gas price
was accessed unchecked causing panics and (2) non-gas-coin objects as
gas in dev-inspect caused crashes.

Changes to executor.rs:
- Add `new_fullnode()` constructor that uses a keypair not in the
  committee, enabling dry-run and dev-inspect APIs
- Add `dry_run_transaction()` wrapping
`AuthorityState::dry_exec_transaction`
- Add `dev_inspect_transaction()` wrapping
  `AuthorityState::dev_inspect_transaction_block`

Changes to lib.rs:
- Add `GasDataGenConfig::sender_owned_only()` which forces all gas coins
to `AddressOwner(sender)`, needed for dev-inspect with skip_checks=true
where ownership validation is bypassed and non-sender-owned gas objects
  would panic during execution
- Add `run_proptest_with_fullnode()` helper and refactor existing
  `run_proptest()` to share logic via `run_proptest_with_executor()`

Changes to gas_data_tests.rs:
- Add 3 new proptest fuzz tests: dry-run, dev-inspect with skip_checks,
  and dev-inspect without skip_checks
- Add 6 deterministic edge-case tests covering: valid gas data,
  gas_price=0, gas_price < RGP, gas_budget=0, gas_budget > max, and
  insufficient balance — each verified across all four execution modes
- Add helpers for constructing gas coins, gas data, and running all
  modes in a single test

## Test plan 

The gas tests cover 4 execution modes across 2 testing strategies:

### Proptest Fuzz Tests (5 total)

Randomly generate gas data (price, budget, balance, number of gas
objects, ownership) and verify no panics across execution modes:

- `test_gas_data_owned_or_immut`: sender-owned or immutable gas, normal
execution
- `test_gas_data_any_owner`: any owner type, normal execution
- `test_gas_data_dry_run_fuzz`: sender-owned or immutable gas, dry-run
- `test_gas_data_dev_inspect_skip_checks_fuzz`: sender-owned only,
dev-inspect (skip_checks=true)
- `test_gas_data_dev_inspect_no_skip_fuzz`: sender-owned or immutable
gas, dev-inspect (skip_checks=false)

The skip_checks fuzz uses `sender_owned_only()` because when ownership
validation is bypassed, immutable/shared gas objects panic in
`temporary_store.rs` when the system tries to modify them.

### Deterministic Edge Case Tests (6 total)

Each test runs through all 4 modes (normal, dry-run, dev-inspect with
and without skip_checks) and asserts the expected error:

- `test_valid_gas_data_all_modes`: valid price/budget/balance, all modes
succeed
- `test_gas_price_zero`: gas_price=0, expects "Gas price 0 under min"
- `test_gas_price_below_rgp`: gas_price=rgp-1, expects "Gas price ...
under min"
- `test_gas_budget_zero`: gas_budget=0, expects "Gas budget 0 is below
min"
- `test_gas_budget_exceeds_max`: gas_budget > max_tx_gas, expects "Gas
budget ... is above max"
- `test_gas_balance_insufficient`: balance=1, expects "balance of ... is
lower than the needed"

---

## 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:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:
akmysti added a commit to akmysti/sui that referenced this pull request Mar 3, 2026
Extend the transaction-fuzzer crate to test gas data handling across all
four execution modes: normal (validator), dry-run (fullnode), dev-inspect
with skip_checks=true, and dev-inspect with skip_checks=false. This
exercises the gas validation paths fixed in MystenLabs#25361 where (1) gas price
was accessed unchecked causing panics and (2) non-gas-coin objects as
gas in dev-inspect caused crashes.

Changes to executor.rs:
- Add `new_fullnode()` constructor that uses a keypair not in the
  committee, enabling dry-run and dev-inspect APIs
- Add `dry_run_transaction()` wrapping `AuthorityState::dry_exec_transaction`
- Add `dev_inspect_transaction()` wrapping
  `AuthorityState::dev_inspect_transaction_block`

Changes to lib.rs:
- Add `GasDataGenConfig::sender_owned_only()` which forces all gas coins
  to `AddressOwner(sender)`, needed for dev-inspect with skip_checks=true
  where ownership validation is bypassed and non-sender-owned gas objects
  would panic during execution
- Add `run_proptest_with_fullnode()` helper and refactor existing
  `run_proptest()` to share logic via `run_proptest_with_executor()`

Changes to gas_data_tests.rs:
- Add 3 new proptest fuzz tests: dry-run, dev-inspect with skip_checks,
  and dev-inspect without skip_checks
- Add 6 deterministic edge-case tests covering: valid gas data,
  gas_price=0, gas_price < RGP, gas_budget=0, gas_budget > max, and
  insufficient balance — each verified across all four execution modes
- Add helpers for constructing gas coins, gas data, and running all
  modes in a single test

The gas tests cover 4 execution modes across 2 testing strategies:

Randomly generate gas data (price, budget, balance, number of gas
objects, ownership) and verify no panics across execution modes:

- `test_gas_data_owned_or_immut`: sender-owned or immutable gas, normal execution
- `test_gas_data_any_owner`: any owner type, normal execution
- `test_gas_data_dry_run_fuzz`: sender-owned or immutable gas, dry-run
- `test_gas_data_dev_inspect_skip_checks_fuzz`: sender-owned only, dev-inspect (skip_checks=true)
- `test_gas_data_dev_inspect_no_skip_fuzz`: sender-owned or immutable gas, dev-inspect (skip_checks=false)

The skip_checks fuzz uses `sender_owned_only()` because when ownership
validation is bypassed, immutable/shared gas objects panic in
`temporary_store.rs` when the system tries to modify them.

Each test runs through all 4 modes (normal, dry-run, dev-inspect with
and without skip_checks) and asserts the expected error:

- `test_valid_gas_data_all_modes`: valid price/budget/balance, all modes succeed
- `test_gas_price_zero`: gas_price=0, expects "Gas price 0 under min"
- `test_gas_price_below_rgp`: gas_price=rgp-1, expects "Gas price ... under min"
- `test_gas_budget_zero`: gas_budget=0, expects "Gas budget 0 is below min"
- `test_gas_budget_exceeds_max`: gas_budget > max_tx_gas, expects "Gas budget ... is above max"
- `test_gas_balance_insufficient`: balance=1, expects "balance of ... is lower than the needed"

---

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:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] Indexing Framework:
akmysti added a commit that referenced this pull request Mar 6, 2026
…ct (#25692)

Extend the transaction-fuzzer crate to test gas data handling across all
four execution modes: normal (validator), dry-run (fullnode),
dev-inspect with skip_checks=true, and dev-inspect with
skip_checks=false. This exercises the gas validation paths fixed in
#25361 where (1) gas price was accessed unchecked causing panics and (2)
non-gas-coin objects as gas in dev-inspect caused crashes.

Changes to executor.rs:
- Add `new_fullnode()` constructor that uses a keypair not in the
committee, enabling dry-run and dev-inspect APIs
- Add `dry_run_transaction()` wrapping
`AuthorityState::dry_exec_transaction`
- Add `dev_inspect_transaction()` wrapping
`AuthorityState::dev_inspect_transaction_block`

Changes to lib.rs:
- Add `GasDataGenConfig::sender_owned_only()` which forces all gas coins
to `AddressOwner(sender)`, needed for dev-inspect with skip_checks=true
where ownership validation is bypassed and non-sender-owned gas objects
would panic during execution
- Add `run_proptest_with_fullnode()` helper and refactor existing
`run_proptest()` to share logic via `run_proptest_with_executor()`

Changes to gas_data_tests.rs:
- Add 3 new proptest fuzz tests: dry-run, dev-inspect with skip_checks,
and dev-inspect without skip_checks
- Add 6 deterministic edge-case tests covering: valid gas data,
gas_price=0, gas_price < RGP, gas_budget=0, gas_budget > max, and
insufficient balance — each verified across all four execution modes
- Add helpers for constructing gas coins, gas data, and running all
modes in a single test

The gas tests cover 4 execution modes across 2 testing strategies:

Randomly generate gas data (price, budget, balance, number of gas
objects, ownership) and verify no panics across execution modes:

- `test_gas_data_owned_or_immut`: sender-owned or immutable gas, normal
execution
- `test_gas_data_any_owner`: any owner type, normal execution
- `test_gas_data_dry_run_fuzz`: sender-owned or immutable gas, dry-run
- `test_gas_data_dev_inspect_skip_checks_fuzz`: sender-owned only,
dev-inspect (skip_checks=true)
- `test_gas_data_dev_inspect_no_skip_fuzz`: sender-owned or immutable
gas, dev-inspect (skip_checks=false)

The skip_checks fuzz uses `sender_owned_only()` because when ownership
validation is bypassed, immutable/shared gas objects panic in
`temporary_store.rs` when the system tries to modify them.

Each test runs through all 4 modes (normal, dry-run, dev-inspect with
and without skip_checks) and asserts the expected error:

- `test_valid_gas_data_all_modes`: valid price/budget/balance, all modes
succeed
- `test_gas_price_zero`: gas_price=0, expects "Gas price 0 under min"
- `test_gas_price_below_rgp`: gas_price=rgp-1, expects "Gas price ...
under min"
- `test_gas_budget_zero`: gas_budget=0, expects "Gas budget 0 is below
min"
- `test_gas_budget_exceeds_max`: gas_budget > max_tx_gas, expects "Gas
budget ... is above max"
- `test_gas_balance_insufficient`: balance=1, expects "balance of ... is
lower than the needed"

---

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:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] Indexing Framework:

## Description 

Describe the changes or additions included in this PR.

## 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:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:
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.

3 participants