Skip to content

Commit

Permalink
AUDIT: Check Fees Fix (#55)
Browse files Browse the repository at this point in the history
Was not checking the newly updated fees in `update_fee_config`
  • Loading branch information
coachchucksol authored Jan 17, 2025
1 parent 84de81c commit 5eedec8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions core/src/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ impl FeeConfig {

// CHECK FEES
self.check_fees_okay(current_epoch)?;
self.check_fees_okay(
current_epoch
.checked_add(1)
.ok_or(TipRouterError::ArithmeticOverflow)?,
)?;

Ok(())
}
Expand Down
5 changes: 3 additions & 2 deletions integration_tests/tests/tip_router/set_config_fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ mod tests {
let ncn_root = fixture.setup_ncn().await?;

const NEW_BLOCK_ENGINE_FEE: u16 = 500;
const NEW_BASE_FEE: u16 = 600;
const NEW_NCN_FEE: u16 = 700;
// 10_000 total, base 5000 / 8 = 625
const NEW_BASE_FEE: u16 = 625;
const NEW_NCN_FEE: u16 = 625;

let new_base_fee_wallet = Pubkey::new_unique();

Expand Down

0 comments on commit 5eedec8

Please sign in to comment.