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

feat(l2): integrate ExecutionDB, prove execution #956

Merged
merged 83 commits into from
Oct 31, 2024
Merged
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
45c9a95
add libmdbx features
fborello-lambda Oct 16, 2024
0b6658b
bump-up versions
fborello-lambda Oct 16, 2024
b154097
add de/serialization for Block and Transaction
fborello-lambda Oct 16, 2024
ab231dd
add zkvm program ci job
xqft Oct 16, 2024
8957079
misc fixes on ci job
xqft Oct 16, 2024
330177c
change names ci jobs
xqft Oct 16, 2024
88d0f71
wip: add basic structure
fborello-lambda Oct 16, 2024
cf4d670
fix: run tests with no-default-features
fborello-lambda Oct 16, 2024
6a794f2
Merge branch 'l2/prover_integration' into l2/prover_base
fborello-lambda Oct 16, 2024
518c30d
add de/serialization for Receipt
fborello-lambda Oct 16, 2024
0703ce6
Merge branch 'l2/prover_integration' into l2/prover_base
fborello-lambda Oct 16, 2024
687619c
Revert "change names ci jobs"
xqft Oct 17, 2024
33db110
fix prover job
xqft Oct 17, 2024
2190010
fix job binary path
xqft Oct 17, 2024
1604131
fix cargo prove
xqft Oct 17, 2024
0312121
nit
xqft Oct 17, 2024
4d01428
add prover crate to workspace
fborello-lambda Oct 17, 2024
f49e67e
fix: rm clone
fborello-lambda Oct 17, 2024
408e256
fix: replace todo! with custom error
fborello-lambda Oct 17, 2024
056094d
rm derive Deserialize for EIP1559
fborello-lambda Oct 17, 2024
e573135
refactor transactions deser and derive deserialize on enum
xqft Oct 17, 2024
7f0f7e8
Revert "refactor transactions deser and derive deserialize on enum"
xqft Oct 17, 2024
24bc2d2
refactor transactions deser and derive deserialize on enum
xqft Oct 17, 2024
702c11b
rm underscore form path variable
fborello-lambda Oct 17, 2024
2698e5b
add missing Serialize impl for EIP1559
fborello-lambda Oct 17, 2024
6ecac43
Merge branch 'l2/prover_integration' into l2/prover_base
fborello-lambda Oct 17, 2024
980fea6
wip
fborello-lambda Oct 17, 2024
bbb3976
Merge branch 'main' into l2/prover_base
xqft Oct 18, 2024
ce5c073
[wip] run prover with ethereum_rust_l2 cli
fborello-lambda Oct 18, 2024
c1498ab
integrate prover's client with existing setup
fborello-lambda Oct 18, 2024
4e4e7e5
Merge branch 'main' into l2/prover_base
fborello-lambda Oct 18, 2024
02282f1
fix
fborello-lambda Oct 18, 2024
bba68f1
add Makefile target
fborello-lambda Oct 21, 2024
9227e46
use libmdbx
fborello-lambda Oct 21, 2024
14bf100
Merge branch 'main' into l2/prover_base
fborello-lambda Oct 21, 2024
1733e0d
renaming
fborello-lambda Oct 21, 2024
32a0328
revert .gitignore
xqft Oct 21, 2024
bedc3e6
change MemoryDB to more descriptive
xqft Oct 21, 2024
83875cb
remove commented dependency
xqft Oct 21, 2024
ea7abc3
remove unwrap
xqft Oct 21, 2024
e9772cd
add revm dep comments
xqft Oct 21, 2024
5522b6b
fix comment
xqft Oct 21, 2024
49ba37e
tidy mock zkvm program
xqft Oct 21, 2024
54a2e51
improve revm dep comment
xqft Oct 21, 2024
8d54fe5
Merge branch 'main' into l2/prover_base
xqft Oct 21, 2024
1eefc32
change unused fn name
xqft Oct 21, 2024
27b56a6
Merge branch 'main' into l2/prover_base
fborello-lambda Oct 22, 2024
34ec094
fix zkvm ci job
xqft Oct 23, 2024
d507c03
Merge branch 'main' into l2/prover_base
xqft Oct 23, 2024
589a6b4
refactor(l2): new zkvm (#939)
fborello-lambda Oct 23, 2024
e2e15be
renaming and fix CI
fborello-lambda Oct 23, 2024
65d8c39
fix ci
fborello-lambda Oct 23, 2024
5b3f84a
chore: docs
fborello-lambda Oct 23, 2024
5bfee10
add cache crate and mock struct
xqft Oct 17, 2024
bcc356d
fix new EvmState
xqft Oct 17, 2024
2271eec
move to vm crate, rename
xqft Oct 18, 2024
08f3a3e
remove newline
xqft Oct 18, 2024
972d552
rename file
xqft Oct 18, 2024
076b6b3
define db fields
xqft Oct 18, 2024
28acd02
fix doc
xqft Oct 18, 2024
82fdfe2
integrate new EvmState
xqft Oct 21, 2024
67236b1
add from_exec()
xqft Oct 23, 2024
d072af3
add/fix comments
xqft Oct 23, 2024
bb1e4b6
add impl for executiondb to get_state_transitions()
xqft Oct 23, 2024
8adff1b
fix database() function, added chain_config()
xqft Oct 23, 2024
9feaf96
replace MemoryDB with ExecutionDB
xqft Oct 23, 2024
baa9fe7
create prover input when handling request
xqft Oct 23, 2024
f188f19
add debug log
xqft Oct 23, 2024
accc380
tidy up zkvm program, remove revm deps
xqft Oct 24, 2024
0f0d864
fix compilation
fborello-lambda Oct 24, 2024
4532715
remove parent header
xqft Oct 24, 2024
499d43e
add better info log
xqft Oct 24, 2024
7db34c6
fix log level
xqft Oct 24, 2024
d249f39
change prover log level
xqft Oct 24, 2024
48cfa4c
change prover log level
xqft Oct 24, 2024
5fcfcd7
fix log level
xqft Oct 24, 2024
8796417
remove unused dep
xqft Oct 24, 2024
d948827
update example env
xqft Oct 24, 2024
2c0f597
feat(l2): generate groth16 proof (#971)
xqft Oct 24, 2024
7f84c9e
feat(l2): prove block validation (#973)
xqft Oct 25, 2024
bdca908
rm [old] .example.env
fborello-lambda Oct 28, 2024
ee89df8
Merge branch 'main' into l2/integrate_cache_db
fborello-lambda Oct 30, 2024
1e7cd7f
fix merge
fborello-lambda Oct 30, 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
Prev Previous commit
Next Next commit
add prover crate to workspace
fborello-lambda committed Oct 17, 2024
commit 4d0142844f69732ff1c524818a87d32c9ff86f7a
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ members = [
"cmd/ethereum_rust_l2",
"crates/vm/levm",
"crates/vm/levm/bench/revm_comparison",
"crates/l2/prover",
]
resolver = "2"
default-members = ["cmd/ethereum_rust", "cmd/ethereum_rust_l2"]
@@ -31,6 +32,7 @@ ethereum_rust-vm = { path = "./crates/vm" }
ethereum_rust-trie = { path = "./crates/storage/trie" }
ethereum_rust-rlp = { path = "./crates/common/rlp" }
ethereum_rust-l2 = { path = "./crates/l2" }
ethereum_rust-prover = { path = "./crates/l2/prover" }

tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = "0.3.0"
29 changes: 23 additions & 6 deletions crates/l2/prover/Cargo.toml
Original file line number Diff line number Diff line change
@@ -4,16 +4,33 @@ name = "ethereum_rust-prover"
edition = "2021"

[dependencies]
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
tracing = "0.1.40"
hex = "0.4.3"
serde_json.workspace = true
serde.workspace = true
bytes.workspace = true
ethereum-types.workspace = true
tokio.workspace = true
tokio-util.workspace = true
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tracing.workspace = true
hex.workspace = true

ethereum_rust-core = { path = "../../common", package = "ethereum_rust-core" }
ethereum_rust-rlp = { path = "../../common/rlp", package = "ethereum_rust-rlp" }
# ethereum_rust
ethereum_rust-core.workspace = true
ethereum_rust-rlp.workspace = true

# l2
ethereum_rust-l2.workspace = true

sp1-sdk = "2.0.0"

# revm
revm = { version = "14.0.3", features = [
"std",
"serde",
"kzg-rs",
], default-features = false }


# Some tests need the release profile.
[profile.test]
inherits = "release"
6 changes: 0 additions & 6 deletions crates/l2/prover/program/Cargo.toml
Original file line number Diff line number Diff line change
@@ -21,12 +21,6 @@ revm = { version = "14.0.3", features = [
"kzg-rs",
], default-features = false }

# reth
# This should be a custom error
reth-storage-errors = { git = "https://github.com/paradigmxyz/reth", default-features = false, features = [
"std",
] }

[patch.crates-io]
sha3 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", branch = "patch-sha3-v0.10.8", package = "sha3" }
crypto-bigint = { git = "https://github.com/sp1-patches/RustCrypto-bigint", branch = "patch-v0.5.5" }
4 changes: 3 additions & 1 deletion crates/l2/prover/src/client.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,9 @@ use sp1_sdk::SP1ProofWithPublicValues;
use tokio::time::sleep;
use tracing::{debug, error, warn};

use crate::{operator::proof_data_provider::ProofData, utils::config::prover::ProverConfig};
use ethereum_rust_l2::{
operator::proof_data_provider::ProofData, utils::config::prover::ProverConfig,
};

use super::prover::Prover;

8 changes: 6 additions & 2 deletions crates/l2/prover/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
pub mod client;
pub mod prover;

use tracing::info;

pub async fn start_prover() {
let proof_data_client = tokio::spawn(proof_data_client::start_proof_data_client());
#[tokio::main]
async fn main() {
let proof_data_client = tokio::spawn(client::start_proof_data_client());

tokio::try_join!(proof_data_client).unwrap();
info!("Prover finished!");
2 changes: 1 addition & 1 deletion crates/l2/prover/src/prover.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ use tracing::info;

use sp1_sdk::{ProverClient, SP1ProofWithPublicValues, SP1ProvingKey, SP1Stdin, SP1VerifyingKey};

use crate::utils::config::prover::ProverConfig;
use ethereum_rust_l2::utils::config::prover::ProverConfig;

pub struct Prover {
client: ProverClient,
17 changes: 17 additions & 0 deletions crates/l2/prover/src/utils/input.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use ethereum_rust_core::{
types::{Block, BlockHeader},
Bytes,
};
use ethereum_rust_rlp::decode::RLPDecode;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Default)]
pub struct ProverInput {
pub db: MemoryDB,
pub parent_block_header: BlockHeader,
pub block: Block,
}

pub struct MemoryDB {
data: u64,
}
Empty file.