From 16f5bdef838cb6acb32d7764d8b474aa0c15994f Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Sun, 3 Aug 2025 14:59:58 +0800 Subject: [PATCH 1/4] wip bincode --- Cargo.lock | 46 ++++++++++++++++--- crates/circuits/chunk-circuit/Cargo.toml | 1 + .../chunk-circuit/chunk_exe_commit.rs | 2 +- crates/circuits/chunk-circuit/src/circuit.rs | 17 ++++--- crates/integration/src/testers/chunk.rs | 2 +- crates/prover/src/prover/chunk.rs | 2 +- crates/prover/src/task/chunk.rs | 4 +- crates/types/chunk/Cargo.toml | 1 + crates/types/chunk/src/execute.rs | 18 +++----- crates/types/chunk/src/witness.rs | 11 ++++- 10 files changed, 74 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ccf4c0a9..13d0e433 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -935,6 +935,26 @@ dependencies = [ "serde", ] +[[package]] +name = "bincode" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" +dependencies = [ + "bincode_derive", + "serde", + "unty", +] + +[[package]] +name = "bincode_derive" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" +dependencies = [ + "virtue", +] + [[package]] name = "bit-set" version = "0.8.0" @@ -6825,6 +6845,7 @@ dependencies = [ name = "scroll-zkvm-chunk-circuit" version = "0.5.0" dependencies = [ + "bincode 2.0.1", "k256 0.13.4 (git+https://github.com/openvm-org/openvm.git?rev=5368d4756993fc1e51092499a816867cf4808de0)", "openvm 1.3.0", "openvm-algebra-complex-macros 1.3.0", @@ -6887,7 +6908,7 @@ version = "0.5.0" dependencies = [ "alloy-primitives", "base64", - "bincode", + "bincode 1.3.3", "c-kzg", "eyre", "git-version", @@ -6924,7 +6945,7 @@ name = "scroll-zkvm-types" version = "0.5.0" dependencies = [ "base64", - "bincode", + "bincode 1.3.3", "openvm-continuations", "openvm-native-recursion", "openvm-sdk", @@ -6989,6 +7010,7 @@ name = "scroll-zkvm-types-chunk" version = "0.5.0" dependencies = [ "alloy-primitives", + "bincode 2.0.1", "itertools 0.14.0", "openvm 1.3.0", "openvm-custom-insn 0.1.0 (git+https://github.com/openvm-org/openvm.git?rev=5368d4756993fc1e51092499a816867cf4808de0)", @@ -7022,7 +7044,7 @@ dependencies = [ name = "scroll-zkvm-verifier" version = "0.5.0" dependencies = [ - "bincode", + "bincode 1.3.3", "eyre", "itertools 0.14.0", "openvm-circuit", @@ -7386,7 +7408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a338d065044702bf751e87cf353daac63e2fc4c53a3e323cbcd98c603ee6e66c" dependencies = [ "ark-std 0.3.0", - "bincode", + "bincode 1.3.3", "ethereum-types", "getset", "halo2-base", @@ -7409,7 +7431,7 @@ version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03046db52868c1b60e8acffa0777ef6dc11ec1bbbb10b9eb612a871f69c8d3f6" dependencies = [ - "bincode", + "bincode 1.3.3", "serde", "sp1-primitives", ] @@ -7420,7 +7442,7 @@ version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6939d6b2f63e54e5fbd208a0293027608f22511741b62fe32b6f67f6c144e0c0" dependencies = [ - "bincode", + "bincode 1.3.3", "blake3", "cfg-if", "hex", @@ -8010,6 +8032,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + [[package]] name = "url" version = "2.5.4" @@ -8055,6 +8083,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "virtue" +version = "0.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" + [[package]] name = "vm-zstd" version = "0.1.1" diff --git a/crates/circuits/chunk-circuit/Cargo.toml b/crates/circuits/chunk-circuit/Cargo.toml index 7fd535ff..407292c1 100644 --- a/crates/circuits/chunk-circuit/Cargo.toml +++ b/crates/circuits/chunk-circuit/Cargo.toml @@ -6,6 +6,7 @@ repository.workspace = true version = "0.5.0" [dependencies] +bincode = { workspace = true, features = ["serde"] } scroll-zkvm-types-circuit = { workspace = true } scroll-zkvm-types-chunk = { workspace = true } sbv-precompile = { workspace = true } diff --git a/crates/circuits/chunk-circuit/chunk_exe_commit.rs b/crates/circuits/chunk-circuit/chunk_exe_commit.rs index af7e9bef..92ea0e28 100644 --- a/crates/circuits/chunk-circuit/chunk_exe_commit.rs +++ b/crates/circuits/chunk-circuit/chunk_exe_commit.rs @@ -1,4 +1,4 @@ #![cfg_attr(rustfmt, rustfmt_skip)] //! Generated by crates/build-guest. DO NOT EDIT! -pub const COMMIT: [u32; 8] = [1071419318, 13542696, 228098146, 1154682103, 1049712254, 1415629403, 1604860768, 985830407]; +pub const COMMIT: [u32; 8] = [1800085633, 726233151, 1518603456, 652109740, 581790696, 729545535, 1686720310, 1475009617]; diff --git a/crates/circuits/chunk-circuit/src/circuit.rs b/crates/circuits/chunk-circuit/src/circuit.rs index 8b7cdeb5..6d18e10b 100644 --- a/crates/circuits/chunk-circuit/src/circuit.rs +++ b/crates/circuits/chunk-circuit/src/circuit.rs @@ -1,5 +1,5 @@ use openvm::init; -use scroll_zkvm_types_chunk::ArchivedChunkWitness; +use scroll_zkvm_types_chunk::{execute, ArchivedChunkWitness, ChunkWitness}; use scroll_zkvm_types_circuit::{ Circuit, io::read_witnesses, @@ -22,7 +22,7 @@ init!(); pub struct ChunkCircuit; impl Circuit for ChunkCircuit { - type Witness = ArchivedChunkWitness; + type Witness = ChunkWitness; type PublicInputs = VersionedChunkInfo; fn read_witness_bytes() -> Vec { @@ -30,14 +30,19 @@ impl Circuit for ChunkCircuit { } fn deserialize_witness(witness_bytes: &[u8]) -> &Self::Witness { - rkyv::access::(witness_bytes) - .expect("ChunkCircuit: rkyv deserialisation of witness bytes failed") + let config = bincode::config::standard(); + let (witness, _): (Self::Witness, _) = + bincode::serde::decode_from_slice(witness_bytes, config).unwrap(); + Box::leak(Box::new(witness)) + //rkyv::access::(witness_bytes) + // .expect("ChunkCircuit: rkyv deserialisation of witness bytes failed") } fn validate(witness: &Self::Witness) -> Self::PublicInputs { + let info = execute(witness).unwrap(); ( - ChunkInfo::try_from(witness).expect("failed to execute chunk"), - (&witness.fork_name).into(), + info, + (witness.fork_name.clone()), ) } } diff --git a/crates/integration/src/testers/chunk.rs b/crates/integration/src/testers/chunk.rs index e843d05b..9bda69a5 100644 --- a/crates/integration/src/testers/chunk.rs +++ b/crates/integration/src/testers/chunk.rs @@ -59,7 +59,7 @@ impl ProverTester for ChunkProverTester { let blocks = match testing_hardfork() { ForkName::EuclidV1 => 12508460usize..=12508463usize, ForkName::EuclidV2 => 1usize..=4usize, - ForkName::Feynman => 16525000usize..=16525003usize, + ForkName::Feynman => 16525000usize..=16525019usize, }; blocks .into_iter() diff --git a/crates/prover/src/prover/chunk.rs b/crates/prover/src/prover/chunk.rs index 59469e3a..83dbd941 100644 --- a/crates/prover/src/prover/chunk.rs +++ b/crates/prover/src/prover/chunk.rs @@ -57,7 +57,7 @@ impl ProverType for GenericChunkProverType { ); let to_archieve = ToArchievedWitness::create(&chunk_witness).map_err(Error::GenProof)?; - let chunk_info = execute(to_archieve.access().map_err(Error::GenProof)?) + let chunk_info = execute(&chunk_witness) .map_err(|e| Error::GenProof(format!("{}: {}", err_prefix, e)))?; Ok(ChunkProofMetadata { chunk_info }) diff --git a/crates/prover/src/task/chunk.rs b/crates/prover/src/task/chunk.rs index fc4903a4..a0f1251d 100644 --- a/crates/prover/src/task/chunk.rs +++ b/crates/prover/src/task/chunk.rs @@ -81,8 +81,8 @@ impl ProvingTask for ChunkProvingTask { self.fork_name.to_lowercase().as_str().into(), ); - let serialized = witness.rkyv_serialize(guest_version())?; - + //let serialized = witness.rkyv_serialize(guest_version())?; + let serialized = witness.bincode_serialize(guest_version()).unwrap(); stdin.write_bytes(&serialized); Ok(()) diff --git a/crates/types/chunk/Cargo.toml b/crates/types/chunk/Cargo.toml index 7a6980f5..7610f065 100644 --- a/crates/types/chunk/Cargo.toml +++ b/crates/types/chunk/Cargo.toml @@ -10,6 +10,7 @@ version.workspace = true [dependencies] revm-precompile = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v74", default-features=false, features = ["kzg-rs", "libsecp256k1"] } alloy-primitives = { workspace = true, features = ["native-keccak"] } +bincode = { workspace = true, features = ["serde"] } rkyv.workspace = true sbv-trie = { workspace = true } sbv-core = { workspace = true } diff --git a/crates/types/chunk/src/execute.rs b/crates/types/chunk/src/execute.rs index b19647c0..170374d9 100644 --- a/crates/types/chunk/src/execute.rs +++ b/crates/types/chunk/src/execute.rs @@ -1,6 +1,5 @@ use crate::{ - ArchivedChunkWitness, BlockHashProvider, CodeDb, NodesProvider, make_providers, - manually_drop_on_zkvm, witness::ArchivedStateCommitMode, + make_providers, manually_drop_on_zkvm, witness::{ArchivedStateCommitMode, StateCommitMode}, ArchivedChunkWitness, BlockHashProvider, ChunkWitness, CodeDb, NodesProvider }; use alloy_primitives::B256; use itertools::Itertools; @@ -22,7 +21,7 @@ use sbv_primitives::{ use std::sync::Arc; use types_base::{fork_name::ForkName, public_inputs::chunk::ChunkInfo}; -type Witness = ArchivedChunkWitness; +type Witness = ChunkWitness; /// `compression_ratios` can be `None` in host mode. /// But in guest mode, it must be provided. @@ -47,7 +46,7 @@ pub fn execute(witness: &Witness) -> Result { ); let pre_state_root = witness.blocks[0].pre_state_root; - let fork_name = ForkName::from(&witness.fork_name); + let fork_name = ForkName::from(witness.fork_name.clone()); let chain = Chain::from_id(witness.blocks[0].chain_id()); // SCROLL_DEV_HARDFORKS will enable all forks @@ -78,13 +77,10 @@ pub fn execute(witness: &Witness) -> Result { println!("state_commit_mode: {:?}", state_commit_mode); let compression_ratios = witness - .compression_ratios - .iter() - .map(|b| b.iter().map(|c| c.into()).collect()) - .collect::>>(); + .compression_ratios.clone(); let (post_state_root, withdraw_root) = match state_commit_mode { - ArchivedStateCommitMode::Chunk | ArchivedStateCommitMode::Block => execute_inner( + StateCommitMode::Chunk | StateCommitMode::Block => execute_inner( fork_name, &code_db, &nodes_provider, @@ -93,9 +89,9 @@ pub fn execute(witness: &Witness) -> Result { &blocks, chain_spec.clone(), compression_ratios, - matches!(state_commit_mode, ArchivedStateCommitMode::Chunk), + matches!(state_commit_mode, StateCommitMode::Chunk), )?, - ArchivedStateCommitMode::Auto => match execute_inner( + StateCommitMode::Auto => match execute_inner( fork_name, &code_db, &nodes_provider, diff --git a/crates/types/chunk/src/witness.rs b/crates/types/chunk/src/witness.rs index 770a0dd3..67d24ff7 100644 --- a/crates/types/chunk/src/witness.rs +++ b/crates/types/chunk/src/witness.rs @@ -115,6 +115,13 @@ impl ChunkWitness { fork_name: self.fork_name, } } + pub fn bincode_serialize( + &self, + guest_version: Option, + ) -> Result, bincode::error::EncodeError> { + let config = bincode::config::standard(); + bincode::serde::encode_to_vec(&self, config) + } /// `guest_version` is related to the guest program. /// It is not always same with the evm hardfork. /// For example, a `Feynman` guest program can execute `EuclidV2` blocks. @@ -135,10 +142,10 @@ impl ChunkWitness { } } -impl TryFrom<&ArchivedChunkWitness> for ChunkInfo { +impl TryFrom<&ChunkWitness> for ChunkInfo { type Error = String; - fn try_from(value: &ArchivedChunkWitness) -> Result { + fn try_from(value: &ChunkWitness) -> Result { crate::execute(value) } } From 5dd524e51908b4c12f99a9704e02fd00fc1d7336 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Mon, 4 Aug 2025 17:18:23 +0800 Subject: [PATCH 2/4] upgrade sbv --- Cargo.lock | 651 +++++++----------- Cargo.toml | 50 +- crates/circuits/batch-circuit/Cargo.toml | 1 + crates/circuits/batch-circuit/src/circuit.rs | 18 +- crates/circuits/bundle-circuit/Cargo.toml | 1 + crates/circuits/bundle-circuit/src/circuit.rs | 18 +- crates/circuits/chunk-circuit/src/circuit.rs | 9 +- crates/integration/src/testers/chunk.rs | 2 +- crates/integration/src/utils/mod.rs | 25 +- crates/prover/Cargo.toml | 2 +- crates/prover/src/prover/chunk.rs | 3 +- crates/prover/src/task/batch.rs | 5 +- crates/prover/src/task/bundle.rs | 3 +- crates/prover/src/task/chunk.rs | 4 +- crates/prover/src/utils/mod.rs | 2 +- crates/types/base/src/public_inputs/batch.rs | 34 +- crates/types/base/src/public_inputs/chunk.rs | 70 +- crates/types/batch/Cargo.toml | 1 + crates/types/batch/src/header/mod.rs | 3 +- crates/types/batch/src/header/v6.rs | 85 +-- crates/types/batch/src/header/v7.rs | 61 +- crates/types/batch/src/header/v8.rs | 5 +- crates/types/batch/src/lib.rs | 7 +- crates/types/batch/src/witness.rs | 88 ++- crates/types/bundle/Cargo.toml | 1 + crates/types/bundle/src/lib.rs | 2 +- crates/types/bundle/src/witness.rs | 51 +- crates/types/chunk/src/execute.rs | 16 +- crates/types/chunk/src/lib.rs | 2 +- crates/types/chunk/src/utils.rs | 8 +- crates/types/chunk/src/witness.rs | 54 +- crates/types/src/lib.rs | 43 +- 32 files changed, 407 insertions(+), 918 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13d0e433..c2f4c9b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,9 +57,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy-chains" -version = "0.2.3" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6967ca1ed656766e471bc323da42fb0db320ca5e1418b408650e98e4757b3d2" +checksum = "4195a29a4b87137b2bb02105e746102873bc03561805cf45c0e510c961f160e6" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -70,14 +70,14 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73e7f99e3a50210eaee2abd57293a2e72b1a5b7bb251b44c4bf33d02ddd402ab" +checksum = "1b6093bc69509849435a2d68237a2e9fea79d27390c8e62f1e4012c460aabad8" dependencies = [ - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "alloy-trie", "alloy-tx-macros", "auto_impl", @@ -95,15 +95,15 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9945351a277c914f3776ae72b3fc1d22f90d2e840276830e48e9be5bf371a8fe" +checksum = "8d1cfed4fefd13b5620cb81cdb6ba397866ff0de514c1b24806e6e79cdff5570" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "serde", ] @@ -167,16 +167,16 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4134375e533d095e045982cd7684a29c37089ab7a605ecf2b4aa17a5e61d72d3" +checksum = "5937e2d544e9b71000942d875cbc57965b32859a666ea543cc57aae5a06d602d" dependencies = [ "alloy-eip2124", "alloy-eip2930", "alloy-eip7702", "alloy-primitives", "alloy-rlp", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "auto_impl", "c-kzg", "derive_more 2.0.1", @@ -187,12 +187,12 @@ dependencies = [ [[package]] name = "alloy-evm" -version = "0.12.3" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff5aae4c6dc600734b206b175f3200085ee82dcdaa388760358830a984ca9869" +checksum = "4042e855163839443cba91147fb7737c4aba02df4767cb322b0e8cea5a77642c" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-hardforks", "alloy-primitives", "alloy-rpc-types-eth", @@ -201,19 +201,19 @@ dependencies = [ "derive_more 2.0.1", "op-alloy-consensus", "op-revm", - "revm 26.0.1", + "revm 27.1.0", "thiserror 2.0.12", ] [[package]] name = "alloy-genesis" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61d58e94791b74c2566a2f240f3f796366e2479d4d39b4a3ec848c733fb92ce" +checksum = "c51b4c13e02a8104170a4de02ccf006d7c233e6c10ab290ee16e7041e6ac221d" dependencies = [ - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "alloy-trie", "serde", "serde_with", @@ -247,21 +247,22 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b21283a28b117505a75ee1f2e63c16ea2ea72afca44f670b1f02795d9f5d988" +checksum = "793df1e3457573877fbde8872e4906638fde565ee2d3bd16d04aad17d43dbf0e" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "serde", ] [[package]] name = "alloy-primitives" -version = "1.2.0" -source = "git+https://github.com/scroll-tech/alloy-core?branch=v1.2.0#48cf7ca879766d96663b6b336f47677e5194896a" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cfebde8c581a5d37b678d0a48a32decb51efd7a63a08ce2517ddec26db705c8" dependencies = [ "alloy-rlp", "bytes", @@ -277,7 +278,6 @@ dependencies = [ "paste", "proptest", "rand 0.9.1", - "rkyv", "ruint", "rustc-hash 2.1.1", "serde", @@ -309,12 +309,12 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14796fd8574c77213802b0dc0e85886b5cb27c44e72678ab7d0a4a2d5aee79e9" +checksum = "f2f9cbf5f781b9ee39cfdddea078fdef6015424f4c8282ef0e5416d15ca352c4" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", "derive_more 2.0.1", @@ -323,21 +323,22 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bea7326ca6cd6971c58042055a039d5c97a1431e30380d8b4883ad98067c1b5" +checksum = "46586ec3c278639fc0e129f0eb73dbfa3d57f683c44b2ff5e066fab7ba63fa1f" dependencies = [ "alloy-consensus", "alloy-consensus-any", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-network-primitives", "alloy-primitives", "alloy-rlp", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "alloy-sol-types", "itertools 0.14.0", "serde", "serde_json", + "serde_with", "thiserror 2.0.12", ] @@ -354,9 +355,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c02a06ae34d2354398dc9d2de0503129c3f0904a3eb791b5d0149f267c2688" +checksum = "1e1722bc30feef87cc0fa824e43c9013f9639cc6c037be7be28a31361c788be2" dependencies = [ "alloy-primitives", "serde", @@ -451,9 +452,9 @@ dependencies = [ [[package]] name = "alloy-tx-macros" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afd621a9ddef2fdc06d17089f45e47cf84d0b46ca5a1bc6c83807c9119636f52" +checksum = "9f916ff6d52f219c44a9684aea764ce2c7e1d53bd4a724c9b127863aeacc30bb" dependencies = [ "alloy-primitives", "darling", @@ -3272,15 +3273,15 @@ checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "op-alloy-consensus" -version = "0.18.9" +version = "0.18.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8719d9b783b29cfa1cf8d591b894805786b9ab4940adc700a57fd0d5b721cf5" +checksum = "0c88d2940558fd69f8f07b3cbd7bb3c02fc7d31159c1a7ba9deede50e7881024" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "derive_more 2.0.1", "serde", "serde_with", @@ -3289,13 +3290,13 @@ dependencies = [ [[package]] name = "op-revm" -version = "7.0.1" +version = "8.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b97d2b54651fcd2955b454e86b2336c031e17925a127f4c44e2b63b2eeda923" +checksum = "5ce1dc7533f4e5716c55cd3d62488c6200cb4dfda96e0c75a7e484652464343b" dependencies = [ "auto_impl", "once_cell", - "revm 26.0.1", + "revm 27.1.0", "serde", ] @@ -5434,12 +5435,12 @@ dependencies = [ [[package]] name = "reth-chainspec" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-evm", "alloy-genesis", "alloy-primitives", @@ -5454,11 +5455,11 @@ dependencies = [ [[package]] name = "reth-codecs" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-genesis", "alloy-primitives", "alloy-trie", @@ -5472,8 +5473,8 @@ dependencies = [ [[package]] name = "reth-codecs-derive" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "convert_case 0.7.1", "proc-macro2", @@ -5483,18 +5484,18 @@ dependencies = [ [[package]] name = "reth-db-models" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "reth-primitives-traits", ] [[package]] name = "reth-ethereum-forks" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-eip2124", "alloy-hardforks", @@ -5505,11 +5506,11 @@ dependencies = [ [[package]] name = "reth-ethereum-primitives" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", "reth-codecs", @@ -5520,11 +5521,11 @@ dependencies = [ [[package]] name = "reth-evm" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-evm", "alloy-primitives", "auto_impl", @@ -5536,17 +5537,17 @@ dependencies = [ "reth-storage-api", "reth-storage-errors", "reth-trie-common", - "revm 26.0.1", + "revm 27.1.0", "scroll-alloy-evm", ] [[package]] name = "reth-evm-ethereum" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-evm", "alloy-primitives", "reth-chainspec", @@ -5555,13 +5556,13 @@ dependencies = [ "reth-evm", "reth-execution-types", "reth-primitives-traits", - "revm 26.0.1", + "revm 27.1.0", ] [[package]] name = "reth-execution-errors" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-evm", "alloy-primitives", @@ -5573,24 +5574,24 @@ dependencies = [ [[package]] name = "reth-execution-types" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-evm", "alloy-primitives", "derive_more 2.0.1", "reth-ethereum-primitives", "reth-primitives-traits", "reth-trie-common", - "revm 26.0.1", + "revm 27.1.0", ] [[package]] name = "reth-network-peers" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -5601,8 +5602,8 @@ dependencies = [ [[package]] name = "reth-primitives" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", "once_cell", @@ -5614,11 +5615,11 @@ dependencies = [ [[package]] name = "reth-primitives-traits" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-genesis", "alloy-primitives", "alloy-rlp", @@ -5630,9 +5631,9 @@ dependencies = [ "once_cell", "op-alloy-consensus", "reth-codecs", - "revm-bytecode 5.0.0", - "revm-primitives 20.0.0", - "revm-state 6.0.0", + "revm-bytecode 6.1.0", + "revm-primitives 20.1.0", + "revm-state 7.0.2", "scroll-alloy-consensus", "secp256k1 0.30.0", "serde", @@ -5642,8 +5643,8 @@ dependencies = [ [[package]] name = "reth-prune-types" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-primitives", "derive_more 2.0.1", @@ -5652,15 +5653,15 @@ dependencies = [ [[package]] name = "reth-scroll-chainspec" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-chains", "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-genesis", "alloy-primitives", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "auto_impl", "derive_more 2.0.1", "once_cell", @@ -5677,11 +5678,11 @@ dependencies = [ [[package]] name = "reth-scroll-evm" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-evm", "alloy-primitives", "derive_more 2.0.1", @@ -5694,8 +5695,8 @@ dependencies = [ "reth-scroll-forks", "reth-scroll-primitives", "reth-storage-api", - "revm 26.0.1", - "revm-primitives 20.0.0", + "revm 27.1.0", + "revm-primitives 20.1.0", "revm-scroll", "scroll-alloy-consensus", "scroll-alloy-evm", @@ -5706,8 +5707,8 @@ dependencies = [ [[package]] name = "reth-scroll-forks" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-chains", "alloy-primitives", @@ -5720,11 +5721,11 @@ dependencies = [ [[package]] name = "reth-scroll-primitives" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", "bytes", @@ -5737,8 +5738,8 @@ dependencies = [ [[package]] name = "reth-stages-types" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-primitives", "reth-trie-common", @@ -5746,8 +5747,8 @@ dependencies = [ [[package]] name = "reth-static-file-types" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-primitives", "derive_more 2.0.1", @@ -5757,11 +5758,11 @@ dependencies = [ [[package]] name = "reth-storage-api" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rpc-types-engine", "auto_impl", @@ -5774,32 +5775,32 @@ dependencies = [ "reth-stages-types", "reth-storage-errors", "reth-trie-common", - "revm-database 6.0.0", + "revm-database 7.0.2", ] [[package]] name = "reth-storage-errors" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", "derive_more 2.0.1", "reth-primitives-traits", "reth-prune-types", "reth-static-file-types", - "revm-database-interface 6.0.0", + "revm-database-interface 7.0.2", "thiserror 2.0.12", ] [[package]] name = "reth-trie" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", "alloy-trie", @@ -5811,14 +5812,14 @@ dependencies = [ "reth-storage-errors", "reth-trie-common", "reth-trie-sparse", - "revm-database 6.0.0", + "revm-database 7.0.2", "tracing", ] [[package]] name = "reth-trie-common" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -5828,13 +5829,13 @@ dependencies = [ "itertools 0.14.0", "nybbles", "reth-primitives-traits", - "revm-database 6.0.0", + "revm-database 7.0.2", ] [[package]] name = "reth-trie-sparse" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -5849,8 +5850,8 @@ dependencies = [ [[package]] name = "reth-zstd-compressors" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "zstd", ] @@ -5876,39 +5877,20 @@ dependencies = [ [[package]] name = "revm" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3ae9d1b08303eb5150dcf820a29e14235cf3f24f6c09024458a4dcbffe6695" -dependencies = [ - "revm-bytecode 4.1.0", - "revm-context 5.0.1", - "revm-context-interface 5.0.0", - "revm-database 4.0.1", - "revm-database-interface 4.0.1", - "revm-handler 5.0.1", - "revm-inspector 5.0.1", - "revm-interpreter 20.0.0", - "revm-precompile 21.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "revm-primitives 19.2.0", - "revm-state 4.0.1", -] - -[[package]] -name = "revm" -version = "26.0.1" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" +version = "27.1.0" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ - "revm-bytecode 5.0.0", - "revm-context 7.0.1", - "revm-context-interface 7.0.1", - "revm-database 6.0.0", - "revm-database-interface 6.0.0", - "revm-handler 7.0.1", - "revm-inspector 7.0.1", - "revm-interpreter 22.0.1", - "revm-precompile 23.0.0", - "revm-primitives 20.0.0", - "revm-state 6.0.0", + "revm-bytecode 6.1.0", + "revm-context 8.0.4", + "revm-context-interface 9.0.0", + "revm-database 7.0.2", + "revm-database-interface 7.0.2", + "revm-handler 8.1.0", + "revm-inspector 8.1.0", + "revm-interpreter 24.0.0", + "revm-precompile 25.0.0", + "revm-primitives 20.1.0", + "revm-state 7.0.2", ] [[package]] @@ -5925,26 +5907,13 @@ dependencies = [ [[package]] name = "revm-bytecode" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942fe4724cf552fd28db6b0a2ca5b79e884d40dd8288a4027ed1e9090e0c6f49" +version = "6.1.0" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "bitvec", "once_cell", "phf", - "revm-primitives 19.2.0", - "serde", -] - -[[package]] -name = "revm-bytecode" -version = "5.0.0" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" -dependencies = [ - "bitvec", - "once_cell", - "phf", - "revm-primitives 20.0.0", + "revm-primitives 20.1.0", "serde", ] @@ -5966,32 +5935,16 @@ dependencies = [ [[package]] name = "revm-context" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01aad49e1233f94cebda48a4e5cef022f7c7ed29b4edf0d202b081af23435ef" +version = "8.0.4" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "cfg-if", "derive-where", - "revm-bytecode 4.1.0", - "revm-context-interface 5.0.0", - "revm-database-interface 4.0.1", - "revm-primitives 19.2.0", - "revm-state 4.0.1", - "serde", -] - -[[package]] -name = "revm-context" -version = "7.0.1" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" -dependencies = [ - "cfg-if", - "derive-where", - "revm-bytecode 5.0.0", - "revm-context-interface 7.0.1", - "revm-database-interface 6.0.0", - "revm-primitives 20.0.0", - "revm-state 6.0.0", + "revm-bytecode 6.1.0", + "revm-context-interface 9.0.0", + "revm-database-interface 7.0.2", + "revm-primitives 20.1.0", + "revm-state 7.0.2", "serde", ] @@ -6012,32 +5965,16 @@ dependencies = [ [[package]] name = "revm-context-interface" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b844f48a411e62c7dde0f757bf5cce49c85b86d6fc1d3b2722c07f2bec4c3ce" -dependencies = [ - "alloy-eip2930", - "alloy-eip7702", - "auto_impl", - "either", - "revm-database-interface 4.0.1", - "revm-primitives 19.2.0", - "revm-state 4.0.1", - "serde", -] - -[[package]] -name = "revm-context-interface" -version = "7.0.1" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" +version = "9.0.0" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "alloy-eip2930", "alloy-eip7702", "auto_impl", "either", - "revm-database-interface 6.0.0", - "revm-primitives 20.0.0", - "revm-state 6.0.0", + "revm-database-interface 7.0.2", + "revm-primitives 20.1.0", + "revm-state 7.0.2", "serde", ] @@ -6057,28 +5994,14 @@ dependencies = [ [[package]] name = "revm-database" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad3fbe34f6bb00a9c3155723b3718b9cb9f17066ba38f9eb101b678cd3626775" +version = "7.0.2" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ - "alloy-eips 1.0.20", - "revm-bytecode 4.1.0", - "revm-database-interface 4.0.1", - "revm-primitives 19.2.0", - "revm-state 4.0.1", - "serde", -] - -[[package]] -name = "revm-database" -version = "6.0.0" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" -dependencies = [ - "alloy-eips 1.0.20", - "revm-bytecode 5.0.0", - "revm-database-interface 6.0.0", - "revm-primitives 20.0.0", - "revm-state 6.0.0", + "alloy-eips 1.0.23", + "revm-bytecode 6.1.0", + "revm-database-interface 7.0.2", + "revm-primitives 20.1.0", + "revm-state 7.0.2", "serde", ] @@ -6096,24 +6019,13 @@ dependencies = [ [[package]] name = "revm-database-interface" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b8acd36784a6d95d5b9e1b7be3ce014f1e759abb59df1fa08396b30f71adc2a" +version = "7.0.2" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "auto_impl", - "revm-primitives 19.2.0", - "revm-state 4.0.1", - "serde", -] - -[[package]] -name = "revm-database-interface" -version = "6.0.0" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" -dependencies = [ - "auto_impl", - "revm-primitives 20.0.0", - "revm-state 6.0.0", + "either", + "revm-primitives 20.1.0", + "revm-state 7.0.2", "serde", ] @@ -6137,37 +6049,19 @@ dependencies = [ [[package]] name = "revm-handler" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "481e8c3290ff4fa1c066592fdfeb2b172edfd14d12e6cade6f6f5588cad9359a" -dependencies = [ - "auto_impl", - "revm-bytecode 4.1.0", - "revm-context 5.0.1", - "revm-context-interface 5.0.0", - "revm-database-interface 4.0.1", - "revm-interpreter 20.0.0", - "revm-precompile 21.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "revm-primitives 19.2.0", - "revm-state 4.0.1", - "serde", -] - -[[package]] -name = "revm-handler" -version = "7.0.1" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" +version = "8.1.0" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "auto_impl", "derive-where", - "revm-bytecode 5.0.0", - "revm-context 7.0.1", - "revm-context-interface 7.0.1", - "revm-database-interface 6.0.0", - "revm-interpreter 22.0.1", - "revm-precompile 23.0.0", - "revm-primitives 20.0.0", - "revm-state 6.0.0", + "revm-bytecode 6.1.0", + "revm-context 8.0.4", + "revm-context-interface 9.0.0", + "revm-database-interface 7.0.2", + "revm-interpreter 24.0.0", + "revm-precompile 25.0.0", + "revm-primitives 20.1.0", + "revm-state 7.0.2", "serde", ] @@ -6190,34 +6084,17 @@ dependencies = [ [[package]] name = "revm-inspector" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc1167ef8937d8867888e63581d8ece729a72073d322119ef4627d813d99ecb" -dependencies = [ - "auto_impl", - "revm-context 5.0.1", - "revm-database-interface 4.0.1", - "revm-handler 5.0.1", - "revm-interpreter 20.0.0", - "revm-primitives 19.2.0", - "revm-state 4.0.1", - "serde", - "serde_json", -] - -[[package]] -name = "revm-inspector" -version = "7.0.1" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" +version = "8.1.0" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "auto_impl", "either", - "revm-context 7.0.1", - "revm-database-interface 6.0.0", - "revm-handler 7.0.1", - "revm-interpreter 22.0.1", - "revm-primitives 20.0.0", - "revm-state 6.0.0", + "revm-context 8.0.4", + "revm-database-interface 7.0.2", + "revm-handler 8.1.0", + "revm-interpreter 24.0.0", + "revm-primitives 20.1.0", + "revm-state 7.0.2", "serde", "serde_json", ] @@ -6236,24 +6113,12 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ee65e57375c6639b0f50555e92a4f1b2434349dd32f52e2176f5c711171697" -dependencies = [ - "revm-bytecode 4.1.0", - "revm-context-interface 5.0.0", - "revm-primitives 19.2.0", - "serde", -] - -[[package]] -name = "revm-interpreter" -version = "22.0.1" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" +version = "24.0.0" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ - "revm-bytecode 5.0.0", - "revm-context-interface 7.0.1", - "revm-primitives 20.0.0", + "revm-bytecode 6.1.0", + "revm-context-interface 9.0.0", + "revm-primitives 20.1.0", "serde", ] @@ -6282,31 +6147,6 @@ dependencies = [ "sha2 0.10.9", ] -[[package]] -name = "revm-precompile" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f9311e735123d8d53a02af2aa81877bba185be7c141be7f931bb3d2f3af449c" -dependencies = [ - "ark-bls12-381", - "ark-bn254", - "ark-ec", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "aurora-engine-modexp", - "blst", - "c-kzg", - "cfg-if", - "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libsecp256k1", - "once_cell", - "p256 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", - "revm-primitives 19.2.0", - "ripemd", - "secp256k1 0.30.0", - "sha2 0.10.9", -] - [[package]] name = "revm-precompile" version = "21.0.0" @@ -6330,22 +6170,24 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "23.0.0" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" +version = "25.0.0" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "ark-bls12-381", "ark-bn254", "ark-ec", "ark-ff 0.5.0", "ark-serialize 0.5.0", + "arrayref", "aurora-engine-modexp", + "blst", "c-kzg", "cfg-if", "k256 0.13.4 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1", "once_cell", "p256 0.13.2 (registry+https://github.com/rust-lang/crates.io-index)", - "revm-primitives 20.0.0", + "revm-primitives 20.1.0", "ripemd", "rug", "secp256k1 0.31.1", @@ -6374,19 +6216,8 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "19.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c1588093530ec4442461163be49c433c07a3235d1ca6f6799fef338dacc50d3" -dependencies = [ - "alloy-primitives", - "num_enum", - "serde", -] - -[[package]] -name = "revm-primitives" -version = "20.0.0" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" +version = "20.1.0" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "alloy-primitives", "num_enum", @@ -6396,14 +6227,14 @@ dependencies = [ [[package]] name = "revm-scroll" version = "0.1.0" -source = "git+https://github.com/scroll-tech/scroll-revm?branch=main#6a1e33df5b9e5ad6585a8469faaba9e6ea5e3f3d" +source = "git+https://github.com/scroll-tech/scroll-revm#720ee7802e5ad695ac1f8699bbab9c9f2424417f" dependencies = [ "auto_impl", "enumn", "once_cell", - "revm 26.0.1", - "revm-inspector 7.0.1", - "revm-primitives 20.0.0", + "revm 27.1.0", + "revm-inspector 8.1.0", + "revm-primitives 20.1.0", "serde", ] @@ -6421,24 +6252,12 @@ dependencies = [ [[package]] name = "revm-state" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0040c61c30319254b34507383ba33d85f92949933adf6525a2cede05d165e1fa" +version = "7.0.2" +source = "git+https://github.com/scroll-tech/revm#9cd9896c06a5bf6d4212906260d8789579873ba4" dependencies = [ "bitflags", - "revm-bytecode 4.1.0", - "revm-primitives 19.2.0", - "serde", -] - -[[package]] -name = "revm-state" -version = "6.0.0" -source = "git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v78#c143b332683b41849632cc482bddbcb1be0d8d6f" -dependencies = [ - "bitflags", - "revm-bytecode 5.0.0", - "revm-primitives 20.0.0", + "revm-bytecode 6.1.0", + "revm-primitives 20.1.0", "serde", ] @@ -6526,7 +6345,8 @@ dependencies = [ [[package]] name = "ruint" version = "1.15.0" -source = "git+https://github.com/scroll-tech/uint.git?branch=v1.15.0#e80953859952d6ad3cfd96d0a659499c38b96794" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11256b5fe8c68f56ac6f39ef0720e592f33d2367a4782740d9c9142e889c7fb4" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -6542,7 +6362,6 @@ dependencies = [ "proptest", "rand 0.8.5", "rand 0.9.1", - "rkyv", "rlp", "ruint-macro", "serde", @@ -6553,7 +6372,8 @@ dependencies = [ [[package]] name = "ruint-macro" version = "1.2.1" -source = "git+https://github.com/scroll-tech/uint.git?branch=v1.15.0#e80953859952d6ad3cfd96d0a659499c38b96794" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rustc-demangle" @@ -6637,7 +6457,7 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "sbv-core" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=chore%2Fopenvm-1.3#a4d0e2302ffd3ecbeef29e16ddeb361084358f7b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" dependencies = [ "sbv-helpers", "sbv-kv", @@ -6650,7 +6470,7 @@ dependencies = [ [[package]] name = "sbv-helpers" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=chore%2Fopenvm-1.3#a4d0e2302ffd3ecbeef29e16ddeb361084358f7b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" dependencies = [ "tracing", ] @@ -6658,7 +6478,7 @@ dependencies = [ [[package]] name = "sbv-kv" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=chore%2Fopenvm-1.3#a4d0e2302ffd3ecbeef29e16ddeb361084358f7b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" dependencies = [ "auto_impl", "hashbrown 0.15.4", @@ -6668,7 +6488,7 @@ dependencies = [ [[package]] name = "sbv-precompile" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=chore%2Fopenvm-1.3#a4d0e2302ffd3ecbeef29e16ddeb361084358f7b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" dependencies = [ "openvm-ecc-guest 1.3.0", "openvm-pairing", @@ -6679,13 +6499,13 @@ dependencies = [ [[package]] name = "sbv-primitives" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=chore%2Fopenvm-1.3#a4d0e2302ffd3ecbeef29e16ddeb361084358f7b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-evm", "alloy-primitives", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "auto_impl", "itertools 0.14.0", "reth-chainspec", @@ -6699,9 +6519,8 @@ dependencies = [ "reth-scroll-evm", "reth-scroll-forks", "reth-scroll-primitives", - "revm 26.0.1", + "revm 27.1.0", "revm-scroll", - "rkyv", "sbv-helpers", "sbv-kv", "scroll-alloy-consensus", @@ -6713,10 +6532,11 @@ dependencies = [ [[package]] name = "sbv-trie" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=chore%2Fopenvm-1.3#a4d0e2302ffd3ecbeef29e16ddeb361084358f7b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" dependencies = [ "alloy-rlp", "alloy-trie", + "auto_impl", "reth-trie", "reth-trie-sparse", "sbv-helpers", @@ -6727,14 +6547,14 @@ dependencies = [ [[package]] name = "scroll-alloy-consensus" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-primitives", "alloy-rlp", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "derive_more 2.0.1", "reth-codecs", "serde", @@ -6743,15 +6563,15 @@ dependencies = [ [[package]] name = "scroll-alloy-evm" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-consensus", - "alloy-eips 1.0.20", + "alloy-eips 1.0.23", "alloy-evm", "alloy-primitives", "auto_impl", - "revm 26.0.1", + "revm 27.1.0", "revm-scroll", "scroll-alloy-consensus", "scroll-alloy-hardforks", @@ -6761,8 +6581,8 @@ dependencies = [ [[package]] name = "scroll-alloy-hardforks" -version = "1.5.0" -source = "git+https://github.com/scroll-tech/reth?rev=090d7950d169abbfb896875a7b1ff3f8ca356ac8#090d7950d169abbfb896875a7b1ff3f8ca356ac8" +version = "1.6.0" +source = "git+https://github.com/scroll-tech/reth?rev=f451fe852900aa68b6f9d8df1a838da5adf23401#f451fe852900aa68b6f9d8df1a838da5adf23401" dependencies = [ "alloy-hardforks", "auto_impl", @@ -6774,6 +6594,7 @@ name = "scroll-zkvm-batch-circuit" version = "0.5.0" dependencies = [ "alloy-primitives", + "bincode 2.0.1", "bitcode", "c-kzg", "halo2curves-axiom 0.7.0", @@ -6832,6 +6653,7 @@ name = "scroll-zkvm-bundle-circuit" version = "0.5.0" dependencies = [ "alloy-primitives", + "bincode 2.0.1", "openvm 1.3.0", "openvm-algebra-guest 1.3.0", "openvm-keccak256-guest 1.3.0", @@ -6887,7 +6709,7 @@ dependencies = [ "openvm-transpiler", "rayon", "regex", - "revm 24.0.0", + "revm 27.1.0", "rkyv", "sbv-primitives", "scroll-zkvm-prover", @@ -6924,10 +6746,9 @@ dependencies = [ "openvm-native-recursion", "openvm-sdk", "openvm-stark-sdk", - "revm 24.0.0", + "revm 27.1.0", "rkyv", "sbv-primitives", - "scroll-alloy-evm", "scroll-zkvm-types", "scroll-zkvm-types-chunk", "scroll-zkvm-verifier", @@ -6964,7 +6785,7 @@ name = "scroll-zkvm-types-base" version = "0.5.0" dependencies = [ "alloy-primitives", - "alloy-serde 1.0.20", + "alloy-serde 1.0.23", "itertools 0.14.0", "rkyv", "sbv-primitives", @@ -6978,6 +6799,7 @@ name = "scroll-zkvm-types-batch" version = "0.5.0" dependencies = [ "alloy-primitives", + "bincode 2.0.1", "c-kzg", "halo2curves-axiom 0.7.0", "itertools 0.14.0", @@ -6998,6 +6820,7 @@ name = "scroll-zkvm-types-bundle" version = "0.5.0" dependencies = [ "alloy-primitives", + "bincode 2.0.1", "itertools 0.14.0", "rkyv", "scroll-zkvm-types-base", @@ -7015,7 +6838,7 @@ dependencies = [ "openvm 1.3.0", "openvm-custom-insn 0.1.0 (git+https://github.com/openvm-org/openvm.git?rev=5368d4756993fc1e51092499a816867cf4808de0)", "openvm-rv32im-guest 1.3.0", - "revm-precompile 21.0.0 (git+https://github.com/scroll-tech/revm?branch=feat%2Freth-v74)", + "revm-precompile 21.0.0", "rkyv", "sbv-core", "sbv-kv", @@ -7053,7 +6876,7 @@ dependencies = [ "openvm-native-recursion", "openvm-sdk", "openvm-stark-sdk", - "revm 24.0.0", + "revm 27.1.0", "scroll-zkvm-prover", "scroll-zkvm-types", "serde", diff --git a/Cargo.toml b/Cargo.toml index a40a0433..8767a4a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,20 +58,20 @@ openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", rev = "f48090c9febd021f8ee0349bc929a775fb1fa3ad" } p3-field = { git = "https://github.com/Plonky3/Plonky3.git", rev = "539bbc84085efb609f4f62cb03cf49588388abdb" } -sbv-core = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3", features = ["scroll"] } -sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3", features = ["scroll", "serde", "rkyv"] } -sbv-kv = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3" } -sbv-trie = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3" } -sbv-precompile = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "chore/openvm-1.3" } +sbv-core = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "feat/bump-reth", features = ["scroll"] } +sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "feat/bump-reth", features = ["scroll", "serde"] } +sbv-kv = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "feat/bump-reth" } +sbv-trie = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "feat/bump-reth" } +sbv-precompile = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "feat/bump-reth" } -scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth", rev = "090d7950d169abbfb896875a7b1ff3f8ca356ac8", default-features = false } +#scroll-alloy-evm = { git = "https://github.com/scroll-tech/reth", rev = "090d7950d169abbfb896875a7b1ff3f8ca356ac8", default-features = false } -alloy-primitives = { version = "1.2", default-features = false, features = ["std", "map-hashbrown", "map-fxhash", "rkyv"] } +alloy-primitives = { version = "1.3", default-features = false, features = ["std", "map-hashbrown", "map-fxhash"] } alloy-serde = { version = "1.0.13", default-features = false } bitcode = { version = "0.6.5", default-features = false, features = ["serde", "derive"] } bincode_v1 = { version = "1.3", package = "bincode"} -bincode = { version = "2.0" } +bincode = { version = "2.0", features = ["serde"] } cargo_metadata = "0.20" c-kzg = { version = "2.0" } derivative = "2.2.0" @@ -84,7 +84,7 @@ metrics-util = "0.17" metrics-tracing-context = "0.16.0" rayon = "1.10" rkyv = "0.8" -revm = "=24.0.0" +revm = "=27.1.0" serde = { version = "1", default-features = false, features = ["derive"] } serde_json = { version = "1.0" } serde_with = "3.11.0" @@ -112,26 +112,18 @@ scroll-zkvm-prover = { path = "crates/prover" } scroll-zkvm-verifier = { path = "crates/verifier" } [patch.crates-io] -revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-bytecode = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-context = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-context-interface = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-database = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-database-interface = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-handler = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-inspector = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-interpreter = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-precompile = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-primitives = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } -revm-state = { git = "https://github.com/scroll-tech/revm", branch = "feat/reth-v78" } - -ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.15.0" } -alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "v1.2.0" } - -#alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "v0.8.18-euclid-upgrade" } -#ruint = { git = "https://github.com/scroll-tech/uint.git", branch = "v1.12.3" } -#tiny-keccak = { git = "https://github.com/scroll-tech/tiny-keccak", branch = "scroll-patch-v2.0.2-euclid-upgrade" } -#ruint = { git = "https://github.com/openvm-org/openvm.git", tag = "v1.2.1-rc.1" } +revm = { git = "https://github.com/scroll-tech/revm" } +revm-bytecode = { git = "https://github.com/scroll-tech/revm" } +revm-context = { git = "https://github.com/scroll-tech/revm" } +revm-context-interface = { git = "https://github.com/scroll-tech/revm" } +revm-database = { git = "https://github.com/scroll-tech/revm" } +revm-database-interface = { git = "https://github.com/scroll-tech/revm" } +revm-handler = { git = "https://github.com/scroll-tech/revm" } +revm-inspector = { git = "https://github.com/scroll-tech/revm" } +revm-interpreter = { git = "https://github.com/scroll-tech/revm" } +revm-precompile = { git = "https://github.com/scroll-tech/revm" } +revm-primitives = { git = "https://github.com/scroll-tech/revm" } +revm-state = { git = "https://github.com/scroll-tech/revm" } [profile.maxperf] inherits = "release" diff --git a/crates/circuits/batch-circuit/Cargo.toml b/crates/circuits/batch-circuit/Cargo.toml index de32cbf3..aae02382 100644 --- a/crates/circuits/batch-circuit/Cargo.toml +++ b/crates/circuits/batch-circuit/Cargo.toml @@ -6,6 +6,7 @@ repository.workspace = true version = "0.5.0" [dependencies] +bincode.workspace = true scroll-zkvm-types-circuit.workspace = true scroll-zkvm-types-batch.workspace = true diff --git a/crates/circuits/batch-circuit/src/circuit.rs b/crates/circuits/batch-circuit/src/circuit.rs index 21ad1a34..e83b80be 100644 --- a/crates/circuits/batch-circuit/src/circuit.rs +++ b/crates/circuits/batch-circuit/src/circuit.rs @@ -1,5 +1,5 @@ use alloy_primitives::B256; -use scroll_zkvm_types_batch::ArchivedBatchWitness; +use scroll_zkvm_types_batch::BatchWitness; use scroll_zkvm_types_circuit::{ AggCircuit, AggregationInput, Circuit, ProgramCommitment, io::read_witnesses, @@ -25,7 +25,7 @@ openvm::init!(); pub struct BatchCircuit; impl Circuit for BatchCircuit { - type Witness = ArchivedBatchWitness; + type Witness = BatchWitness; type PublicInputs = VersionedBatchInfo; @@ -34,12 +34,16 @@ impl Circuit for BatchCircuit { } fn deserialize_witness(witness_bytes: &[u8]) -> &Self::Witness { - rkyv::access::(witness_bytes) - .expect("BatchCircuit: rkyc deserialisation of witness bytes failed") + let config = bincode::config::standard(); + let (witness, _): (Self::Witness, _) = + bincode::serde::decode_from_slice(witness_bytes, config).unwrap(); + Box::leak(Box::new(witness)) + // rkyv::access::(witness_bytes) + // .expect("BatchCircuit: rkyc deserialisation of witness bytes failed") } fn validate(witness: &Self::Witness) -> Self::PublicInputs { - (BatchInfo::from(witness), (&witness.fork_name).into()) + (BatchInfo::from(witness), (witness.fork_name.clone())) } } @@ -64,11 +68,11 @@ impl AggCircuit for BatchCircuit { } fn aggregated_public_inputs(witness: &Self::Witness) -> Vec { - let fork_name = (&witness.fork_name).into(); + let fork_name = (witness.fork_name).clone(); witness .chunk_infos .iter() - .map(|archived| (archived.into(), fork_name)) + .map(|archived| (archived.clone(), fork_name)) .collect() } diff --git a/crates/circuits/bundle-circuit/Cargo.toml b/crates/circuits/bundle-circuit/Cargo.toml index a51da15b..7bdce203 100644 --- a/crates/circuits/bundle-circuit/Cargo.toml +++ b/crates/circuits/bundle-circuit/Cargo.toml @@ -6,6 +6,7 @@ repository.workspace = true version = "0.5.0" [dependencies] +bincode.workspace = true scroll-zkvm-types-circuit.workspace = true scroll-zkvm-types-bundle.workspace = true diff --git a/crates/circuits/bundle-circuit/src/circuit.rs b/crates/circuits/bundle-circuit/src/circuit.rs index ef038205..1c332eaa 100644 --- a/crates/circuits/bundle-circuit/src/circuit.rs +++ b/crates/circuits/bundle-circuit/src/circuit.rs @@ -1,5 +1,5 @@ use alloy_primitives::B256; -use scroll_zkvm_types_bundle::ArchivedBundleWitness; +use scroll_zkvm_types_bundle::BundleWitness; use scroll_zkvm_types_circuit::{ AggCircuit, AggregationInput, Circuit, ProgramCommitment, io::read_witnesses, @@ -18,7 +18,7 @@ use openvm_keccak256_guest; pub struct BundleCircuit; impl Circuit for BundleCircuit { - type Witness = ArchivedBundleWitness; + type Witness = BundleWitness; type PublicInputs = VersionedBundleInfo; @@ -27,12 +27,16 @@ impl Circuit for BundleCircuit { } fn deserialize_witness(witness_bytes: &[u8]) -> &Self::Witness { - rkyv::access::(witness_bytes) - .expect("BundleCircuit: rkyv deserialization of witness bytes failed") + let config = bincode::config::standard(); + let (witness, _): (Self::Witness, _) = + bincode::serde::decode_from_slice(witness_bytes, config).unwrap(); + Box::leak(Box::new(witness)) + // rkyv::access::(witness_bytes) + // .expect("BundleCircuit: rkyv deserialization of witness bytes failed") } fn validate(witness: &Self::Witness) -> Self::PublicInputs { - (BundleInfo::from(witness), (&witness.fork_name).into()) + (BundleInfo::from(witness), (witness.fork_name).clone()) } } @@ -57,11 +61,11 @@ impl AggCircuit for BundleCircuit { } fn aggregated_public_inputs(witness: &Self::Witness) -> Vec { - let fork_name = (&witness.fork_name).into(); + let fork_name = (witness.fork_name).clone(); witness .batch_infos .iter() - .map(|archived| (archived.into(), fork_name)) + .map(|archived| (archived.clone(), fork_name)) .collect() } diff --git a/crates/circuits/chunk-circuit/src/circuit.rs b/crates/circuits/chunk-circuit/src/circuit.rs index 6d18e10b..32eac019 100644 --- a/crates/circuits/chunk-circuit/src/circuit.rs +++ b/crates/circuits/chunk-circuit/src/circuit.rs @@ -1,5 +1,5 @@ use openvm::init; -use scroll_zkvm_types_chunk::{execute, ArchivedChunkWitness, ChunkWitness}; +use scroll_zkvm_types_chunk::{ChunkWitness, execute}; use scroll_zkvm_types_circuit::{ Circuit, io::read_witnesses, @@ -34,15 +34,12 @@ impl Circuit for ChunkCircuit { let (witness, _): (Self::Witness, _) = bincode::serde::decode_from_slice(witness_bytes, config).unwrap(); Box::leak(Box::new(witness)) - //rkyv::access::(witness_bytes) + // rkyv::access::(witness_bytes) // .expect("ChunkCircuit: rkyv deserialisation of witness bytes failed") } fn validate(witness: &Self::Witness) -> Self::PublicInputs { let info = execute(witness).unwrap(); - ( - info, - (witness.fork_name.clone()), - ) + (info, (witness.fork_name.clone())) } } diff --git a/crates/integration/src/testers/chunk.rs b/crates/integration/src/testers/chunk.rs index 9bda69a5..b48b4204 100644 --- a/crates/integration/src/testers/chunk.rs +++ b/crates/integration/src/testers/chunk.rs @@ -3,7 +3,7 @@ use std::{ path::{Path, PathBuf}, }; -use sbv_primitives::{B256, types::BlockWitness}; +use sbv_primitives::{B256, BlockWitness}; use scroll_zkvm_prover::{ChunkProverType, ProverType, task::chunk::ChunkProvingTask}; use scroll_zkvm_types::public_inputs::ForkName; diff --git a/crates/integration/src/utils/mod.rs b/crates/integration/src/utils/mod.rs index b9ad94d7..6f238aa3 100644 --- a/crates/integration/src/utils/mod.rs +++ b/crates/integration/src/utils/mod.rs @@ -1,6 +1,5 @@ use sbv_primitives::{ - B256, U256, - types::{BlockWitness, Transaction, eips::Encodable2718, reth::primitives::TransactionSigned}, + B256, BlockWitness, Transaction, U256, eips::Encodable2718, reth::primitives::TransactionSigned, }; use scroll_zkvm_prover::{ ChunkProof, @@ -327,7 +326,7 @@ fn test_build_and_parse_batch_task() -> eyre::Result<()> { use scroll_zkvm_prover::utils::{read_json, read_json_deep, write_json}; use scroll_zkvm_types::{ batch::{Envelope, EnvelopeV8 as GenericEnvelope, Payload, PayloadV8 as GenericPayload}, - chunk::{ArchivedChunkInfo, ChunkInfo}, + chunk::ChunkInfo, }; // ./testdata/ @@ -384,15 +383,6 @@ fn test_build_and_parse_batch_task() -> eyre::Result<()> { let enveloped = ::from_slice(task.blob_bytes.as_slice()); let header = task.batch_header.must_v8_header(); - let serialized_bytes = rkyv::to_bytes::(&chunk_infos).unwrap(); - let chunk_infos = - rkyv::access::, rkyv::rancor::Error>( - &serialized_bytes, - ) - .unwrap() - .iter() - .map(|ci| ci.into()) - .collect::>(); ::from_envelope(&enveloped).validate(header, chunk_infos.as_slice()); write_json(path_testdata.join("batch-task-test-out.json"), &task).unwrap(); @@ -404,7 +394,7 @@ fn test_batch_task_payload() -> eyre::Result<()> { use scroll_zkvm_prover::utils::read_json_deep; use scroll_zkvm_types::{ batch::{Envelope, EnvelopeV7, Payload, PayloadV7}, - chunk::{ArchivedChunkInfo, ChunkInfo}, + chunk::ChunkInfo, }; // ./testdata/ @@ -424,15 +414,6 @@ fn test_batch_task_payload() -> eyre::Result<()> { .map(|proof| proof.metadata.chunk_info.clone()) .collect::>(); - let serialized_bytes = rkyv::to_bytes::(&chunk_infos).unwrap(); - let chunk_infos = - rkyv::access::, rkyv::rancor::Error>( - &serialized_bytes, - ) - .unwrap() - .iter() - .map(|ci| ci.into()) - .collect::>(); ::from_envelope(&enveloped) .validate(task.batch_header.must_v7_header(), chunk_infos.as_slice()); diff --git a/crates/prover/Cargo.toml b/crates/prover/Cargo.toml index af89630f..a7e0d9be 100644 --- a/crates/prover/Cargo.toml +++ b/crates/prover/Cargo.toml @@ -10,7 +10,7 @@ scroll-zkvm-types.workspace = true scroll-zkvm-types-chunk = { workspace = true, features = ["scroll-compress-ratio"] } scroll-zkvm-verifier.workspace = true -scroll-alloy-evm = { workspace = true, features = ["std", "zstd_compression"] } +#scroll-alloy-evm = { workspace = true, features = ["std", "zstd_compression"] } alloy-primitives = { workspace = true, features = ["tiny-keccak"] } rkyv.workspace = true diff --git a/crates/prover/src/prover/chunk.rs b/crates/prover/src/prover/chunk.rs index 83dbd941..c667bfbe 100644 --- a/crates/prover/src/prover/chunk.rs +++ b/crates/prover/src/prover/chunk.rs @@ -1,4 +1,4 @@ -use scroll_zkvm_types::chunk::{ChunkWitness, ToArchievedWitness, execute}; +use scroll_zkvm_types::chunk::{ChunkWitness, execute}; use crate::{ Error, Prover, ProverType, @@ -56,7 +56,6 @@ impl ProverType for GenericChunkProverType { task.fork_name.as_str().into(), ); - let to_archieve = ToArchievedWitness::create(&chunk_witness).map_err(Error::GenProof)?; let chunk_info = execute(&chunk_witness) .map_err(|e| Error::GenProof(format!("{}: {}", err_prefix, e)))?; diff --git a/crates/prover/src/task/batch.rs b/crates/prover/src/task/batch.rs index 26c85828..2c69995e 100644 --- a/crates/prover/src/task/batch.rs +++ b/crates/prover/src/task/batch.rs @@ -13,7 +13,7 @@ use scroll_zkvm_types::{ use crate::{ AsRootProof, ChunkProof, - task::ProvingTask, + task::{ProvingTask, guest_version}, utils::{base64, point_eval}, }; @@ -183,7 +183,8 @@ impl ProvingTask for BatchProvingTask { point_eval_witness, }; - let serialized = rkyv::to_bytes::(&witness)?; + let serialized = witness.bincode_serialize(guest_version()).unwrap(); + // let serialized = rkyv::to_bytes::(&witness)?; stdin.write_bytes(&serialized); for chunk_proof in &self.chunk_proofs { let root_input = chunk_proof.as_root_proof(); diff --git a/crates/prover/src/task/bundle.rs b/crates/prover/src/task/bundle.rs index d0d310a8..6cdd335e 100644 --- a/crates/prover/src/task/bundle.rs +++ b/crates/prover/src/task/bundle.rs @@ -56,7 +56,8 @@ impl ProvingTask for BundleProvingTask { .collect(), fork_name: ForkName::from(self.fork_name.as_str()), }; - let serialized = witness.rkyv_serialize(guest_version())?; + let serialized = witness.bincode_serialize(guest_version()).unwrap(); + // let serialized = witness.rkyv_serialize(guest_version())?; stdin.write_bytes(&serialized); for batch_proof in &self.batch_proofs { let root_input = &batch_proof.as_root_proof(); diff --git a/crates/prover/src/task/chunk.rs b/crates/prover/src/task/chunk.rs index a0f1251d..725f338c 100644 --- a/crates/prover/src/task/chunk.rs +++ b/crates/prover/src/task/chunk.rs @@ -1,7 +1,7 @@ use crate::task::{ProvingTask, guest_version}; use alloy_primitives::B256; use openvm_sdk::StdIn; -use sbv_primitives::types::BlockWitness; +use sbv_primitives::BlockWitness; use scroll_zkvm_types::{chunk::ChunkWitness, public_inputs::ForkName}; /// Message indicating a sanity check failure. @@ -81,7 +81,7 @@ impl ProvingTask for ChunkProvingTask { self.fork_name.to_lowercase().as_str().into(), ); - //let serialized = witness.rkyv_serialize(guest_version())?; + // let serialized = witness.rkyv_serialize(guest_version())?; let serialized = witness.bincode_serialize(guest_version()).unwrap(); stdin.write_bytes(&serialized); diff --git a/crates/prover/src/utils/mod.rs b/crates/prover/src/utils/mod.rs index bc0c135c..f4556902 100644 --- a/crates/prover/src/utils/mod.rs +++ b/crates/prover/src/utils/mod.rs @@ -110,7 +110,7 @@ pub mod as_base64 { pub mod point_eval { use c_kzg; - use sbv_primitives::{B256 as H256, U256, types::eips::eip4844::BLS_MODULUS}; + use sbv_primitives::{B256 as H256, U256, eips::eip4844::BLS_MODULUS}; /// Given the blob-envelope, translate it to a fixed size EIP-4844 blob. /// diff --git a/crates/types/base/src/public_inputs/batch.rs b/crates/types/base/src/public_inputs/batch.rs index 139c8b0f..04e10053 100644 --- a/crates/types/base/src/public_inputs/batch.rs +++ b/crates/types/base/src/public_inputs/batch.rs @@ -6,58 +6,26 @@ use crate::{ }; /// Represents public-input values for a batch. -#[derive( - Clone, - Debug, - rkyv::Archive, - rkyv::Deserialize, - rkyv::Serialize, - serde::Deserialize, - serde::Serialize, -)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub struct BatchInfo { /// The state root before applying the batch. - #[rkyv()] pub parent_state_root: B256, /// The batch hash of the parent batch. - #[rkyv()] pub parent_batch_hash: B256, /// The state root after applying txs in the batch. - #[rkyv()] pub state_root: B256, /// The batch header hash of the batch. - #[rkyv()] pub batch_hash: B256, /// The EIP-155 chain ID of all txs in the batch. - #[rkyv()] pub chain_id: u64, /// The withdraw root of the last block in the last chunk in the batch. - #[rkyv()] pub withdraw_root: B256, /// The L1 msg queue hash at the end of the previous batch. - #[rkyv()] pub prev_msg_queue_hash: B256, /// The L1 msg queue hash at the end of the current batch. - #[rkyv()] pub post_msg_queue_hash: B256, } -impl From<&ArchivedBatchInfo> for BatchInfo { - fn from(archived: &ArchivedBatchInfo) -> Self { - Self { - parent_state_root: archived.parent_state_root.into(), - parent_batch_hash: archived.parent_batch_hash.into(), - state_root: archived.state_root.into(), - batch_hash: archived.batch_hash.into(), - chain_id: archived.chain_id.into(), - withdraw_root: archived.withdraw_root.into(), - prev_msg_queue_hash: archived.prev_msg_queue_hash.into(), - post_msg_queue_hash: archived.post_msg_queue_hash.into(), - } - } -} - impl BatchInfo { /// Public input hash for a batch (euclidv1 or da-codec@v6) is defined as /// diff --git a/crates/types/base/src/public_inputs/chunk.rs b/crates/types/base/src/public_inputs/chunk.rs index 907713b8..15fefd1a 100644 --- a/crates/types/base/src/public_inputs/chunk.rs +++ b/crates/types/base/src/public_inputs/chunk.rs @@ -3,7 +3,7 @@ use crate::{ utils::keccak256, }; use alloy_primitives::{B256, U256}; -use sbv_primitives::types::{ +use sbv_primitives::{ consensus::BlockHeader, reth::primitives::{Block, RecoveredBlock}, }; @@ -14,17 +14,7 @@ pub const SIZE_BLOCK_CTX: usize = 52; /// Represents the version 2 of block context. /// /// The difference between v2 and v1 is that the block number field has been removed since v2. -#[derive( - Debug, - Clone, - PartialEq, - rkyv::Archive, - rkyv::Deserialize, - rkyv::Serialize, - serde::Deserialize, - serde::Serialize, -)] -#[rkyv(derive(Debug))] +#[derive(Debug, Clone, PartialEq, serde::Deserialize, serde::Serialize)] pub struct BlockContextV2 { /// The timestamp of the block. pub timestamp: u64, @@ -38,18 +28,6 @@ pub struct BlockContextV2 { pub num_l1_msgs: u16, } -impl From<&ArchivedBlockContextV2> for BlockContextV2 { - fn from(archived: &ArchivedBlockContextV2) -> Self { - Self { - timestamp: archived.timestamp.into(), - base_fee: archived.base_fee.into(), - gas_limit: archived.gas_limit.into(), - num_txs: archived.num_txs.into(), - num_l1_msgs: archived.num_l1_msgs.into(), - } - } -} - impl From<&[u8]> for BlockContextV2 { fn from(bytes: &[u8]) -> Self { assert_eq!(bytes.len(), SIZE_BLOCK_CTX); @@ -104,51 +82,31 @@ impl BlockContextV2 { } /// Represents header-like information for the chunk. -#[derive( - Debug, - Clone, - rkyv::Archive, - rkyv::Deserialize, - rkyv::Serialize, - serde::Deserialize, - serde::Serialize, -)] -#[rkyv(derive(Debug))] +#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)] pub struct ChunkInfo { /// The EIP-155 chain ID for all txs in the chunk. - #[rkyv()] pub chain_id: u64, /// The state root before applying the chunk. - #[rkyv()] pub prev_state_root: B256, /// The state root after applying the chunk. - #[rkyv()] pub post_state_root: B256, /// The withdrawals root after applying the chunk. - #[rkyv()] pub withdraw_root: B256, /// Digest of L1 message txs force included in the chunk. /// It is a legacy field and can be omitted in new defination - #[rkyv()] #[serde(default)] pub data_hash: B256, /// Digest of L2 tx data flattened over all L2 txs in the chunk. - #[rkyv()] pub tx_data_digest: B256, /// The L1 msg queue hash at the end of the previous chunk. - #[rkyv()] pub prev_msg_queue_hash: B256, /// The L1 msg queue hash at the end of the current chunk. - #[rkyv()] pub post_msg_queue_hash: B256, /// The length of rlp encoded L2 tx bytes flattened over all L2 txs in the chunk. - #[rkyv()] pub tx_data_length: u64, /// The block number of the first block in the chunk. - #[rkyv()] pub initial_block_number: u64, /// The block contexts of the blocks in the chunk. - #[rkyv()] pub block_ctxs: Vec, } @@ -214,28 +172,6 @@ impl ChunkInfo { } } -impl From<&ArchivedChunkInfo> for ChunkInfo { - fn from(archived: &ArchivedChunkInfo) -> Self { - Self { - chain_id: archived.chain_id.into(), - prev_state_root: archived.prev_state_root.into(), - post_state_root: archived.post_state_root.into(), - withdraw_root: archived.withdraw_root.into(), - data_hash: archived.data_hash.into(), - tx_data_digest: archived.tx_data_digest.into(), - prev_msg_queue_hash: archived.prev_msg_queue_hash.into(), - post_msg_queue_hash: archived.post_msg_queue_hash.into(), - tx_data_length: archived.tx_data_length.into(), - initial_block_number: archived.initial_block_number.into(), - block_ctxs: archived - .block_ctxs - .iter() - .map(BlockContextV2::from) - .collect(), - } - } -} - pub type VersionedChunkInfo = (ChunkInfo, ForkName); impl MultiVersionPublicInputs for ChunkInfo { diff --git a/crates/types/batch/Cargo.toml b/crates/types/batch/Cargo.toml index 95e82405..bced00ba 100644 --- a/crates/types/batch/Cargo.toml +++ b/crates/types/batch/Cargo.toml @@ -9,6 +9,7 @@ version.workspace = true [dependencies] alloy-primitives = { workspace = true } +bincode = { workspace = true } rkyv.workspace = true serde.workspace = true itertools.workspace = true diff --git a/crates/types/batch/src/header/mod.rs b/crates/types/batch/src/header/mod.rs index eaae2130..960d6463 100644 --- a/crates/types/batch/src/header/mod.rs +++ b/crates/types/batch/src/header/mod.rs @@ -25,8 +25,7 @@ pub trait BatchHeader { /// Reference header indicate the version of batch header base on which batch hash /// should be calculated. -#[derive(Clone, Debug, rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub enum ReferenceHeader { /// Represents DA-codec v6. V6(v6::BatchHeaderV6), diff --git a/crates/types/batch/src/header/v6.rs b/crates/types/batch/src/header/v6.rs index 9a95c835..c44862f7 100644 --- a/crates/types/batch/src/header/v6.rs +++ b/crates/types/batch/src/header/v6.rs @@ -3,45 +3,25 @@ use alloy_primitives::B256; use types_base::utils::keccak256; /// Represents the header summarising the batch of chunks as per DA-codec v6. -#[derive( - Clone, - Copy, - Debug, - Default, - rkyv::Archive, - rkyv::Deserialize, - rkyv::Serialize, - serde::Deserialize, - serde::Serialize, -)] -#[rkyv(derive(Debug))] +#[derive(Clone, Copy, Debug, Default, serde::Deserialize, serde::Serialize)] pub struct BatchHeaderV6 { /// The DA-codec version for the batch. - #[rkyv()] pub version: u8, /// The index of the batch - #[rkyv()] pub batch_index: u64, /// Number of L1 messages popped in the batch - #[rkyv()] pub l1_message_popped: u64, /// Number of total L1 messages popped after the batch - #[rkyv()] pub total_l1_message_popped: u64, /// The parent batch hash - #[rkyv()] pub parent_batch_hash: B256, /// The timestamp of the last block in this batch - #[rkyv()] pub last_block_timestamp: u64, /// The data hash of the batch - #[rkyv()] pub data_hash: B256, /// The versioned hash of the blob with this batch's data - #[rkyv()] pub blob_versioned_hash: B256, /// The blob data proof: z (32), y (32) - #[rkyv()] pub blob_data_proof: [B256; 2], } @@ -94,66 +74,3 @@ impl BatchHeader for BatchHeaderV6 { self.blob_versioned_hash } } - -impl BatchHeader for ArchivedBatchHeaderV6 { - fn version(&self) -> u8 { - self.version - } - - fn index(&self) -> u64 { - self.batch_index.into() - } - - fn parent_batch_hash(&self) -> B256 { - self.parent_batch_hash.into() - } - - fn batch_hash(&self) -> B256 { - let batch_index: u64 = self.batch_index.into(); - let l1_message_popped: u64 = self.l1_message_popped.into(); - let total_l1_message_popped: u64 = self.total_l1_message_popped.into(); - let data_hash: B256 = self.data_hash.into(); - let blob_versioned_hash: B256 = self.blob_versioned_hash.into(); - let parent_batch_hash: B256 = self.parent_batch_hash.into(); - let last_block_timestamp: u64 = self.last_block_timestamp.into(); - let blob_data_proof: [B256; 2] = self.blob_data_proof.map(|h| h.into()); - keccak256( - std::iter::empty() - .chain(vec![self.version].as_slice()) - .chain(batch_index.to_be_bytes().as_slice()) - .chain(l1_message_popped.to_be_bytes().as_slice()) - .chain(total_l1_message_popped.to_be_bytes().as_slice()) - .chain(data_hash.as_slice()) - .chain(blob_versioned_hash.as_slice()) - .chain(parent_batch_hash.as_slice()) - .chain(last_block_timestamp.to_be_bytes().as_slice()) - .chain(blob_data_proof[0].as_slice()) - .chain(blob_data_proof[1].as_slice()) - .cloned() - .collect::>(), - ) - } - - fn blob_versioned_hash(&self) -> B256 { - self.blob_versioned_hash.into() - } -} - -impl From<&ArchivedBatchHeaderV6> for BatchHeaderV6 { - fn from(archived: &ArchivedBatchHeaderV6) -> Self { - Self { - version: archived.version, - batch_index: archived.batch_index.into(), - l1_message_popped: archived.l1_message_popped.into(), - total_l1_message_popped: archived.total_l1_message_popped.into(), - parent_batch_hash: archived.parent_batch_hash.into(), - last_block_timestamp: archived.last_block_timestamp.into(), - data_hash: archived.data_hash.into(), - blob_versioned_hash: archived.blob_versioned_hash.into(), - blob_data_proof: [ - archived.blob_data_proof[0].into(), - archived.blob_data_proof[1].into(), - ], - } - } -} diff --git a/crates/types/batch/src/header/v7.rs b/crates/types/batch/src/header/v7.rs index e70600c9..69379cf8 100644 --- a/crates/types/batch/src/header/v7.rs +++ b/crates/types/batch/src/header/v7.rs @@ -4,30 +4,15 @@ use super::BatchHeader; use types_base::utils::keccak256; /// Represents the header summarising the batch of chunks as per DA-codec v7. -#[derive( - Clone, - Copy, - Debug, - Default, - rkyv::Archive, - rkyv::Deserialize, - rkyv::Serialize, - serde::Deserialize, - serde::Serialize, -)] -#[rkyv(derive(Debug))] +#[derive(Clone, Copy, Debug, Default, serde::Deserialize, serde::Serialize)] pub struct BatchHeaderV7 { /// The DA-codec version for the batch. - #[rkyv()] pub version: u8, /// The index of the batch - #[rkyv()] pub batch_index: u64, /// The parent batch hash - #[rkyv()] pub parent_batch_hash: B256, /// The versioned hash of the blob with this batch's data - #[rkyv()] pub blob_versioned_hash: B256, } @@ -68,47 +53,3 @@ impl BatchHeader for BatchHeaderV7 { self.blob_versioned_hash } } - -impl BatchHeader for ArchivedBatchHeaderV7 { - fn version(&self) -> u8 { - self.version - } - - fn index(&self) -> u64 { - self.batch_index.into() - } - - fn parent_batch_hash(&self) -> B256 { - self.parent_batch_hash.into() - } - - fn batch_hash(&self) -> B256 { - let batch_index: u64 = self.batch_index.into(); - let blob_versioned_hash: B256 = self.blob_versioned_hash.into(); - let parent_batch_hash: B256 = self.parent_batch_hash.into(); - keccak256( - std::iter::empty() - .chain(vec![self.version].as_slice()) - .chain(batch_index.to_be_bytes().as_slice()) - .chain(blob_versioned_hash.as_slice()) - .chain(parent_batch_hash.as_slice()) - .cloned() - .collect::>(), - ) - } - - fn blob_versioned_hash(&self) -> B256 { - self.blob_versioned_hash.into() - } -} - -impl From<&ArchivedBatchHeaderV7> for BatchHeaderV7 { - fn from(archived: &ArchivedBatchHeaderV7) -> Self { - Self { - version: archived.version, - batch_index: archived.batch_index.into(), - parent_batch_hash: archived.parent_batch_hash.into(), - blob_versioned_hash: archived.blob_versioned_hash.into(), - } - } -} diff --git a/crates/types/batch/src/header/v8.rs b/crates/types/batch/src/header/v8.rs index 0d8dec8e..8a18c852 100644 --- a/crates/types/batch/src/header/v8.rs +++ b/crates/types/batch/src/header/v8.rs @@ -1,7 +1,4 @@ -use crate::{ArchivedBatchHeaderV7, BatchHeaderV7}; +use crate::BatchHeaderV7; /// There is no difference in the header structure between da-codec@v7 and da-codec@v8. pub type BatchHeaderV8 = BatchHeaderV7; - -/// There is no difference in the header structure between da-codec@v7 and da-codec@v8. -pub type ArchivedBatchHeaderV8 = ArchivedBatchHeaderV7; diff --git a/crates/types/batch/src/lib.rs b/crates/types/batch/src/lib.rs index c9c38dca..ea653ae0 100644 --- a/crates/types/batch/src/lib.rs +++ b/crates/types/batch/src/lib.rs @@ -1,9 +1,6 @@ mod header; pub use header::{ - ArchivedReferenceHeader, BatchHeader, ReferenceHeader, - v6::{ArchivedBatchHeaderV6, BatchHeaderV6}, - v7::{ArchivedBatchHeaderV7, BatchHeaderV7}, - v8::{ArchivedBatchHeaderV8, BatchHeaderV8}, + BatchHeader, ReferenceHeader, v6::BatchHeaderV6, v7::BatchHeaderV7, v8::BatchHeaderV8, }; mod payload; @@ -18,4 +15,4 @@ mod blob_consistency; mod builder; mod witness; -pub use witness::{ArchivedBatchWitness, BatchWitness, Bytes48, PointEvalWitness}; +pub use witness::{BatchWitness, Bytes48, PointEvalWitness}; diff --git a/crates/types/batch/src/witness.rs b/crates/types/batch/src/witness.rs index e6f75a9a..6c201fe1 100644 --- a/crates/types/batch/src/witness.rs +++ b/crates/types/batch/src/witness.rs @@ -1,5 +1,5 @@ use types_base::{ - aggregation::{AggregationInput, ProgramCommitment, ProofCarryingWitness}, + aggregation::{AggregationInput, ProofCarryingWitness}, public_inputs::{ForkName, batch::BatchInfo, chunk::ChunkInfo}, }; @@ -8,71 +8,83 @@ use crate::{ BatchInfoBuilder, BatchInfoBuilderV6, BatchInfoBuilderV7, BatchInfoBuilderV8, BuilderArgsV6, BuilderArgsV7, BuilderArgsV8, }, - header::{ArchivedReferenceHeader, ReferenceHeader}, + header::ReferenceHeader, }; - -/// Simply rewrap byte48 to avoid unnecessary dep pub type Bytes48 = [u8; 48]; +mod array48 { + use serde::{Deserialize, Deserializer, Serializer}; + + pub fn serialize(array: &[u8; 48], serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_bytes(array) + } + + pub fn deserialize<'de, D>(deserializer: D) -> Result<[u8; 48], D::Error> + where + D: Deserializer<'de>, + { + let bytes: &[u8] = serde::Deserialize::deserialize(deserializer)?; + bytes.try_into().map_err(|_| { + let msg = format!("expected a byte array of length 48 but got {}", bytes.len()); + serde::de::Error::custom(msg) + }) + } +} /// Witness required by applying point evaluation -#[derive(Clone, Debug, rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub struct PointEvalWitness { /// kzg commitment - #[rkyv()] - pub kzg_commitment: Bytes48, + #[serde(with = "array48")] + pub kzg_commitment: [u8; 48], /// kzg proof - #[rkyv()] - pub kzg_proof: Bytes48, + #[serde(with = "array48")] + pub kzg_proof: [u8; 48], } /// Witness to the batch circuit. -#[derive(Clone, Debug, rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub struct BatchWitness { /// Flattened root proofs from all chunks in the batch. - #[rkyv()] pub chunk_proofs: Vec, /// Chunk infos. - #[rkyv()] pub chunk_infos: Vec, /// Blob bytes. - #[rkyv()] pub blob_bytes: Vec, /// Witness for point evaluation pub point_eval_witness: PointEvalWitness, /// Header for reference. - #[rkyv()] pub reference_header: ReferenceHeader, /// The code version specify the chain spec - #[rkyv()] pub fork_name: ForkName, } -impl ProofCarryingWitness for ArchivedBatchWitness { +impl BatchWitness { + pub fn bincode_serialize( + &self, + guest_version: Option, + ) -> Result, bincode::error::EncodeError> { + let config = bincode::config::standard(); + bincode::serde::encode_to_vec(&self, config) + } +} + +impl ProofCarryingWitness for BatchWitness { fn get_proofs(&self) -> Vec { - self.chunk_proofs - .iter() - .map(|archived| AggregationInput { - public_values: archived - .public_values - .iter() - .map(|u32_le| u32_le.to_native()) - .collect(), - commitment: ProgramCommitment::from(&archived.commitment), - }) - .collect() + self.chunk_proofs.clone() } } -impl From<&ArchivedBatchWitness> for BatchInfo { - fn from(witness: &ArchivedBatchWitness) -> Self { - let chunk_infos: Vec = witness.chunk_infos.iter().map(|ci| ci.into()).collect(); +impl From<&BatchWitness> for BatchInfo { + fn from(witness: &BatchWitness) -> Self { + let chunk_infos: Vec = witness.chunk_infos.clone(); match &witness.reference_header { - ArchivedReferenceHeader::V6(header) => { + ReferenceHeader::V6(header) => { let args = BuilderArgsV6 { - header: header.into(), + header: header.clone(), chunk_infos, blob_bytes: witness.blob_bytes.to_vec(), kzg_commitment: None, @@ -80,9 +92,9 @@ impl From<&ArchivedBatchWitness> for BatchInfo { }; BatchInfoBuilderV6::build(args) } - ArchivedReferenceHeader::V7(header) => { + ReferenceHeader::V7(header) => { let args = BuilderArgsV7 { - header: header.into(), + header: header.clone(), chunk_infos, blob_bytes: witness.blob_bytes.to_vec(), kzg_commitment: Some(witness.point_eval_witness.kzg_commitment), @@ -90,9 +102,9 @@ impl From<&ArchivedBatchWitness> for BatchInfo { }; BatchInfoBuilderV7::build(args) } - ArchivedReferenceHeader::V8(header) => { + ReferenceHeader::V8(header) => { let args = BuilderArgsV8 { - header: header.into(), + header: header.clone(), chunk_infos, blob_bytes: witness.blob_bytes.to_vec(), kzg_commitment: Some(witness.point_eval_witness.kzg_commitment), diff --git a/crates/types/bundle/Cargo.toml b/crates/types/bundle/Cargo.toml index 04d57428..f176a274 100644 --- a/crates/types/bundle/Cargo.toml +++ b/crates/types/bundle/Cargo.toml @@ -9,6 +9,7 @@ version.workspace = true [dependencies] alloy-primitives = { workspace = true } +bincode = { workspace = true } rkyv.workspace = true serde.workspace = true itertools.workspace = true diff --git a/crates/types/bundle/src/lib.rs b/crates/types/bundle/src/lib.rs index 6688df56..ec12827d 100644 --- a/crates/types/bundle/src/lib.rs +++ b/crates/types/bundle/src/lib.rs @@ -1,2 +1,2 @@ mod witness; -pub use witness::{ArchivedBundleWitness, BundleWitness}; +pub use witness::BundleWitness; diff --git a/crates/types/bundle/src/witness.rs b/crates/types/bundle/src/witness.rs index 2e1c129c..46a512c1 100644 --- a/crates/types/bundle/src/witness.rs +++ b/crates/types/bundle/src/witness.rs @@ -6,29 +6,22 @@ use types_base::{ }; /// The witness for the bundle circuit. -#[derive(Clone, Debug, rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug)] pub struct BundleWitnessEuclid { /// Batch proofs being aggregated in the bundle. - #[rkyv()] pub batch_proofs: Vec, /// Public-input values for the corresponding batch proofs. - #[rkyv()] pub batch_infos: Vec, } /// The witness for the bundle circuit. -#[derive(Clone, Debug, rkyv::Archive, rkyv::Deserialize, rkyv::Serialize)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub struct BundleWitness { /// Batch proofs being aggregated in the bundle. - #[rkyv()] pub batch_proofs: Vec, /// Public-input values for the corresponding batch proofs. - #[rkyv()] pub batch_infos: Vec, /// The code version specify the chain spec - #[rkyv()] pub fork_name: ForkName, } @@ -41,39 +34,31 @@ impl BundleWitness { } } /// See ChunkWitnessEuclid::rkyv_serialize for details. - pub fn rkyv_serialize( + pub fn bincode_serialize( &self, guest_version: Option, - ) -> Result { - let guest_version = guest_version.unwrap_or(self.fork_name); - if guest_version >= ForkName::Feynman { - // Use the new rkyv serialization for Feynman and later forks - rkyv::to_bytes::(self) - } else { - // Use the old rkyv serialization for earlier forks - rkyv::to_bytes::(&self.clone().into_euclid()) - } + ) -> Result, bincode::error::EncodeError> { + let config = bincode::config::standard(); + bincode::serde::encode_to_vec(&self, config) + // let guest_version = guest_version.unwrap_or(self.fork_name); + // if guest_version >= ForkName::Feynman { + // Use the new rkyv serialization for Feynman and later forks + // rkyv::to_bytes::(self) + // } else { + // Use the old rkyv serialization for earlier forks + // rkyv::to_bytes::(&self.clone().into_euclid()) + // } } } -impl ProofCarryingWitness for ArchivedBundleWitness { +impl ProofCarryingWitness for BundleWitness { fn get_proofs(&self) -> Vec { - self.batch_proofs - .iter() - .map(|archived| AggregationInput { - public_values: archived - .public_values - .iter() - .map(|u32_le| u32_le.to_native()) - .collect(), - commitment: ProgramCommitment::from(&archived.commitment), - }) - .collect() + self.batch_proofs.clone() } } -impl From<&ArchivedBundleWitness> for BundleInfo { - fn from(witness: &ArchivedBundleWitness) -> Self { +impl From<&BundleWitness> for BundleInfo { + fn from(witness: &BundleWitness) -> Self { assert!( !witness.batch_infos.is_empty(), "at least one batch in a bundle" diff --git a/crates/types/chunk/src/execute.rs b/crates/types/chunk/src/execute.rs index 170374d9..d770281c 100644 --- a/crates/types/chunk/src/execute.rs +++ b/crates/types/chunk/src/execute.rs @@ -1,5 +1,6 @@ use crate::{ - make_providers, manually_drop_on_zkvm, witness::{ArchivedStateCommitMode, StateCommitMode}, ArchivedChunkWitness, BlockHashProvider, ChunkWitness, CodeDb, NodesProvider + BlockHashProvider, ChunkWitness, CodeDb, NodesProvider, make_providers, manually_drop_on_zkvm, + witness::StateCommitMode, }; use alloy_primitives::B256; use itertools::Itertools; @@ -13,10 +14,8 @@ use sbv_primitives::{ }, ext::{BlockWitnessChunkExt, BlockWitnessRethExt as _, TxBytesHashExt}, hardforks::SCROLL_DEV_HARDFORKS, - types::{ - reth::primitives::{Block, RecoveredBlock}, - scroll::ChunkInfoBuilder, - }, + reth::primitives::{Block, RecoveredBlock}, + scroll::ChunkInfoBuilder, }; use std::sync::Arc; use types_base::{fork_name::ForkName, public_inputs::chunk::ChunkInfo}; @@ -47,7 +46,7 @@ pub fn execute(witness: &Witness) -> Result { let pre_state_root = witness.blocks[0].pre_state_root; let fork_name = ForkName::from(witness.fork_name.clone()); - let chain = Chain::from_id(witness.blocks[0].chain_id()); + let chain = Chain::from_id(witness.blocks[0].chain_id); // SCROLL_DEV_HARDFORKS will enable all forks let mut hardforks = (*SCROLL_DEV_HARDFORKS).clone(); @@ -71,13 +70,12 @@ pub fn execute(witness: &Witness) -> Result { let code_db = manually_drop_on_zkvm!(code_db); let nodes_provider = manually_drop_on_zkvm!(nodes_provider); - let prev_state_root = witness.blocks[0].pre_state_root(); + let prev_state_root = witness.blocks[0].pre_state_root; let state_commit_mode = &witness.state_commit_mode; println!("state_commit_mode: {:?}", state_commit_mode); - let compression_ratios = witness - .compression_ratios.clone(); + let compression_ratios = witness.compression_ratios.clone(); let (post_state_root, withdraw_root) = match state_commit_mode { StateCommitMode::Chunk | StateCommitMode::Block => execute_inner( diff --git a/crates/types/chunk/src/lib.rs b/crates/types/chunk/src/lib.rs index 77dee895..acfaf52b 100644 --- a/crates/types/chunk/src/lib.rs +++ b/crates/types/chunk/src/lib.rs @@ -5,7 +5,7 @@ mod utils; mod witness; pub use utils::{BlockHashProvider, CodeDb, NodesProvider, make_providers}; -pub use witness::{ArchivedChunkWitness, ChunkWitness}; +pub use witness::ChunkWitness; mod execute; pub use execute::execute; diff --git a/crates/types/chunk/src/utils.rs b/crates/types/chunk/src/utils.rs index ebd538d6..7afa4f57 100644 --- a/crates/types/chunk/src/utils.rs +++ b/crates/types/chunk/src/utils.rs @@ -8,19 +8,17 @@ pub type NodesProvider = NoHashMap; pub type BlockHashProvider = sbv_kv::null::NullProvider; -pub fn make_providers( - witnesses: &[W], -) -> (CodeDb, NodesProvider, BlockHashProvider) { +pub fn make_providers(witnesses: &[BlockWitness]) -> (CodeDb, NodesProvider, BlockHashProvider) { let code_db = { // build code db - let num_codes = witnesses.iter().map(|w| w.codes_iter().len()).sum(); + let num_codes = witnesses.iter().map(|w| w.codes.len()).sum(); let mut code_db = NoHashMap::::with_capacity_and_hasher(num_codes, Default::default()); witnesses.import_codes(&mut code_db); code_db }; let nodes_provider = { - let num_states = witnesses.iter().map(|w| w.states_iter().len()).sum(); + let num_states = witnesses.iter().map(|w| w.states.len()).sum(); let mut nodes_provider = NoHashMap::::with_capacity_and_hasher(num_states, Default::default()); witnesses.import_nodes(&mut nodes_provider).unwrap(); diff --git a/crates/types/chunk/src/witness.rs b/crates/types/chunk/src/witness.rs index 67d24ff7..f4613fde 100644 --- a/crates/types/chunk/src/witness.rs +++ b/crates/types/chunk/src/witness.rs @@ -1,21 +1,12 @@ use alloy_primitives::B256; use rkyv::util::AlignedVec; -use sbv_primitives::{U256, types::BlockWitness}; +use sbv_primitives::{BlockWitness, U256}; use std::collections::HashSet; use types_base::{fork_name::ForkName, public_inputs::chunk::ChunkInfo}; /// The witness type accepted by the chunk-circuit. -#[derive( - Clone, - Debug, - serde::Deserialize, - serde::Serialize, - rkyv::Archive, - rkyv::Deserialize, - rkyv::Serialize, -)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub struct ChunkWitnessEuclid { /// The block witness for each block in the chunk. pub blocks: Vec, @@ -25,16 +16,7 @@ pub struct ChunkWitnessEuclid { pub fork_name: ForkName, } -#[derive( - Clone, - Debug, - serde::Deserialize, - serde::Serialize, - rkyv::Archive, - rkyv::Deserialize, - rkyv::Serialize, -)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub enum StateCommitMode { Chunk, Block, @@ -42,16 +24,7 @@ pub enum StateCommitMode { } /// The witness type accepted by the chunk-circuit. -#[derive( - Clone, - Debug, - serde::Deserialize, - serde::Serialize, - rkyv::Archive, - rkyv::Deserialize, - rkyv::Serialize, -)] -#[rkyv(derive(Debug))] +#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] pub struct ChunkWitness { /// The block witness for each block in the chunk. pub blocks: Vec, @@ -120,7 +93,7 @@ impl ChunkWitness { guest_version: Option, ) -> Result, bincode::error::EncodeError> { let config = bincode::config::standard(); - bincode::serde::encode_to_vec(&self, config) + bincode::serde::encode_to_vec(&self, config) } /// `guest_version` is related to the guest program. /// It is not always same with the evm hardfork. @@ -131,14 +104,15 @@ impl ChunkWitness { &self, guest_version: Option, ) -> Result { - let guest_version = guest_version.unwrap_or(self.fork_name); - if guest_version >= ForkName::Feynman { - // Use the new rkyv serialization for Feynman and later forks - rkyv::to_bytes::(self) - } else { - // Use the old rkyv serialization for earlier forks - rkyv::to_bytes::(&self.clone().into_euclid()) - } + todo!(); + // let guest_version = guest_version.unwrap_or(self.fork_name); + // if guest_version >= ForkName::Feynman { + // Use the new rkyv serialization for Feynman and later forks + // rkyv::to_bytes::(self) + // } else { + // Use the old rkyv serialization for earlier forks + // rkyv::to_bytes::(&self.clone().into_euclid()) + // } } } diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index a3967ffc..852f421f 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -3,57 +3,18 @@ pub mod bundle { pub use types_base::public_inputs::bundle::BundleInfo; pub use types_bundle::*; - - pub struct ToArchievedWitness(pub rkyv::util::AlignedVec); - impl ToArchievedWitness { - pub fn create(witness: &BundleWitness) -> Result { - rkyv::to_bytes::(witness) - .map_err(|e| format!("failed to serialize bundle witness: {e}")) - .map(Self) - } - pub fn access(&self) -> Result<&ArchivedBundleWitness, String> { - rkyv::access::(&self.0) - .map_err(|e| format!("rkyv deserialisation of bundle witness bytes failed: {e}")) - } - } } pub mod batch { - pub use types_base::public_inputs::batch::{ArchivedBatchInfo, BatchInfo, VersionedBatchInfo}; + pub use types_base::public_inputs::batch::{BatchInfo, VersionedBatchInfo}; pub use types_batch::*; - - pub struct ToArchievedWitness(pub rkyv::util::AlignedVec); - impl ToArchievedWitness { - pub fn create(witness: &BatchWitness) -> Result { - rkyv::to_bytes::(witness) - .map_err(|e| format!("failed to serialize batch witness: {e}")) - .map(Self) - } - pub fn access(&self) -> Result<&ArchivedBatchWitness, String> { - rkyv::access::(&self.0) - .map_err(|e| format!("rkyv deserialisation of batch witness bytes failed: {e}")) - } - } } pub mod chunk { pub use types_base::public_inputs::chunk::{ - ArchivedChunkInfo, BlockContextV2, ChunkInfo, SIZE_BLOCK_CTX, VersionedChunkInfo, + BlockContextV2, ChunkInfo, SIZE_BLOCK_CTX, VersionedChunkInfo, }; pub use types_chunk::*; - - pub struct ToArchievedWitness(pub rkyv::util::AlignedVec); - impl ToArchievedWitness { - pub fn create(witness: &ChunkWitness) -> Result { - rkyv::to_bytes::(witness) - .map_err(|e| format!("failed to serialize chunk witness: {e}")) - .map(Self) - } - pub fn access(&self) -> Result<&ArchivedChunkWitness, String> { - rkyv::access::(&self.0) - .map_err(|e| format!("rkyv deserialisation of chunk witness bytes failed: {e}")) - } - } } pub use types_base::{aggregation as types_agg, environ, public_inputs, utils}; From a5c39d40fb5c77f407eb7fc9e43e20f2f6a1d8b4 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Mon, 4 Aug 2025 11:36:55 +0000 Subject: [PATCH 3/4] fix --- Cargo.lock | 23 +++++++++++++++++------ crates/integration/src/testers/chunk.rs | 5 +++-- crates/types/chunk/src/witness.rs | 11 ++++++++++- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2f4c9b0..b4fe1a3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1445,6 +1445,15 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "convert_case" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baaaa0ecca5b51987b9423ccdc971514dd8b0bb7b4060b983d3664dad3f1f89f" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -6457,7 +6466,7 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "sbv-core" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#89d95494723463d3621b0afe13475f0dd5131ef3" dependencies = [ "sbv-helpers", "sbv-kv", @@ -6470,7 +6479,7 @@ dependencies = [ [[package]] name = "sbv-helpers" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#89d95494723463d3621b0afe13475f0dd5131ef3" dependencies = [ "tracing", ] @@ -6478,7 +6487,7 @@ dependencies = [ [[package]] name = "sbv-kv" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#89d95494723463d3621b0afe13475f0dd5131ef3" dependencies = [ "auto_impl", "hashbrown 0.15.4", @@ -6488,7 +6497,7 @@ dependencies = [ [[package]] name = "sbv-precompile" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#89d95494723463d3621b0afe13475f0dd5131ef3" dependencies = [ "openvm-ecc-guest 1.3.0", "openvm-pairing", @@ -6499,7 +6508,7 @@ dependencies = [ [[package]] name = "sbv-primitives" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#89d95494723463d3621b0afe13475f0dd5131ef3" dependencies = [ "alloy-consensus", "alloy-eips 1.0.23", @@ -6507,6 +6516,7 @@ dependencies = [ "alloy-primitives", "alloy-serde 1.0.23", "auto_impl", + "convert_case 0.8.0", "itertools 0.14.0", "reth-chainspec", "reth-ethereum-forks", @@ -6526,13 +6536,14 @@ dependencies = [ "scroll-alloy-consensus", "scroll-alloy-evm", "serde", + "serde_json", "tiny-keccak", ] [[package]] name = "sbv-trie" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#1d2988c41279c32d9c48eb0b328ca9342823784d" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=feat%2Fbump-reth#89d95494723463d3621b0afe13475f0dd5131ef3" dependencies = [ "alloy-rlp", "alloy-trie", diff --git a/crates/integration/src/testers/chunk.rs b/crates/integration/src/testers/chunk.rs index b48b4204..623f885b 100644 --- a/crates/integration/src/testers/chunk.rs +++ b/crates/integration/src/testers/chunk.rs @@ -32,8 +32,9 @@ where println!("File not found: {:?}", path_witness.as_ref()); return Err(eyre::eyre!("File not found: {:?}", path_witness.as_ref())); } - let witness = File::open(path_witness)?; - Ok(serde_json::from_reader::<_, BlockWitness>(witness)?) + let content = std::fs::read(path_witness)?; + let result = BlockWitness::from_json_slice(&content)?; + Ok(result) } pub struct ChunkProverTester; diff --git a/crates/types/chunk/src/witness.rs b/crates/types/chunk/src/witness.rs index f4613fde..0a4c7ba8 100644 --- a/crates/types/chunk/src/witness.rs +++ b/crates/types/chunk/src/witness.rs @@ -69,7 +69,16 @@ impl ChunkWitness { .collect(); let compression_ratios = blocks .iter() - .map(|block| block.compression_ratios()) + .map(|block| { + #[cfg(feature = "scroll-compress-ratio")] + { + block.compression_ratios() + } + #[cfg(not(feature = "scroll-compress-ratio"))] + { + unimplemented!(); + } + }) .collect(); Self { From e6fd098a06dfded7329a9d553ba74c6a98e6fc85 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Wed, 6 Aug 2025 22:16:25 +0800 Subject: [PATCH 4/4] cargo check --- crates/integration/src/lib.rs | 4 ++-- crates/integration/src/testers/batch.rs | 2 +- crates/integration/src/testers/bundle.rs | 2 +- crates/integration/src/utils/mod.rs | 15 +++------------ crates/types/src/utils.rs | 2 +- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/crates/integration/src/lib.rs b/crates/integration/src/lib.rs index 7dd1d012..a57235a2 100644 --- a/crates/integration/src/lib.rs +++ b/crates/integration/src/lib.rs @@ -72,10 +72,10 @@ static DIR_TESTRUN: OnceCell = OnceCell::new(); /// Circuit that implements functionality required to run e2e tests in specified phase (chunk/batch/bundle). pub trait ProverTester { /// Tester witness type - type Witness: rkyv::Archive + PartialProvingTask; + type Witness: PartialProvingTask;// + rkyv::Archive; /// Tester metadata type - type Metadata: for<'a> TryFrom<&'a ::Archived>; + type Metadata;//: for<'a> TryFrom<&'a ::Archived>; /// Naming for tester const NAME: &str; diff --git a/crates/integration/src/testers/batch.rs b/crates/integration/src/testers/batch.rs index 4faeff4f..e96a7c59 100644 --- a/crates/integration/src/testers/batch.rs +++ b/crates/integration/src/testers/batch.rs @@ -24,7 +24,7 @@ impl PartialProvingTask for BatchWitness { } fn write_guest_input(&self, stdin: &mut openvm_sdk::StdIn) -> Result<(), rkyv::rancor::Error> { - let b = rkyv::to_bytes::(self)?; + let b = self.bincode_serialize(None).unwrap(); stdin.write_bytes(b.as_slice()); Ok(()) } diff --git a/crates/integration/src/testers/bundle.rs b/crates/integration/src/testers/bundle.rs index 76cb5255..e6bfc42a 100644 --- a/crates/integration/src/testers/bundle.rs +++ b/crates/integration/src/testers/bundle.rs @@ -28,7 +28,7 @@ impl PartialProvingTask for BundleWitness { } fn write_guest_input(&self, stdin: &mut openvm_sdk::StdIn) -> Result<(), rkyv::rancor::Error> { - let b = self.rkyv_serialize(None)?; + let b = self.bincode_serialize(None).unwrap(); stdin.write_bytes(b.as_slice()); Ok(()) } diff --git a/crates/integration/src/utils/mod.rs b/crates/integration/src/utils/mod.rs index 46069c9e..9bcbb742 100644 --- a/crates/integration/src/utils/mod.rs +++ b/crates/integration/src/utils/mod.rs @@ -104,26 +104,17 @@ impl From<&BatchHeaderV7> for LastHeader { } pub fn metadata_from_chunk_witnesses(witness: &ChunkWitness) -> eyre::Result { - use scroll_zkvm_types::chunk::ArchivedChunkWitness; - let bytes = witness.rkyv_serialize(None)?; - let archieved_wit = rkyv::access::(&bytes)?; - archieved_wit + witness .try_into() .map_err(|e| eyre::eyre!("get chunk metadata fail {e}")) } pub fn metadata_from_batch_witnesses(witness: &BatchWitness) -> eyre::Result { - use scroll_zkvm_types::batch::ArchivedBatchWitness; - let bytes = rkyv::to_bytes::(witness)?; - let archieved_wit = rkyv::access::(&bytes)?; - Ok(archieved_wit.into()) + Ok(witness.into()) } pub fn metadata_from_bundle_witnesses(witness: &BundleWitness) -> eyre::Result { - use scroll_zkvm_types::bundle::ArchivedBundleWitness; - let bytes = witness.rkyv_serialize(None)?; - let archieved_wit = rkyv::access::(&bytes)?; - Ok(archieved_wit.into()) + Ok(witness.into()) } pub fn build_batch_witnesses( diff --git a/crates/types/src/utils.rs b/crates/types/src/utils.rs index 48c04264..15c3d79f 100644 --- a/crates/types/src/utils.rs +++ b/crates/types/src/utils.rs @@ -41,7 +41,7 @@ pub mod as_base64 { pub mod point_eval { use super::sha256_rv32; use c_kzg; - use sbv_primitives::{B256 as H256, U256, types::eips::eip4844::BLS_MODULUS}; + use sbv_primitives::{B256 as H256, U256, eips::eip4844::BLS_MODULUS}; /// Given the blob-envelope, translate it to a fixed size EIP-4844 blob. ///