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

[Experimental] Transaction and receipt proofs #16

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

33 changes: 31 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Tests

on:
push:
branches: ["main", "community-edition"]
branches: ["main", "develop", "community-edition"]
pull_request:
branches: ["main", "community-edition"]
branches: ["main", "develop", "community-edition"]

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -44,6 +44,7 @@ jobs:
cargo test -- test_mpt_empty_root
cargo test -- test_mpt_noninclusion_branch_fixed
cargo test -- test_mpt_noninclusion_extension_fixed
cargo test -- test_mock_small_val
cargo test -- test_mock_rlc
cargo test -- test_mock_rlp_array
cargo test -- test_mock_rlp_field
Expand All @@ -52,3 +53,31 @@ jobs:
cargo test -- test_mock_rlp_long_long_field
cargo test -- test_mock_rlp_short_field
cargo test -- test_mock_single_eip1186
cargo test -- pos_full_tree_test_inclusion --test-threads=1
cargo test -- neg_full_tree_test_inclusion_badval --test-threads=1
cargo test -- pos_test_noninclusion --test-threads=1
cargo test -- neg_invalid_max_depth --test-threads=1
cargo test -- neg_invalid_max_depth_panic --test-threads=1
cargo test -- neg_invalid_max_key_byte_len --test-threads=1
cargo test -- neg_invalid_max_key_byte_len_panic --test-threads=1
cargo test -- neg_invalid_key_byte_len --test-threads=1
cargo test -- pos_empty_tree_noninclusion --test-threads=1
cargo test -- neg_empty_tree_invalid_depth --test-threads=1
cargo test -- neg_nonempty_tree_empty_proof --test-threads=1
cargo test -- test_mock_single_tx_legacy
cargo test -- test_mock_multi_tx_legacy
cargo test -- test_mock_zero_tx_legacy
cargo test -- test_mock_single_tx_new
cargo test -- test_mock_multi_tx_new
cargo test -- stress_test
cargo test -- test_invalid_block_header
cargo test -- test_valid_root_wrong_block_header
cargo test -- test_invalid_key
cargo test -- test_mock_single_tx_len_legacy
cargo test -- test_mock_multi_tx_len_legacy
cargo test -- test_mock_zero_len_new
cargo test -- test_mock_zero_len_legacy
cargo test -- test_mock_one_len_new
cargo test -- test_mock_one_len_legacy
cargo test -- test_mock_nonzero_len_new
cargo test -- test_mock_nonzero_len_legacy
Empty file removed .gitmodules
Empty file.
2 changes: 1 addition & 1 deletion axiom-eth/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# need to export for tests to work
export JSON_RPC_URL=
export JSON_RPC_URL=
3 changes: 2 additions & 1 deletion axiom-eth/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/target
Cargo.lock
**/*.rs.bk
*~
*~
.env
35 changes: 28 additions & 7 deletions axiom-eth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
[package]
name = "axiom-eth"
version = "0.2.1"
version = "0.2.3"
edition = "2021"

[[bin]]
name = "header_chain"
required-features = ["aggregation", "clap"]

[[bin]]
name = "transaction_proof"
required-features = ["aggregation", "clap"]

[[bin]]
name = "mmr_api"
required-features = ["clap"]

[dependencies]
itertools = "0.10"
lazy_static = "1.4.0"
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1.0", default-features = false }
rayon = "1.7"

hasher = { version = "0.1", features = ["hash-keccak"] }
cita_trie = { git = "https://github.com/citahub/cita-trie", branch = "master" }
patricia-merkle-tree = { git = "https://github.com/lambdaclass/merkle_patricia_tree", branch = "main" }
sha3 = "0.10.6"
# misc
log = "0.4"
env_logger = "0.10"
Expand All @@ -32,27 +43,37 @@ zkevm-keccak = { git = "https://github.com/axiom-crypto/halo2-lib.git", branch =
any_circuit_derive = { path = "../any_circuit_derive", optional = true }

# crypto
rlp = "=0.5.2"
ethers-core = { version = "=2.0.6" }
rlp = "0.5.2"
ethers-core = { version = "2.0.7" }
rand_core = { version = "0.6", default-features = false, features = ["getrandom"] }
rand = "0.8"
rand_chacha = "0.3.1"

# mpt implementation

# aggregation
snark-verifier = { git = "https://github.com/axiom-crypto/snark-verifier.git", branch = "community-edition", default-features = false, features = ["loader_halo2"], optional = true }
snark-verifier-sdk = { git = "https://github.com/axiom-crypto/snark-verifier.git", branch = "community-edition", default-features = false, features = ["loader_halo2"], optional = true }

# generating circuit inputs from blockchain
ethers-providers = { version = "=2.0.6", optional = true }
tokio = { version = "=1.28", default-features = false, features = ["rt", "rt-multi-thread"], optional = true }
futures = { version = "=0.3", optional = true }
ethers-providers = { version = "2.0.6", optional = true }
tokio = { version = "1.28", default-features = false, features = ["rt", "rt-multi-thread", "macros"], optional = true }
futures = { version = "0.3", optional = true }
reqwest = { version = "0.11", features = ["json"] }

[dev-dependencies]
hex = "0.4.3"
ark-std = { version = "0.3.0", features = ["print-trace"] }
log = "0.4"
test-log = "0.2.11"
pprof = { version = "0.11", features = ["criterion", "flamegraph"] }
criterion = "0.4"
criterion-macro = "0.4"
rayon = "1.6.1"
test-case = "3.1.0"
proptest = "1.1.0"
hasher = { version = "0.1", features = ["hash-keccak"] }
cita_trie = { git = "https://github.com/citahub/cita-trie", branch = "master" }

[features]
default = ["halo2-axiom", "jemallocator", "display", "aggregation", "clap", "evm"]
Expand Down
9 changes: 0 additions & 9 deletions axiom-eth/configs/bench/mpt.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@
"unusable_rows": 109,
"keccak_rows_per_round": 50
},
{
"degree": 17,
"num_rlc_columns": 1,
"num_range_advice": [4, 3],
"num_lookup_advice": [1, 1],
"num_fixed": 1,
"unusable_rows": 109,
"keccak_rows_per_round": 90
},
{
"degree": 18,
"num_rlc_columns": 1,
Expand Down
39 changes: 39 additions & 0 deletions axiom-eth/configs/bench/transaction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[
[
{
"degree": 18,
"num_rlc_columns": 1,
"num_range_advice": [5, 3],
"num_lookup_advice": [1, 1],
"num_fixed": 1,
"unusable_rows": 69,
"keccak_rows_per_round": 50
},
1
],
[
{
"degree": 17,
"num_rlc_columns": 2,
"num_range_advice": [24, 14],
"num_lookup_advice": [1, 1],
"num_fixed": 1,
"unusable_rows": 55,
"keccak_rows_per_round": 17
},
4
],
[
{
"degree": 18,
"num_rlc_columns": 2,
"num_range_advice": [26, 15],
"num_lookup_advice": [1, 1],
"num_fixed": 1,
"unusable_rows": 77,
"keccak_rows_per_round": 16
},
10
]
]

23 changes: 23 additions & 0 deletions axiom-eth/configs/bench/transaction_evm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"degree": 22,
"num_advice": 5,
"num_lookup_advice": 1,
"num_fixed": 1,
"lookup_bits": 21
},
{
"degree": 23,
"num_advice": 8,
"num_lookup_advice": 1,
"num_fixed": 1,
"lookup_bits": 22
},
{
"degree": 23,
"num_advice": 3,
"num_lookup_advice": 1,
"num_fixed": 1,
"lookup_bits": 22
}
]
14 changes: 0 additions & 14 deletions axiom-eth/configs/headers/mainnet_10_7_historical_0.json

This file was deleted.

10 changes: 0 additions & 10 deletions axiom-eth/configs/headers/mainnet_17_7.json

This file was deleted.

15 changes: 0 additions & 15 deletions axiom-eth/configs/headers/mainnet_18_7_final.json

This file was deleted.

55 changes: 55 additions & 0 deletions axiom-eth/configs/receipts/goerli_8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"params": {
"degree": 19,
"num_rlc_columns": 2,
"num_range_advice": [
15,
10,
0
],
"num_lookup_advice": [
1,
1,
0
],
"num_fixed": 1,
"unusable_rows": 77,
"keccak_rows_per_round": 21,
"lookup_bits": 8
},
"break_points": {
"gate": [
[
524220,
524220,
524220,
524219,
524219,
524219,
524220,
524220,
524220,
524220,
524219,
524220,
524218,
524219
],
[
524219,
524220,
524218,
524218,
524220,
524220,
524220,
524219,
524218
],
[]
],
"rlc": [
524220
]
}
}
18 changes: 18 additions & 0 deletions axiom-eth/configs/receipts/goerli_8_evm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"params": {
"degree": 23,
"num_advice": 4,
"num_lookup_advice": 1,
"num_fixed": 1,
"lookup_bits": 22
},
"break_points": [
[
8388597,
8388598,
8388597
],
[],
[]
]
}
Loading
Loading