forked from paradigmxyz/reth
-
Notifications
You must be signed in to change notification settings - Fork 6
Feat/add chain spec hardfork #56
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
Merged
Merged
Changes from 18 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
36010de
add hardfork
georgehao dac4a42
complete hardfork lib.rs
georgehao 73f33b5
complete
georgehao 62d984e
add scroll bootnode
georgehao c55aa00
remove duplicated code
georgehao c329f83
update
georgehao 91381be
tweak a comment
georgehao e6598ec
format
georgehao 5f1f0be
fix hardfork
georgehao 9e456d7
fix format
georgehao 65339ce
fix genesis hash error
georgehao 7f03d87
update unit test
georgehao f61684d
update
georgehao a78017c
update
georgehao ca15c76
remove unused dependence
georgehao 83b6ada
fix
georgehao 22e2262
add std
georgehao e90b2cd
update
georgehao 8368780
Update crates/net/peers/src/bootnodes/mod.rs
georgehao cd3f50e
address comment
georgehao 9b43e66
update hardfork
georgehao 21954d1
Merge branch 'feat/add_chain_spec_hardfork' of github.com:scroll-tech…
georgehao 2fd11cf
update
georgehao f111f6f
fix comment
georgehao 67d4e7e
Merge branch 'scroll' of github.com:scroll-tech/reth into feat/add_ch…
georgehao 164d9bb
address comment
georgehao 70abe38
address comment
georgehao 5aea8e8
address comment
georgehao 404f5ff
fix unit test
georgehao c2a88a5
fix unit test
georgehao 66b7e00
address comments
georgehao 34fbf24
Merge branch 'scroll' of github.com:scroll-tech/reth into feat/add_ch…
georgehao c6ca5aa
fix scroll genesis baseFee
georgehao 8b7a17f
Merge branch 'scroll' of github.com:scroll-tech/reth into feat/add_ch…
georgehao 0cee1ba
address comments
georgehao 0ad055a
fix unit test
georgehao cfd062e
fix unit test
georgehao 4b92f77
address comments
georgehao 1a69d3a
address comments
georgehao 13f2f59
fix conflict
georgehao 7fd8e97
resolve conflct
georgehao f47663d
add hardforks doc
georgehao a188c1b
update the doc
georgehao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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" | ||
| ] |
georgehao marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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"} |
Thegaram marked this conversation as resolved.
Show resolved
Hide resolved
|
Large diffs are not rendered by default.
Oops, something went wrong.
georgehao marked this conversation as resolved.
Show resolved
Hide resolved
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,4 @@ | ||
| //! Scroll variation of chain spec constants. | ||
|
|
||
| /// Scroll L2 gas limit | ||
| pub const SCROLL_L2_GAS_LIMIT: u64 = 10_000_000; |
This file contains hidden or 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,32 @@ | ||
| //! 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()), | ||
| deposit_contract: None, // TODO: do we even have? | ||
georgehao marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ..Default::default() | ||
| }, | ||
| } | ||
| .into() | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.