-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore gossip blobs with a slot greater than peer das activation epoch.
- Loading branch information
1 parent
5f09cfd
commit fdcf129
Showing
6 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,18 @@ | ||
use crate::{BeaconChain, BeaconChainTypes}; | ||
use types::{Epoch, EthSpec, Slot}; | ||
|
||
impl<T: BeaconChainTypes> BeaconChain<T> { | ||
/// Returns true if the given epoch is greater than or equal to the `EIP7594_FORK_EPOCH`. | ||
pub(crate) fn is_peer_das_enabled_for_epoch(&self, block_epoch: Epoch) -> bool { | ||
self.spec | ||
.eip7594_fork_epoch | ||
.map_or(false, |eip7594_fork_epoch| { | ||
block_epoch >= eip7594_fork_epoch | ||
}) | ||
} | ||
|
||
/// Returns true if the epoch of the given slot is greater than or equal to the `EIP7594_FORK_EPOCH`. | ||
pub(crate) fn is_peer_das_enabled_for_slot(&self, block_slot: Slot) -> bool { | ||
self.is_peer_das_enabled_for_epoch(block_slot.epoch(T::EthSpec::slots_per_epoch())) | ||
} | ||
} |
This file contains 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 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