Skip to content

Commit

Permalink
soroban-rpc: preflight: Increase instruction leeway to 20% (stellar#909)
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio authored Aug 31, 2023
1 parent 2989a3b commit a0bfedc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/soroban-rpc/lib/preflight/src/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ fn calculate_host_function_soroban_resources(
})
.sum();

// Add a 15% leeway with a minimum of 50k instructions
// Add a 20% leeway with a minimum of 50k instructions
let budget_instructions = budget
.get_cpu_insns_consumed()
.context("cannot get instructions consumed")?;
let instructions = max(budget_instructions + 50000, budget_instructions * 115 / 100);
let instructions = max(budget_instructions + 50000, budget_instructions * 120 / 100);
Ok(SorobanResources {
footprint: ledger_footprint,
instructions: u32::try_from(instructions)?,
Expand Down

0 comments on commit a0bfedc

Please sign in to comment.