Commit dfe3598f authored by Kevin Ho's avatar Kevin Ho Committed by Mark Tyneway

l2geth: lower per tx fee overhead

Lower the constant overhead that is charged per transaction
by about half. This will reduce transaction fees. Note that
this value is in both `l2geth` and in `core-utils` if it
needs to be updated in the future.
parent 087f1f4e
---
'@eth-optimism/core-utils': patch
'@eth-optimism/l2geth': patch
---
Lower per tx fee overhead to more accurately represent L1 costs
......@@ -9,7 +9,7 @@ import (
// overhead represents the fixed cost of batch submission of a single
// transaction in gas.
const overhead uint64 = 4200 + 200*params.TxDataNonZeroGasEIP2028
const overhead uint64 = 2750
// feeScalar is used to scale the calculations in EncodeL2GasLimit
// to prevent them from being too large
......
......@@ -420,9 +420,7 @@ describe('Basic RPC tests', () => {
expect(decoded).to.deep.eq(BigNumber.from(l2Gaslimit))
expect(estimate.toString().endsWith(l2Gaslimit.toString()))
const l2GasPrice = BigNumber.from(0)
// The L2GasPrice should be fetched from the L2GasPrice oracle contract,
// but it does not yet exist. Use the default value for now
const l2GasPrice = await env.gasPriceOracle.gasPrice()
const expected = TxGasLimit.encode({
data: tx.data,
l1GasPrice,
......
......@@ -25,7 +25,7 @@ var (
// overhead represents the fixed cost of batch submission of a single
// transaction in gas.
const overhead uint64 = 4200 + 200*params.TxDataNonZeroGasEIP2028
const overhead uint64 = 2750
// feeScalar is used to scale the calculations in EncodeL2GasLimit
// to prevent them from being too large
......
......@@ -8,7 +8,7 @@ import { remove0x } from './common'
const feeScalar = 10_000_000
const txDataZeroGas = 4
const txDataNonZeroGasEIP2028 = 16
const overhead = 4200 + 200 * txDataNonZeroGasEIP2028
const overhead = 2750
const tenThousand = BigNumber.from(10_000)
export const TxGasPrice = BigNumber.from(feeScalar + feeScalar / 2)
export interface EncodableL2GasLimit {
......
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