Skip to content

Commit 27905d3

Browse files
authored
release: v2 (#47)
* bump version * add public_input_hash assert * add changelog * fix: pre bernoulli (#49) * fix BLOCKHASH & SELFDESTRUCT in pre bernoulli * update ci * update ci * some cleanup * minimize trace
1 parent f5df984 commit 27905d3

File tree

7 files changed

+79
-18
lines changed

7 files changed

+79
-18
lines changed

.github/workflows/ci.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ jobs:
8181
strategy:
8282
fail-fast: false
8383
matrix:
84+
network: [ "mainnet" ]
85+
hardfork: [ "pre-bernoulli", "bernoulli", "curie", "darwin" ]
8486
rust: [ "1.75", "nightly-2024-07-07" ]
8587

8688
steps:
@@ -90,8 +92,10 @@ jobs:
9092
with:
9193
repository: 'scroll-tech/block-testdata'
9294
path: 'testdata'
95+
sparse-checkout: '${{ matrix.network }}_blocks/${{ matrix.hardfork }}'
9396
- uses: dtolnay/rust-toolchain@master
9497
with:
9598
toolchain: ${{ matrix.rust }}
9699
- uses: Swatinem/rust-cache@v2
97-
- run: cargo run --release --package stateless-block-verifier -- run-file testdata/mainnet_blocks/flatten-proofs/*
100+
- name: Test ${{ matrix.network }} ${{ matrix.hardfork }}
101+
run: cargo run --release --package stateless-block-verifier -- run-file testdata/${{ matrix.network }}_blocks/${{ matrix.hardfork }}/*

CHANGELOG.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [2.0.0] - 2024-09-04
11+
12+
### Added
13+
14+
- Add rkyv support, support zero-copy deserialization
15+
- Add an `ordered-db` feature gate to ensure the order when iterating over the database
16+
- Add a new sp1 cycle tracker macro `cycle_track!` which returns wrapped expression
17+
- Add chunk mode to work in chunk mode ([#29](https://github.com/scroll-tech/stateless-block-verifier/pull/29))
18+
- Add openmetrics support and a `metrics` feature gate ([#33](https://github.com/scroll-tech/stateless-block-verifier/pull/33))
19+
- Add zktrie lazy commitment ([#39](https://github.com/scroll-tech/stateless-block-verifier/pull/39))
20+
21+
### Fixed
22+
23+
- revm v40 upgrade cause `EXTCODEHASH` loads code to check if it's EOF, fixed by [revm#17](https://github.com/scroll-tech/revm/pull/17/files)
24+
- The tx hash is ignored and the tx hash is calculated from the tx body instead
25+
- The `from` field of the transaction trace is ignored if it's not l1 msg, the `tx.from` will be recovered from the signature instead
26+
- `BLOBHASH` & `BLOBBASEFEE` opcodes were accidentally enabled in CURIE ([#40](https://github.com/scroll-tech/stateless-block-verifier/pull/40))
27+
28+
### Changed
29+
30+
- Code database now use the keccak code hash as key, instead of the poseidon hash of the code ([#20](https://github.com/scroll-tech/stateless-block-verifier/pull/20))
31+
- Remove StateDB, direct query the zktrie db ([#38](https://github.com/scroll-tech/stateless-block-verifier/pull/38))
32+
- Dependency of `eth-types` is removed ([#43](https://github.com/scroll-tech/stateless-block-verifier/pull/43))
33+
- Dependency of `mpt-zktrie` is removed ([#45](https://github.com/scroll-tech/stateless-block-verifier/pull/45))
34+
- Dependency of `ethers-rs` is removed ([#46](https://github.com/scroll-tech/stateless-block-verifier/pull/46))
35+
36+
### Removed
37+
38+
- `post_check` is removed as long as the command line argument `--disable-check`
39+
- Support of legacy trace format is removed, only support the trace with codes and flatten proofs now.
40+
41+
## [1.0.0] - 2024-07-26
42+
43+
### Added
44+
45+
- Initial release
46+
47+
[unreleased]: https://github.com/scroll-tech/stateless-block-verifier/compare/2.0.0...HEAD
48+
[2.0.0]: https://github.com/scroll-tech/stateless-block-verifier/compare/v1.0.0...v2.0.0
49+
[1.0.0]: https://github.com/scroll-tech/stateless-block-verifier/releases/tag/v1.0.0

Cargo.lock

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.3.0"
6+
version = "2.0.0"
77
edition = "2021"
88
rust-version = "1.75"
99
authors = ["Scroll developers"]
@@ -20,16 +20,14 @@ thiserror = "1.0"
2020
tiny-keccak = "2.0"
2121

2222
# dependencies from scroll-tech
23-
poseidon-bn254 = { git = "https://github.com/scroll-tech/poseidon-bn254", branch = "master" }
23+
poseidon-bn254 = { git = "https://github.com/scroll-tech/poseidon-bn254", branch = "master", features = ["bn254"] }
2424
zktrie = { git = "https://github.com/scroll-tech/zktrie.git", branch = "main", features= ["rs_zktrie"] }
2525

2626
# binary dependencies
2727
anyhow = "1.0"
2828
async-channel = "2.2"
2929
clap = "4"
3030
env_logger = "0.9"
31-
ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "feat/rkyv" }
32-
ethers-providers = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "feat/rkyv", default-features = false }
3331
futures = "0.3"
3432
serde = "1.0"
3533
serde_json = "1.0"

crates/bin/src/commands/run_rpc.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ impl RunRpcCommand {
8080
"scroll_getBlockTraceByNumberOrHash".into(),
8181
(
8282
format!("0x{:x}", block_number),
83-
serde_json::json!({"StorageProofFormat": "flatten"}),
83+
serde_json::json!({
84+
"ExcludeExecutionResults": true,
85+
"ExcludeTxStorageTraces": true,
86+
"StorageProofFormat": "flatten",
87+
"FlattenProofsOnly": true
88+
}),
8489
),
8590
)
8691
.await

crates/core/src/chunk.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ impl ChunkInfo {
115115
mod tests {
116116
use super::*;
117117
use crate::{EvmExecutorBuilder, HardforkConfig};
118+
use revm::primitives::b256;
118119
use sbv_primitives::types::BlockTrace;
119120
use std::cell::RefCell;
120121

@@ -164,6 +165,10 @@ mod tests {
164165

165166
let mut tx_bytes_hash = B256::ZERO;
166167
tx_bytes_hasher.into_inner().finalize(&mut tx_bytes_hash.0);
167-
let _public_input_hash = chunk_info.public_input_hash(&tx_bytes_hash);
168+
let public_input_hash = chunk_info.public_input_hash(&tx_bytes_hash);
169+
assert_eq!(
170+
public_input_hash,
171+
b256!("764bffabc9fd4227d447a46d8bb04e5448ed64d89d6e5f4215fcf3593e00f109")
172+
);
168173
}
169174
}

crates/primitives/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ pub fn init_hash_scheme() {
2626
static INIT: Once = Once::new();
2727
INIT.call_once(|| {
2828
zktrie::init_hash_scheme_simple(|a: &[u8; 32], b: &[u8; 32], domain: &[u8; 32]| {
29-
use poseidon_bn254::{hash_with_domain, Fr};
29+
use poseidon_bn254::{hash_with_domain, Fr, PrimeField};
3030
let a = Fr::from_bytes(a).into_option()?;
3131
let b = Fr::from_bytes(b).into_option()?;
3232
let domain = Fr::from_bytes(domain).into_option()?;
33-
Some(hash_with_domain(&[a, b], domain).to_bytes())
33+
Some(hash_with_domain(&[a, b], domain).to_repr())
3434
});
3535
});
3636
}

0 commit comments

Comments
 (0)