Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add chain spec hardfork #56

Merged
merged 43 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
36010de
add hardfork
georgehao Nov 28, 2024
dac4a42
complete hardfork lib.rs
georgehao Nov 28, 2024
73f33b5
complete
georgehao Dec 2, 2024
62d984e
add scroll bootnode
georgehao Dec 2, 2024
c55aa00
remove duplicated code
georgehao Dec 2, 2024
c329f83
update
georgehao Dec 2, 2024
91381be
tweak a comment
georgehao Dec 2, 2024
e6598ec
format
georgehao Dec 3, 2024
5f1f0be
fix hardfork
georgehao Dec 3, 2024
9e456d7
fix format
georgehao Dec 3, 2024
65339ce
fix genesis hash error
georgehao Dec 3, 2024
7f03d87
update unit test
georgehao Dec 3, 2024
f61684d
update
georgehao Dec 3, 2024
a78017c
update
georgehao Dec 3, 2024
ca15c76
remove unused dependence
georgehao Dec 3, 2024
83b6ada
fix
georgehao Dec 3, 2024
22e2262
add std
georgehao Dec 3, 2024
e90b2cd
update
georgehao Dec 3, 2024
8368780
Update crates/net/peers/src/bootnodes/mod.rs
georgehao Dec 3, 2024
cd3f50e
address comment
georgehao Dec 4, 2024
9b43e66
update hardfork
georgehao Dec 4, 2024
21954d1
Merge branch 'feat/add_chain_spec_hardfork' of github.com:scroll-tech…
georgehao Dec 4, 2024
2fd11cf
update
georgehao Dec 4, 2024
f111f6f
fix comment
georgehao Dec 4, 2024
67d4e7e
Merge branch 'scroll' of github.com:scroll-tech/reth into feat/add_ch…
georgehao Dec 4, 2024
164d9bb
address comment
georgehao Dec 4, 2024
70abe38
address comment
georgehao Dec 4, 2024
5aea8e8
address comment
georgehao Dec 4, 2024
404f5ff
fix unit test
georgehao Dec 4, 2024
c2a88a5
fix unit test
georgehao Dec 4, 2024
66b7e00
address comments
georgehao Dec 4, 2024
34fbf24
Merge branch 'scroll' of github.com:scroll-tech/reth into feat/add_ch…
georgehao Dec 6, 2024
c6ca5aa
fix scroll genesis baseFee
georgehao Dec 6, 2024
8b7a17f
Merge branch 'scroll' of github.com:scroll-tech/reth into feat/add_ch…
georgehao Dec 6, 2024
0cee1ba
address comments
georgehao Dec 6, 2024
0ad055a
fix unit test
georgehao Dec 6, 2024
cfd062e
fix unit test
georgehao Dec 6, 2024
4b92f77
address comments
georgehao Dec 6, 2024
1a69d3a
address comments
georgehao Dec 6, 2024
13f2f59
fix conflict
georgehao Dec 9, 2024
7fd8e97
resolve conflct
georgehao Dec 9, 2024
f47663d
add hardforks doc
georgehao Dec 9, 2024
a188c1b
update the doc
georgehao Dec 9, 2024
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
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ revm-primitives = { version = "14.0.0", features = [
], default-features = false }

# eth
alloy-chains = "0.1.32"
alloy-chains = "0.1.48"
georgehao marked this conversation as resolved.
Show resolved Hide resolved
alloy-dyn-abi = "0.8.11"
alloy-primitives = { version = "0.8.11", default-features = false }
alloy-rlp = "0.3.4"
Expand Down
4 changes: 4 additions & 0 deletions crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ impl ChainSpec {

/// Get the initial base fee of the genesis block.
pub fn initial_base_fee(&self) -> Option<u64> {
if self.chain.named() == Chain::scroll_mainnet().named() {
return Some(0)
georgehao marked this conversation as resolved.
Show resolved Hide resolved
}

// If the base fee is set in the genesis block, we use that instead of the default.
let genesis_base_fee =
self.genesis.base_fee_per_gas.map(|fee| fee as u64).unwrap_or(INITIAL_BASE_FEE);
Expand Down
4 changes: 2 additions & 2 deletions crates/scroll/chainspec/src/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use alloc::sync::Arc;

use alloy_chains::{Chain, NamedChain};
use alloy_chains::Chain;
use alloy_primitives::b256;
use reth_chainspec::{once_cell_set, ChainSpec};
use reth_scroll_forks::ScrollHardfork;
Expand All @@ -13,7 +13,7 @@ use crate::{LazyLock, ScrollChainSpec};
pub static SCROLL_MAINNET: LazyLock<Arc<ScrollChainSpec>> = LazyLock::new(|| {
ScrollChainSpec {
inner: ChainSpec {
chain: Chain::from_named(NamedChain::Scroll),
chain: Chain::scroll_mainnet(),
// genesis contains empty alloc field because state at first bedrock block is imported
// manually from trusted source
genesis: serde_json::from_str(include_str!("../res/genesis/scroll.json"))
Expand Down
4 changes: 2 additions & 2 deletions crates/scroll/chainspec/src/scroll_sepolia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use alloc::sync::Arc;

use alloy_chains::{Chain, NamedChain};
use alloy_chains::Chain;
use alloy_primitives::b256;
use reth_chainspec::{once_cell_set, ChainSpec};
use reth_scroll_forks::ScrollHardfork;
Expand All @@ -13,7 +13,7 @@ use crate::{LazyLock, ScrollChainSpec};
pub static SCROLL_SEPOLIA: LazyLock<Arc<ScrollChainSpec>> = LazyLock::new(|| {
ScrollChainSpec {
inner: ChainSpec {
chain: Chain::from_named(NamedChain::ScrollSepolia),
chain: Chain::scroll_sepolia(),
genesis: serde_json::from_str(include_str!("../res/genesis/sepolia_scroll.json"))
.expect("Can't deserialize Scroll Sepolia genesis json"),
genesis_hash: once_cell_set(b256!(
Expand Down
Loading