Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ebatsell committed Jun 19, 2024
1 parent 6ebbd6d commit 3110775
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions programs/steward/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ pub const NUM_EPOCHS_BETWEEN_SCORING_MAX: u64 = 100;
// Cannot score validators in under 100 slots, to submit 1 instruction per validator
pub const COMPUTE_SCORE_SLOT_RANGE_MIN: u64 = 100;
#[cfg(feature = "mainnet-beta")]
pub const VALIDATOR_HISTORY_FIRST_RELIABLE_EPOCH: usize = 520;
pub const VALIDATOR_HISTORY_FIRST_RELIABLE_EPOCH: u64 = 520;
#[cfg(not(feature = "mainnet-beta"))]
pub const VALIDATOR_HISTORY_FIRST_RELIABLE_EPOCH: usize = 0;
pub const VALIDATOR_HISTORY_FIRST_RELIABLE_EPOCH: u64 = 0;
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct ComputeInstantUnstake<'info> {

pub validator_history: AccountLoader<'info, ValidatorHistory>,

/// CHECK: TODO
/// CHECK: TODO add validator list to config
#[account(owner = spl_stake_pool::id())]
pub validator_list: AccountInfo<'info>,

Expand Down
4 changes: 2 additions & 2 deletions programs/steward/src/state/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@ impl Parameters {
/// Validate reasonable bounds on parameters
pub fn validate(&self, current_epoch: u64, slots_per_epoch: u64) -> Result<()> {
// Cannot evaluate epochs before VALIDATOR_HISTORY_FIRST_RELIABLE_EPOCH or beyond the CircBuf length
let window_max = (current_epoch as usize)
let window_max = current_epoch
.checked_sub(VALIDATOR_HISTORY_FIRST_RELIABLE_EPOCH)
.ok_or(StewardError::ArithmeticError)?
.min(validator_history::ValidatorHistory::MAX_ITEMS - 1);

Check failure on line 333 in programs/steward/src/state/parameters.rs

View workflow job for this annotation

GitHub Actions / lint

mismatched types

Check failure on line 333 in programs/steward/src/state/parameters.rs

View workflow job for this annotation

GitHub Actions / udeps

mismatched types

Check failure on line 333 in programs/steward/src/state/parameters.rs

View workflow job for this annotation

GitHub Actions / verified_build

mismatched types
let window_max = cast_epoch(window_max as u64)?;
let window_max = cast_epoch(window_max)?;

if self.mev_commission_range > window_max {
return Err(StewardError::InvalidParameterValue.into());
Expand Down

0 comments on commit 3110775

Please sign in to comment.