Skip to content
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
607610e
chore: add galileo fork and update pi
roynalnaruto Nov 3, 2025
17ae47f
chore: bump sbv
roynalnaruto Nov 4, 2025
935dcf7
fix: bump sbv and fix compilation
roynalnaruto Nov 5, 2025
8599192
add witness data
roynalnaruto Nov 5, 2025
eaf146d
test: sbv update
roynalnaruto Nov 5, 2025
1e36f26
try dbg
roynalnaruto Nov 5, 2025
44dd468
chore: bump sbv
roynalnaruto Nov 5, 2025
56eb5b3
fix: compilation post sbv update
roynalnaruto Nov 6, 2025
fb8ad5b
test: remove witness for block xxx156
roynalnaruto Nov 6, 2025
eeb76a9
test: update testdata
roynalnaruto Nov 6, 2025
c7d2201
commitments
lispc Nov 6, 2025
f073b5a
test data updated devnet3
roynalnaruto Nov 9, 2025
ab41960
update test data
roynalnaruto Nov 10, 2025
2270c54
update first block witness (testdata galileo)
roynalnaruto Nov 10, 2025
f5807b0
chore: bump reth + sbv
roynalnaruto Nov 10, 2025
f30db47
chore: commitments
lispc Nov 10, 2025
a18ffd9
Merge branch 'master' into feat/galileo
roynalnaruto Nov 11, 2025
f7a9dea
chore: bump sbv+reth
roynalnaruto Nov 12, 2025
01195ce
commitments
lispc Nov 12, 2025
d78e674
chore: bump all
roynalnaruto Nov 13, 2025
e80ef70
fix: version in blob is da-codec
roynalnaruto Nov 13, 2025
032fbbd
fix: onchain batch header version is stf-version
roynalnaruto Nov 13, 2025
479171a
fix(tests): pi-hash for e2e
roynalnaruto Nov 13, 2025
6383727
tests: reduce proofgen time by changing e2e wit
roynalnaruto Nov 13, 2025
224690a
commitments
lispc Nov 14, 2025
518d06c
chore: bump version
roynalnaruto Nov 14, 2025
f3a277d
chore: commitments for 0.7.0-rc.1
lispc Nov 14, 2025
dc7565a
Merge remote-tracking branch 'origin/master' into feat/galileo
lispc Nov 14, 2025
089d607
fix: blob's version is also stf-version
roynalnaruto Nov 14, 2025
26bc1a8
v0.7.0-rc.2 ok
lispc Nov 14, 2025
607104d
Merge branch 'master' into feat/galileo
roynalnaruto Nov 17, 2025
90e7ede
chore: commitments
lispc Nov 17, 2025
db70d80
Galileo refactor header (#225)
roynalnaruto Nov 18, 2025
f683d7f
Merge remote-tracking branch 'origin/master' into feat/galileo
lispc Nov 19, 2025
074f736
Merge branch 'master' into feat/galileo
roynalnaruto Nov 19, 2025
4d9af18
Re-introduce `ReferenceHeader::V8` for backwards compatibility with `…
roynalnaruto Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,045 changes: 814 additions & 231 deletions Cargo.lock

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ edition = "2021"
homepage = "https://github.com/scroll-tech/zkvm-prover"
readme = "README.md"
repository = "https://github.com/scroll-tech/zkvm-prover"
version = "0.6.0"
version = "0.7.0"

[workspace.dependencies]
# openvm guest libs
Expand Down Expand Up @@ -69,17 +69,17 @@ openvm-transpiler = { git = "https://github.com/openvm-org/openvm.git", tag = "v
# more openvm related libs
openvm-stark-sdk = { git = "https://github.com/openvm-org/stark-backend.git", tag = "v1.2.1" }

sbv-core = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
sbv-helpers = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
sbv-utils = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
sbv-trie = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "master" }
sbv-core = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "fix/build-chainspec" }
sbv-helpers = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "fix/build-chainspec", features = ["dev"] }
sbv-primitives = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "fix/build-chainspec" }
sbv-utils = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "fix/build-chainspec" }
sbv-trie = { git = "https://github.com/scroll-tech/stateless-block-verifier", branch = "fix/build-chainspec" }

alloy-consensus = "1.0"
alloy-provider = "1.0"
alloy-rpc-client = "1.0"
alloy-transport = "1.0"
alloy-primitives = { version = "1.3", default-features = false, features = [
alloy-primitives = { version = "1.4.1", default-features = false, features = [
"std",
"map-hashbrown",
"map-fxhash",
Expand Down Expand Up @@ -143,20 +143,20 @@ scroll-zkvm-prover = { path = "crates/prover" }
scroll-zkvm-verifier = { path = "crates/verifier" }

[patch.crates-io]
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" }
revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-bytecode = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-context = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-context-interface = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-database = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-database-interface = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-handler = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-inspector = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-interpreter = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-precompile = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-primitives = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }
revm-state = { git = "https://github.com/scroll-tech/revm", branch = "feat/v88" }

alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "feat/rkyv" }
alloy-primitives = { git = "https://github.com/scroll-tech/alloy-core", branch = "feat/1.4.1-rkyv" }

## FIXME: when openvm fixes https://github.com/openvm-org/openvm/pull/1937
#[patch.'https://github.com/openvm-org/openvm.git']
Expand Down
2 changes: 1 addition & 1 deletion crates/circuits/batch-circuit/batch_exe_commit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
//! Generated by crates/build-guest. DO NOT EDIT!

pub const COMMIT: [u32; 8] = [1649793006, 453918448, 700472053, 1708688727, 1956651385, 1452705656, 611459631, 1820274171];
pub const COMMIT: [u32; 8] = [864719956, 1846690715, 923265474, 853025065, 1740953812, 1558837582, 1966928989, 1847199187];
2 changes: 1 addition & 1 deletion crates/circuits/bundle-circuit/bundle_exe_commit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
//! Generated by crates/build-guest. DO NOT EDIT!

pub const COMMIT: [u32; 8] = [2012351307, 1390891344, 349217220, 1980321794, 92671869, 1673212720, 1290433404, 1552447571];
pub const COMMIT: [u32; 8] = [476823590, 119511347, 152701176, 1053953387, 213549889, 1957849243, 410523811, 694894829];
2 changes: 1 addition & 1 deletion crates/circuits/chunk-circuit/chunk_exe_commit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg_attr(rustfmt, rustfmt_skip)]
//! Generated by crates/build-guest. DO NOT EDIT!

pub const COMMIT: [u32; 8] = [534218310, 1811212981, 1016259372, 652600422, 1802874675, 1341042917, 594473376, 479497145];
pub const COMMIT: [u32; 8] = [1209101837, 99643033, 996198416, 1107956009, 1219145045, 927684997, 1902587021, 1745407319];
4 changes: 2 additions & 2 deletions crates/integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ const ENV_OUTPUT_DIR: &str = "OUTPUT_DIR";

/// Enviroment settings for test: fork
pub fn testing_hardfork() -> ForkName {
ForkName::Feynman
ForkName::Galileo
}

/// Test settings (version).
pub fn testing_version() -> Version {
Version::feynman()
Version::galileo()
}

pub fn testing_version_validium() -> Version {
Expand Down
9 changes: 9 additions & 0 deletions crates/integration/src/testers/chunk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ pub fn preset_chunk() -> ChunkTaskGenerator {
ForkName::EuclidV1 => (Version::euclid_v1(), 12508460u64..=12508463u64),
ForkName::EuclidV2 => (Version::euclid_v2(), 1u64..=4u64),
ForkName::Feynman => (Version::feynman(), 16525000u64..=16525003u64),
ForkName::Galileo => (Version::galileo(), 20239156..=20239235),
};

ChunkTaskGenerator {
Expand Down Expand Up @@ -282,6 +283,14 @@ pub fn preset_chunk_multiple() -> Vec<ChunkTaskGenerator> {
],
Version::feynman(),
),
ForkName::Galileo => (
vec![
20239220..=20239220,
20239221..=20239221,
20239222..=20239222,
],
Version::galileo(),
),
};
create_canonical_tasks(version, block_range.into_iter())
.expect("must success for preset collections")
Expand Down
20 changes: 16 additions & 4 deletions crates/integration/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use bytesize::ByteSize;
use sbv_core::BlockWitness;
use sbv_primitives::types::consensus::ScrollTransaction;
use sbv_primitives::{B256, types::eips::Encodable2718};
use scroll_zkvm_types::batch::build_point_eval_witness;
use scroll_zkvm_types::batch::{N_BLOB_BYTES, build_point_eval_witness};
use scroll_zkvm_types::{
batch::{
BatchHeader, BatchHeaderV6, BatchHeaderV7, BatchHeaderValidium, BatchHeaderValidiumV1,
Expand Down Expand Up @@ -202,9 +202,17 @@ pub fn build_batch_witnesses(
// compress ...
let compressed_payload = zstd_encode(&payload);

let heading = compressed_payload.len() as u32 + ((version.as_version_byte() as u32) << 24);
// 5 bytes are utilised by version (1), compressed_len (3) and is_encoded (1).
if compressed_payload.len() > N_BLOB_BYTES - 5 {
return Err(eyre::eyre!(
"compression payload of batch too big: len={}",
compressed_payload.len()
));
}

let heading = compressed_payload.len() as u32 + ((version.codec() as u32) << 24);

let blob_bytes = if testing_hardfork() >= ForkName::EuclidV2 {
let blob_bytes = if version.fork >= ForkName::EuclidV2 {
let mut blob_bytes = Vec::from(heading.to_be_bytes());
blob_bytes.push(1u8); // compressed flag
blob_bytes.extend(compressed_payload);
Expand Down Expand Up @@ -299,7 +307,7 @@ pub fn build_batch_witnesses(
blob_versioned_hash,
})
}
ForkName::Feynman => {
ForkName::Feynman | ForkName::Galileo => {
use scroll_zkvm_types::batch::BatchHeaderV8;
let _ = x + z;
ReferenceHeader::V8(BatchHeaderV8 {
Expand Down Expand Up @@ -429,6 +437,10 @@ fn test_build_and_parse_batch_task() -> eyre::Result<()> {
block_range: (16525000..=16525003).collect(),
..Default::default()
},
ForkName::Galileo => ChunkTaskGenerator {
block_range: (20239156..=20239192).collect(),
..Default::default()
},
}
.get_or_build_witness()?;

Expand Down
8 changes: 8 additions & 0 deletions crates/integration/tests/batch_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ fn verify_batch_hash_invariant() -> eyre::Result<()> {
16525003u64..=16525003u64,
],
),
ForkName::Galileo => (
Version::galileo(),
vec![
20239156..=20239162,
20239163..=20239175,
20239176..=20239192,
],
),
};
let outcome_2 = create_canonical_tasks(version, block_range.into_iter())?;

Expand Down
8 changes: 5 additions & 3 deletions crates/integration/tests/bundle_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use scroll_zkvm_integration::{
chunk::ChunkProverTester,
load_local_task,
},
testing_hardfork, testing_version_validium,
testing_version, testing_version_validium,
utils::metadata_from_bundle_witnesses,
};
use scroll_zkvm_prover::{Prover, ProverConfig};
Expand Down Expand Up @@ -133,12 +133,14 @@ fn e2e() -> eyre::Result<()> {
let metadata = metadata_from_bundle_witnesses(&wit)?;

// Sanity check for pi of bundle hash, update the expected hash if block witness changed
let pi_str = match testing_hardfork() {
let version = testing_version();
let pi_str = match version.fork {
ForkName::EuclidV1 => "3cc70faf6b5a4bd565694a4c64de59befb735f4aac2a4b9e6a6fc2ee950b8a72",
ForkName::EuclidV2 => "2028510c403837c6ed77660fd92814ba61d7b746e7268cc8dfc14d163d45e6bd",
ForkName::Feynman => "80523a61b2b94b2922638ec90edd084b1022798e1e5539c3a079d2b0736e4f32",
ForkName::Galileo => "bef1b9511ed0162cde799f4a3c49a44436f20bf4d7a0a851f3b5f9c4b2dbea71",
};
let expected_pi_hash = metadata.pi_hash(testing_hardfork());
let expected_pi_hash = metadata.pi_hash_by_version(version);
// sanity check for pi of bundle hash, update the expected hash if block witness changed
assert_eq!(
alloy_primitives::hex::encode(expected_pi_hash),
Expand Down
6 changes: 6 additions & 0 deletions crates/types/base/src/fork_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub enum ForkName {
EuclidV1,
EuclidV2,
Feynman,
Galileo,
}

impl fmt::Display for ForkName {
Expand All @@ -30,6 +31,7 @@ impl fmt::Display for ForkName {
ForkName::EuclidV1 => "euclidv1",
ForkName::EuclidV2 => "euclidv2",
ForkName::Feynman => "feynman",
ForkName::Galileo => "galileo",
};
write!(f, "{}", s)
}
Expand All @@ -42,6 +44,7 @@ impl ForkName {
ForkName::EuclidV1 => "euclidv1",
ForkName::EuclidV2 => "euclidv2",
ForkName::Feynman => "feynman",
ForkName::Galileo => "galileo",
}
}
/// Convert ForkName to its protocol version
Expand All @@ -50,6 +53,7 @@ impl ForkName {
ForkName::EuclidV1 => 6,
ForkName::EuclidV2 => 7,
ForkName::Feynman => 8,
ForkName::Galileo => 9,
}
}
}
Expand All @@ -61,6 +65,7 @@ impl From<Option<&str>> for ForkName {
Some("euclidv1") => ForkName::EuclidV1,
Some("euclidv2") => ForkName::EuclidV2,
Some("feynman") => ForkName::Feynman,
Some("galileo") => ForkName::Galileo,
Some(s) => unreachable!("hardfork not accepted: {s}"),
}
}
Expand All @@ -72,6 +77,7 @@ impl From<&str> for ForkName {
"euclidv1" => ForkName::EuclidV1,
"euclidv2" => ForkName::EuclidV2,
"feynman" => ForkName::Feynman,
"galileo" => ForkName::Galileo,
s => unreachable!("hardfork not accepted: {s}"),
}
}
Expand Down
31 changes: 31 additions & 0 deletions crates/types/base/src/public_inputs/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,35 @@ impl BatchInfo {
self.pi_hash_euclidv2()
}

/// Public input hash for a batch (galileo or da-codec@v9) is defined as
///
/// keccak(
/// version ||
/// parent state root ||
/// parent batch hash ||
/// state root ||
/// batch hash ||
/// chain id ||
/// withdraw root ||
/// prev msg queue hash ||
/// post msg queue hash
/// )
fn pi_hash_galileo(&self, version: Version) -> B256 {
keccak256(
std::iter::empty()
.chain(&[version.as_version_byte()])
.chain(self.parent_state_root.as_slice())
.chain(self.parent_batch_hash.as_slice())
.chain(self.state_root.as_slice())
.chain(self.batch_hash.as_slice())
.chain(self.chain_id.to_be_bytes().as_slice())
.chain(self.withdraw_root.as_slice())
.chain(self.prev_msg_queue_hash.as_slice())
.chain(self.post_msg_queue_hash.as_slice())
.cloned()
.collect::<Vec<u8>>(),
)
}
/// Public input hash for a L3 validium @ v1.
///
/// keccak(
Expand Down Expand Up @@ -148,6 +177,7 @@ impl MultiVersionPublicInputs for BatchInfo {
ForkName::EuclidV1 => self.pi_hash_euclidv1(),
ForkName::EuclidV2 => self.pi_hash_euclidv2(),
ForkName::Feynman => self.pi_hash_feynman(),
_ => unreachable!("Fork > Feynman should use `pi_hash_by_version`"),
}
}

Expand All @@ -156,6 +186,7 @@ impl MultiVersionPublicInputs for BatchInfo {
(Domain::Scroll, STFVersion::V6) => self.pi_hash_by_fork(ForkName::EuclidV1),
(Domain::Scroll, STFVersion::V7) => self.pi_hash_by_fork(ForkName::EuclidV2),
(Domain::Scroll, STFVersion::V8) => self.pi_hash_by_fork(ForkName::Feynman),
(Domain::Scroll, STFVersion::V9) => self.pi_hash_galileo(version),
(Domain::Validium, STFVersion::V1) => self.pi_hash_validium(version),
(domain, stf_version) => {
unreachable!("unsupported version=({domain:?}, {stf_version:?})")
Expand Down
19 changes: 19 additions & 0 deletions crates/types/base/src/public_inputs/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ impl BundleInfo {
keccak256(pi)
}

pub fn pi_galileo(&self) -> Vec<u8> {
std::iter::empty()
.chain(self.chain_id.to_be_bytes().as_slice())
.chain(self.msg_queue_hash.as_slice())
.chain(self.num_batches.to_be_bytes().as_slice())
.chain(self.prev_state_root.as_slice())
.chain(self.prev_batch_hash.as_slice())
.chain(self.post_state_root.as_slice())
.chain(self.batch_hash.as_slice())
.chain(self.withdraw_root.as_slice())
.cloned()
.collect()
}

pub fn pi_hash_versioned(&self, version: Version, pi: &[u8]) -> B256 {
let version_byte = version.as_version_byte();
keccak256(
Expand All @@ -129,6 +143,7 @@ impl BundleInfo {
ForkName::EuclidV1 => self.pi_hash_euclidv1(),
ForkName::EuclidV2 => self.pi_hash_euclidv2(),
ForkName::Feynman => self.pi_hash_feynman(),
_ => unreachable!("Fork > Feynman should use `pi_hash_by_version`"),
}
}
}
Expand All @@ -141,6 +156,7 @@ impl MultiVersionPublicInputs for BundleInfo {
ForkName::EuclidV1 => self.pi_hash_euclidv1(),
ForkName::EuclidV2 => self.pi_hash_euclidv2(),
ForkName::Feynman => self.pi_hash_feynman(),
_ => unreachable!("Fork > Feynman should use `pi_hash_by_version`"),
}
}

Expand All @@ -149,6 +165,9 @@ impl MultiVersionPublicInputs for BundleInfo {
(Domain::Scroll, STFVersion::V6) => self.pi_hash_euclidv1(),
(Domain::Scroll, STFVersion::V7) => self.pi_hash_euclidv2(),
(Domain::Scroll, STFVersion::V8) => self.pi_hash_feynman(),
(Domain::Scroll, STFVersion::V9) => {
self.pi_hash_versioned(version, self.pi_galileo().as_slice())
}
(Domain::Validium, STFVersion::V1) => {
self.pi_hash_versioned(version, self.pi_validium_v1().as_slice())
}
Expand Down
Loading