From 0ca85b75acab7e632b909c95092ad1ebba10f70f Mon Sep 17 00:00:00 2001 From: lightsing Date: Mon, 10 Nov 2025 15:53:04 +0800 Subject: [PATCH 1/6] wip --- Cargo.lock | 96 ++++++++++++------------ crates/types/chunk/Cargo.toml | 4 +- crates/types/chunk/src/scroll/execute.rs | 2 +- crates/types/chunk/src/scroll/witness.rs | 49 ++++++++++-- 4 files changed, 95 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca004be0..c207238e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1673,7 +1673,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2359,7 +2359,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.0", ] [[package]] @@ -6296,7 +6296,7 @@ dependencies = [ [[package]] name = "reth-chainspec" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-chains", "alloy-consensus", @@ -6316,7 +6316,7 @@ dependencies = [ [[package]] name = "reth-codecs" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6334,7 +6334,7 @@ dependencies = [ [[package]] name = "reth-codecs-derive" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "proc-macro2", "quote", @@ -6344,7 +6344,7 @@ dependencies = [ [[package]] name = "reth-consensus" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -6357,7 +6357,7 @@ dependencies = [ [[package]] name = "reth-consensus-common" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6369,7 +6369,7 @@ dependencies = [ [[package]] name = "reth-db-models" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-eips 1.0.38", "alloy-primitives", @@ -6379,7 +6379,7 @@ dependencies = [ [[package]] name = "reth-errors" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "reth-consensus", "reth-execution-errors", @@ -6390,7 +6390,7 @@ dependencies = [ [[package]] name = "reth-ethereum-consensus" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6406,7 +6406,7 @@ dependencies = [ [[package]] name = "reth-ethereum-forks" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-eip2124", "alloy-hardforks", @@ -6418,7 +6418,7 @@ dependencies = [ [[package]] name = "reth-ethereum-primitives" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6435,7 +6435,7 @@ dependencies = [ [[package]] name = "reth-evm" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6457,7 +6457,7 @@ dependencies = [ [[package]] name = "reth-evm-ethereum" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6477,7 +6477,7 @@ dependencies = [ [[package]] name = "reth-execution-errors" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-evm", "alloy-primitives", @@ -6490,7 +6490,7 @@ dependencies = [ [[package]] name = "reth-execution-types" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6506,7 +6506,7 @@ dependencies = [ [[package]] name = "reth-network-peers" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -6518,7 +6518,7 @@ dependencies = [ [[package]] name = "reth-primitives" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "once_cell", @@ -6531,7 +6531,7 @@ dependencies = [ [[package]] name = "reth-primitives-traits" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6559,7 +6559,7 @@ dependencies = [ [[package]] name = "reth-prune-types" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-primitives", "derive_more 2.0.1", @@ -6569,7 +6569,7 @@ dependencies = [ [[package]] name = "reth-revm" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-primitives", "reth-primitives-traits", @@ -6581,7 +6581,7 @@ dependencies = [ [[package]] name = "reth-scroll-chainspec" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-chains", "alloy-consensus", @@ -6606,7 +6606,7 @@ dependencies = [ [[package]] name = "reth-scroll-evm" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6636,7 +6636,7 @@ dependencies = [ [[package]] name = "reth-scroll-forks" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-chains", "alloy-primitives", @@ -6650,7 +6650,7 @@ dependencies = [ [[package]] name = "reth-scroll-primitives" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6667,7 +6667,7 @@ dependencies = [ [[package]] name = "reth-stages-types" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-primitives", "reth-trie-common", @@ -6676,7 +6676,7 @@ dependencies = [ [[package]] name = "reth-stateless" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -6702,7 +6702,7 @@ dependencies = [ [[package]] name = "reth-static-file-types" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-primitives", "derive_more 2.0.1", @@ -6713,7 +6713,7 @@ dependencies = [ [[package]] name = "reth-storage-api" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6735,7 +6735,7 @@ dependencies = [ [[package]] name = "reth-storage-errors" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-eips 1.0.38", "alloy-primitives", @@ -6751,7 +6751,7 @@ dependencies = [ [[package]] name = "reth-trie" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -6773,7 +6773,7 @@ dependencies = [ [[package]] name = "reth-trie-common" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-primitives", @@ -6789,7 +6789,7 @@ dependencies = [ [[package]] name = "reth-trie-sparse" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -6805,7 +6805,7 @@ dependencies = [ [[package]] name = "reth-zstd-compressors" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "zstd", ] @@ -7151,7 +7151,7 @@ dependencies = [ [[package]] name = "revm-scroll" version = "0.1.0" -source = "git+https://github.com/scroll-tech/scroll-revm#d6b77e226ce20646d0ddf3dfe3b1fb3ec8a58cc3" +source = "git+https://github.com/scroll-tech/scroll-revm#f5ae93d909f185461af8d0263b2549081e9781c8" dependencies = [ "auto_impl", "enumn", @@ -7367,7 +7367,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.0", ] [[package]] @@ -7406,7 +7406,7 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "sbv-core" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#d1b5f2ed2bd5ba4b646213b3f6ae1433ca5b396b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#40aed436537900b49338b37325c4444e3b408ad8" dependencies = [ "auto_impl", "itertools 0.14.0", @@ -7423,7 +7423,7 @@ dependencies = [ [[package]] name = "sbv-helpers" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#d1b5f2ed2bd5ba4b646213b3f6ae1433ca5b396b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#40aed436537900b49338b37325c4444e3b408ad8" dependencies = [ "tracing", ] @@ -7431,7 +7431,7 @@ dependencies = [ [[package]] name = "sbv-primitives" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#d1b5f2ed2bd5ba4b646213b3f6ae1433ca5b396b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#40aed436537900b49338b37325c4444e3b408ad8" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -7468,7 +7468,7 @@ dependencies = [ [[package]] name = "sbv-trie" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#d1b5f2ed2bd5ba4b646213b3f6ae1433ca5b396b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#40aed436537900b49338b37325c4444e3b408ad8" dependencies = [ "alloy-rlp", "alloy-trie 0.9.1", @@ -7485,7 +7485,7 @@ dependencies = [ [[package]] name = "sbv-utils" version = "2.0.0" -source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#d1b5f2ed2bd5ba4b646213b3f6ae1433ca5b396b" +source = "git+https://github.com/scroll-tech/stateless-block-verifier?branch=master#40aed436537900b49338b37325c4444e3b408ad8" dependencies = [ "alloy-provider", "alloy-rpc-client", @@ -7540,7 +7540,7 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scroll-alloy-consensus" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -7556,7 +7556,7 @@ dependencies = [ [[package]] name = "scroll-alloy-evm" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -7574,7 +7574,7 @@ dependencies = [ [[package]] name = "scroll-alloy-hardforks" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-hardforks", "auto_impl", @@ -7584,7 +7584,7 @@ dependencies = [ [[package]] name = "scroll-alloy-network" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-network", @@ -7599,7 +7599,7 @@ dependencies = [ [[package]] name = "scroll-alloy-rpc-types" version = "1.8.2" -source = "git+https://github.com/scroll-tech/reth?branch=scroll#5edac541f81be7271d6e0b74a8f13f74e9facbb9" +source = "git+https://github.com/scroll-tech/reth?branch=scroll#0e4001e46de6de73f1ebd479a228f9159f8f3721" dependencies = [ "alloy-consensus", "alloy-eips 1.0.38", @@ -8351,7 +8351,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -8524,7 +8524,7 @@ dependencies = [ "getrandom 0.3.3", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.0", ] [[package]] diff --git a/crates/types/chunk/Cargo.toml b/crates/types/chunk/Cargo.toml index a85c57b5..0d758c68 100644 --- a/crates/types/chunk/Cargo.toml +++ b/crates/types/chunk/Cargo.toml @@ -34,7 +34,7 @@ serde_json.workspace = true [features] default = [] -host = ["scroll-compress-ratio", "alloy-primitives/tiny-keccak"] +host = ["scroll-compress-info", "alloy-primitives/tiny-keccak"] scroll = [ "sbv-core/scroll", "sbv-primitives/scroll-evm-types", @@ -42,4 +42,4 @@ scroll = [ "sbv-primitives/scroll-revm-types", "sbv-primitives/scroll-reth-evm-types" ] -scroll-compress-ratio = ["sbv-core/scroll-compress-ratio"] +scroll-compress-info = ["sbv-core/scroll-compress-info"] diff --git a/crates/types/chunk/src/scroll/execute.rs b/crates/types/chunk/src/scroll/execute.rs index b568ff6a..74ee2784 100644 --- a/crates/types/chunk/src/scroll/execute.rs +++ b/crates/types/chunk/src/scroll/execute.rs @@ -42,7 +42,7 @@ pub fn execute(witness: ChunkWitness) -> Result { post_state_root, withdraw_root, .. - } = verifier::run(&witness.blocks, chain_spec, witness.compression_ratios) + } = verifier::run(&witness.blocks, chain_spec, witness.compression_infos) .map_err(|e| format!("verify error: {e}"))?; let blocks = manually_drop_on_zkvm!(blocks); diff --git a/crates/types/chunk/src/scroll/witness.rs b/crates/types/chunk/src/scroll/witness.rs index bc6caf41..3fd81db2 100644 --- a/crates/types/chunk/src/scroll/witness.rs +++ b/crates/types/chunk/src/scroll/witness.rs @@ -19,7 +19,7 @@ pub struct ChunkWitness { /// The code version specify the chain spec pub fork_name: ForkName, /// The compression ratios for each block in the chunk. - pub compression_ratios: Vec>, + pub compression_infos: Vec>, /// Validium encrypted txs and secret key if this is a validium chain. pub validium: Option, } @@ -33,6 +33,23 @@ pub struct ValidiumInputs { pub secret_key: Box<[u8]>, } +/// The witness type accepted by last version chunk-circuit. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ChunkWitnessUpgradeCompact { + /// Version byte as per [version][types_base::version]. + pub version: u8, + /// The block witness for each block in the chunk. + pub blocks: Vec, + /// The on-chain rolling L1 message queue hash before enqueueing any L1 msg tx from the chunk. + pub prev_msg_queue_hash: B256, + /// The code version specify the chain spec + pub fork_name: ForkName, + /// The compression ratios for each block in the chunk. + pub compression_ratios: Vec>, + /// Validium encrypted txs and secret key if this is a validium chain. + pub validium: Option, +} + /// The witness type accepted by the chunk-circuit. #[derive( Clone, @@ -129,9 +146,10 @@ impl ChunkWitness { .collect(), }) .collect(); - let compression_ratios = blocks + + let compression_infos = blocks .iter() - .map(|block| block.compression_ratios()) + .map(|block| block.compression_infos()) .collect(); Self { @@ -139,7 +157,7 @@ impl ChunkWitness { blocks, prev_msg_queue_hash, fork_name, - compression_ratios, + compression_infos, validium, } } @@ -183,8 +201,29 @@ impl From for LegacyChunkWitness { .collect(), prev_msg_queue_hash: value.prev_msg_queue_hash, fork_name: value.fork_name, - compression_ratios: value.compression_ratios, + compression_ratios: value + .compression_infos + .iter() + .map(|compression_infos| compression_infos.iter().map(|v| v.0).collect()) + .collect(), state_commit_mode: StateCommitMode::Auto, } } } + +impl From for ChunkWitnessUpgradeCompact { + fn from(value: ChunkWitness) -> Self { + ChunkWitnessUpgradeCompact { + version: value.version, + blocks: value.blocks, + prev_msg_queue_hash: value.prev_msg_queue_hash, + fork_name: value.fork_name, + compression_ratios: value + .compression_infos + .iter() + .map(|compression_infos| compression_infos.iter().map(|v| v.0).collect()) + .collect(), + validium: value.validium, + } + } +} From 30a7e9381908d62b5e3397758fc5d0af6b119283 Mon Sep 17 00:00:00 2001 From: lightsing Date: Mon, 10 Nov 2025 16:12:35 +0800 Subject: [PATCH 2/6] add compact --- crates/integration/src/testers/chunk.rs | 32 ++++++++++++++++++++----- crates/types/chunk/src/scroll.rs | 2 +- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/crates/integration/src/testers/chunk.rs b/crates/integration/src/testers/chunk.rs index acf50277..2934a03d 100644 --- a/crates/integration/src/testers/chunk.rs +++ b/crates/integration/src/testers/chunk.rs @@ -1,8 +1,15 @@ +use crate::{ + PartialProvingTask, ProverTester, guest_version, prove_verify, testdata_fork_directory, + tester_execute, testers::PATH_TESTDATA, testing_hardfork, testing_version, + utils::metadata_from_chunk_witnesses, +}; +use openvm_sdk::StdIn; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use sbv_core::BlockWitness; use sbv_primitives::{B256, types::consensus::TxL1Message}; use scroll_zkvm_prover::utils::vm::ExecutionResult; use scroll_zkvm_prover::{Prover, utils::read_json}; +use scroll_zkvm_types::chunk::ChunkWitnessUpgradeCompact; use scroll_zkvm_types::{ chunk::{ChunkInfo, ChunkWitness, LegacyChunkWitness, SecretKey}, proof::ProofEnum, @@ -13,12 +20,6 @@ use std::{ path::{Path, PathBuf}, }; -use crate::{ - PartialProvingTask, ProverTester, prove_verify, testdata_fork_directory, tester_execute, - testers::PATH_TESTDATA, testing_hardfork, testing_version, - utils::metadata_from_chunk_witnesses, -}; - /// Load a file .json in the directory. pub fn read_block_witness_from_testdata(block_n: usize) -> eyre::Result { read_block_witness( @@ -67,6 +68,25 @@ impl PartialProvingTask for ChunkWitness { Ok(bytes.to_vec()) } + fn write_guest_input(&self, stdin: &mut StdIn) -> eyre::Result<()> + where + Self: Sized, + { + let bytes: Vec = match guest_version().as_str() { + "0.5.2" => self.legacy_rkyv_archive()?, + "" => { + let config = bincode::config::standard(); + bincode::serde::encode_to_vec(ChunkWitnessUpgradeCompact::from(self), config)? + } + _ => { + let config = bincode::config::standard(); + bincode::serde::encode_to_vec(self, config)? + } + }; + stdin.write_bytes(&bytes); + Ok(()) + } + fn fork_name(&self) -> ForkName { ForkName::from(self.fork_name.as_str()) } diff --git a/crates/types/chunk/src/scroll.rs b/crates/types/chunk/src/scroll.rs index 422918a4..4e0ad631 100644 --- a/crates/types/chunk/src/scroll.rs +++ b/crates/types/chunk/src/scroll.rs @@ -5,4 +5,4 @@ mod execute; pub use execute::execute; mod witness; -pub use witness::{ChunkWitness, LegacyChunkWitness, ValidiumInputs}; +pub use witness::{ChunkWitness, ChunkWitnessUpgradeCompact, LegacyChunkWitness, ValidiumInputs}; From 0aea7aa23fde515464cfed0f64db1e4f05ef05fb Mon Sep 17 00:00:00 2001 From: lightsing Date: Mon, 10 Nov 2025 17:13:58 +0800 Subject: [PATCH 3/6] set latest version --- crates/integration/src/testers/chunk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/integration/src/testers/chunk.rs b/crates/integration/src/testers/chunk.rs index 2934a03d..9575ba67 100644 --- a/crates/integration/src/testers/chunk.rs +++ b/crates/integration/src/testers/chunk.rs @@ -74,7 +74,7 @@ impl PartialProvingTask for ChunkWitness { { let bytes: Vec = match guest_version().as_str() { "0.5.2" => self.legacy_rkyv_archive()?, - "" => { + "0.6.0-rc.6" => { let config = bincode::config::standard(); bincode::serde::encode_to_vec(ChunkWitnessUpgradeCompact::from(self), config)? } From a4956211cb199b8145b3cd035b5f7aaa69d1f1dd Mon Sep 17 00:00:00 2001 From: lightsing Date: Mon, 10 Nov 2025 20:43:49 +0800 Subject: [PATCH 4/6] fix --- crates/integration/src/testers/chunk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/integration/src/testers/chunk.rs b/crates/integration/src/testers/chunk.rs index 9575ba67..db76d350 100644 --- a/crates/integration/src/testers/chunk.rs +++ b/crates/integration/src/testers/chunk.rs @@ -76,7 +76,7 @@ impl PartialProvingTask for ChunkWitness { "0.5.2" => self.legacy_rkyv_archive()?, "0.6.0-rc.6" => { let config = bincode::config::standard(); - bincode::serde::encode_to_vec(ChunkWitnessUpgradeCompact::from(self), config)? + bincode::serde::encode_to_vec(ChunkWitnessUpgradeCompact::from(self.clone()), config)? } _ => { let config = bincode::config::standard(); From 6b17fec67939ba4da966c844a4ffd2753721ae91 Mon Sep 17 00:00:00 2001 From: lightsing Date: Mon, 10 Nov 2025 20:45:22 +0800 Subject: [PATCH 5/6] fmt --- crates/integration/src/testers/chunk.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/integration/src/testers/chunk.rs b/crates/integration/src/testers/chunk.rs index db76d350..bf46db83 100644 --- a/crates/integration/src/testers/chunk.rs +++ b/crates/integration/src/testers/chunk.rs @@ -76,7 +76,10 @@ impl PartialProvingTask for ChunkWitness { "0.5.2" => self.legacy_rkyv_archive()?, "0.6.0-rc.6" => { let config = bincode::config::standard(); - bincode::serde::encode_to_vec(ChunkWitnessUpgradeCompact::from(self.clone()), config)? + bincode::serde::encode_to_vec( + ChunkWitnessUpgradeCompact::from(self.clone()), + config, + )? } _ => { let config = bincode::config::standard(); From 51cf757e2d80ece733af2ff82a78e49a1b80c101 Mon Sep 17 00:00:00 2001 From: Zhuo Zhang Date: Mon, 10 Nov 2025 14:32:14 +0000 Subject: [PATCH 6/6] update commitments --- crates/circuits/batch-circuit/batch_exe_commit.rs | 2 +- crates/circuits/bundle-circuit/bundle_exe_commit.rs | 2 +- crates/circuits/chunk-circuit/chunk_exe_commit.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/circuits/batch-circuit/batch_exe_commit.rs b/crates/circuits/batch-circuit/batch_exe_commit.rs index f2f5a400..31ba7cf6 100644 --- a/crates/circuits/batch-circuit/batch_exe_commit.rs +++ b/crates/circuits/batch-circuit/batch_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] = [1202988051, 1148264508, 1543561268, 1765749557, 1182656731, 396804521, 834486540, 1245597015]; +pub const COMMIT: [u32; 8] = [1649793006, 453918448, 700472053, 1708688727, 1956651385, 1452705656, 611459631, 1820274171]; diff --git a/crates/circuits/bundle-circuit/bundle_exe_commit.rs b/crates/circuits/bundle-circuit/bundle_exe_commit.rs index c645cb76..527a5026 100644 --- a/crates/circuits/bundle-circuit/bundle_exe_commit.rs +++ b/crates/circuits/bundle-circuit/bundle_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] = [373288848, 1343506321, 1914796275, 1793072527, 65733832, 1916923301, 963694893, 639345462]; +pub const COMMIT: [u32; 8] = [2012351307, 1390891344, 349217220, 1980321794, 92671869, 1673212720, 1290433404, 1552447571]; diff --git a/crates/circuits/chunk-circuit/chunk_exe_commit.rs b/crates/circuits/chunk-circuit/chunk_exe_commit.rs index 2d5a3733..70205ab2 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] = [1957156571, 872843267, 744762733, 1147670747, 1109472993, 163434507, 1792562840, 1106326803]; +pub const COMMIT: [u32; 8] = [534218310, 1811212981, 1016259372, 652600422, 1802874675, 1341042917, 594473376, 479497145];