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

refactor: frontend of trace_decoder #309

Merged
merged 27 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e6898d4
mark: 0xaatif/trace-decoder-rewrite
0xaatif Jun 21, 2024
ee384ef
run: rm -r trace_decoder/src/
0xaatif Jun 21, 2024
303c031
run: git checkout 0xaatif/type-2-witness -- trace_decoder/src/
0xaatif Jun 21, 2024
b34ffb4
build: add required deps
0xaatif Jun 21, 2024
9aa9f95
run: cargo autoinherit
0xaatif Jun 21, 2024
15a8a14
chore: sort and trim deps
0xaatif Jun 21, 2024
ddba52f
chore: update benches
0xaatif Jun 21, 2024
e57b9d0
chore: update zero-bin
0xaatif Jun 21, 2024
bef0328
run: mv zero_bin/.cargo/config.toml .cargo/config.toml
0xaatif Jun 21, 2024
84ec63f
fix: feature gated code
0xaatif Jun 21, 2024
1cb092d
fix: clippy
0xaatif Jun 21, 2024
ae1a05d
review: nits
0xaatif Jun 21, 2024
ff84903
chore: track smt_trie upstreaming
0xaatif Jun 21, 2024
ea72c8c
chore: trace script
0xaatif Jun 21, 2024
c037d5e
fix: accept different header tokens
0xaatif Jun 21, 2024
ef2adbd
test: port other testing logic
0xaatif Jun 21, 2024
1603023
chore: mark generated files
0xaatif Jun 21, 2024
f3b03da
refactor: make decode_key less quirky
0xaatif Jun 21, 2024
17c7521
fix: eth_getWitness returns 0x-prefixed strings
0xaatif Jun 27, 2024
a78a12c
fix: broken build
0xaatif Jul 1, 2024
7161656
review: change BUG to BUG(spec), change wording
0xaatif Jul 2, 2024
efc8e77
Merge remote-tracking branch 'origin/develop' into 0xaatif/trace-deco…
0xaatif Jul 2, 2024
e4f93e4
refactor: zero_jerigon -> type1, hermez_cdk_erigon -> type2
0xaatif Jul 3, 2024
7ca602a
Merge remote-tracking branch 'origin/develop' into 0xaatif/trace-deco…
0xaatif Jul 9, 2024
0ce9852
review: docs from @atanmarko
0xaatif Jul 9, 2024
8600449
fix: broken intra-doc links
0xaatif Jul 9, 2024
680ff87
Merge remote-tracking branch 'origin/develop' into 0xaatif/trace-deco…
0xaatif Jul 10, 2024
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
510 changes: 197 additions & 313 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ keywords = ["cryptography", "STARK", "plonky2", "ethereum", "zk"]
categories = ["cryptography::cryptocurrencies"]

