Skip to content

Commit

Permalink
Revert changes to ForkContext
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Aug 24, 2021
1 parent 076c5ce commit 4e53423
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions consensus/types/src/fork_context.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use parking_lot::RwLock;

use crate::{ChainSpec, Epoch, EthSpec, ForkName, Hash256, Slot};
use crate::{ChainSpec, EthSpec, ForkName, Hash256, Slot};
use std::collections::HashMap;

/// Provides fork specific info like the current fork name and the fork digests corresponding to every valid fork.
Expand All @@ -26,18 +26,12 @@ impl ForkContext {
ChainSpec::compute_fork_digest(spec.genesis_fork_version, genesis_validators_root),
)];

// Only add Altair to list of forks if it's enabled
// Note: `altair_fork_epoch = None | Some(Epoch::max_value())` implies altair hasn't been activated yet on the config.
if let Some(altair_epoch) = spec.altair_fork_epoch {
if altair_epoch != Epoch::max_value() {
fork_to_digest.push((
ForkName::Altair,
ChainSpec::compute_fork_digest(
spec.altair_fork_version,
genesis_validators_root,
),
));
}
// Only add Altair to list of forks if it's enabled (i.e. spec.altair_fork_epoch != None)
if spec.altair_fork_epoch.is_some() {
fork_to_digest.push((
ForkName::Altair,
ChainSpec::compute_fork_digest(spec.altair_fork_version, genesis_validators_root),
))
}

let fork_to_digest: HashMap<ForkName, [u8; 4]> = fork_to_digest.into_iter().collect();
Expand Down

0 comments on commit 4e53423

Please sign in to comment.