Skip to content

[FEAT] Integrate state capture before host function calls#1070

Open
Zhaenyra wants to merge 5 commits intodotandev:mainfrom
Zhaenyra:feat/integrate-state-capture
Open

[FEAT] Integrate state capture before host function calls#1070
Zhaenyra wants to merge 5 commits intodotandev:mainfrom
Zhaenyra:feat/integrate-state-capture

Conversation

@Zhaenyra
Copy link
Copy Markdown

Description

This PR implements a state capture mechanism that records the ledger state immediately before the Soroban VM executes a host function, addressing Issue #979.

Changes

  • Created simulator/src/host.rs with take_snapshot and a hook mechanism to record ledger state and instruction index.
  • Updated simulator/src/vm.rs with prepare_host to register the hooks.
  • Updated simulator/src/main.rs to declare the host module and initialize it.
  • Updated simulator/src/runner.rs with a SimHost::take_snapshot() method.
  • Updated simulator/src/lib.rs to export the new module.

Verification

  • Verified snapshotting logic captures ledger entries, timestamp, and estimated instruction index.
  • Logged snapshot IDs for debugging.

Fixes #979

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@Zhaenyra Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[TIME-TRAVEL] [FEAT] Integrate state capture before host function calls

1 participant