[workspace.dependencies]
__compat_primitive_types = { version = "0.12.2", package = "primitive-types" }
alloy = { git = "https://github.com/alloy-rs/alloy", tag = 'v0.1.1', default-features = false, features = [
"consensus",
"reqwest",
Expand All @@ -43,19 +44,21 @@ alloy = { git = "https://github.com/alloy-rs/alloy", tag = 'v0.1.1', default-fea
anyhow = "1.0.86"
async-stream = "0.3.5"
axum = "0.7.5"
bitflags = "2.5.0"
bitvec = "1.0.1"
bytes = "1.6.0"
ciborium = "0.2.2"
ciborium-io = "0.2.2"
clap = { version = "4.5.7", features = ["derive", "env"] }
compat = { path = "compat" }
__compat_primitive_types = { version = "0.12.2", package = "primitive-types" }
criterion = "0.5.1"
dotenvy = "0.15.7"
either = "1.12.0"
enum-as-inner = "0.6.0"
enumn = "0.1.13"
env_logger = "0.11.3"
ethereum-types = "0.14.1"
eth_trie = "0.4.0"
ethereum-types = "0.14.1"
evm_arithmetization = { path = "evm_arithmetization", version = "0.2.0" }
futures = "0.3.30"
hashbrown = "0.14.5"
Expand All @@ -68,10 +71,12 @@ impl-serde = "0.4.0"
itertools = "0.13.0"
keccak-hash = "0.10.0"
log = "0.4.21"
lru = "0.12.3"
mpt_trie = { path = "mpt_trie", version = "0.3.0" }
num = "0.4.3"
num-bigint = "0.4.5"
num-traits = "0.2.19"
nunny = "0.2.1"
once_cell = "1.19.0"
paladin-core = "0.4.2"
parking_lot = "0.12.3"
Expand All @@ -90,8 +95,8 @@ serde = "1.0.203"
serde_json = "1.0.118"
serde_path_to_error = "0.1.16"
serde_with = "3.8.1"
smt_trie = { path = "smt_trie", version = "0.1.0" }
sha2 = "0.10.8"
smt_trie = { path = "smt_trie", version = "0.1.0" }
static_assertions = "1.1.0"
thiserror = "1.0.61"
tiny-keccak = "2.0.2"
Expand All @@ -101,9 +106,10 @@ tower = "0.4"
trace_decoder = { path = "trace_decoder", version = "0.4.0" }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
u4 = "0.1.0"
uint = "0.9.5"
url = "2.5.2"
lru = "0.12.3"
winnow = "0.6.13"

# zero-bin related dependencies
ops = { path = "zero_bin/ops" }
Expand Down
26 changes: 17 additions & 9 deletions trace_decoder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "trace_decoder"
description = "Processes trace payloads into Intermediate Representation (IR) format."
authors = ["Polygon Zero <[email protected]>"]
description = "Ethereum node witness -> Prover input"
authors = ["Polygon Zero"]
version = "0.4.0"
edition.workspace = true
license.workspace = true
Expand All @@ -10,25 +10,33 @@ homepage.workspace = true
keywords.workspace = true

[dependencies]
anyhow.workspace = true
bitflags = { workspace = true }
bitvec = { workspace = true }
bytes = { workspace = true }
ciborium = { workspace = true }
ciborium-io = { workspace = true }
either = { workspace = true }
enum-as-inner = { workspace = true }
enumn = { workspace = true }
ethereum-types = { workspace = true }
evm_arithmetization = { workspace = true }
hex = { workspace = true }
hex-literal = { workspace = true }
itertools.workspace = true
keccak-hash = { workspace = true }
log = { workspace = true }
mpt_trie = { workspace = true }
nunny = { workspace = true, features = ["serde"] }
plonky2 = { workspace = true }
rlp = { workspace = true }
serde = { workspace = true }
serde_with = { workspace = true }
smt_trie = { workspace = true }
thiserror = { workspace = true }

# Local dependencies
mpt_trie = { workspace = true }
evm_arithmetization = { workspace = true }
u4 = { workspace = true }
winnow = { workspace = true }

[dev-dependencies]
criterion = { workspace = true }
pretty_env_logger = { workspace = true }
serde_json = { workspace = true }

[[bench]]
Expand Down
29 changes: 0 additions & 29 deletions trace_decoder/README.md

This file was deleted.

30 changes: 10 additions & 20 deletions trace_decoder/benches/block_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,27 @@
//! (<https://etherscan.io/block/19240650>) containing 201 transactions and 16 withdrawals.

use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use serde::{Deserialize, Serialize};
use trace_decoder::{
processed_block_trace::ProcessingMeta,
trace_protocol::BlockTrace,
types::{CodeHash, OtherBlockData},
};
0xaatif marked this conversation as resolved.
Show resolved Hide resolved
use trace_decoder::{BlockTrace, OtherBlockData};

#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, serde::Deserialize)]
0xaatif marked this conversation as resolved.
Show resolved Hide resolved
pub struct ProverInput {
pub block_trace: BlockTrace,
pub other_data: OtherBlockData,
}

fn resolve_code_hash_fn(_: &CodeHash) -> Vec<u8> {
todo!()
}

fn criterion_benchmark(c: &mut Criterion) {
let bytes = std::fs::read("benches/block_input.json").unwrap();
let prover_input: ProverInput = serde_json::from_slice(&bytes).unwrap();
let prover_input =
serde_json::from_slice::<ProverInput>(include_bytes!("block_input.json").as_slice())
.unwrap();

c.bench_function("Block 19240650 processing", |b| {
b.iter_batched(
|| prover_input.clone(),
|pi| {
pi.block_trace
.into_txn_proof_gen_ir(
&ProcessingMeta::new(resolve_code_hash_fn),
prover_input.other_data.clone(),
)
.unwrap()
|ProverInput {
block_trace,
other_data,
}| {
trace_decoder::entrypoint(block_trace, other_data, |_| unimplemented!()).unwrap()
},
BatchSize::LargeInput,
)
Expand Down
28 changes: 0 additions & 28 deletions trace_decoder/src/compact/compact_debug_tools.rs

This file was deleted.

Loading
Loading