0xEigenLabs / eigen-prover

Eigen zkVM's Proving Service
33 stars 9 forks source link

Fill in the storage of pre-state in REVM #77

Closed eigmax closed 4 months ago

eigmax commented 5 months ago

In the zkVM, there are 2 steps to go:

  1. Execution Step: the executor simulates the execution of the block:

    i. filling in the pre-state ii. performing the EVM interpreter iii. parsing the execution trace, and getting the post-state.

The example here is employed to run the above steps.

  1. Proving Step: the prover receives the pre-state, post-state, and task_name(which VM to prove), then calls the zkVM to generate the proof.

After discussing with @nick199910, @BC-A and @JangoCCC , we reach an agreement that:

  1. Do dynamic execution over block data, which does the same as debug_traceTransaction in Geth.
  2. Use storage layout tools, like smlxl/storage-layout-extractor, to calculate the slots without the solidity source code.

I submitted a proposal for the method 2 at #76. For the method 1, we need to modify zkevm-node, to embed a Golang EVM to produce the pre/post state.

eigmax commented 5 months ago

A cross contract invocation sample is here: https://github.com/BC-A/hardhat-example