File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { L1ToL2MessageGasEstimator } from '@arbitrum/sdk'
2
2
import { L1ToL2MessageNoGasParams } from '@arbitrum/sdk/dist/lib/message/L1ToL2MessageCreator'
3
+ import { GasOverrides } from '@arbitrum/sdk/dist/lib/message/L1ToL2MessageGasEstimator'
3
4
import { BigNumber , providers } from 'ethers'
4
5
import { parseEther } from 'ethers/lib/utils'
5
6
@@ -53,10 +54,17 @@ export const estimateRetryableTxGas = async (
53
54
excessFeeRefundAddress : gatewayAddress ,
54
55
callValueRefundAddress : gatewayAddress ,
55
56
}
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
+
56
63
const gasParams = await gasEstimator . estimateAll (
57
64
retryableEstimateData ,
58
65
baseFee as BigNumber ,
59
66
l1Provider ,
67
+ estimateOpts ,
60
68
)
61
69
62
70
// override fixed values
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { cliOpts } from '../../cli/defaults'
3
3
import { sendToL2 } from '../../cli/commands/bridge/to-l2'
4
4
import { loadEnv } from '../../cli/env'
5
5
import { TASK_NITRO_SETUP_SDK } from '../deployment/nitro'
6
+ import { BigNumber } from 'ethers'
6
7
7
8
export const TASK_BRIDGE_TO_L2 = 'bridge:send-to-l2'
8
9
@@ -49,6 +50,11 @@ task(TASK_BRIDGE_TO_L2, 'Bridge GRT tokens from L1 to L2')
49
50
taskArgs . l2Provider = graph . l2 . provider
50
51
taskArgs . amount = hre . ethers . utils . formatEther ( taskArgs . amount ) // sendToL2 expects amount in GRT
51
52
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
+
52
58
await sendToL2 ( await loadEnv ( taskArgs , wallet ) , taskArgs )
53
59
54
60
console . log ( 'Done!' )
You can’t perform that action at this time.
0 commit comments