Skip to content

Commit 710dfb7

Browse files
shane-mooremacladson
authored andcommitted
gloas fixes
1 parent 204d445 commit 710dfb7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

consensus/types/src/chain_spec.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,12 @@ impl ChainSpec {
468468
.is_some_and(|fulu_fork_epoch| fulu_fork_epoch != self.far_future_epoch)
469469
}
470470

471+
/// Returns true if `GLOAS_FORK_EPOCH` is set and is not set to `FAR_FUTURE_EPOCH`.
472+
pub fn is_gloas_scheduled(&self) -> bool {
473+
self.gloas_fork_epoch
474+
.is_some_and(|gloas_fork_epoch| gloas_fork_epoch != self.far_future_epoch)
475+
}
476+
471477
/// Returns a full `Fork` struct for a given epoch.
472478
pub fn fork_at_epoch(&self, epoch: Epoch) -> Fork {
473479
let current_fork_name = self.fork_name_at_epoch(epoch);

consensus/types/src/config_and_preset.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ mod test {
159159
.open(tmp_file.as_ref())
160160
.expect("error opening file");
161161
let mut mainnet_spec = ChainSpec::mainnet();
162-
// setting fulu_fork_epoch because we are roundtripping a fulu config
163-
mainnet_spec.fulu_fork_epoch = Some(Epoch::new(42));
162+
// setting gloas_fork_epoch because we are roundtripping a gloas config
163+
mainnet_spec.gloas_fork_epoch = Some(Epoch::new(42));
164164
let mut yamlconfig = ConfigAndPreset::from_chain_spec::<MainnetEthSpec>(&mainnet_spec);
165165
let (k1, v1) = ("SAMPLE_HARDFORK_KEY1", "123456789");
166166
let (k2, v2) = ("SAMPLE_HARDFORK_KEY2", "987654321");

consensus/types/src/signed_beacon_block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ mod test {
967967
chain_spec.deneb_fork_epoch = Some(Epoch::new(4));
968968
chain_spec.electra_fork_epoch = Some(Epoch::new(5));
969969
chain_spec.fulu_fork_epoch = Some(Epoch::new(6));
970+
chain_spec.gloas_fork_epoch = Some(Epoch::new(7));
970971

971972
// check that we have all forks covered
972973
assert!(chain_spec.fork_epoch(ForkName::latest()).is_some());

0 commit comments

Comments
 (0)