[go: up one dir, main page]

Meta/Etherlink: support Cancun

Meta

This issue will behave as a meta-issue to discuss and list the different issues that needs to be tackled.

Context

The current problem that we have in order to support Cancun is to test our changes. In the past we used ethereum/tests as our battery/source of testing for our VM.

The way it worked is we have a scenario that is a JSON file with inputs, we feed it to our VM and then we check if the state matches the "filler" file of the scenario (which contains details of what the state looks like after the execution).

Usually the "normal path" it to check the root hash of the Patricia Merkle Tree to assert the good behaviour of their VM. This isn't doable for us as our backend is Irmin.

Up to Shanghai everything went smoothly. For Cancun they decided to also introduce a new testing framework that generates the scenario files but not the filler files: this is an issue.

High level plan(s)

We have three way to tackle this:

    1. Ask the framework maintainers to make a feature to also generate the filler files.

Pros: No work on our end.

Cons: Uncertainty. They have no real interest in doing that as they don't need the filler files. And even if they did start working on this feature we don't know when it'd be available.

    1. Try to mimic the Patricia Merkle Tree in memory-state (there are some crate that would allow us to do that) and plug it in our EvalHost to use it as the new backend

Pros: This would allow us to use the root hash as intended.

Cons: Not an easy task in practice. Also it's nice to be able to test how our durable storage behave with the test-suite, it can reveal some potential issues, this wouldn't be the case anymore.

    1. Generate the missing filler files thanks to an already 100% compatible VM.

Pros: Wouldn't be too hard to implement and is the quickest approach for our issue. Would work in the short and long term. There isn't a new upgrade on Ethereum every month so it's (kind of) sustainable.

Cons: Kind of a "quick & dirty" approach. We need to fork ethereum/tests to add the filler files (but pulling new upstream tests would'nt cause conflicts).

Current plan

We will follow the third approach as it's the easiest road, a priori, and would allow us to have something in the short term that would work. This can definitely be revisited afterwards if we find a better way.

TODO

  • Play the ethereum/tests test-suite with a VM that's 100% compatible
  • ╰─➤ revm was chosen because we already have knowledge on it and it's 100% compatible
  • Generate the diff. of the state tree before/after the execution of each tests from the "voucher" VM
  • ╰─➤ !1
  • Validate the generation on filler files by regenerating all the already existing fillers for v13.1 and check that the test-suite is still fully successfull. Write a script to make all the replacements.
  • Fork ethereum/tests/v14.1 to add these filler files (like it was done prior to Cancun)
  • Make the modifition to support Cancun on the VM side
  • ╰─➤ !16141 (merged)
  • Use the evm-evaluation-assessor with the new added filler files and assert that the changes made in the previous point keep our compatibility to 100%
  • Tweak the CI to bump the job about the test-suite up to Cancun.
Edited by Rodi-Can Bozman