Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure state is correct in both EVM and Scilla environments #2414

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JamesHinshelwood
Copy link
Contributor

@JamesHinshelwood JamesHinshelwood commented Feb 27, 2025

When an interop. transaction is run, we need to be careful to keep track of state changes in both sides of the world.

This PR takes the approach of:

  • Let revm keep track of EVM state changes as normal.
  • When an interop call is made to the Scilla interpreter, we make sure any 'pending' changes from the EVM side are visible to the Scilla contract.
  • When the Scilla call finishes, if any 'pending' EVM changes were modified further, we apply those changes to the EVM state journal before transferring control back to revm.

This ensures the state we read is consistent and that when we come to apply state delta updates, there is no overlap between the EVM and Scilla state maps.

Copy link
Contributor

github-actions bot commented Feb 27, 2025

🐰 Bencher Report

Branchfix-interop
Testbedself-hosted
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
full-blocks-erc20-transfers/full-blocks-erc20-transfers📈 view plot
🚷 view threshold
966.32 ms
(-13.04%)Baseline: 1,111.17 ms
1,467.93 ms
(65.83%)
full-blocks-evm-transfers/full-blocks-evm-transfers📈 view plot
🚷 view threshold
372.68 ms
(-9.12%)Baseline: 410.09 ms
490.90 ms
(75.92%)
full-blocks-zil-transfers/full-blocks-zil-transfers📈 view plot
🚷 view threshold
4,046.90 ms
(+2.27%)Baseline: 3,956.96 ms
5,426.57 ms
(74.58%)
process-empty/process-empty📈 view plot
🚷 view threshold
9.68 ms
(-3.29%)Baseline: 10.01 ms
10.69 ms
(90.55%)
🐰 View full continuous benchmarking report in Bencher

@JamesHinshelwood JamesHinshelwood force-pushed the fix-interop branch 2 times, most recently from fcea5fd to 09ca46a Compare February 28, 2025 12:39
@JamesHinshelwood JamesHinshelwood marked this pull request as ready for review February 28, 2025 12:39
When an interop. transaction is run, we need to be careful to
keep track of state changes in both sides of the world.

This PR takes the approach of:
* Let `revm` keep track of EVM state changes as normal.
* When an interop call is made to the Scilla interpreter, we make
sure any 'pending' changes from the EVM side are visible to the
Scilla contract.
* When the Scilla call finishes, if any 'pending' EVM changes were
modified further, we apply those changes to the EVM state journal
before transferring control back to `revm`.

This ensures the state we read is consistent and that when we come
to apply state delta updates, there is no overlap between the EVM
and Scilla state maps.
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.

1 participant