Skip to content

Commit

Permalink
qol: purge goerli
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk committed Jul 4, 2024
1 parent f759ca6 commit 4fbef02
Show file tree
Hide file tree
Showing 38 changed files with 57 additions and 347 deletions.
1 change: 0 additions & 1 deletion 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 book/cli/reth.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/dump-genesis.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/init-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/p2p.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/prune.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/recover.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/recover/storage-tries.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/stage/drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/stage/dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/stage/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/stage/unwind.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Datadir:
Possible values are either a built-in chain or the path to a chain specification file.
Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev
[default: mainnet]
Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/test-vectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
2 changes: 1 addition & 1 deletion book/cli/reth/test-vectors/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Options:
Possible values are either a built-in chain or the path to a chain specification file.

Built-in chains:
mainnet, sepolia, goerli, holesky, dev
mainnet, sepolia, holesky, dev

[default: mainnet]

Expand Down
10 changes: 5 additions & 5 deletions crates/chainspec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub use alloy_chains::{Chain, ChainKind, NamedChain};
pub use info::ChainInfo;
pub use spec::{
BaseFeeParams, BaseFeeParamsKind, ChainSpec, ChainSpecBuilder, DepositContract,
ForkBaseFeeParams, DEV, GOERLI, HOLESKY, MAINNET, SEPOLIA,
ForkBaseFeeParams, DEV, HOLESKY, MAINNET, SEPOLIA,
};
#[cfg(feature = "optimism")]
pub use spec::{BASE_MAINNET, BASE_SEPOLIA, OP_MAINNET, OP_SEPOLIA};
Expand Down Expand Up @@ -50,8 +50,8 @@ mod tests {

#[test]
fn test_named_id() {
let chain = Chain::from_named(NamedChain::Goerli);
assert_eq!(chain.id(), 5);
let chain = Chain::from_named(NamedChain::Holesky);
assert_eq!(chain.id(), 17000);
}

#[test]
Expand All @@ -77,9 +77,9 @@ mod tests {

#[test]
fn test_into_u256() {
let chain = Chain::from_named(NamedChain::Goerli);
let chain = Chain::from_named(NamedChain::Holesky);
let n: U256 = U256::from(chain.id());
let expected = U256::from(5);
let expected = U256::from(17000);

assert_eq!(n, expected);
}
Expand Down
143 changes: 2 additions & 141 deletions crates/chainspec/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ pub use alloy_eips::eip1559::BaseFeeParams;
#[cfg(feature = "optimism")]
use reth_ethereum_forks::OptimismHardfork;
use reth_network_peers::{
base_nodes, base_testnet_nodes, goerli_nodes, holesky_nodes, mainnet_nodes, op_nodes,
op_testnet_nodes, sepolia_nodes,
base_nodes, base_testnet_nodes, holesky_nodes, mainnet_nodes, op_nodes, op_testnet_nodes,
sepolia_nodes,
};

/// The Ethereum mainnet spec
Expand Down Expand Up @@ -66,30 +66,6 @@ pub static MAINNET: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
.into()
});

/// The Goerli spec
pub static GOERLI: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
ChainSpec {
chain: Chain::goerli(),
genesis: serde_json::from_str(include_str!("../res/genesis/goerli.json"))
.expect("Can't deserialize Goerli genesis json"),
genesis_hash: Some(b256!(
"bf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a"
)),
// <https://goerli.etherscan.io/block/7382818>
paris_block_and_final_difficulty: Some((7382818, U256::from(10_790_000))),
hardforks: EthereumHardfork::goerli().into(),
// https://goerli.etherscan.io/tx/0xa3c07dc59bfdb1bfc2d50920fed2ef2c1c4e0a09fe2325dbc14e07702f965a78
deposit_contract: Some(DepositContract::new(
address!("ff50ed3d0ec03ac01d4c79aad74928bff48a7b2b"),
4367322,
b256!("649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5"),
)),
base_fee_params: BaseFeeParamsKind::Constant(BaseFeeParams::ethereum()),
prune_delete_limit: 1700,
}
.into()
});

