forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add hardfork * complete hardfork lib.rs * complete * add scroll bootnode * remove duplicated code * update * tweak a comment * format * fix hardfork * fix format * fix genesis hash error * update unit test * update * update * remove unused dependence * fix * add std * update * Update crates/net/peers/src/bootnodes/mod.rs Co-authored-by: Péter Garamvölgyi <[email protected]> * address comment * update hardfork * update * fix comment * address comment * address comment * address comment * fix unit test * fix unit test * address comments * fix scroll genesis baseFee * address comments * fix unit test * fix unit test * address comments * address comments * resolve conflct * add hardforks doc * update the doc --------- Co-authored-by: Péter Garamvölgyi <[email protected]>
- Loading branch information
Showing
19 changed files
with
1,758 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//! Scroll bootnodes come from <https://github.com/scroll-tech/go-ethereum/blob/develop/params/bootnodes.go> | ||
/// Scroll mainnet boot nodes. | ||
pub static SCROLL_BOOTNODES: &[&str] = &[ | ||
"enode://c6ac91f43df3d63916ac1ae411cdd5ba249d55d48a7bec7f8cd5bb351a31aba437e5a69e8a1de74d73fdfeba8af1cfe9caf9846ecd3abf60d1ffdf4925b55b23@54.186.123.248:30303", | ||
"enode://fdcc807b5d1353f3a1e98b90208ce6ef1b7d446136e51eaa8ad657b55518a2f8b37655e42375d61622e6ea18f3faf9d070c9bbdf012cf5484bcbad33b7a15fb1@44.227.91.206:30303", | ||
"enode://6beb5a3efbb39be73d17630b6da48e94c0ce7ec665172111463cb470197b20c12faa1fa6f835b81c28571277d1017e65c4e426cc92a46141cf69118ecf28ac03@44.237.194.52:30303", | ||
"enode://7cf893d444eb8e129dca0f6485b3df579911606e7c728be4fa55fcc5f155a37c3ce07d217ccec5447798bde465ac2bdba2cb8763d107e9f3257e787579e9f27e@52.35.203.107:30303", | ||
"enode://c7b2d94e95da343db6e667a01cef90376a592f2d277fbcbf6e9c9186734ed8003d01389571bd10cdbab7a6e5adfa6f0c7b55644d0db24e0b9deb4ec80f842075@54.70.236.187:30303", | ||
]; | ||
|
||
/// Scroll sepolia boot nodes. | ||
pub static SCROLL_SEPOLIA_BOOTNODES: &[&str] = &[ | ||
"enode://ceb1636bac5cbb262e5ad5b2cd22014bdb35ffe7f58b3506970d337a63099481814a338dbcd15f2d28757151e3ecd40ba38b41350b793cd0d910ff0436654f8c@35.85.84.250:30303", | ||
"enode://29cee709c400533ae038a875b9ca975c8abef9eade956dcf3585e940acd5c0ae916968f514bd37d1278775aad1b7db30f7032a70202a87fd7365bd8de3c9f5fc@44.242.39.33:30303", | ||
"enode://dd1ac5433c5c2b04ca3166f4cb726f8ff6d2da83dbc16d9b68b1ea83b7079b371eb16ef41c00441b6e85e32e33087f3b7753ea9e8b1e3f26d3e4df9208625e7f@54.148.111.168:30303", | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[package] | ||
name = "reth-scroll-chainspec" | ||
version.workspace = true | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
license.workspace = true | ||
homepage.workspace = true | ||
repository.workspace = true | ||
description = "EVM chain spec implementation for scroll." | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
# reth | ||
reth-chainspec.workspace = true | ||
reth-ethereum-forks.workspace = true | ||
reth-primitives-traits.workspace = true | ||
reth-network-peers.workspace = true | ||
|
||
# scroll-reth | ||
reth-scroll-forks.workspace = true | ||
|
||
# ethereum | ||
alloy-chains.workspace = true | ||
alloy-genesis.workspace = true | ||
alloy-primitives.workspace = true | ||
alloy-consensus.workspace = true | ||
alloy-eips.workspace = true | ||
alloy-serde.workspace = true | ||
|
||
# io | ||
serde_json.workspace = true | ||
serde = { workspace = true, features = ["derive"] } | ||
|
||
# misc | ||
derive_more.workspace = true | ||
once_cell.workspace = true | ||
|
||
[dev-dependencies] | ||
reth-chainspec = { workspace = true, features = ["test-utils"] } | ||
alloy-genesis.workspace = true | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"alloy-chains/std", | ||
"alloy-genesis/std", | ||
"alloy-primitives/std", | ||
"alloy-eips/std", | ||
"alloy-serde/std", | ||
"reth-chainspec/std", | ||
"reth-ethereum-forks/std", | ||
"reth-primitives-traits/std", | ||
"reth-scroll-forks/std", | ||
"alloy-consensus/std", | ||
"once_cell/std", | ||
"serde/std" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"nonce":"0x0","timestamp":"0x6490fdd2","extraData":"0x","gasLimit":"0x1c9c380","difficulty":"0x0","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","coinbase":"0x0000000000000000000000000000000000000000","stateRoot":"0x5eb6e371a698b8d68f665192350ffcecbbbf322916f4b51bd79bb6887da3f494","alloc":{"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266":{"balance":"0xD3C21BCECCEDA1000000"},"0x70997970C51812dc3A010C7d01b50e0d17dc79C8":{"balance":"0xD3C21BCECCEDA1000000"},"0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC":{"balance":"0xD3C21BCECCEDA1000000"},"0x90F79bf6EB2c4f870365E785982E1f101E93b906":{"balance":"0xD3C21BCECCEDA1000000"},"0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65":{"balance":"0xD3C21BCECCEDA1000000"},"0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc":{"balance":"0xD3C21BCECCEDA1000000"},"0x976EA74026E726554dB657fA54763abd0C3a0aa9":{"balance":"0xD3C21BCECCEDA1000000"},"0x14dC79964da2C08b23698B3D3cc7Ca32193d9955":{"balance":"0xD3C21BCECCEDA1000000"},"0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f":{"balance":"0xD3C21BCECCEDA1000000"},"0xa0Ee7A142d267C1f36714E4a8F75612F20a79720":{"balance":"0xD3C21BCECCEDA1000000"},"0xBcd4042DE499D14e55001CcbB24a551F3b954096":{"balance":"0xD3C21BCECCEDA1000000"},"0x71bE63f3384f5fb98995898A86B02Fb2426c5788":{"balance":"0xD3C21BCECCEDA1000000"},"0xFABB0ac9d68B0B445fB7357272Ff202C5651694a":{"balance":"0xD3C21BCECCEDA1000000"},"0x1CBd3b2770909D4e10f157cABC84C7264073C9Ec":{"balance":"0xD3C21BCECCEDA1000000"},"0xdF3e18d64BC6A983f673Ab319CCaE4f1a57C7097":{"balance":"0xD3C21BCECCEDA1000000"},"0xcd3B766CCDd6AE721141F452C550Ca635964ce71":{"balance":"0xD3C21BCECCEDA1000000"},"0x2546BcD3c84621e976D8185a91A922aE77ECEc30":{"balance":"0xD3C21BCECCEDA1000000"},"0xbDA5747bFD65F08deb54cb465eB87D40e51B197E":{"balance":"0xD3C21BCECCEDA1000000"},"0xdD2FD4581271e230360230F9337D5c0430Bf44C0":{"balance":"0xD3C21BCECCEDA1000000"},"0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199":{"balance":"0xD3C21BCECCEDA1000000"}},"number":"0x0","gasUsed":"0x0","parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//! Chain specification in dev mode for custom chain. | ||
use alloc::sync::Arc; | ||
|
||
use alloy_chains::Chain; | ||
use alloy_consensus::constants::DEV_GENESIS_HASH; | ||
use alloy_primitives::U256; | ||
use reth_chainspec::{once_cell_set, BaseFeeParams, BaseFeeParamsKind, ChainSpec}; | ||
use reth_scroll_forks::DEV_HARDFORKS; | ||
|
||
use crate::{LazyLock, ScrollChainSpec}; | ||
|
||
/// Scroll dev testnet specification | ||
/// | ||
/// Includes 20 prefunded accounts with `10_000` ETH each derived from mnemonic "test test test test | ||
/// test test test test test test test junk". | ||
pub static SCROLL_DEV: LazyLock<Arc<ScrollChainSpec>> = LazyLock::new(|| { | ||
ScrollChainSpec { | ||
inner: ChainSpec { | ||
chain: Chain::dev(), | ||
genesis: serde_json::from_str(include_str!("../res/genesis/dev.json")) | ||
.expect("Can't deserialize Dev testnet genesis json"), | ||
genesis_hash: once_cell_set(DEV_GENESIS_HASH), | ||
paris_block_and_final_difficulty: Some((0, U256::from(0))), | ||
hardforks: DEV_HARDFORKS.clone(), | ||
base_fee_params: BaseFeeParamsKind::Constant(BaseFeeParams::ethereum()), | ||
..Default::default() | ||
}, | ||
} | ||
.into() | ||
}); |
Oops, something went wrong.