Skip to content

Commit fdecdc9

Browse files
committed
fix(e2e): use fixed gasLimit for CI send to L2
Signed-off-by: Tomás Migone <[email protected]>
1 parent 288f864 commit fdecdc9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

cli/cross-chain.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { L1ToL2MessageGasEstimator } from '@arbitrum/sdk'
22
import { L1ToL2MessageNoGasParams } from '@arbitrum/sdk/dist/lib/message/L1ToL2MessageCreator'
3+
import { GasOverrides } from '@arbitrum/sdk/dist/lib/message/L1ToL2MessageGasEstimator'
34
import { BigNumber, providers } from 'ethers'
45
import { parseEther } from 'ethers/lib/utils'
56

@@ -53,10 +54,17 @@ export const estimateRetryableTxGas = async (
5354
excessFeeRefundAddress: gatewayAddress,
5455
callValueRefundAddress: gatewayAddress,
5556
}
57+
58+
const estimateOpts: GasOverrides = {}
59+
if (opts.maxGas) estimateOpts.gasLimit = { base: opts.maxGas }
60+
if (opts.maxSubmissionCost) estimateOpts.maxSubmissionFee = { base: opts.maxSubmissionCost }
61+
if (opts.gasPriceBid) estimateOpts.maxFeePerGas = { base: opts.gasPriceBid }
62+
5663
const gasParams = await gasEstimator.estimateAll(
5764
retryableEstimateData,
5865
baseFee as BigNumber,
5966
l1Provider,
67+
estimateOpts,
6068
)
6169

6270
// override fixed values

tasks/bridge/to-l2.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { cliOpts } from '../../cli/defaults'
33
import { sendToL2 } from '../../cli/commands/bridge/to-l2'
44
import { loadEnv } from '../../cli/env'
55
import { TASK_NITRO_SETUP_SDK } from '../deployment/nitro'
6+
import { BigNumber } from 'ethers'
67

78
export const TASK_BRIDGE_TO_L2 = 'bridge:send-to-l2'
89

@@ -49,6 +50,11 @@ task(TASK_BRIDGE_TO_L2, 'Bridge GRT tokens from L1 to L2')
4950
taskArgs.l2Provider = graph.l2.provider
5051
taskArgs.amount = hre.ethers.utils.formatEther(taskArgs.amount) // sendToL2 expects amount in GRT
5152

53+
// L2 provider gas limit estimation has been hit or miss in CI, 400k should be more than enough
54+
if (process.env.CI) {
55+
taskArgs.maxGas = BigNumber.from('400000')
56+
}
57+
5258
await sendToL2(await loadEnv(taskArgs, wallet), taskArgs)
5359

5460
console.log('Done!')

0 commit comments

Comments
 (0)