Skip to content

Commit 4b92f77

Browse files
committed
address comments
1 parent cfd062e commit 4b92f77

File tree

7 files changed

+24
-16
lines changed

7 files changed

+24
-16
lines changed

Cargo.lock

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

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ revm-primitives = { version = "14.0.0", features = [
440440
], default-features = false }
441441

442442
# eth
443-
alloy-chains = "0.1.48"
443+
alloy-chains = "0.1.32"
444444
alloy-dyn-abi = "0.8.11"
445445
alloy-primitives = { version = "0.8.11", default-features = false }
446446
alloy-rlp = "0.3.4"

crates/chainspec/src/spec.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ impl ChainSpec {
317317

318318
/// Get the initial base fee of the genesis block.
319319
pub fn initial_base_fee(&self) -> Option<u64> {
320-
if self.chain == Chain::scroll_mainnet() || self.chain == Chain::scroll_sepolia() {
320+
// TODO(scroll): migrate to Chain::scroll() (introduced in https://github.com/alloy-rs/chains/pull/112) when alloy-chains is bumped to version 0.1.48
321+
if self.chain == Chain::from_named(NamedChain::Scroll) ||
322+
self.chain == Chain::from_named(NamedChain::ScrollSepolia)
323+
{
321324
return None
322325
}
323326

crates/scroll/chainspec/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ impl EthChainSpec for ScrollChainSpec {
148148
}
149149

150150
fn base_fee_params_at_block(&self, block_number: u64) -> BaseFeeParams {
151-
// TODO need to implement Scroll L2 formula related to https://github.com/scroll-tech/reth/issues/60
151+
// TODO(scroll): need to implement Scroll L2 formula related to https://github.com/scroll-tech/reth/issues/60
152152
self.inner.base_fee_params_at_block(block_number)
153153
}
154154

155155
fn base_fee_params_at_timestamp(&self, timestamp: u64) -> BaseFeeParams {
156-
// TODO need to implement Scroll L2 formula related to https://github.com/scroll-tech/reth/issues/60
156+
// TODO(scroll): need to implement Scroll L2 formula related to https://github.com/scroll-tech/reth/issues/60
157157
self.inner.base_fee_params_at_timestamp(timestamp)
158158
}
159159

crates/scroll/chainspec/src/scroll.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use alloc::sync::Arc;
44

5-
use alloy_chains::Chain;
5+
use alloy_chains::{Chain, NamedChain};
66
use alloy_primitives::b256;
77
use reth_chainspec::{once_cell_set, ChainSpec};
88
use reth_scroll_forks::ScrollHardfork;
@@ -13,7 +13,8 @@ use crate::{LazyLock, ScrollChainSpec};
1313
pub static SCROLL_MAINNET: LazyLock<Arc<ScrollChainSpec>> = LazyLock::new(|| {
1414
ScrollChainSpec {
1515
inner: ChainSpec {
16-
chain: Chain::scroll_mainnet(),
16+
// TODO(scroll): migrate to Chain::scroll() (introduced in https://github.com/alloy-rs/chains/pull/112) when alloy-chains is bumped to version 0.1.48
17+
chain: Chain::from_named(NamedChain::Scroll),
1718
genesis: serde_json::from_str(include_str!("../res/genesis/scroll.json"))
1819
.expect("Can't deserialize Scroll Mainnet genesis json"),
1920
genesis_hash: once_cell_set(b256!(

crates/scroll/chainspec/src/scroll_sepolia.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use alloc::sync::Arc;
44

5-
use alloy_chains::Chain;
5+
use alloy_chains::{Chain, NamedChain};
66
use alloy_primitives::b256;
77
use reth_chainspec::{once_cell_set, ChainSpec};
88
use reth_scroll_forks::ScrollHardfork;
@@ -13,7 +13,8 @@ use crate::{LazyLock, ScrollChainSpec};
1313
pub static SCROLL_SEPOLIA: LazyLock<Arc<ScrollChainSpec>> = LazyLock::new(|| {
1414
ScrollChainSpec {
1515
inner: ChainSpec {
16-
chain: Chain::scroll_sepolia(),
16+
// Let's add TODO(scroll): migrate to Chain::scroll_sepolia() (introduced in https://github.com/alloy-rs/chains/pull/112) when alloy-chains is bumped to version 0.1.48
17+
chain: Chain::from_named(NamedChain::ScrollSepolia),
1718
genesis: serde_json::from_str(include_str!("../res/genesis/sepolia_scroll.json"))
1819
.expect("Can't deserialize Scroll Sepolia genesis json"),
1920
genesis_hash: once_cell_set(b256!(

crates/scroll/hardforks/src/hardfork.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ hardfork!(
3131
impl ScrollHardfork {
3232
/// Retrieves the activation block for the specified hardfork on the given chain.
3333
pub fn activation_block<H: Hardfork>(self, fork: H, chain: Chain) -> Option<u64> {
34-
if chain == Chain::scroll_mainnet() {
34+
// TODO(scroll): migrate to Chain::scroll() (introduced in https://github.com/alloy-rs/chains/pull/112) when alloy-chains is bumped to version 0.1.48
35+
if chain == Chain::from_named(NamedChain::Scroll) {
3536
return Self::scroll_sepolia_activation_block(fork);
3637
}
37-
if chain == Chain::scroll_sepolia() {
38+
// TODO(scroll): migrate to Chain::scroll_sepolia() (introduced in https://github.com/alloy-rs/chains/pull/112) when alloy-chains is bumped to version 0.1.48
39+
if chain == Chain::from_named(NamedChain::ScrollSepolia) {
3840
return Self::scroll_mainnet_activation_block(fork);
3941
}
4042

@@ -43,9 +45,11 @@ impl ScrollHardfork {
4345

4446
/// Retrieves the activation timestamp for the specified hardfork on the given chain.
4547
pub fn activation_timestamp<H: Hardfork>(self, fork: H, chain: Chain) -> Option<u64> {
48+
// TODO(scroll): migrate to Chain::scroll_sepolia() (introduced in https://github.com/alloy-rs/chains/pull/112) when alloy-chains is bumped to version 0.1.48
4649
if chain == Chain::from_named(NamedChain::ScrollSepolia) {
4750
return Self::scroll_sepolia_activation_timestamp(fork);
4851
}
52+
// TODO(scroll): migrate to Chain::scroll() (introduced in https://github.com/alloy-rs/chains/pull/112) when alloy-chains is bumped to version 0.1.48
4953
if chain == Chain::from_named(NamedChain::Scroll) {
5054
return Self::scroll_mainnet_activation_timestamp(fork);
5155
}

0 commit comments

Comments
 (0)