From 22dafb85c359bb6c894367cdba08a930778da1cb Mon Sep 17 00:00:00 2001 From: viraj124 Date: Mon, 30 Dec 2024 15:28:08 +0530 Subject: [PATCH] chore: debug ci failure --- .../integration-tests/bridge_erc20.ts | 14 +++++++++++--- .../integration-tests/transfer_eth.ts | 12 ++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/packages/solidity-contracts/integration-tests/bridge_erc20.ts b/packages/solidity-contracts/integration-tests/bridge_erc20.ts index 65954400..fa6dc64f 100644 --- a/packages/solidity-contracts/integration-tests/bridge_erc20.ts +++ b/packages/solidity-contracts/integration-tests/bridge_erc20.ts @@ -146,16 +146,20 @@ describe('Bridging ERC20 tokens', async function () { const commitHeight = new BN(nextBlockHeight).div(blocksPerCommitInterval); let cooldown = await env.eth.fuelChainState.COMMIT_COOLDOWN(); - + + // fast forward post the commit cooldown period await env.eth.provider.send('evm_increaseTime', [Number(cooldown) * 10]); // Advance 1 hour await env.eth.provider.send('evm_mine', []); // Mine a new block + + // override the commit hash in a existing block await env.eth.fuelChainState .connect(env.eth.signers[1]) .commit( '0x0000000000000000000000000000000000000000000000000000000000000000', commitHeight.toString() ); - + + // fast forward to the block finalization time await env.eth.provider.send('evm_increaseTime', [ Number(TIME_TO_FINALIZE) * 2, ]); @@ -163,17 +167,21 @@ describe('Bridging ERC20 tokens', async function () { cooldown = await env.eth.fuelChainState.COMMIT_COOLDOWN(); + // fast forward post the commit cooldown period await env.eth.provider.send('evm_increaseTime', [Number(cooldown) * 10]); // Advance 1 hour await env.eth.provider.send('evm_mine', []); // Mine a new block - + + // produce more blocks to fetch the block height await forwardFuelChain(env.fuel.provider, blocksPerCommitInterval); const block = await getBlockWithHeight(env, nextBlockHeight.toString()); + // reset the commit hash in the local L2 network await env.eth.fuelChainState .connect(env.eth.signers[1]) .commit(block.id, commitHeight.toString()); + // fast forward to the block finalization time await env.eth.provider.send('evm_increaseTime', [ Number(TIME_TO_FINALIZE) * 2, ]); diff --git a/packages/solidity-contracts/integration-tests/transfer_eth.ts b/packages/solidity-contracts/integration-tests/transfer_eth.ts index 9d5d1a4c..5df1477f 100644 --- a/packages/solidity-contracts/integration-tests/transfer_eth.ts +++ b/packages/solidity-contracts/integration-tests/transfer_eth.ts @@ -102,8 +102,11 @@ describe('Transferring ETH', async function () { let cooldown = await env.eth.fuelChainState.COMMIT_COOLDOWN(); + // fast forward post the commit cooldown period await env.eth.provider.send('evm_increaseTime', [Number(cooldown) * 10]); // Advance 1 hour await env.eth.provider.send('evm_mine', []); // Mine a new block + + // override the commit hash in a existing block await env.eth.fuelChainState .connect(env.eth.signers[1]) .commit( @@ -111,6 +114,7 @@ describe('Transferring ETH', async function () { commitHeight.toString() ); + // fast forward to the block finalization time await env.eth.provider.send('evm_increaseTime', [ Number(TIME_TO_FINALIZE) * 2, ]); @@ -118,17 +122,21 @@ describe('Transferring ETH', async function () { cooldown = await env.eth.fuelChainState.COMMIT_COOLDOWN(); + // fast forward post the commit cooldown period await env.eth.provider.send('evm_increaseTime', [Number(cooldown) * 10]); // Advance 1 hour await env.eth.provider.send('evm_mine', []); // Mine a new block + // produce more blocks to fetch the block height await forwardFuelChain(env.fuel.provider, blocksPerCommitInterval); const block = await getBlockWithHeight(env, nextBlockHeight.toString()); + // reset the commit hash in the local L2 network await env.eth.fuelChainState .connect(env.eth.signers[1]) .commit(block.id, commitHeight.toString()); + // fast forward to the block finalization time await env.eth.provider.send('evm_increaseTime', [ Number(TIME_TO_FINALIZE) * 2, ]); @@ -446,9 +454,13 @@ describe('Transferring ETH', async function () { const currentPeriodEndBeforeRelay = await env.eth.fuelMessagePortal.currentPeriodEnd(); + console.log("reset limit") + await env.eth.fuelMessagePortal .connect(deployer) .resetRateLimitAmount(parseEther(largeRateLimit)); + + console.log("generateWithdrawalMessageProof") withdrawMessageProof = await generateWithdrawalMessageProof( fuelETHSender,