Skip to content

feat(replay): implement sandbox execution and hot-path state reconstruction - #401

Merged
codeZe-us merged 1 commit into
Toolbox-Lab:mainfrom
daRk8238:transaction-replay
Aug 22, 2026
Merged

feat(replay): implement sandbox execution and hot-path state reconstruction#401
codeZe-us merged 1 commit into
Toolbox-Lab:mainfrom
daRk8238:transaction-replay

Conversation

@daRk8238

Copy link
Copy Markdown
Contributor

Summary

  • reconstruct_hot_path now decodes the transaction envelope, extracts the InvokeHostFunctionOp/footprint, and fetches ledger entries plus network cost/archival config settings via RPC to build a real InvocationInput, instead of returning an empty ledger state.
  • execute_with_tracing builds a soroban-env-host Budget from that input and drives invoke_host_function_with_trace_hook, translating host trace events (PushCtx/PopCtx/EnvCall/EnvRet) into the crate's own TraceEvent schema and diffing ledger changes into final_state — replacing the stub that immediately logged "not yet implemented" and errored.
  • Diagnostic events captured during sandbox execution are threaded through replay_transaction into ExecutionTrace instead of being discarded.
  • Cold-path (archived ledger) reconstruction now returns an explicit "not yet implemented" error instead of silently returning empty state.

Fixes #391

Test plan

  • cargo check --workspace --all-targets — clean
  • cargo test --workspace — 326 passed, 0 failed
  • cargo fmt --check — clean
  • cargo clippy --workspace --all-targets — no new warnings

🤖 Generated with Claude Code

…uction

execute_with_tracing was a stub that immediately errored, and
reconstruct_hot_path returned an empty ledger state, so no replay job
could ever actually run.

- reconstruct_hot_path decodes the transaction envelope, extracts the
  InvokeHostFunctionOp and its footprint, and fetches ledger entries
  plus network cost/archival config settings via RPC to build an
  InvocationInput for the sandbox.
- execute_with_tracing builds a soroban-env-host Budget from that
  input and drives invoke_host_function_with_trace_hook, translating
  host trace events (PushCtx/PopCtx/EnvCall/EnvRet) into the crate's
  own TraceEvent schema and diffing ledger changes into final_state.
- Diagnostic events captured during sandbox execution are now
  threaded through replay_transaction into ExecutionTrace instead of
  being discarded.
- Cold-path (archived ledger) reconstruction now returns an explicit
  "not yet implemented" error instead of silently returning empty
  state.

Fixes Toolbox-Lab#391

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c3442a8-e5f6-4fa5-ba3c-42dd7972c4c9


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeZe-us
codeZe-us self-requested a review August 22, 2026 18:51

@codeZe-us codeZe-us 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.

@daRk8238 PR reviewed and merged

@codeZe-us
codeZe-us merged commit ae952ec into Toolbox-Lab:main Aug 22, 2026
3 checks passed
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.

Transaction Replay Sandbox Is a Stub and Cannot Actually Simulate Contracts

2 participants