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

Commit

Permalink
MPT: Testing & go library fix (#1757)
Browse files Browse the repository at this point in the history
### Description

This PR:

- Removes the light client (that now is deprecated) and moves its
StateUpdate circuit into bin/mpt-test.
- `bin/mpt-test` is a tool to prove mainnet tests, see the README inside
for more information.
- Is not possible to link to external golang libraries in the same
binary, so this PR also moves golang MPT code inside `/geth-utils`

### Type of change

- [X] New feature (non-breaking change which adds functionality)

### Contents

- Removal if `light-client-poc` folder
- Move `mpt-witness-generator` into `geth-utils`, this includes also
renaming the git action workflow file to geth utils.
- Create new `bin/mpt-folder`
  - `access-lists` contains JSON files of accesslists of mainnet blocks
- `src/circuit` contains a circuit and the witness generator to test
chained MPT proofs. Well, there's some stuff that is not strictly
mandatory to be there - it's taken from light client circuit - but it
can be done later.
- `src/cache.rs` it's a proxy server with a cache file. There's a lot of
RPC calls to execute this tests and this allows to cache them all into a
file, this makes the testing being possible without accessing any RPC
server and speeding-up it.

### How Has This Been Tested?

For the moment, some of the tests are not passing, but the idea is to
integrate into CI when tests passes successfully.

---------

Co-authored-by: Miha Stopar <[email protected]>
Co-authored-by: adria0 <adria0@nowhere>
  • Loading branch information
3 people authored Feb 8, 2024
1 parent 8ba838b commit 3151efd
Show file tree
Hide file tree
Showing 101 changed files with 973 additions and 8,565 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MPT Witness Generator Checks
name: Geth-utils Checks

on:
merge_group:
Expand All @@ -19,7 +19,7 @@ jobs:
with:
cancel_others: 'true'
concurrent_skipping: 'same_content_newer'
paths: '["mpt-witness-generator/**"]'
paths: '["geth-utils/**"]'


build:
Expand All @@ -35,15 +35,15 @@ jobs:
- name: Format
uses: Jerome1337/[email protected]
with:
gofmt-path: './mpt-witness-generator'
gofmt-path: './geth-utils'
gofmt-flags: '-l -d'

- name: Build
working-directory: ./mpt-witness-generator
working-directory: ./geth-utils
run: go build -v ./...

- name: Test
working-directory: ./mpt-witness-generator
working-directory: ./geth-utils
env:
NO_GETH: true
run: go test -v ./...
184 changes: 30 additions & 154 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ members = [
"external-tracer",
"mock",
"testool",
"mpt-witness-generator/rustlib",
"light-client-poc"
"bin/mpt-test"
]

[patch.crates-io]
Expand Down
1 change: 1 addition & 0 deletions bin/mpt-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web3_rpc_cache.bin
27 changes: 27 additions & 0 deletions bin/mpt-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "mpt-test"
version = "0.1.0"
edition = "2021"

[dependencies]
ethers ={ version = "2.0.10", features = ["abigen", "rustls", "ws", "ethers-solc"] }
eth-types = { path = "../../eth-types" }
gadgets = { path = "../../gadgets" }
geth-utils = { path = "../../geth-utils" }
zkevm-circuits = { path = "../../zkevm-circuits", features=["test-circuits"]}
eyre = "0.6.11"
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", features=["circuit-params"], tag = "v0.3.0" }
serde_json = "1.0.111"
tokio = { version= "1.28.2", features = ["macros", "rt-multi-thread"] }
glob = "0.3.1"
lazy_static = "1.4.0"
base64 = "0.21.7"
flate2 = "1.0.28"
hyper = { version="0.14.27", features= ["full"]}
hyper-rustls = "0.24.1"
serde = "1.0.195"
hex = "0.4.3"

[features]
default = ["disable-keccak"]
disable-keccak = []
Loading

0 comments on commit 3151efd

Please sign in to comment.