diff --git a/yarn-project/end-to-end/src/e2e_bot.test.ts b/yarn-project/end-to-end/src/e2e_bot.test.ts index 00c5b06e16c3..78a1f6affff9 100644 --- a/yarn-project/end-to-end/src/e2e_bot.test.ts +++ b/yarn-project/end-to-end/src/e2e_bot.test.ts @@ -134,8 +134,9 @@ describe('e2e_bot', () => { // TODO: this should be taken from the `setup` call above l1Mnemonic: new SecretValue('test test test test test test test test test test test junk'), flushSetupTransactions: true, - // Increase fee headroom to handle fee volatility from rapid block building in tests - minFeePadding: 9, + // Increase fee headroom to handle fee volatility from rapid block building in tests. + // Fees can escalate >10x due to blocks built by earlier tests and bridge operations. + minFeePadding: 99, }; { @@ -174,8 +175,10 @@ describe('e2e_bot', () => { // TODO: this should be taken from the `setup` call above l1Mnemonic: new SecretValue('test test test test test test test test test test test junk'), flushSetupTransactions: true, - // Increase fee headroom to handle fee volatility from rapid block building in tests - minFeePadding: 9, + // Increase fee headroom to handle fee volatility from rapid block building in tests. + // This test is especially susceptible because changing salt triggers a new bridge claim, + // adding more block building on top of what earlier tests already produced. + minFeePadding: 99, }; { diff --git a/yarn-project/stdlib/src/gas/gas_fees.ts b/yarn-project/stdlib/src/gas/gas_fees.ts index ca2e700c27da..7387b2df0496 100644 --- a/yarn-project/stdlib/src/gas/gas_fees.ts +++ b/yarn-project/stdlib/src/gas/gas_fees.ts @@ -56,8 +56,14 @@ export class GasFees { return this.clone(); } else if (typeof scalar === 'bigint') { return new GasFees(this.feePerDaGas * scalar, this.feePerL2Gas * scalar); + } else if (Number.isInteger(scalar)) { + const s = BigInt(scalar); + return new GasFees(this.feePerDaGas * s, this.feePerL2Gas * s); } else { - return new GasFees(Number(this.feePerDaGas) * scalar, Number(this.feePerL2Gas) * scalar); + return new GasFees( + BigInt(Math.ceil(Number(this.feePerDaGas) * scalar)), + BigInt(Math.ceil(Number(this.feePerL2Gas) * scalar)), + ); } }