Skip to content

Commit

Permalink
chore: Fix for gas_limit test (#4131)
Browse files Browse the repository at this point in the history
* chore: not run gaslimit test if not localnet

* chore: fix equality check

* chore: add fallback mechanism
  • Loading branch information
albert-llimos authored Oct 23, 2023
1 parent 1258c54 commit 049482a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bouncer/shared/gaslimit_ccm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const MAX_TEST_GAS_CONSUMPTION = 4000000;
// EVM requires 16 gas per calldata byte so a reasonable approximation is 17 to cover hashing and other operations over the data.
const GAS_PER_BYTE = 17;
const MIN_PRIORITY_FEE = 1000000000;
const LOOP_TIMEOUT = 15;

let stopObservingCcmReceived = false;

Expand Down Expand Up @@ -277,7 +278,15 @@ export async function testGasLimitCcmSwaps() {
const spamming = spamEthereum();

// Wait for the fees to increase to the stable expected amount
while ((await getChainFees()).priorityFee >= MIN_PRIORITY_FEE) {
let i = 0;
while ((await getChainFees()).priorityFee < MIN_PRIORITY_FEE) {
console.log(i);
if (++i > LOOP_TIMEOUT) {
spam = false;
await spamming;
console.log("=== Skipping gasLimit CCM test as the priority fee didn't increase enough. ===");
return;
}
await sleep(500);
}

Expand Down

0 comments on commit 049482a

Please sign in to comment.