/// The Sepolia spec
pub static SEPOLIA: Lazy<Arc<ChainSpec>> = Lazy::new(|| {
ChainSpec {
Expand Down Expand Up @@ -715,7 +691,6 @@ impl ChainSpec {
let chain = self.chain;
match chain.try_into().ok()? {
C::Mainnet => Some(mainnet_nodes()),
C::Goerli => Some(goerli_nodes()),
C::Sepolia => Some(sepolia_nodes()),
C::Holesky => Some(holesky_nodes()),
C::Base => Some(base_nodes()),
Expand Down Expand Up @@ -1457,63 +1432,6 @@ Post-merge hard forks (timestamp based):
);
}

#[test]
fn goerli_hardfork_fork_ids() {
test_hardfork_fork_ids(
&GOERLI,
&[
(
EthereumHardfork::Frontier,
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
EthereumHardfork::Homestead,
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
EthereumHardfork::Tangerine,
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
EthereumHardfork::SpuriousDragon,
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
EthereumHardfork::Byzantium,
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
EthereumHardfork::Constantinople,
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
EthereumHardfork::Petersburg,
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
EthereumHardfork::Istanbul,
ForkId { hash: ForkHash([0xc2, 0x5e, 0xfa, 0x5c]), next: 4460644 },
),
(
EthereumHardfork::Berlin,
ForkId { hash: ForkHash([0x75, 0x7a, 0x1c, 0x47]), next: 5062605 },
),
(
EthereumHardfork::London,
ForkId { hash: ForkHash([0xb8, 0xc6, 0x29, 0x9d]), next: 1678832736 },
),
(
EthereumHardfork::Shanghai,
ForkId { hash: ForkHash([0xf9, 0x84, 0x3a, 0xbf]), next: 1705473120 },
),
(
EthereumHardfork::Cancun,
ForkId { hash: ForkHash([0x70, 0xcc, 0x14, 0xe2]), next: 0 },
),
],
);
}

#[test]
fn sepolia_hardfork_fork_ids() {
test_hardfork_fork_ids(
Expand Down Expand Up @@ -1689,63 +1607,6 @@ Post-merge hard forks (timestamp based):
)
}

#[test]
fn goerli_forkids() {
test_fork_ids(
&GOERLI,
&[
(
Head { number: 0, ..Default::default() },
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
Head { number: 1561650, ..Default::default() },
ForkId { hash: ForkHash([0xa3, 0xf5, 0xab, 0x08]), next: 1561651 },
),
(
Head { number: 1561651, ..Default::default() },
ForkId { hash: ForkHash([0xc2, 0x5e, 0xfa, 0x5c]), next: 4460644 },
),
(
Head { number: 4460643, ..Default::default() },
ForkId { hash: ForkHash([0xc2, 0x5e, 0xfa, 0x5c]), next: 4460644 },
),
(
Head { number: 4460644, ..Default::default() },
ForkId { hash: ForkHash([0x75, 0x7a, 0x1c, 0x47]), next: 5062605 },
),
(
Head { number: 5062605, ..Default::default() },
ForkId { hash: ForkHash([0xb8, 0xc6, 0x29, 0x9d]), next: 1678832736 },
),
(
Head { number: 6000000, timestamp: 1678832735, ..Default::default() },
ForkId { hash: ForkHash([0xb8, 0xc6, 0x29, 0x9d]), next: 1678832736 },
),
// First Shanghai block
(
Head { number: 6000001, timestamp: 1678832736, ..Default::default() },
ForkId { hash: ForkHash([0xf9, 0x84, 0x3a, 0xbf]), next: 1705473120 },
),
// Future Shanghai block
(
Head { number: 6500002, timestamp: 1678832736, ..Default::default() },
ForkId { hash: ForkHash([0xf9, 0x84, 0x3a, 0xbf]), next: 1705473120 },
),
// First Cancun block
(
Head { number: 6500003, timestamp: 1705473120, ..Default::default() },
ForkId { hash: ForkHash([0x70, 0xcc, 0x14, 0xe2]), next: 0 },
),
// Future Cancun block
(
Head { number: 6500003, timestamp: 2705473120, ..Default::default() },
ForkId { hash: ForkHash([0x70, 0xcc, 0x14, 0xe2]), next: 0 },
),
],
);
}

#[test]
fn sepolia_forkids() {
test_fork_ids(
Expand Down
Loading

0 comments on commit 4fbef02

Please sign in to comment.