From 33e23ee37d181bff41692a6b3b826a8053ffd1cd Mon Sep 17 00:00:00 2001 From: "Saman H. Pasha" <51169592+saman-pasha@users.noreply.github.com> Date: Sat, 5 Nov 2022 00:33:34 +0330 Subject: [PATCH] accounts/abi.bind: don't fetch head in transact unless required (#25988) If GasFeeCap and GasTipCap are specified, we don't need to retrieve the head block for constructing a transaction --- accounts/abi/bind/base.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 88b997684a..df3f52a403 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -373,6 +373,8 @@ func (c *BoundContract) transact(opts *TransactOpts, contract *common.Address, i ) if opts.GasPrice != nil { rawTx, err = c.createLegacyTx(opts, contract, input) + } else if opts.GasFeeCap != nil && opts.GasTipCap != nil { + rawTx, err = c.createDynamicTx(opts, contract, input, nil) } else { // Only query for basefee if gasPrice not specified if head, errHead := c.transactor.HeaderByNumber(ensureContext(opts.Context), nil); errHead != nil {