From 049482aaf3133a3c99ef0dcafb5725458c08580e Mon Sep 17 00:00:00 2001 From: Albert Llimos <53186777+albert-llimos@users.noreply.github.com> Date: Mon, 23 Oct 2023 13:30:18 +0200 Subject: [PATCH] chore: Fix for gas_limit test (#4131) * chore: not run gaslimit test if not localnet * chore: fix equality check * chore: add fallback mechanism --- bouncer/shared/gaslimit_ccm.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bouncer/shared/gaslimit_ccm.ts b/bouncer/shared/gaslimit_ccm.ts index 7c3e7964f4..9879a54342 100644 --- a/bouncer/shared/gaslimit_ccm.ts +++ b/bouncer/shared/gaslimit_ccm.ts @@ -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; @@ -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); }