Skip to content

Commit 407f779

Browse files
authored
internal/ethapi: avoid using pending for defaults (#28784)
Given the discussions around deprecating pending (see #28623 or ethereum/execution-apis#495), we can move away from using the pending block internally, and use latest instead
1 parent 1335ba5 commit 407f779

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ethclient/gethclient/gethclient_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ func testAccessList(t *testing.T, client *rpc.Client) {
169169
From: testAddr,
170170
To: &common.Address{},
171171
Gas: 21000,
172-
GasPrice: big.NewInt(765625000),
172+
GasPrice: big.NewInt(875000000),
173173
Value: big.NewInt(1),
174174
}
175175
al, gas, vmErr, err := ec.CreateAccessList(context.Background(), msg)

internal/ethapi/api.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ type accessListResult struct {
14781478
// CreateAccessList creates an EIP-2930 type AccessList for the given transaction.
14791479
// Reexec and BlockNrOrHash can be specified to create the accessList on top of a certain state.
14801480
func (s *BlockChainAPI) CreateAccessList(ctx context.Context, args TransactionArgs, blockNrOrHash *rpc.BlockNumberOrHash) (*accessListResult, error) {
1481-
bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber)
1481+
bNrOrHash := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)
14821482
if blockNrOrHash != nil {
14831483
bNrOrHash = *blockNrOrHash
14841484
}

internal/ethapi/transaction_args.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error {
110110
Data: (*hexutil.Bytes)(&data),
111111
AccessList: args.AccessList,
112112
}
113-
pendingBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.PendingBlockNumber)
114-
estimated, err := DoEstimateGas(ctx, b, callArgs, pendingBlockNr, nil, b.RPCGasCap())
113+
latestBlockNr := rpc.BlockNumberOrHashWithNumber(rpc.LatestBlockNumber)
114+
estimated, err := DoEstimateGas(ctx, b, callArgs, latestBlockNr, nil, b.RPCGasCap())
115115
if err != nil {
116116
return err
117117
}

0 commit comments

Comments
 (0)