Skip to content

Added support for tracing (local) dry-runs - #27592

Closed
awelc wants to merge 8 commits into
mainfrom
aw/replay-dry-run-support
Closed

Added support for tracing (local) dry-runs#27592
awelc wants to merge 8 commits into
mainfrom
aw/replay-dry-run-support

Conversation

@awelc

@awelc awelc commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds tracing support for sui client ptb --dry-run via an additional --trace flag. It produces artifacts similar to those created by the replay tool, most importantly the artifacts needed for trace debugging.

The traced dry-run executes locally, similarly to how the replay tool executes historical transactions. Unlike a regular dry-run on a full node, which executes against the latest chain state and may observe state mid-checkpoint, it executes against the latest completed checkpoint. This ensures that the epoch, protocol version, gas price, timestamp, packages, and object state form a consistent snapshot for local execution.

We chose the replay tool as a foundation because it already supports traced transaction execution, produces artifacts needed for trace debugging, and provides convenient data-store abstractions (but we had to add dry-run-specific input preparation and a checkpoint-bounded runtime store to support correct dry-run validation and checkpoint consistency)

Test plan

New tests have been added. All tests must pass. Also tested manually end-to-end

@awelc
awelc temporarily deployed to sui-typescript-aws-kms-test-env August 6, 2026 00:38 — with GitHub Actions Inactive
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Aug 6, 2026 12:38am
sui-kiosk Ignored Ignored Aug 6, 2026 12:38am

Request Review

@awelc awelc self-assigned this Aug 6, 2026
@awelc
awelc requested a review from tzakian August 6, 2026 00:38
@awelc awelc changed the title Aw/replay dry run support Added support for tracing (local) dry-runs Aug 6, 2026

@tzakian tzakian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the main questions I have on this are the following:

  1. How important is it that we anchor to a consistent checkpoint view? My gut is that it's not super important, and my (possibly incorrect) read, is that if we relax things in this manner it makes the implementation much simpler and able to reuse a lot of the existing functionality.
  2. If we do decide that we want to checkpoint anchor everything, I'd like to see if there is some way of unifying some things, as it feels like there's a lot of parallel and "almost the same but slightly dissimilar" place throughout -- so just enough to cause a lot of almost-duplicate-but-not-quite code which I'd prefer if we could avoid.

}

/// Recheck address-owned inputs against the latest live state at the selected checkpoint.
fn validate_live_owned_inputs<S>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I follow why this is needed in addition to the check_transaction_input checks? IMO it feels like this should share a lot/all with that and if not that's a good signal to re-evaluate probably

pub start_timestamp: u64,
}

/// Chain and epoch metadata for executing against state at a finalized checkpoint.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like the wrong place for this to live?

I get why you want it here, but the fact that it needs to exist here makes me a bit iffy about this...

@awelc

awelc commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #27749

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