Schedule gnosis merge (#3729)

## Issue Addressed

N/A

## Proposed Changes

Schedule Gnosis merge
- Upstream config PR: https://github.com/gnosischain/configs/pull/3
- Nethermind PR: https://github.com/NethermindEth/nethermind/pull/4901
- Public announcement: https://twitter.com/gnosischain/status/1592589482641223682

## Additional Info

N/A

Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Lion - dapplion 2022-11-21 06:29:02 +00:00
parent 8a36acdb1a
commit e3729533a1
3 changed files with 18 additions and 14 deletions

View File

@ -6,8 +6,8 @@ PRESET_BASE: 'gnosis'
# Transition # Transition
# --------------------------------------------------------------- # ---------------------------------------------------------------
# TBD, 2**256-2**10 is a placeholder # Estimated on Dec 5, 2022
TERMINAL_TOTAL_DIFFICULTY: 115792089237316195423570985008687907853269984665640564039457584007913129638912 TERMINAL_TOTAL_DIFFICULTY: 8626000000000000000000058750000000000000000000
# By default, don't use these params # By default, don't use these params
TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000 TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000
TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615
@ -35,7 +35,7 @@ ALTAIR_FORK_VERSION: 0x01000064
ALTAIR_FORK_EPOCH: 512 ALTAIR_FORK_EPOCH: 512
# Merge # Merge
BELLATRIX_FORK_VERSION: 0x02000064 BELLATRIX_FORK_VERSION: 0x02000064
BELLATRIX_FORK_EPOCH: 18446744073709551615 BELLATRIX_FORK_EPOCH: 385536
# Sharding # Sharding
SHARDING_FORK_VERSION: 0x03000064 SHARDING_FORK_VERSION: 0x03000064
SHARDING_FORK_EPOCH: 18446744073709551615 SHARDING_FORK_EPOCH: 18446744073709551615

View File

@ -226,7 +226,7 @@ mod tests {
use super::*; use super::*;
use ssz::Encode; use ssz::Encode;
use tempfile::Builder as TempBuilder; use tempfile::Builder as TempBuilder;
use types::{Config, Eth1Data, GnosisEthSpec, Hash256, MainnetEthSpec, GNOSIS}; use types::{Config, Eth1Data, GnosisEthSpec, Hash256, MainnetEthSpec};
type E = MainnetEthSpec; type E = MainnetEthSpec;
@ -250,6 +250,13 @@ mod tests {
assert_eq!(spec, config.chain_spec::<E>().unwrap()); assert_eq!(spec, config.chain_spec::<E>().unwrap());
} }
#[test]
fn gnosis_config_eq_chain_spec() {
let config = Eth2NetworkConfig::from_hardcoded_net(&GNOSIS).unwrap();
let spec = ChainSpec::gnosis();
assert_eq!(spec, config.chain_spec::<GnosisEthSpec>().unwrap());
}
#[test] #[test]
fn mainnet_genesis_state() { fn mainnet_genesis_state() {
let config = Eth2NetworkConfig::from_hardcoded_net(&MAINNET).unwrap(); let config = Eth2NetworkConfig::from_hardcoded_net(&MAINNET).unwrap();
@ -270,7 +277,7 @@ mod tests {
.unwrap_or_else(|_| panic!("{:?}", net.name)); .unwrap_or_else(|_| panic!("{:?}", net.name));
// Ensure we can parse the YAML config to a chain spec. // Ensure we can parse the YAML config to a chain spec.
if net.name == GNOSIS { if net.name == types::GNOSIS {
config.chain_spec::<GnosisEthSpec>().unwrap(); config.chain_spec::<GnosisEthSpec>().unwrap();
} else { } else {
config.chain_spec::<MainnetEthSpec>().unwrap(); config.chain_spec::<MainnetEthSpec>().unwrap();

View File

@ -777,7 +777,7 @@ impl ChainSpec {
domain_sync_committee_selection_proof: 8, domain_sync_committee_selection_proof: 8,
domain_contribution_and_proof: 9, domain_contribution_and_proof: 9,
altair_fork_version: [0x01, 0x00, 0x00, 0x64], altair_fork_version: [0x01, 0x00, 0x00, 0x64],
altair_fork_epoch: Some(Epoch::new(256)), altair_fork_epoch: Some(Epoch::new(512)),
/* /*
* Merge hard fork params * Merge hard fork params
@ -788,14 +788,11 @@ impl ChainSpec {
.expect("pow does not overflow"), .expect("pow does not overflow"),
proportional_slashing_multiplier_bellatrix: 3, proportional_slashing_multiplier_bellatrix: 3,
bellatrix_fork_version: [0x02, 0x00, 0x00, 0x64], bellatrix_fork_version: [0x02, 0x00, 0x00, 0x64],
bellatrix_fork_epoch: None, bellatrix_fork_epoch: Some(Epoch::new(385536)),
terminal_total_difficulty: Uint256::MAX terminal_total_difficulty: Uint256::from_dec_str(
.checked_sub(Uint256::from(2u64.pow(10))) "8626000000000000000000058750000000000000000000",
.expect("subtraction does not overflow") )
// Add 1 since the spec declares `2**256 - 2**10` and we use .expect("terminal_total_difficulty is a valid integer"),
// `Uint256::MAX` which is `2*256- 1`.
.checked_add(Uint256::one())
.expect("addition does not overflow"),
terminal_block_hash: ExecutionBlockHash::zero(), terminal_block_hash: ExecutionBlockHash::zero(),
terminal_block_hash_activation_epoch: Epoch::new(u64::MAX), terminal_block_hash_activation_epoch: Epoch::new(u64::MAX),
safe_slots_to_import_optimistically: 128u64, safe_slots_to_import_optimistically: 128u64,