Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
bus-mapping: Extend CircuitInputBuilder (#235)
Browse files Browse the repository at this point in the history
- CircuitInputBuilder:
    - Fix `gen_state_access_trace` by splitting the code and address in the
      context of a call.
    - Add `codes` field in the CircuitInputBuilder to keep a mapping of
      code hash -> code.
    - When doing the `gen_associated_ops` step for opcodes not yet
      implemented, instead of panic show a log warning, so that we can
      generate circuit inputs for blocks eventhough the implementation
      is not complete.  This will allow performing integration tests.
    - Resolve #207
- rpc:
    - Add `eth_coinbase` and `eth_chainId` methods.
    - Remove `BlockNumber` in favour of the implementation in `ethers`.
- General:
    - Replace usage of `BlockConstants` by the new struct
      `ChainConstants`.  This way we split constant parameters of the
      chain into `ChainConstants` and block parameters into `Block`.
      `BlockConstants` is now only used by the external_tracer.
    - Move `BlockConstants` from `bus-mapping/src/exec_trace.rs` to
      `bus-mapping/src/external_tracer.rs`.
    - Implement the Debug trait for some types manually to make debug
      output nicer.
    - Introduce a `circuit_input_builder` integration test with geth.
      The test builds the circuit inputs for the block where the
      Greeter.sol contract is deployed, up to step 5 from
      #222 (whith
      some missing parts)
    - Fix `mload` by allowing memory reads at addresses higher than the
      memory size found in the trace (in such case, a 0 value is read)
  • Loading branch information
ed255 committed Dec 17, 2021
1 parent 259fa25 commit b92b295
Show file tree
Hide file tree
Showing 31 changed files with 606 additions and 368 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ jobs:
- run: ./run.sh --steps "setup"
- run: ./run.sh --steps "gendata"
- run: ./run.sh --steps "tests" --tests "rpc"
- run: ./run.sh --steps "tests" --tests "circuit_input_builder"
- run: ./run.sh --steps "cleanup"
31 changes: 31 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bus-mapping/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ uint = "0.9.1"
ethers-providers = "0.6"
ethers-core = "0.6"
regex = "1.5.4"
log = "0.4.14"

[dev-dependencies]
url = "2.2.2"
Expand Down
Loading

0 comments on commit b92b295

Please sign in to comment.