Commit 50d2b108 authored by Joshua Gutow's avatar Joshua Gutow Committed by GitHub

op-node: Adjust L1 Info Transaction Gas Parameters (#2582)

This reduces the gas on the L1 Info Transaction from 99,999,999
down to 75,000. This is required as the gas from deposits is now
being counted against the total gas used in the L2 block.

Typically the transaction only uses around 30k gas and 35k would
be fine; however, for the first transaction, it uses more gas to
set the storage slots from zero (around 70k gas). As such, we
set it to a single gas limit for the time being. We also give
it a buffer of 5k gas to ensure that this transaction will not
fail.
parent cd15c40a
......@@ -189,14 +189,16 @@ func L1InfoDeposit(seqNumber uint64, block L1Info) (*types.DepositTx, error) {
L1BlockHash: block.Hash(),
SeqNumber: seqNumber,
}
// Uses ~30k normal case
// Uses ~70k on first transaction
// Round up to 75k to ensure that we always have enough gas.
return &types.DepositTx{
SourceHash: source.SourceHash(),
From: L1InfoDepositerAddress,
To: &L1InfoPredeployAddr,
Mint: nil,
Value: big.NewInt(0),
Gas: 99_999_999,
Gas: 75_000,
Data: data,
}, 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