diff --git a/CHANGELOG.md b/CHANGELOG.md index 016284bd55..c27798fdd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -133,6 +133,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#1503](https://github.com/evmos/ethermint/pull/1503) Fix block hashes returned on JSON-RPC filter `eth_newBlockFilter`. * (rpc) [#1557](https://github.com/evmos/ethermint/pull/1557) Patch GasUsed before the fix of revert gas refund logic when transaction reverted for `eth_getTransactionReceipt`. * (ante) [#1566](https://github.com/evmos/ethermint/pull/1566) Fix `gasWanted` on `EthGasConsumeDecorator` ante handler when running transaction in `ReCheckMode` +* (rpc) [#1585](https://github.com/evmos/ethermint/pull/1585) Patch gas before the fix of clear access list before processing each transaction for `debug_traceTransaction`. ## [v0.19.3] - 2022-10-14 diff --git a/go.mod b/go.mod index f45db540ee..f03d6b5dc8 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,6 @@ require ( github.com/tyler-smith/go-bip39 v1.1.0 golang.org/x/net v0.5.0 golang.org/x/text v0.6.0 - golang.org/x/text v0.6.0 google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 google.golang.org/grpc v1.52.0 sigs.k8s.io/yaml v1.3.0 diff --git a/gomod2nix.toml b/gomod2nix.toml index d54d7f90a2..21e2192e8d 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -358,8 +358,8 @@ schema = 3 version = "v0.0.5" hash = "sha256-/5i70IkH/qSW5KjGzv8aQNKh9tHoz98tqtL0K2DMFn4=" [mod."github.com/onsi/ginkgo/v2"] - version = "v2.6.1" - hash = "sha256-OEiWYKCGPCaqL3vzSrHquHGm+Q8URT2anpanAVK5hRo=" + version = "v2.7.0" + hash = "sha256-BKqQKCsPA73FaQwYpAY+QsWFHIncrG5jgRhC2IiNmCk=" [mod."github.com/onsi/gomega"] version = "v1.24.2" hash = "sha256-iascSzzBT1Uv/XybezSblIwwrq78BU4a9BVB5MvK6MM=" @@ -496,8 +496,8 @@ schema = 3 version = "v0.0.0-20220722155223-a9213eeb770e" hash = "sha256-kNgzydWRpjm0sZl4uXEs3LX5L0xjJtJRAFf/CTlYUN4=" [mod."golang.org/x/net"] - version = "v0.4.0" - hash = "sha256-7IwGZh/xg4mQz88cJio2Ov5d3jGRXKj1itlAja/EAbQ=" + version = "v0.5.0" + hash = "sha256-HpbIAiLs7S1+tVsaSSdbCPw1IK43A0bFFuSzPSyjLbo=" [mod."golang.org/x/oauth2"] version = "v0.0.0-20221014153046-6fdb5e3db783" hash = "sha256-IoygidVNqyAZmN+3macDeIefK8hhJToygpcqlwehdYQ=" @@ -505,14 +505,14 @@ schema = 3 version = "v0.1.0" hash = "sha256-Hygjq9euZ0qz6TvHYQwOZEjNiTbTh1nSLRAWZ6KFGR8=" [mod."golang.org/x/sys"] - version = "v0.3.0" - hash = "sha256-TIHhfYbZ99sCU1ZMikxwomXH5AEtD/lA1VMMW+UAhbU=" + version = "v0.4.0" + hash = "sha256-jchMzHCH5dg+IL/F+LqaX/fyAcB/nvHQpfBjqwaRJH0=" [mod."golang.org/x/term"] - version = "v0.3.0" - hash = "sha256-NKv2o8wz8DB/2W2h/muGEIHb+S06mBXZxhG254RpQ5s=" + version = "v0.4.0" + hash = "sha256-wQKxHV10TU4vCU8Re2/hFmAbur/jRWEOB8QXBzgTFNY=" [mod."golang.org/x/text"] - version = "v0.5.0" - hash = "sha256-ztH+xQyM/clOcQl+y/UEPcfNKbc3xApMbEPDDZ9up0o=" + version = "v0.6.0" + hash = "sha256-+bpeRWR3relKACdal6NPj+eP5dnWCplTViArSN7/qA4=" [mod."golang.org/x/xerrors"] version = "v0.0.0-20220907171357-04be3eba64a2" hash = "sha256-6+zueutgefIYmgXinOflz8qGDDDj0Zhv+2OkGhBTKno=" diff --git a/proto/ethermint/evm/v1/query.proto b/proto/ethermint/evm/v1/query.proto index e533edc927..7cf873cd39 100644 --- a/proto/ethermint/evm/v1/query.proto +++ b/proto/ethermint/evm/v1/query.proto @@ -255,6 +255,9 @@ message QueryTraceTxRequest { bytes proposer_address = 8 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; // chain_id is the the eip155 chain id parsed from the requested block header int64 chain_id = 9; + // fix_clear_access_list_height defines the upgrade height for fix clear access list before processing each + // transaction + int64 fix_clear_access_list_height = 10; } // QueryTraceTxResponse defines TraceTx response @@ -279,6 +282,9 @@ message QueryTraceBlockRequest { bytes proposer_address = 8 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ConsAddress"]; // chain_id is the eip155 chain id parsed from the requested block header int64 chain_id = 9; + // fix_clear_access_list_height defines the upgrade height for fix clear access list before processing each + // transaction + int64 fix_clear_access_list_height = 10; } // QueryTraceBlockResponse defines TraceBlock response diff --git a/rpc/backend/tracing.go b/rpc/backend/tracing.go index 64aee968ed..e22219e0b2 100644 --- a/rpc/backend/tracing.go +++ b/rpc/backend/tracing.go @@ -93,13 +93,14 @@ func (b *Backend) TraceTransaction(hash common.Hash, config *evmtypes.TraceConfi } traceTxRequest := evmtypes.QueryTraceTxRequest{ - Msg: ethMessage, - Predecessors: predecessors, - BlockNumber: blk.Block.Height, - BlockTime: blk.Block.Time, - BlockHash: common.Bytes2Hex(blk.BlockID.Hash), - ProposerAddress: sdk.ConsAddress(blk.Block.ProposerAddress), - ChainId: b.chainID.Int64(), + Msg: ethMessage, + Predecessors: predecessors, + BlockNumber: blk.Block.Height, + BlockTime: blk.Block.Time, + BlockHash: common.Bytes2Hex(blk.BlockID.Hash), + ProposerAddress: sdk.ConsAddress(blk.Block.ProposerAddress), + ChainId: b.chainID.Int64(), + FixClearAccessListHeight: b.cfg.JSONRPC.FixClearAccessListHeight, } if config != nil { @@ -172,13 +173,14 @@ func (b *Backend) TraceBlock(height rpctypes.BlockNumber, ctxWithHeight := rpctypes.ContextWithHeight(int64(contextHeight)) traceBlockRequest := &evmtypes.QueryTraceBlockRequest{ - Txs: txsMessages, - TraceConfig: config, - BlockNumber: block.Block.Height, - BlockTime: block.Block.Time, - BlockHash: common.Bytes2Hex(block.BlockID.Hash), - ProposerAddress: sdk.ConsAddress(block.Block.ProposerAddress), - ChainId: b.chainID.Int64(), + Txs: txsMessages, + TraceConfig: config, + BlockNumber: block.Block.Height, + BlockTime: block.Block.Time, + BlockHash: common.Bytes2Hex(block.BlockID.Hash), + ProposerAddress: sdk.ConsAddress(block.Block.ProposerAddress), + ChainId: b.chainID.Int64(), + FixClearAccessListHeight: b.cfg.JSONRPC.FixClearAccessListHeight, } res, err := b.queryClient.TraceBlock(ctxWithHeight, traceBlockRequest) diff --git a/server/config/config.go b/server/config/config.go index ed897ee8b7..f0074d9d88 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -138,6 +138,8 @@ type JSONRPCConfig struct { MetricsAddress string `mapstructure:"metrics-address"` // FixRevertGasRefundHeight defines the upgrade height for fix of revert gas refund logic when transaction reverted FixRevertGasRefundHeight int64 `mapstructure:"fix-revert-gas-refund-height"` + // FixClearAccessListHeight defines the upgrade height for fix clear access list before processing each transaction + FixClearAccessListHeight int64 `mapstructure:"fix-clear-access-list-height"` } // TLSConfig defines the certificate and matching private key for the server. @@ -351,6 +353,7 @@ func GetConfig(v *viper.Viper) (Config, error) { EnableIndexer: v.GetBool("json-rpc.enable-indexer"), MetricsAddress: v.GetString("json-rpc.metrics-address"), FixRevertGasRefundHeight: v.GetInt64("json-rpc.fix-revert-gas-refund-height"), + FixClearAccessListHeight: v.GetInt64("json-rpc.fix-clear-access-list-height"), }, TLS: TLSConfig{ CertificatePath: v.GetString("tls.certificate-path"), diff --git a/server/config/toml.go b/server/config/toml.go index a61f110dc7..f4ddeed549 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -95,6 +95,9 @@ metrics-address = "{{ .JSONRPC.MetricsAddress }}" # Upgrade height for fix of revert gas refund logic when transaction reverted. fix-revert-gas-refund-height = {{ .JSONRPC.FixRevertGasRefundHeight }} +# Upgrade height for fix clear access list before processing each transaction. +fix-clear-access-list-height = {{ .JSONRPC.FixClearAccessListHeight }} + ############################################################################### ### TLS Configuration ### ############################################################################### diff --git a/server/flags/flags.go b/server/flags/flags.go index 5f3d9c7112..946d7e63fc 100644 --- a/server/flags/flags.go +++ b/server/flags/flags.go @@ -70,6 +70,7 @@ const ( // https://github.com/ethereum/go-ethereum/blob/master/metrics/metrics.go#L35-L55 JSONRPCEnableMetrics = "metrics" JSONRPCFixRevertGasRefundHeight = "json-rpc.fix-revert-gas-refund-height" + JSONRPCFixClearAccessListHeight = "json-rpc.fix-clear-access-list-height" ) // EVM flags diff --git a/tests/integration_tests/configs/default.jsonnet b/tests/integration_tests/configs/default.jsonnet index 349be756f4..86770fac4f 100644 --- a/tests/integration_tests/configs/default.jsonnet +++ b/tests/integration_tests/configs/default.jsonnet @@ -20,6 +20,7 @@ 'block-range-cap': 10000, 'logs-cap': 10000, 'fix-revert-gas-refund-height': 1, + 'fix-clear-access-list-height': 1, }, }, validators: [{ diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index c825c76f34..0745f2a133 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -390,6 +390,38 @@ func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*type return &types.EstimateGasResponse{Gas: hi}, nil } +// GetTxTraceResultForTx returns statedb with cached address list when need patch +func (k Keeper) GetTxTraceResultForTx( + ctx sdk.Context, + tx *types.MsgEthereumTx, + signer ethtypes.Signer, + cfg *statedb.EVMConfig, + txConfig statedb.TxConfig, + patch bool, + lastDB *statedb.StateDB, +) (*statedb.StateDB, error) { + ethTx := tx.AsTransaction() + msg, err := ethTx.AsMessage(signer, cfg.BaseFee) + if err != nil { + return lastDB, err + } + txConfig.TxHash = ethTx.Hash() + var stateDB *statedb.StateDB + if patch { + stateDB = statedb.New(ctx, &k, txConfig) + if lastDB != nil { + stateDB.SetAddressToAccessList(lastDB.GetAddressToAccessList()) + } + lastDB = stateDB + } + rsp, err := k.ApplyMessageWithStateDB(ctx, msg, types.NewNoOpTracer(), true, cfg, txConfig, stateDB) + if err != nil { + return lastDB, err + } + txConfig.LogIndex += uint(len(rsp.Logs)) + return lastDB, nil +} + // TraceTx configures a new tracer according to the provided configuration, and // executes the given message in the provided environment. The return value will // be tracer dependent. @@ -421,22 +453,14 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ if err != nil { return nil, status.Errorf(codes.Internal, "failed to load evm config: %s", err.Error()) } - signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(ctx.BlockHeight())) - + height := ctx.BlockHeight() + patch := height < req.FixClearAccessListHeight + signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(height)) txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())) + var lastDB *statedb.StateDB for i, tx := range req.Predecessors { - ethTx := tx.AsTransaction() - msg, err := ethTx.AsMessage(signer, cfg.BaseFee) - if err != nil { - continue - } - txConfig.TxHash = ethTx.Hash() txConfig.TxIndex = uint(i) - rsp, err := k.ApplyMessageWithConfig(ctx, msg, types.NewNoOpTracer(), true, cfg, txConfig) - if err != nil { - continue - } - txConfig.LogIndex += uint(len(rsp.Logs)) + lastDB, _ = k.GetTxTraceResultForTx(ctx, tx, signer, cfg, txConfig, patch, lastDB) } tx := req.Msg.AsTransaction() @@ -450,8 +474,11 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ // ignore error. default to no traceConfig _ = json.Unmarshal([]byte(req.TraceConfig.TracerJsonConfig), &tracerConfig) } - - result, _, err := k.traceTx(ctx, cfg, txConfig, signer, tx, req.TraceConfig, false, tracerConfig) + stateDB := statedb.New(ctx, &k, txConfig) + if lastDB != nil { + stateDB.SetAddressToAccessList(lastDB.GetAddressToAccessList()) + } + result, _, err := k.traceTx(ctx, cfg, txConfig, stateDB, signer, tx, req.TraceConfig, false, tracerConfig) if err != nil { // error will be returned with detail status from traceTx return nil, err @@ -467,6 +494,39 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ }, nil } +// GetTxTraceResultForBlock returns TxTraceResult and +// statedb with cached address list when need patch and +func (k Keeper) GetTxTraceResultForBlock( + ctx sdk.Context, + tx *types.MsgEthereumTx, + signer ethtypes.Signer, + cfg *statedb.EVMConfig, + txConfig statedb.TxConfig, + traceConfig *types.TraceConfig, + patch bool, + lastDB *statedb.StateDB, +) (*statedb.StateDB, *types.TxTraceResult) { + result := new(types.TxTraceResult) + ethTx := tx.AsTransaction() + txConfig.TxHash = ethTx.Hash() + var stateDB *statedb.StateDB + if patch { + stateDB = statedb.New(ctx, &k, txConfig) + if lastDB != nil { + stateDB.SetAddressToAccessList(lastDB.GetAddressToAccessList()) + } + lastDB = stateDB + } + traceResult, logIndex, err := k.traceTx(ctx, cfg, txConfig, stateDB, signer, ethTx, traceConfig, true, nil) + if err != nil { + result.Error = err.Error() + } else { + txConfig.LogIndex = logIndex + result.Result = traceResult + } + return lastDB, result +} + // TraceBlock configures a new tracer according to the provided configuration, and // executes the given message in the provided environment for all the transactions in the queried block. // The return value will be tracer dependent. @@ -499,24 +559,18 @@ func (k Keeper) TraceBlock(c context.Context, req *types.QueryTraceBlockRequest) if err != nil { return nil, status.Error(codes.Internal, "failed to load evm config") } - signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(ctx.BlockHeight())) + height := ctx.BlockHeight() + patch := height < req.FixClearAccessListHeight + signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(height)) txsLength := len(req.Txs) results := make([]*types.TxTraceResult, 0, txsLength) - txConfig := statedb.NewEmptyTxConfig(common.BytesToHash(ctx.HeaderHash().Bytes())) + var lastDB *statedb.StateDB for i, tx := range req.Txs { - result := types.TxTraceResult{} - ethTx := tx.AsTransaction() - txConfig.TxHash = ethTx.Hash() txConfig.TxIndex = uint(i) - traceResult, logIndex, err := k.traceTx(ctx, cfg, txConfig, signer, ethTx, req.TraceConfig, true, nil) - if err != nil { - result.Error = err.Error() - } else { - txConfig.LogIndex = logIndex - result.Result = traceResult - } - results = append(results, &result) + var result *types.TxTraceResult + lastDB, result = k.GetTxTraceResultForBlock(ctx, tx, signer, cfg, txConfig, req.TraceConfig, patch, lastDB) + results = append(results, result) } resultData, err := json.Marshal(results) @@ -534,6 +588,7 @@ func (k *Keeper) traceTx( ctx sdk.Context, cfg *statedb.EVMConfig, txConfig statedb.TxConfig, + stateDB *statedb.StateDB, signer ethtypes.Signer, tx *ethtypes.Transaction, traceConfig *types.TraceConfig, @@ -602,7 +657,7 @@ func (k *Keeper) traceTx( } }() - res, err := k.ApplyMessageWithConfig(ctx, msg, tracer, commitMessage, cfg, txConfig) + res, err := k.ApplyMessageWithStateDB(ctx, msg, tracer, commitMessage, cfg, txConfig, stateDB) if err != nil { return nil, 0, status.Error(codes.Internal, err.Error()) } diff --git a/x/evm/keeper/grpc_query_test.go b/x/evm/keeper/grpc_query_test.go index a56b78ff48..76db7e42d9 100644 --- a/x/evm/keeper/grpc_query_test.go +++ b/x/evm/keeper/grpc_query_test.go @@ -9,11 +9,13 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" + ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" ethlogger "github.com/ethereum/go-ethereum/eth/tracers/logger" ethparams "github.com/ethereum/go-ethereum/params" "github.com/evmos/ethermint/tests" + "github.com/evmos/ethermint/x/evm/keeper" "github.com/evmos/ethermint/x/evm/statedb" sdk "github.com/cosmos/cosmos-sdk/types" @@ -753,6 +755,87 @@ func (suite *KeeperTestSuite) TestEstimateGas() { suite.enableFeemarket = false // reset flag } +func (suite *KeeperTestSuite) TestGetTxTraceResultForTx() { + var ( + patch bool + lastDB *statedb.StateDB + addr common.Address + ) + + testCases := []struct { + msg string + malleate func(sdk.Context, *keeper.Keeper, statedb.TxConfig) + expect func(*KeeperTestSuite, *statedb.StateDB) + }{ + { + msg: "not patch case", + malleate: func(ctx sdk.Context, k *keeper.Keeper, txConfig statedb.TxConfig) { + patch = false + lastDB = nil + }, + expect: func(suite *KeeperTestSuite, result *statedb.StateDB) { + suite.Require().Nil(result) + }, + }, { + msg: "patch with empty statedb", + malleate: func(ctx sdk.Context, k *keeper.Keeper, txConfig statedb.TxConfig) { + patch = true + lastDB = statedb.New(ctx, k, txConfig) + }, + expect: func(suite *KeeperTestSuite, result *statedb.StateDB) { + suite.Require().NotNil(result) + }, + }, { + msg: "patch with existing statedb", + malleate: func(ctx sdk.Context, k *keeper.Keeper, txConfig statedb.TxConfig) { + patch = true + lastDB = statedb.New(ctx, k, txConfig) + addr = common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec") + lastDB.AddAddressToAccessList(addr) + }, + expect: func(suite *KeeperTestSuite, result *statedb.StateDB) { + suite.Require().NotNil(result) + suite.Require().True(result.GetAddressToAccessList().ContainsAddress(addr)) + }, + }, + } + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() + // Deploy contract + contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) + suite.Commit() + // Generate token transfer transaction + txMsg := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdkmath.NewIntWithDecimal(1, 18).BigInt()) + suite.Commit() + + k := suite.app.EvmKeeper + chainID := k.ChainID() + proposerAddress := suite.ctx.BlockHeader().ProposerAddress + cfg, err := k.EVMConfig(suite.ctx, proposerAddress, chainID) + if err != nil { + suite.Error(err, "error when init EVMConfig") + } + signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(1)) + txHash := common.BytesToHash([]byte("tx_hash")) + txIndex := uint(1) + logIndex := uint(1) + txConfig := statedb.NewTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes()), txHash, txIndex, logIndex) + tc.malleate(suite.ctx, k, txConfig) + lastDB, _ = k.GetTxTraceResultForTx( + suite.ctx, + txMsg, + signer, + cfg, + txConfig, + patch, + lastDB, + ) + tc.expect(suite, lastDB) + }) + } +} + func (suite *KeeperTestSuite) TestTraceTx() { // TODO deploy contract that triggers internal transactions var ( @@ -981,6 +1064,91 @@ func (suite *KeeperTestSuite) TestTraceTx() { suite.enableFeemarket = false // reset flag } +func (suite *KeeperTestSuite) TestGetTxTraceResultForBlock() { + var ( + patch bool + lastDB *statedb.StateDB + addr common.Address + ) + + testCases := []struct { + msg string + malleate func(sdk.Context, *keeper.Keeper, statedb.TxConfig) + expect func(*KeeperTestSuite, *statedb.StateDB) + }{ + { + msg: "not patch case", + malleate: func(ctx sdk.Context, k *keeper.Keeper, txConfig statedb.TxConfig) { + patch = false + lastDB = nil + }, + expect: func(suite *KeeperTestSuite, result *statedb.StateDB) { + suite.Require().Nil(result) + }, + }, { + msg: "patch with empty statedb", + malleate: func(ctx sdk.Context, k *keeper.Keeper, txConfig statedb.TxConfig) { + patch = true + lastDB = statedb.New(ctx, k, txConfig) + }, + expect: func(suite *KeeperTestSuite, result *statedb.StateDB) { + suite.Require().NotNil(result) + }, + }, { + msg: "patch with existing statedb", + malleate: func(ctx sdk.Context, k *keeper.Keeper, txConfig statedb.TxConfig) { + patch = true + lastDB = statedb.New(ctx, k, txConfig) + addr = common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec") + lastDB.AddAddressToAccessList(addr) + }, + expect: func(suite *KeeperTestSuite, result *statedb.StateDB) { + suite.Require().NotNil(result) + suite.Require().True(result.GetAddressToAccessList().ContainsAddress(addr)) + }, + }, + } + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + suite.SetupTest() + // Deploy contract + contractAddr := suite.DeployTestContract(suite.T(), suite.address, sdkmath.NewIntWithDecimal(1000, 18).BigInt()) + suite.Commit() + // Generate token transfer transaction + txMsg := suite.TransferERC20Token(suite.T(), contractAddr, suite.address, common.HexToAddress("0x378c50D9264C63F3F92B806d4ee56E9D86FfB3Ec"), sdkmath.NewIntWithDecimal(1, 18).BigInt()) + suite.Commit() + + k := suite.app.EvmKeeper + chainID := k.ChainID() + proposerAddress := suite.ctx.BlockHeader().ProposerAddress + cfg, err := k.EVMConfig(suite.ctx, proposerAddress, chainID) + if err != nil { + suite.Error(err, "error when init EVMConfig") + } + signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(1)) + txHash := common.BytesToHash([]byte("tx_hash")) + txIndex := uint(1) + logIndex := uint(1) + txConfig := statedb.NewTxConfig(common.BytesToHash(suite.ctx.HeaderHash().Bytes()), txHash, txIndex, logIndex) + tc.malleate(suite.ctx, k, txConfig) + traceConfig := &types.TraceConfig{ + EnableMemory: false, + } + lastDB, _ = k.GetTxTraceResultForBlock( + suite.ctx, + txMsg, + signer, + cfg, + txConfig, + traceConfig, + patch, + lastDB, + ) + tc.expect(suite, lastDB) + }) + } +} + func (suite *KeeperTestSuite) TestTraceBlock() { var ( txs []*types.MsgEthereumTx diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index ad90dba5fd..894498b86c 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -316,6 +316,17 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, commit bool, cfg *statedb.EVMConfig, txConfig statedb.TxConfig, +) (*types.MsgEthereumTxResponse, error) { + return k.ApplyMessageWithStateDB(ctx, msg, tracer, commit, cfg, txConfig, nil) +} + +func (k *Keeper) ApplyMessageWithStateDB(ctx sdk.Context, + msg core.Message, + tracer vm.EVMLogger, + commit bool, + cfg *statedb.EVMConfig, + txConfig statedb.TxConfig, + stateDB *statedb.StateDB, ) (*types.MsgEthereumTxResponse, error) { var ( ret []byte // return bytes from evm execution @@ -329,7 +340,9 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, return nil, errorsmod.Wrap(types.ErrCallDisabled, "failed to call contract") } - stateDB := statedb.New(ctx, k, txConfig) + if stateDB == nil { + stateDB = statedb.New(ctx, k, txConfig) + } evm := k.NewEVM(ctx, msg, cfg, tracer, stateDB) leftoverGas := msg.Gas() diff --git a/x/evm/statedb/statedb.go b/x/evm/statedb/statedb.go index 753ec76164..911a44e1fc 100644 --- a/x/evm/statedb/statedb.go +++ b/x/evm/statedb/statedb.go @@ -396,6 +396,16 @@ func (s *StateDB) AddAddressToAccessList(addr common.Address) { } } +// GetAddressToAccessList return full access list +func (s *StateDB) GetAddressToAccessList() *accessList { + return s.accessList +} + +// SetAddressToAccessList overwrite with new access list +func (s *StateDB) SetAddressToAccessList(accessList *accessList) { + s.accessList = accessList +} + // AddSlotToAccessList adds the given (address, slot)-tuple to the access list func (s *StateDB) AddSlotToAccessList(addr common.Address, slot common.Hash) { addrMod, slotMod := s.accessList.AddSlot(addr, slot) diff --git a/x/evm/types/query.pb.go b/x/evm/types/query.pb.go index d259a96d2b..f7f7926b6c 100644 --- a/x/evm/types/query.pb.go +++ b/x/evm/types/query.pb.go @@ -924,6 +924,9 @@ type QueryTraceTxRequest struct { ProposerAddress github_com_cosmos_cosmos_sdk_types.ConsAddress `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ConsAddress" json:"proposer_address,omitempty"` // chain_id is the the eip155 chain id parsed from the requested block header ChainId int64 `protobuf:"varint,9,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // fix_clear_access_list_height defines the upgrade height for fix clear access list before processing each + // transaction + FixClearAccessListHeight int64 `protobuf:"varint,10,opt,name=fix_clear_access_list_height,json=fixClearAccessListHeight,proto3" json:"fix_clear_access_list_height,omitempty"` } func (m *QueryTraceTxRequest) Reset() { *m = QueryTraceTxRequest{} } @@ -1015,6 +1018,13 @@ func (m *QueryTraceTxRequest) GetChainId() int64 { return 0 } +func (m *QueryTraceTxRequest) GetFixClearAccessListHeight() int64 { + if m != nil { + return m.FixClearAccessListHeight + } + return 0 +} + // QueryTraceTxResponse defines TraceTx response type QueryTraceTxResponse struct { // data is the response serialized in bytes @@ -1077,6 +1087,9 @@ type QueryTraceBlockRequest struct { ProposerAddress github_com_cosmos_cosmos_sdk_types.ConsAddress `protobuf:"bytes,8,opt,name=proposer_address,json=proposerAddress,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ConsAddress" json:"proposer_address,omitempty"` // chain_id is the eip155 chain id parsed from the requested block header ChainId int64 `protobuf:"varint,9,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + // fix_clear_access_list_height defines the upgrade height for fix clear access list before processing each + // transaction + FixClearAccessListHeight int64 `protobuf:"varint,10,opt,name=fix_clear_access_list_height,json=fixClearAccessListHeight,proto3" json:"fix_clear_access_list_height,omitempty"` } func (m *QueryTraceBlockRequest) Reset() { *m = QueryTraceBlockRequest{} } @@ -1161,6 +1174,13 @@ func (m *QueryTraceBlockRequest) GetChainId() int64 { return 0 } +func (m *QueryTraceBlockRequest) GetFixClearAccessListHeight() int64 { + if m != nil { + return m.FixClearAccessListHeight + } + return 0 +} + // QueryTraceBlockResponse defines TraceBlock response type QueryTraceBlockResponse struct { // data is the response serialized in bytes @@ -1314,97 +1334,100 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/query.proto", fileDescriptor_e15a877459347994) } var fileDescriptor_e15a877459347994 = []byte{ - // 1434 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xcd, 0x6f, 0x13, 0x47, - 0x14, 0xcf, 0xc6, 0x4e, 0xec, 0x3c, 0x07, 0x70, 0x87, 0x50, 0xcc, 0x36, 0xb1, 0xc3, 0x42, 0x3e, - 0x09, 0xbb, 0x8d, 0x5b, 0x21, 0x95, 0x4b, 0xc1, 0x56, 0xa0, 0x14, 0xa8, 0xa8, 0x1b, 0xf5, 0x50, - 0x09, 0x59, 0xe3, 0xf5, 0xb0, 0xb6, 0x62, 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0x56, 0xd1, 0xd9, - 0x30, 0x2c, 0xc9, 0xe9, 0x68, 0x4f, 0xe8, 0x1e, 0x6b, 0x10, 0x93, 0x6c, 0x6c, 0x24, 0x90, 0x7e, - 0xea, 0x37, 0x12, 0xc8, 0x00, 0xa9, 0x33, 0xb6, 0x05, 0x90, 0x73, 0x68, 0x23, 0x0c, 0x84, 0x06, - 0xa2, 0x5d, 0x1c, 0xd6, 0xfd, 0x3d, 0xb2, 0xff, 0x00, 0xdd, 0x83, 0x28, 0x27, 0x6d, 0xc8, 0x18, - 0x59, 0x32, 0x1d, 0x26, 0xa8, 0x9f, 0x19, 0x2b, 0x23, 0x31, 0x6c, 0x08, 0x0c, 0x67, 0xd0, 0xe9, - 0x61, 0xd5, 0x54, 0xee, 0x8b, 0xc4, 0x97, 0x30, 0x1b, 0xf0, 0x16, 0x74, 0x76, 0x84, 0xe6, 0x3e, - 0x7a, 0xa4, 0xaf, 0x4c, 0x90, 0x92, 0x08, 0x96, 0x05, 0x02, 0x1d, 0xa5, 0xc2, 0x08, 0x02, 0x62, - 0x84, 0xda, 0x10, 0x93, 0xbc, 0x08, 0x2d, 0x87, 0x75, 0xf6, 0x53, 0x26, 0x7d, 0x6d, 0xd2, 0xac, - 0x50, 0x76, 0x0d, 0x61, 0x77, 0x11, 0xe9, 0x61, 0xbb, 0x84, 0x55, 0x8a, 0x36, 0x37, 0xf7, 0x35, - 0x24, 0x7a, 0x88, 0xcd, 0x21, 0xac, 0x0f, 0xf1, 0x79, 0x08, 0x33, 0x32, 0x56, 0x85, 0xed, 0x65, - 0x94, 0x1e, 0x62, 0x5b, 0x8a, 0x17, 0x1d, 0x4c, 0xd1, 0x57, 0x10, 0x93, 0x73, 0x74, 0x64, 0xed, - 0xf5, 0x33, 0xa9, 0x91, 0xb5, 0x37, 0x30, 0x8e, 0xc7, 0x79, 0x1f, 0x0c, 0x51, 0xd6, 0x46, 0x8f, - 0x34, 0x80, 0xee, 0x24, 0x40, 0xeb, 0xe3, 0x54, 0xf7, 0x0e, 0x6f, 0x7d, 0xe3, 0x10, 0x92, 0x12, - 0xc7, 0x8a, 0xc0, 0x91, 0x41, 0x4b, 0xa3, 0x70, 0x88, 0xb1, 0xc8, 0x03, 0x21, 0xa7, 0xc9, 0x98, - 0x6e, 0xd0, 0x3b, 0x84, 0xc6, 0x74, 0x83, 0xbe, 0xa1, 0x34, 0x2e, 0x10, 0x6a, 0x58, 0xe5, 0x2e, - 0x3d, 0x7b, 0x95, 0xd6, 0x9e, 0xbf, 0x4a, 0x6b, 0x2f, 0x5f, 0xa5, 0xb5, 0x27, 0x07, 0xe9, 0xa9, - 0xe7, 0x07, 0xe9, 0xa9, 0x5f, 0x0f, 0xd2, 0x53, 0x5f, 0xf4, 0x0e, 0x2f, 0xd2, 0xe2, 0xb3, 0xab, - 0xab, 0xa5, 0x2d, 0xf4, 0x88, 0x01, 0x56, 0x9a, 0x15, 0xb3, 0xff, 0xbd, 0x7f, 0x02, 0x00, 0x00, - 0xff, 0xff, 0xa4, 0xba, 0x06, 0x5b, 0xc7, 0x11, 0x00, 0x00, + // 1480 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xc6, 0x4e, 0xec, 0x3c, 0xa7, 0x6d, 0x98, 0xa6, 0xd4, 0x5d, 0x12, 0x3b, 0xdd, 0x36, + 0x9f, 0x4d, 0x77, 0x89, 0x41, 0x95, 0xe8, 0x01, 0x1a, 0x5b, 0xe9, 0x07, 0x6d, 0x51, 0x31, 0x11, + 0x07, 0xa4, 0x6a, 0x35, 0x5e, 0x4f, 0xd6, 0xab, 0xd8, 0xbb, 0xee, 0xce, 0xd8, 0x38, 0x2d, 0xe5, + 0x80, 0x44, 0x55, 0xd4, 0x4b, 0x25, 0xee, 0xa8, 0xff, 0x01, 0x47, 0xfe, 0x85, 0x9e, 0x50, 0x25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0x3e, 0x7c, 0x92, 0x9d, 0xf8, 0xe3, 0x49, 0x76, 0x42, 0xb3, 0x60, 0xbe, + 0xf7, 0x2a, 0xad, 0x7b, 0x2e, 0x25, 0xfc, 0x6e, 0x09, 0x57, 0xb1, 0x6b, 0x91, 0xf0, 0xae, 0x5c, + 0xa2, 0xb7, 0x60, 0xc6, 0xf2, 0xca, 0xc4, 0xac, 0x60, 0x5a, 0x49, 0x4f, 0x8a, 0xb3, 0x24, 0xdf, + 0xb8, 0x8a, 0x69, 0x05, 0xcd, 0xc3, 0x94, 0xeb, 0xf1, 0x4b, 0xb1, 0x25, 0x65, 0x2d, 0x5e, 0x0c, + 0x16, 0xda, 0x07, 0x70, 0x4a, 0x18, 0x29, 0x88, 0xf0, 0xfe, 0x03, 0x94, 0x0f, 0x14, 0x50, 0x07, + 0x69, 0x90, 0x60, 0x97, 0xe1, 0x68, 0x90, 0x39, 0xb3, 0x57, 0xd3, 0x91, 0x60, 0x77, 0x3b, 0xd8, + 0x44, 0x2a, 0x24, 0x29, 0x37, 0xca, 0xf1, 0x4d, 0x0a, 0x7c, 0xed, 0x35, 0x57, 0x81, 0x03, 0xad, + 0xa6, 0xdb, 0xa8, 0x95, 0x88, 0x2f, 0x3d, 0x38, 0x22, 0x77, 0x3f, 0x12, 0x9b, 0xda, 0x75, 0x58, + 0x10, 0x38, 0x3e, 0xc5, 0x55, 0xa7, 0x8c, 0x99, 0xe7, 0xf7, 0x39, 0x73, 0x1a, 0x66, 0x2d, 0xcf, + 0xed, 0xc7, 0x91, 0xe2, 0x7b, 0xdb, 0x11, 0xaf, 0x1e, 0x29, 0xb0, 0x38, 0x44, 0x9b, 0x74, 0x6c, + 0x15, 0x8e, 0x85, 0xa8, 0x7a, 0x35, 0x86, 0x60, 0x5f, 0xa3, 0x6b, 0x61, 0x11, 0xe5, 0x83, 0x3c, + 0xbf, 0x4a, 0x7a, 0xde, 0x96, 0x45, 0xd4, 0xbe, 0x3a, 0xae, 0x88, 0xb4, 0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, 0xf3, + 0x68, 0x74, 0x55, 0x14, 0x6b, 0x85, 0x4d, 0x62, 0x7c, 0x45, 0xb1, 0x16, 0x7d, 0x0d, 0x15, 0xf5, + 0x7f, 0x31, 0xfc, 0xbb, 0x62, 0xd0, 0xce, 0xc3, 0xc9, 0x48, 0x3e, 0x47, 0xe4, 0xff, 0x44, 0x7b, + 0xce, 0x53, 0x72, 0x99, 0x84, 0xf3, 0x44, 0xbb, 0xdd, 0x9e, 0xe1, 0x72, 0x5b, 0xaa, 0xd8, 0x81, + 0x24, 0x6f, 0xfa, 0xe6, 0x1e, 0x91, 0x73, 0x34, 0xbf, 0xf1, 0xcb, 0xf3, 0xec, 0xca, 0x21, 0xe2, + 0x71, 0xcd, 0x65, 0x7c, 0xe0, 0x0b, 0x75, 0xb9, 0x3f, 0x67, 0x61, 0x4a, 0xe8, 0x47, 0x5f, 0x2b, + 0x90, 0x90, 0x3c, 0x07, 0x2d, 0x47, 0xeb, 0x64, 0x00, 0x91, 0x55, 0x57, 0xc6, 0x89, 0x05, 0x58, + 0xb5, 0x73, 0x5f, 0xfd, 0xf4, 0xfb, 0xb7, 0x93, 0xcb, 0xe8, 0x8c, 0x11, 0x21, 0xe0, 0x92, 0xeb, + 0x18, 0xf7, 0x64, 0x6e, 0xef, 0xa3, 0xef, 0x14, 0x38, 0xd2, 0x43, 0x27, 0xd1, 0xb9, 0x21, 0x66, + 0x06, 0xd1, 0x56, 0x75, 0xf3, 0x70, 0xc2, 0x12, 0x59, 0x4e, 0x20, 0xdb, 0x44, 0x1b, 0x51, 0x64, + 0x21, 0x73, 0x8d, 0x00, 0xfc, 0x5e, 0x81, 0xb9, 0x7e, 0x66, 0x88, 0xf4, 0x21, 0x66, 0x87, 0x10, + 0x52, 0xd5, 0x38, 0xb4, 0xbc, 0x44, 0x7a, 0x51, 0x20, 0x7d, 0x17, 0xe5, 0xa2, 0x48, 0x9b, 0xe1, + 0x9d, 0x0e, 0xd8, 0x6e, 0xb2, 0x7b, 0x1f, 0x3d, 0x50, 0x20, 0x21, 0x39, 0xe0, 0xd0, 0xd4, 0xf6, + 0xd2, 0xcb, 0xa1, 0xa9, 0xed, 0xa3, 0x92, 0xda, 0xa6, 0x80, 0xb5, 0x82, 0xce, 0x46, 0x61, 0x49, + 0x4e, 0x49, 0xbb, 0x42, 0xf7, 0x48, 0x81, 0x84, 0x64, 0x83, 0x43, 0x81, 0xf4, 0x52, 0xcf, 0xa1, + 0x40, 0xfa, 0x48, 0xa5, 0xb6, 0x25, 0x80, 0x9c, 0x43, 0xeb, 0x51, 0x20, 0x34, 0x10, 0xed, 0xe0, + 0x30, 0xee, 0xed, 0x93, 0x83, 0xfb, 0xe8, 0x2e, 0xc4, 0x39, 0x69, 0x44, 0xda, 0xd0, 0x92, 0x69, + 0x33, 0x51, 0xf5, 0xcc, 0x48, 0x19, 0x89, 0x61, 0x5d, 0x60, 0x38, 0x83, 0x4e, 0x0f, 0xaa, 0xa6, + 0x72, 0x4f, 0x24, 0x3e, 0x87, 0xe9, 0x80, 0x37, 0xa1, 0xb3, 0x43, 0x34, 0xf7, 0xd0, 0x33, 0x75, + 0x79, 0x8c, 0x94, 0x44, 0xb0, 0x24, 0x10, 0xa8, 0x28, 0x1d, 0x45, 0x10, 0x10, 0x33, 0xd4, 0x82, + 0x84, 0xe4, 0x65, 0x68, 0x29, 0xaa, 0xb3, 0x97, 0xb2, 0xa9, 0xab, 0xe3, 0x66, 0x4d, 0x68, 0x57, + 0x13, 0x76, 0x17, 0x90, 0x1a, 0xb5, 0x4b, 0x58, 0xc5, 0xb4, 0xb8, 0xb9, 0x2f, 0x21, 0xd5, 0x45, + 0xac, 0x0e, 0x61, 0x7d, 0x80, 0xcf, 0x03, 0x98, 0x99, 0xb6, 0x22, 0x6c, 0x2f, 0xa1, 0xcc, 0x00, + 0xdb, 0x52, 0xdc, 0xb4, 0x31, 0x45, 0x5f, 0x40, 0x42, 0xce, 0xe1, 0xa1, 0xb5, 0xd7, 0xcb, 0xe4, + 0x86, 0xd6, 0x5e, 0xdf, 0x38, 0x1f, 0xe5, 0x7d, 0x30, 0x84, 0x59, 0x0b, 0x3d, 0x54, 0x00, 0x3a, + 0x93, 0x00, 0xad, 0x8d, 0x52, 0xdd, 0x3d, 0xfc, 0xd5, 0xf5, 0x43, 0x48, 0x4a, 0x1c, 0xcb, 0x02, + 0x47, 0x16, 0x2d, 0x0e, 0xc3, 0x21, 0xc6, 0x2a, 0x0f, 0x84, 0x9c, 0x26, 0x23, 0xba, 0x41, 0xf7, + 0x10, 0x1a, 0xd1, 0x0d, 0x7a, 0x86, 0xd2, 0xa8, 0x40, 0x84, 0xc3, 0x2a, 0x7f, 0xe9, 0xe9, 0x8b, + 0x8c, 0xf2, 0xec, 0x45, 0x46, 0xf9, 0xed, 0x45, 0x46, 0x79, 0xfc, 0x32, 0x33, 0xf1, 0xec, 0x65, + 0x66, 0xe2, 0xe7, 0x97, 0x99, 0x89, 0xcf, 0xba, 0x87, 0x17, 0x69, 0xf2, 0xd9, 0xd5, 0xd1, 0xd2, + 0x12, 0x7a, 0xc4, 0x00, 0x2b, 0x4d, 0x0b, 0xee, 0xf0, 0xce, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x97, 0x70, 0x48, 0x45, 0x47, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2554,6 +2577,11 @@ func (m *QueryTraceTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.FixClearAccessListHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.FixClearAccessListHeight)) + i-- + dAtA[i] = 0x50 + } if m.ChainId != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) i-- @@ -2677,6 +2705,11 @@ func (m *QueryTraceBlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.FixClearAccessListHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.FixClearAccessListHeight)) + i-- + dAtA[i] = 0x50 + } if m.ChainId != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) i-- @@ -3143,6 +3176,9 @@ func (m *QueryTraceTxRequest) Size() (n int) { if m.ChainId != 0 { n += 1 + sovQuery(uint64(m.ChainId)) } + if m.FixClearAccessListHeight != 0 { + n += 1 + sovQuery(uint64(m.FixClearAccessListHeight)) + } return n } @@ -3191,6 +3227,9 @@ func (m *QueryTraceBlockRequest) Size() (n int) { if m.ChainId != 0 { n += 1 + sovQuery(uint64(m.ChainId)) } + if m.FixClearAccessListHeight != 0 { + n += 1 + sovQuery(uint64(m.FixClearAccessListHeight)) + } return n } @@ -5248,6 +5287,25 @@ func (m *QueryTraceTxRequest) Unmarshal(dAtA []byte) error { break } } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FixClearAccessListHeight", wireType) + } + m.FixClearAccessListHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FixClearAccessListHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -5589,6 +5647,25 @@ func (m *QueryTraceBlockRequest) Unmarshal(dAtA []byte) error { break } } + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FixClearAccessListHeight", wireType) + } + m.FixClearAccessListHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FixClearAccessListHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:])