Created
December 23, 2021 01:24
-
-
Save ralexstokes/1430507703ed1cd00447113eefcb428f to your computer and use it in GitHub Desktop.
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
diff --git a/src/phase0/beacon_state.rs b/src/phase0/beacon_state.rs | |
index 5997634..d283932 100644 | |
--- a/src/phase0/beacon_state.rs | |
+++ b/src/phase0/beacon_state.rs | |
@@ -3,14 +3,14 @@ use crate::phase0::fork::Fork; | |
use crate::phase0::operations::{Checkpoint, Eth1Data, PendingAttestation}; | |
use crate::phase0::validator::Validator; | |
use crate::phase0::JUSTIFICATION_BITS_LENGTH; | |
-use crate::primitives::{Bytes32, Gwei, Root, Slot}; | |
+use crate::primitives::{Bytes32, Epoch, Gwei, Root, Slot}; | |
use ssz_rs::prelude::*; | |
pub(super) const fn get_eth1_data_votes_bound( | |
- epochs_per_eth1_voting_period: usize, | |
+ epochs_per_eth1_voting_period: Epoch, | |
slots_per_epoch: usize, | |
) -> usize { | |
- epochs_per_eth1_voting_period * slots_per_epoch | |
+ epochs_per_eth1_voting_period as usize * slots_per_epoch | |
} | |
pub(super) const fn get_pending_attestations_bound( | |
diff --git a/src/phase0/presets/mainnet.rs b/src/phase0/presets/mainnet.rs | |
index ae7e885..65be1b4 100644 | |
--- a/src/phase0/presets/mainnet.rs | |
+++ b/src/phase0/presets/mainnet.rs | |
@@ -44,7 +44,7 @@ pub const SLOTS_PER_EPOCH: Slot = 32; | |
pub const MIN_SEED_LOOKAHEAD: Epoch = 1; | |
pub const MAX_SEED_LOOKAHEAD: Epoch = 4; | |
pub const MIN_EPOCHS_TO_INACTIVITY_PENALTY: Epoch = 4; | |
-pub const EPOCHS_PER_ETH1_VOTING_PERIOD: usize = 64; | |
+pub const EPOCHS_PER_ETH1_VOTING_PERIOD: Epoch = 64; | |
pub const SLOTS_PER_HISTORICAL_ROOT: usize = 8192; | |
pub const EPOCHS_PER_HISTORICAL_VECTOR: usize = 65536; | |
pub const EPOCHS_PER_SLASHINGS_VECTOR: usize = 8192; | |
diff --git a/src/phase0/presets/mod.rs b/src/phase0/presets/mod.rs | |
index 25e5243..85be9d1 100644 | |
--- a/src/phase0/presets/mod.rs | |
+++ b/src/phase0/presets/mod.rs | |
@@ -19,7 +19,7 @@ pub struct Preset { | |
pub min_seed_lookahead: Epoch, | |
pub max_seed_lookahead: Epoch, | |
pub min_epochs_to_inactivity_penalty: Epoch, | |
- pub epochs_per_eth1_voting_period: usize, | |
+ pub epochs_per_eth1_voting_period: Epoch, | |
pub slots_per_historical_root: usize, | |
pub epochs_per_historical_vector: usize, | |
pub epochs_per_slashings_vector: usize, | |
diff --git a/src/phase0/state_transition/context.rs b/src/phase0/state_transition/context.rs | |
index a8320aa..13e6f2d 100644 | |
--- a/src/phase0/state_transition/context.rs | |
+++ b/src/phase0/state_transition/context.rs | |
@@ -19,7 +19,7 @@ pub struct Context { | |
pub min_seed_lookahead: Epoch, | |
pub max_seed_lookahead: Epoch, | |
pub min_epochs_to_inactivity_penalty: Epoch, | |
- pub epochs_per_eth1_voting_period: usize, | |
+ pub epochs_per_eth1_voting_period: Epoch, | |
pub slots_per_historical_root: usize, | |
pub epochs_per_historical_vector: usize, | |
pub epochs_per_slashings_vector: usize, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment