diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index f1302848f725d..8aabe465fc6b9 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1421,7 +1421,12 @@ func AccessList(ctx context.Context, b Backend, blockNrOrHash rpc.BlockNumberOrH if gasPrice == nil { gasPrice = new(big.Int) } - msg := types.NewMessage(args.from(), args.To, uint64(*args.Nonce), args.Value.ToInt(), uint64(*args.Gas), gasPrice, big.NewInt(0), big.NewInt(0), args.data(), accessList, false) + // Set the accesslist to the last al + args.AccessList = &accessList + msg, err := args.ToMessage(b.RPCGasCap(), header.BaseFee) + if err != nil { + return nil, 0, nil, err + } // Apply the transaction with the access list tracer tracer := vm.NewAccessListTracer(accessList, args.from(), to, precompiles)