Skip to content

Commit c475bc4

Browse files
committed
eth/channel: Don't set GasPrice in ContractBackend.NewTransactor
Setting TransactOpts.GasPrice forces the transactions to be sent as a legacy transaction, instead of a type 2 EIP1559, which results in much higher gas costs. Also remove the SuggestedGasPrice method from the SimulatedBackend, as it is not used anymore, because EIP1559 TXs are now sent everywhere. Signed-off-by: Sebastian Stammler <seb@perun.network>
1 parent 2af7cbd commit c475bc4

2 files changed

Lines changed: 0 additions & 10 deletions

File tree

backend/ethereum/channel/contractbackend.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,6 @@ func (c *ContractBackend) NewTransactor(ctx context.Context, gasLimit uint64,
145145
return nil, errors.WithMessage(err, "creating transactor")
146146
}
147147

148-
auth.GasPrice, err = c.SuggestGasPrice(ctx)
149-
if err != nil {
150-
return nil, errors.Wrapf(err, "estimating gas price")
151-
}
152-
153148
auth.GasLimit = gasLimit
154149
auth.Context = ctx
155150

backend/ethereum/channel/test/simulated.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,6 @@ func NewSimulatedBackend(opts ...SimBackendOpt) *SimulatedBackend {
106106
return sb
107107
}
108108

109-
// SuggestGasPrice always returns `GasPrice`.
110-
func (*SimulatedBackend) SuggestGasPrice(context.Context) (*big.Int, error) {
111-
return big.NewInt(GasPrice), nil
112-
}
113-
114109
// SendTransaction executes a transaction.
115110
func (s *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transaction) error {
116111
if err := s.SimulatedBackend.SendTransaction(ctx, tx); err != nil {

0 commit comments

Comments
 (0)