Skip to content

Commit

Permalink
Merge pull request #8591 from ethereum-optimism/aj/backport-txmgr-fix…
Browse files Browse the repository at this point in the history
…-canyon-mainnet

Backport #8572: fix swapped fee/tip parameters to estimateGas
  • Loading branch information
ajsutton authored Dec 12, 2023
2 parents 6a9f126 + aa7fda6 commit 39fc506
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions op-service/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
gas, err := m.backend.EstimateGas(ctx, ethereum.CallMsg{
From: m.cfg.From,
To: candidate.To,
GasFeeCap: gasFeeCap,
GasTipCap: gasTipCap,
GasFeeCap: gasFeeCap,
Data: rawTx.Data,
Value: rawTx.Value,
})
Expand Down Expand Up @@ -536,8 +536,8 @@ func (m *SimpleTxManager) increaseGasPrice(ctx context.Context, tx *types.Transa
gas, err := m.backend.EstimateGas(ctx, ethereum.CallMsg{
From: m.cfg.From,
To: rawTx.To,
GasFeeCap: bumpedTip,
GasTipCap: bumpedFee,
GasTipCap: bumpedTip,
GasFeeCap: bumpedFee,
Data: rawTx.Data,
})
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions op-service/txmgr/txmgr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ func (b *mockBackend) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (ui
if b.g.err != nil {
return 0, b.g.err
}
if msg.GasFeeCap.Cmp(msg.GasTipCap) < 0 {
return 0, core.ErrTipAboveFeeCap
}
return b.g.basefee().Uint64(), nil
}

Expand Down

0 comments on commit 39fc506

Please sign in to comment.