fix(sender): add gas limit when querying access list (#1108)

Co-authored-by: colinlyguo <colinlyguo@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <HAOYUatHZ@users.noreply.github.com>
This commit is contained in:
colin
2024-02-19 10:59:00 +08:00
committed by GitHub
parent e5e5cafc48
commit 66619a7548
2 changed files with 4 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ import (
"runtime/debug"
)
var tag = "v4.3.64"
var tag = "v4.3.65"
var commit = func() string {
if info, ok := debug.ReadBuildInfo(); ok {

View File

@@ -84,6 +84,9 @@ func (s *Sender) estimateGasLimit(to *common.Address, data []byte, gasPrice, gas
return gasLimitWithoutAccessList, nil, nil
}
// Explicitly set a gas limit to prevent the "insufficient funds for gas * price + value" error.
// Because if msg.Gas remains unset, CreateAccessList defaults to using RPCGasCap(), which can be excessively high.
msg.Gas = gasLimitWithoutAccessList * 3
accessList, gasLimitWithAccessList, errStr, rpcErr := s.gethClient.CreateAccessList(s.ctx, msg)
if rpcErr != nil {
log.Error("CreateAccessList RPC error", "error", rpcErr)