Skip to content

Commit

Permalink
fix cli
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsing committed Feb 20, 2025
1 parent 38a6f24 commit c3165f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 8 additions & 2 deletions crates/bin/src/commands/run_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct RunFileCommand {
#[arg(short, long)]
chunk_mode: bool,
#[cfg(feature = "scroll")]
#[arg(long)]
prev_msg_queue_hash: Option<sbv::primitives::B256>,
}

Expand Down Expand Up @@ -48,8 +49,9 @@ impl RunFileCommand {
kv::{nohash::NoHashMap, null::NullProvider},
primitives::{
BlockWitness as _,
chainspec::{Chain, get_chain_spec},
chainspec::{Chain, get_chain_spec_or_build},
ext::{BlockWitnessChunkExt, BlockWitnessExt},
hardforks::{ForkCondition, ScrollHardfork},
types::{BlockWitness, ChunkInfoBuilder},
},
trie::BlockWitnessTrieExt,
Expand All @@ -75,7 +77,11 @@ impl RunFileCommand {
.collect::<Result<Vec<_>, _>>()?;

let chain_id = witnesses[0].chain_id;
let chain_spec = get_chain_spec(Chain::from_id(chain_id)).unwrap();
let chain_spec = get_chain_spec_or_build(Chain::from_id(chain_id), |spec| {
spec.inner
.hardforks
.insert(ScrollHardfork::EuclidV2, ForkCondition::Timestamp(0));
});

let mut chunk_info_builder = ChunkInfoBuilder::new(&chain_spec, &blocks);
if let Some(prev_msg_queue_hash) = self.prev_msg_queue_hash {
Expand Down
9 changes: 7 additions & 2 deletions crates/bin/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use sbv::{
kv::nohash::NoHashMap,
primitives::{
BlockWitness,
chainspec::{Chain, get_chain_spec},
chainspec::{Chain, get_chain_spec_or_build},
ext::BlockWitnessExt,
hardforks::{ForkCondition, ScrollHardfork},
},
trie::BlockWitnessTrieExt,
};
Expand All @@ -30,7 +31,11 @@ fn verify_inner<T: BlockWitness + BlockWitnessTrieExt + BlockWitnessExt>(
.build()
.unwrap();

let chain_spec = get_chain_spec(Chain::from_id(witness.chain_id())).unwrap();
let chain_spec = get_chain_spec_or_build(Chain::from_id(witness.chain_id()), |spec| {
spec.inner
.hardforks
.insert(ScrollHardfork::EuclidV2, ForkCondition::Timestamp(0));
});

let mut code_db = NoHashMap::default();
witness.import_codes(&mut code_db);
Expand Down

0 comments on commit c3165f6

Please sign in to comment.