Commit 40d3f4ff authored by Roberto Bayardo's avatar Roberto Bayardo Committed by GitHub

baseFee naming consistency (#8973)

parent 077254ed
......@@ -108,17 +108,17 @@ func (ba *FetchingAttributesBuilder) PreparePayloadAttributes(ctx context.Contex
}
// If this is the Ecotone activation block we update the system config by copying over "Scalar"
// to "BasefeeScalar". Note that after doing so, the L2 view of the system config differs from
// to "BaseFeeScalar". Note that after doing so, the L2 view of the system config differs from
// that on the L1 up until we receive a "type 4" log event that explicitly updates the new
// scalars.
if ba.rollupCfg.IsEcotoneActivationBlock(nextL2Time) {
// check if the scalar is too big to convert to uint32, and if so just use the uint32 max value
basefeeScalar := uint32(math.MaxUint32)
baseFeeScalar := uint32(math.MaxUint32)
scalar := new(big.Int).SetBytes(sysConfig.Scalar[:])
if scalar.Cmp(big.NewInt(math.MaxUint32)) < 0 {
basefeeScalar = uint32(scalar.Int64())
baseFeeScalar = uint32(scalar.Int64())
}
sysConfig.BasefeeScalar = basefeeScalar
sysConfig.BaseFeeScalar = baseFeeScalar
}
txs := make([]hexutil.Bytes, 0, 1+len(depositTxs))
......
......@@ -269,8 +269,8 @@ func L1InfoDeposit(rollupCfg *rollup.Config, sysCfg eth.SystemConfig, seqNumber
var err error
if isEcotoneButNotFirstBlock(rollupCfg, l2BlockTime) {
l1BlockInfo.BlobBaseFee = block.BlobBaseFee()
l1BlockInfo.BlobBaseFeeScalar = sysCfg.BlobBasefeeScalar
l1BlockInfo.BaseFeeScalar = sysCfg.BasefeeScalar
l1BlockInfo.BlobBaseFeeScalar = sysCfg.BlobBaseFeeScalar
l1BlockInfo.BaseFeeScalar = sysCfg.BaseFeeScalar
data, err = l1BlockInfo.marshalBinaryEcotone()
} else {
l1BlockInfo.L1FeeOverhead = sysCfg.Overhead
......
......@@ -78,8 +78,8 @@ func PayloadToSystemConfig(rollupCfg *rollup.Config, payload *eth.ExecutionPaylo
Overhead: info.L1FeeOverhead,
Scalar: info.L1FeeScalar,
GasLimit: uint64(payload.GasLimit),
BasefeeScalar: info.BaseFeeScalar,
BlobBasefeeScalar: info.BlobBaseFeeScalar,
BaseFeeScalar: info.BaseFeeScalar,
BlobBaseFeeScalar: info.BlobBaseFeeScalar,
}, err
}
}
......@@ -164,8 +164,8 @@ func ProcessSystemConfigUpdateLogEvent(destSysCfg *eth.SystemConfig, ev *types.L
if !solabi.EmptyReader(reader) {
return NewCriticalError(errors.New("too many bytes"))
}
destSysCfg.BasefeeScalar = binary.BigEndian.Uint32(packed[0:4])
destSysCfg.BlobBasefeeScalar = binary.BigEndian.Uint32(packed[4:8])
destSysCfg.BaseFeeScalar = binary.BigEndian.Uint32(packed[0:4])
destSysCfg.BlobBaseFeeScalar = binary.BigEndian.Uint32(packed[4:8])
return nil
default:
return fmt.Errorf("unrecognized L1 sysCfg update type: %s", updateType)
......
......@@ -149,19 +149,19 @@ func TestProcessSystemConfigUpdateLogEvent(t *testing.T) {
},
},
hook: func(t *testing.T, log *types.Log) *types.Log {
basefeeScalar := big.NewInt(0xaa)
blobBasefeeScalar := big.NewInt(0xbb)
baseFeeScalar := big.NewInt(0xaa)
blobBaseFeeScalar := big.NewInt(0xbb)
packed := make([]byte, 8)
basefeeScalar.FillBytes(packed[0:4])
blobBasefeeScalar.FillBytes(packed[4:8])
baseFeeScalar.FillBytes(packed[0:4])
blobBaseFeeScalar.FillBytes(packed[4:8])
data, err := bytesArgs.Pack(packed)
require.NoError(t, err)
log.Data = data
return log
},
config: eth.SystemConfig{
BasefeeScalar: 0xaa,
BlobBasefeeScalar: 0xbb,
BaseFeeScalar: 0xaa,
BlobBaseFeeScalar: 0xbb,
},
err: false,
},
......
......@@ -316,10 +316,10 @@ type SystemConfig struct {
Scalar Bytes32 `json:"scalar"`
// GasLimit identifies the L2 block gas limit
GasLimit uint64 `json:"gasLimit"`
// BasefeeScalar scales the L1 calldata fee after the Ecotone upgrade
BasefeeScalar uint32 `json:"basefeeScalar"`
// BlobBasefeeScalar scales the L1 blob fee after the Ecotone upgrade
BlobBasefeeScalar uint32 `json:"blobBasefeeScalar"`
// BaseFeeScalar scales the L1 calldata fee after the Ecotone upgrade
BaseFeeScalar uint32 `json:"baseFeeScalar"`
// BlobBaseFeeScalar scales the L1 blob fee after the Ecotone upgrade
BlobBaseFeeScalar uint32 `json:"blobBaseFeeScalar"`
// More fields can be added for future SystemConfig versions.
}
......
......@@ -29,7 +29,7 @@ const (
SafeAbortNonceTooLowCountFlagName = "safe-abort-nonce-too-low-count"
FeeLimitMultiplierFlagName = "fee-limit-multiplier"
FeeLimitThresholdFlagName = "txmgr.fee-limit-threshold"
MinBasefeeFlagName = "txmgr.min-basefee"
MinBaseFeeFlagName = "txmgr.min-basefee"
MinTipCapFlagName = "txmgr.min-tip-cap"
ResubmissionTimeoutFlagName = "resubmission-timeout"
NetworkTimeoutFlagName = "network-timeout"
......@@ -139,8 +139,8 @@ func CLIFlagsWithDefaults(envPrefix string, defaults DefaultFlagValues) []cli.Fl
EnvVars: prefixEnvVars("TXMGR_FEE_LIMIT_THRESHOLD"),
},
&cli.Float64Flag{
Name: MinBasefeeFlagName,
Usage: "Enforces a minimum basefee (in GWei) to assume when determining tx fees. Off by default.",
Name: MinBaseFeeFlagName,
Usage: "Enforces a minimum base fee (in GWei) to assume when determining tx fees. Off by default.",
EnvVars: prefixEnvVars("TXMGR_MIN_BASEFEE"),
},
&cli.Float64Flag{
......@@ -193,7 +193,7 @@ type CLIConfig struct {
SafeAbortNonceTooLowCount uint64
FeeLimitMultiplier uint64
FeeLimitThresholdGwei float64
MinBasefeeGwei float64
MinBaseFeeGwei float64
MinTipCapGwei float64
ResubmissionTimeout time.Duration
ReceiptQueryInterval time.Duration
......@@ -231,9 +231,9 @@ func (m CLIConfig) Check() error {
if m.FeeLimitMultiplier == 0 {
return errors.New("must provide FeeLimitMultiplier")
}
if m.MinBasefeeGwei < m.MinTipCapGwei {
return fmt.Errorf("minBasefee smaller than minTipCap, have %f < %f",
m.MinBasefeeGwei, m.MinTipCapGwei)
if m.MinBaseFeeGwei < m.MinTipCapGwei {
return fmt.Errorf("minBaseFee smaller than minTipCap, have %f < %f",
m.MinBaseFeeGwei, m.MinTipCapGwei)
}
if m.ResubmissionTimeout == 0 {
return errors.New("must provide ResubmissionTimeout")
......@@ -266,7 +266,7 @@ func ReadCLIConfig(ctx *cli.Context) CLIConfig {
SafeAbortNonceTooLowCount: ctx.Uint64(SafeAbortNonceTooLowCountFlagName),
FeeLimitMultiplier: ctx.Uint64(FeeLimitMultiplierFlagName),
FeeLimitThresholdGwei: ctx.Float64(FeeLimitThresholdFlagName),
MinBasefeeGwei: ctx.Float64(MinBasefeeFlagName),
MinBaseFeeGwei: ctx.Float64(MinBaseFeeFlagName),
MinTipCapGwei: ctx.Float64(MinTipCapFlagName),
ResubmissionTimeout: ctx.Duration(ResubmissionTimeoutFlagName),
ReceiptQueryInterval: ctx.Duration(ReceiptQueryIntervalFlagName),
......@@ -313,9 +313,9 @@ func NewConfig(cfg CLIConfig, l log.Logger) (Config, error) {
return Config{}, fmt.Errorf("invalid fee limit threshold: %w", err)
}
minBasefee, err := eth.GweiToWei(cfg.MinBasefeeGwei)
minBaseFee, err := eth.GweiToWei(cfg.MinBaseFeeGwei)
if err != nil {
return Config{}, fmt.Errorf("invalid min basefee: %w", err)
return Config{}, fmt.Errorf("invalid min base fee: %w", err)
}
minTipCap, err := eth.GweiToWei(cfg.MinTipCapGwei)
......@@ -328,7 +328,7 @@ func NewConfig(cfg CLIConfig, l log.Logger) (Config, error) {
ResubmissionTimeout: cfg.ResubmissionTimeout,
FeeLimitMultiplier: cfg.FeeLimitMultiplier,
FeeLimitThreshold: feeLimitThreshold,
MinBasefee: minBasefee,
MinBaseFee: minBaseFee,
MinTipCap: minTipCap,
ChainID: chainID,
TxSendTimeout: cfg.TxSendTimeout,
......@@ -359,8 +359,8 @@ type Config struct {
// below this threshold.
FeeLimitThreshold *big.Int
// Minimum basefee (in Wei) to assume when determining tx fees.
MinBasefee *big.Int
// Minimum base fee (in Wei) to assume when determining tx fees.
MinBaseFee *big.Int
// Minimum tip cap (in Wei) to enforce when determining tx fees.
MinTipCap *big.Int
......@@ -412,9 +412,9 @@ func (m Config) Check() error {
if m.FeeLimitMultiplier == 0 {
return errors.New("must provide FeeLimitMultiplier")
}
if m.MinBasefee != nil && m.MinTipCap != nil && m.MinBasefee.Cmp(m.MinTipCap) == -1 {
return fmt.Errorf("minBasefee smaller than minTipCap, have %v < %v",
m.MinBasefee, m.MinTipCap)
if m.MinBaseFee != nil && m.MinTipCap != nil && m.MinBaseFee.Cmp(m.MinTipCap) == -1 {
return fmt.Errorf("minBaseFee smaller than minTipCap, have %v < %v",
m.MinBaseFee, m.MinTipCap)
}
if m.ResubmissionTimeout == 0 {
return errors.New("must provide ResubmissionTimeout")
......
......@@ -14,6 +14,6 @@ func (*NoopTxMetrics) RecordGasBumpCount(int) {}
func (*NoopTxMetrics) RecordTxConfirmationLatency(int64) {}
func (*NoopTxMetrics) TxConfirmed(*types.Receipt) {}
func (*NoopTxMetrics) TxPublished(string) {}
func (*NoopTxMetrics) RecordBasefee(*big.Int) {}
func (*NoopTxMetrics) RecordBaseFee(*big.Int) {}
func (*NoopTxMetrics) RecordTipCap(*big.Int) {}
func (*NoopTxMetrics) RPCError() {}
......@@ -17,7 +17,7 @@ type TxMetricer interface {
RecordPendingTx(pending int64)
TxConfirmed(*types.Receipt)
TxPublished(string)
RecordBasefee(*big.Int)
RecordBaseFee(*big.Int)
RecordTipCap(*big.Int)
RPCError()
}
......@@ -33,7 +33,7 @@ type TxMetrics struct {
txPublishError *prometheus.CounterVec
publishEvent *metrics.Event
confirmEvent metrics.EventVec
basefee prometheus.Gauge
baseFee prometheus.Gauge
tipCap prometheus.Gauge
rpcError prometheus.Counter
}
......@@ -104,10 +104,10 @@ func MakeTxMetrics(ns string, factory metrics.Factory) TxMetrics {
}, []string{"error"}),
confirmEvent: metrics.NewEventVec(factory, ns, "txmgr", "confirm", "tx confirm", []string{"status"}),
publishEvent: metrics.NewEvent(factory, ns, "txmgr", "publish", "tx publish"),
basefee: factory.NewGauge(prometheus.GaugeOpts{
baseFee: factory.NewGauge(prometheus.GaugeOpts{
Namespace: ns,
Name: "basefee_wei",
Help: "Latest L1 basefee (in Wei)",
Help: "Latest L1 baseFee (in Wei)",
Subsystem: "txmgr",
}),
tipCap: factory.NewGauge(prometheus.GaugeOpts{
......@@ -158,9 +158,9 @@ func (t *TxMetrics) TxPublished(errString string) {
}
}
func (t *TxMetrics) RecordBasefee(basefee *big.Int) {
bff, _ := basefee.Float64()
t.basefee.Set(bff)
func (t *TxMetrics) RecordBaseFee(baseFee *big.Int) {
bff, _ := baseFee.Float64()
t.baseFee.Set(bff)
}
func (t *TxMetrics) RecordTipCap(tipcap *big.Int) {
......
......@@ -14,19 +14,19 @@ import (
type priceBumpTest struct {
prevGasTip int64
prevBasefee int64
prevBaseFee int64
newGasTip int64
newBasefee int64
newBaseFee int64
expectedTip int64
expectedFC int64
isBlobTx bool
}
func (tc *priceBumpTest) run(t *testing.T) {
prevFC := calcGasFeeCap(big.NewInt(tc.prevBasefee), big.NewInt(tc.prevGasTip))
prevFC := calcGasFeeCap(big.NewInt(tc.prevBaseFee), big.NewInt(tc.prevGasTip))
lgr := testlog.Logger(t, log.LvlCrit)
tip, fc := updateFees(big.NewInt(tc.prevGasTip), prevFC, big.NewInt(tc.newGasTip), big.NewInt(tc.newBasefee), tc.isBlobTx, lgr)
tip, fc := updateFees(big.NewInt(tc.prevGasTip), prevFC, big.NewInt(tc.newGasTip), big.NewInt(tc.newBaseFee), tc.isBlobTx, lgr)
require.Equal(t, tc.expectedTip, tip.Int64(), "tip must be as expected")
require.Equal(t, tc.expectedFC, fc.Int64(), "fee cap must be as expected")
......@@ -36,112 +36,112 @@ func TestUpdateFees(t *testing.T) {
require.Equal(t, int64(10), priceBump, "test must be updated if priceBump is adjusted")
tests := []priceBumpTest{
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 90, newBasefee: 900,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 90, newBaseFee: 900,
expectedTip: 110, expectedFC: 2310,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 90, newBasefee: 900,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 90, newBaseFee: 900,
expectedTip: 200, expectedFC: 4200,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 101, newBasefee: 1000,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 101, newBaseFee: 1000,
expectedTip: 110, expectedFC: 2310,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 101, newBasefee: 1000,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 101, newBaseFee: 1000,
expectedTip: 200, expectedFC: 4200,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 100, newBasefee: 1001,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 100, newBaseFee: 1001,
expectedTip: 110, expectedFC: 2310,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 100, newBasefee: 1001,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 100, newBaseFee: 1001,
expectedTip: 200, expectedFC: 4200,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 101, newBasefee: 900,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 101, newBaseFee: 900,
expectedTip: 110, expectedFC: 2310,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 101, newBasefee: 900,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 101, newBaseFee: 900,
expectedTip: 200, expectedFC: 4200,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 90, newBasefee: 1010,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 90, newBaseFee: 1010,
expectedTip: 110, expectedFC: 2310,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 90, newBasefee: 1010,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 90, newBaseFee: 1010,
expectedTip: 200, expectedFC: 4200,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 101, newBasefee: 2000,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 101, newBaseFee: 2000,
expectedTip: 110, expectedFC: 4110,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 101, newBasefee: 3000,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 101, newBaseFee: 3000,
expectedTip: 200, expectedFC: 6200,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 120, newBasefee: 900,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 120, newBaseFee: 900,
expectedTip: 120, expectedFC: 2310,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 220, newBasefee: 900,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 220, newBaseFee: 900,
expectedTip: 220, expectedFC: 4200,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 120, newBasefee: 1100,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 120, newBaseFee: 1100,
expectedTip: 120, expectedFC: 2320,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 220, newBasefee: 2000,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 220, newBaseFee: 2000,
expectedTip: 220, expectedFC: 4220,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 120, newBasefee: 1140,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 120, newBaseFee: 1140,
expectedTip: 120, expectedFC: 2400,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 220, newBasefee: 2040,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 220, newBaseFee: 2040,
expectedTip: 220, expectedFC: 4300,
isBlobTx: true,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 120, newBasefee: 1200,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 120, newBaseFee: 1200,
expectedTip: 120, expectedFC: 2520,
},
{
prevGasTip: 100, prevBasefee: 1000,
newGasTip: 220, newBasefee: 2100,
prevGasTip: 100, prevBaseFee: 1000,
newGasTip: 220, newBaseFee: 2100,
expectedTip: 220, expectedFC: 4420,
isBlobTx: true,
},
......
This diff is collapsed.
......@@ -166,7 +166,7 @@ func (g *gasPricer) feesForEpoch(epoch int64) (*big.Int, *big.Int, uint64) {
return epochGasTipCap, epochGasFeeCap, epochExcessBlobGas
}
func (g *gasPricer) basefee() *big.Int {
func (g *gasPricer) baseFee() *big.Int {
g.mu.Lock()
defer g.mu.Unlock()
return new(big.Int).Mul(g.baseBaseFee, big.NewInt(g.epoch))
......@@ -263,7 +263,7 @@ func (b *mockBackend) HeaderByNumber(ctx context.Context, number *big.Int) (*typ
bg := b.g.excessblobgas()
return &types.Header{
Number: num,
BaseFee: b.g.basefee(),
BaseFee: b.g.baseFee(),
ExcessBlobGas: &bg,
}, nil
}
......@@ -275,7 +275,7 @@ func (b *mockBackend) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (ui
if msg.GasFeeCap.Cmp(msg.GasTipCap) < 0 {
return 0, core.ErrTipAboveFeeCap
}
return b.g.basefee().Uint64(), nil
return b.g.baseFee().Uint64(), nil
}
func (b *mockBackend) SuggestGasTipCap(ctx context.Context) (*big.Int, error) {
......@@ -1022,7 +1022,7 @@ func TestIncreaseGasPrice(t *testing.T) {
},
},
{
name: "enforces min bump on only basefee increase",
name: "enforces min bump on only base fee increase",
run: func(t *testing.T) {
tx, newTx := doGasPriceIncrease(t, 100, 1000, 99, 460)
require.True(t, newTx.GasFeeCap().Cmp(tx.GasFeeCap()) > 0, "new tx fee cap must be larger")
......@@ -1061,7 +1061,7 @@ func TestIncreaseGasPrice(t *testing.T) {
}
}
// TestIncreaseGasPriceLimits asserts that if the L1 basefee & tip remain the
// TestIncreaseGasPriceLimits asserts that if the L1 base fee & tip remain the
// same, repeated calls to IncreaseGasPrice eventually hit a limit.
func TestIncreaseGasPriceLimits(t *testing.T) {
t.Run("no-threshold", func(t *testing.T) {
......@@ -1094,7 +1094,7 @@ func testIncreaseGasPriceLimit(t *testing.T, lt gasPriceLimitTest) {
borkedTip := int64(10)
borkedFee := int64(45)
// simulate 100 excess blobs which yields a 50 wei blob basefee
// simulate 100 excess blobs which yields a 50 wei blob base fee
borkedExcessBlobGas := uint64(100 * params.BlobTxBlobGasPerBlob)
borkedBackend := failingBackend{
gasTip: big.NewInt(borkedTip),
......@@ -1227,9 +1227,9 @@ func TestNonceReset(t *testing.T) {
func TestMinFees(t *testing.T) {
for _, tt := range []struct {
desc string
minBasefee *big.Int
minBaseFee *big.Int
minTipCap *big.Int
expectMinBasefee bool
expectMinBaseFee bool
expectMinTipCap bool
}{
{
......@@ -1237,8 +1237,8 @@ func TestMinFees(t *testing.T) {
},
{
desc: "high-min-basefee",
minBasefee: big.NewInt(10_000_000),
expectMinBasefee: true,
minBaseFee: big.NewInt(10_000_000),
expectMinBaseFee: true,
},
{
desc: "high-min-tipcap",
......@@ -1247,14 +1247,14 @@ func TestMinFees(t *testing.T) {
},
{
desc: "high-mins",
minBasefee: big.NewInt(10_000_000),
minBaseFee: big.NewInt(10_000_000),
minTipCap: big.NewInt(1_000_000),
expectMinBasefee: true,
expectMinBaseFee: true,
expectMinTipCap: true,
},
{
desc: "low-min-basefee",
minBasefee: big.NewInt(1),
minBaseFee: big.NewInt(1),
},
{
desc: "low-min-tipcap",
......@@ -1262,24 +1262,24 @@ func TestMinFees(t *testing.T) {
},
{
desc: "low-mins",
minBasefee: big.NewInt(1),
minBaseFee: big.NewInt(1),
minTipCap: big.NewInt(1),
},
} {
t.Run(tt.desc, func(t *testing.T) {
require := require.New(t)
conf := configWithNumConfs(1)
conf.MinBasefee = tt.minBasefee
conf.MinBaseFee = tt.minBaseFee
conf.MinTipCap = tt.minTipCap
h := newTestHarnessWithConfig(t, conf)
tip, basefee, _, err := h.mgr.suggestGasPriceCaps(context.TODO())
tip, baseFee, _, err := h.mgr.suggestGasPriceCaps(context.TODO())
require.NoError(err)
if tt.expectMinBasefee {
require.Equal(tt.minBasefee, basefee, "expect suggested basefee to equal MinBasefee")
if tt.expectMinBaseFee {
require.Equal(tt.minBaseFee, baseFee, "expect suggested base fee to equal MinBaseFee")
} else {
require.Equal(h.gasPricer.baseBaseFee, basefee, "expect suggested basefee to equal mock basefee")
require.Equal(h.gasPricer.baseBaseFee, baseFee, "expect suggested base fee to equal mock base fee")
}
if tt.expectMinTipCap {
......
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