Arrow Glacier

This commit is contained in:
Artem Vorotnikov
2021-11-10 17:57:21 +03:00
parent 9f39a9feaa
commit 3ccbdcfcd1
3 changed files with 26 additions and 1 deletions

View File

@@ -99,7 +99,10 @@ pub fn canonical_difficulty(
if rev >= Revision::Byzantium {
let bomb_delay = {
if rev >= Revision::London {
if block_number >= config.arrow_glacier_block.unwrap_or(BlockNumber(u64::MAX)) {
// https://eips.ethereum.org/EIPS/eip-4345
10_700_000
} else if rev >= Revision::London {
// https://eips.ethereum.org/EIPS/eip-3554
9_700_000
} else if block_number >= config.muir_glacier_block.unwrap_or(BlockNumber(u64::MAX)) {

View File

@@ -39,6 +39,7 @@ pub struct ChainConfig {
pub muir_glacier_block: Option<BlockNumber>,
pub berlin_block: Option<BlockNumber>,
pub london_block: Option<BlockNumber>,
pub arrow_glacier_block: Option<BlockNumber>,
}
impl ChainConfig {
@@ -55,6 +56,7 @@ impl ChainConfig {
self.muir_glacier_block,
self.berlin_block,
self.london_block,
self.arrow_glacier_block,
]
.iter()
.filter_map(|b| {
@@ -99,3 +101,22 @@ impl ChainConfig {
.unwrap_or(false)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn distinct_block_numbers() {
assert_eq!(
crate::res::genesis::MAINNET.config.gather_forks(),
vec![
1_150_000, 1_920_000, 2_463_000, 2_675_000, 4_370_000, 7_280_000, 9_069_000,
9_200_000, 12_244_000, 12_965_000, 13_773_000
]
.into_iter()
.map(BlockNumber)
.collect()
);
}
}

View File

@@ -26813,6 +26813,7 @@
"petersburgBlock": 7280000,
"istanbulBlock": 9069000,
"muirGlacierBlock": 9200000,
"arrowGlacierBlock": 13773000,
"berlinBlock": 12244000,
"londonBlock": 12965000,
"sealEngine": "Ethash"