diff --git a/cmd/soroban-rpc/internal/preflight/preflight_test.go b/cmd/soroban-rpc/internal/preflight/preflight_test.go index 1dca591b4..57a2e82b0 100644 --- a/cmd/soroban-rpc/internal/preflight/preflight_test.go +++ b/cmd/soroban-rpc/internal/preflight/preflight_test.go @@ -21,7 +21,7 @@ var mockContractHash = xdr.Hash{0xd, 0xe, 0xf} var contractCostParams = func() *xdr.ContractCostParams { var result xdr.ContractCostParams - for i := 0; i < 22; i++ { + for i := 0; i < 23; i++ { result = append(result, xdr.ContractCostParamEntry{ Ext: xdr.ExtensionPoint{}, ConstTerm: 0, diff --git a/cmd/soroban-rpc/lib/preflight/src/fees.rs b/cmd/soroban-rpc/lib/preflight/src/fees.rs index 6d6124f7a..fe4c5f2fb 100644 --- a/cmd/soroban-rpc/lib/preflight/src/fees.rs +++ b/cmd/soroban-rpc/lib/preflight/src/fees.rs @@ -138,11 +138,11 @@ fn calculate_host_function_soroban_resources( .map(|c| c.encoded_new_value.as_ref().map_or(0, Vec::len) as u32) .sum(); - // Add a 20% leeway with a minimum of 50k instructions + // Add a 20% leeway with a minimum of 800k instructions let budget_instructions = budget .get_cpu_insns_consumed() .context("cannot get instructions consumed")?; - let instructions = max(budget_instructions + 50000, budget_instructions * 120 / 100); + let instructions = max(budget_instructions + 800000, budget_instructions * 120 / 100); Ok(SorobanResources { footprint: ledger_footprint, instructions: u32::try_from(instructions)?,