feat(replay): implement sandbox execution and hot-path state reconstruction - #401
Merged
Merged
Conversation
…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>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 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. Comment |
codeZe-us
self-requested a review
August 22, 2026 18:51
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.
Summary
reconstruct_hot_pathnow decodes the transaction envelope, extracts theInvokeHostFunctionOp/footprint, and fetches ledger entries plus network cost/archival config settings via RPC to build a realInvocationInput, instead of returning an empty ledger state.execute_with_tracingbuilds asoroban-env-hostBudgetfrom that input and drivesinvoke_host_function_with_trace_hook, translating host trace events (PushCtx/PopCtx/EnvCall/EnvRet) into the crate's ownTraceEventschema and diffing ledger changes intofinal_state— replacing the stub that immediately logged "not yet implemented" and errored.replay_transactionintoExecutionTraceinstead of being discarded.Fixes #391
Test plan
cargo check --workspace --all-targets— cleancargo test --workspace— 326 passed, 0 failedcargo fmt --check— cleancargo clippy --workspace --all-targets— no new warnings🤖 Generated with Claude Code