Commit 40640b09 authored by Mark Tyneway's avatar Mark Tyneway

op-chain-ops: withdrawal migration gaslimit

Set the withdrawal migration gas limit to
a non zero number.
parent 9ee4f3d7
......@@ -64,6 +64,8 @@ func MigrateWithdrawal(withdrawal *LegacyWithdrawal, l1CrossDomainMessenger *com
}
versionedNonce := EncodeVersionedNonce(withdrawal.Nonce, common.Big1)
// Encode the call to `relayMessage` on the `CrossDomainMessenger`.
// The minGasLimit can safely be 0 here.
data, err := abi.Pack(
"relayMessage",
versionedNonce,
......@@ -77,12 +79,15 @@ func MigrateWithdrawal(withdrawal *LegacyWithdrawal, l1CrossDomainMessenger *com
return nil, fmt.Errorf("cannot abi encode relayMessage: %w", err)
}
// Set the outer gas limit. This cannot be zero
gasLimit := uint64(len(data)*16 + 200_000)
w := NewWithdrawal(
withdrawal.Nonce,
&predeploys.L2CrossDomainMessengerAddr,
l1CrossDomainMessenger,
value,
new(big.Int),
new(big.Int).SetUint64(gasLimit),
data,
)
return w, nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment