From 836617d2161919f73f12e34e7496fef96b6c1a0e Mon Sep 17 00:00:00 2001 From: mmsqe Date: Fri, 8 Nov 2024 10:00:06 +0800 Subject: [PATCH 1/5] Problem: no trace detail on insufficient balance (#554) * Problem: no trace detail on insufficient balance * skip check * simple reproduce --- CHANGELOG.md | 1 + .../hardhat/contracts/FeeCollector.sol | 10 +++++ tests/integration_tests/test_tracers.py | 37 ++++++++++++++++++- tests/integration_tests/utils.py | 1 + x/evm/keeper/grpc_query.go | 6 --- 5 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 tests/integration_tests/hardhat/contracts/FeeCollector.sol diff --git a/CHANGELOG.md b/CHANGELOG.md index c9cf53a8f1..28b6971aa3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -74,6 +74,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (cli) [#537](https://github.com/crypto-org-chain/ethermint/pull/537) Fix unsuppored sign mode SIGN_MODE_TEXTUAL for bank transfer. * (cli) [#543](https://github.com/crypto-org-chain/ethermint/pull/543) Fix graceful shutdown. * (rpc) [#545](https://github.com/crypto-org-chain/ethermint/pull/545) Fix state overwrite in debug trace APIs. +* (rpc) [#554](https://github.com/crypto-org-chain/ethermint/pull/554) No trace detail on insufficient balance. ### Improvements diff --git a/tests/integration_tests/hardhat/contracts/FeeCollector.sol b/tests/integration_tests/hardhat/contracts/FeeCollector.sol new file mode 100644 index 0000000000..71027eed74 --- /dev/null +++ b/tests/integration_tests/hardhat/contracts/FeeCollector.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +contract FeeCollector { + event TokensMinted(address indexed to, uint256 amount); + + function mint(uint256 amount) public payable { + emit TokensMinted(msg.sender, amount); + } +} diff --git a/tests/integration_tests/test_tracers.py b/tests/integration_tests/test_tracers.py index ea1c051641..968bb7c196 100644 --- a/tests/integration_tests/test_tracers.py +++ b/tests/integration_tests/test_tracers.py @@ -19,8 +19,10 @@ deploy_contract, derive_new_account, derive_random_account, + send_raw_transactions, send_transaction, send_txs, + sign_transaction, w3_wait_for_new_blocks, ) @@ -156,6 +158,39 @@ def process(w3): assert res[0] == res[-1], res +def test_trace_tx_reverse_transfer(ethermint): + print("reproduce only") + return + method = "debug_traceTransaction" + tracer = {"tracer": "callTracer"} + acc = derive_new_account(11) + w3 = ethermint.w3 + fund_acc(w3, acc, fund=40000000000000000) + contract, _ = deploy_contract(w3, CONTRACTS["FeeCollector"]) + amt = 18633908679862681 + raw_transactions = [] + nonce = w3.eth.get_transaction_count(acc.address) + tx = contract.functions.mint(amt).build_transaction( + { + "from": acc.address, + "value": hex(amt), + "nonce": nonce, + } + ) + raw_transactions.append(sign_transaction(w3, tx, acc.key).rawTransaction) + tx = tx | {"nonce": nonce + 1} + raw_transactions.append(sign_transaction(w3, tx, acc.key).rawTransaction) + w3_wait_for_new_blocks(w3, 1) + sended_hash_set = send_raw_transactions(w3, raw_transactions) + for h in sended_hash_set: + tx_hash = h.hex() + tx_res = w3.provider.make_request( + method, + [tx_hash, tracer], + ) + print(tx_res) + + def test_tracecall_insufficient_funds(ethermint, geth): method = "debug_traceCall" acc = derive_random_account() @@ -540,7 +575,7 @@ def test_refund_unused_gas_when_contract_tx_reverted_state_overrides(ethermint): "balance": hex(balance), "nonce": hex(nonce), } - } + }, }, ], ) diff --git a/tests/integration_tests/utils.py b/tests/integration_tests/utils.py index 9d5e9a15b2..1893cdc374 100644 --- a/tests/integration_tests/utils.py +++ b/tests/integration_tests/utils.py @@ -44,6 +44,7 @@ "Caller": "Caller.sol", "Random": "Random.sol", "TestBlockTxProperties": "TestBlockTxProperties.sol", + "FeeCollector": "FeeCollector.sol", } diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 12179d35f4..13626e35a9 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -728,12 +728,6 @@ func (k *Keeper) prepareTrace( return nil, 0, status.Error(codes.Internal, err.Error()) } - if res.VmError != "" { - if res.VmError == vm.ErrInsufficientBalance.Error() { - return nil, 0, status.Error(codes.Internal, res.VmError) - } - } - var result interface{} result, err = tracer.GetResult() if err != nil { From c9e06fa7ad1be7fa88a3172936baafaee5b2b7d9 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Mon, 11 Nov 2024 10:17:32 +0800 Subject: [PATCH 2/5] Problem: incorrect balance when no tracer in predecessors (#558) * Problem: incorrect balance when no tracer in predecessors * lint --- CHANGELOG.md | 1 + rpc/types/utils.go | 8 +++--- types/dynamic_fee.go | 4 +-- x/evm/keeper/grpc_query.go | 59 ++++++++++++++++++++++++-------------- x/evm/types/codec.go | 8 +++--- 5 files changed, 48 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28b6971aa3..e59663687d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (cli) [#543](https://github.com/crypto-org-chain/ethermint/pull/543) Fix graceful shutdown. * (rpc) [#545](https://github.com/crypto-org-chain/ethermint/pull/545) Fix state overwrite in debug trace APIs. * (rpc) [#554](https://github.com/crypto-org-chain/ethermint/pull/554) No trace detail on insufficient balance. +* (rpc) [#558](https://github.com/crypto-org-chain/ethermint/pull/558) New tracer in predecessors to trace balance correctly when `debug_traceTransaction`. ### Improvements diff --git a/rpc/types/utils.go b/rpc/types/utils.go index c0ae4b4e2e..a8e5f21f14 100644 --- a/rpc/types/utils.go +++ b/rpc/types/utils.go @@ -288,9 +288,9 @@ func BaseFeeFromEvents(events []abci.Event) *big.Int { // CheckTxFee is an internal function used to check whether the fee of // the given transaction is _reasonable_(under the cap). -func CheckTxFee(gasPrice *big.Int, gas uint64, cap float64) error { +func CheckTxFee(gasPrice *big.Int, gas uint64, feeCap float64) error { // Short circuit if there is no cap for transaction fee at all. - if cap == 0 { + if feeCap == 0 { return nil } totalfee := new(big.Float).SetInt(new(big.Int).Mul(gasPrice, new(big.Int).SetUint64(gas))) @@ -300,8 +300,8 @@ func CheckTxFee(gasPrice *big.Int, gas uint64, cap float64) error { feeEth := new(big.Float).Quo(totalfee, oneToken) // no need to check error from parsing feeFloat, _ := feeEth.Float64() - if feeFloat > cap { - return fmt.Errorf("tx fee (%.2f ether) exceeds the configured cap (%.2f ether)", feeFloat, cap) + if feeFloat > feeCap { + return fmt.Errorf("tx fee (%.2f ether) exceeds the configured cap (%.2f ether)", feeFloat, feeCap) } return nil } diff --git a/types/dynamic_fee.go b/types/dynamic_fee.go index 04bc572e7e..c3e783ff26 100644 --- a/types/dynamic_fee.go +++ b/types/dynamic_fee.go @@ -20,7 +20,7 @@ import ( ) // HasDynamicFeeExtensionOption returns true if the tx implements the `ExtensionOptionDynamicFeeTx` extension option. -func HasDynamicFeeExtensionOption(any *codectypes.Any) bool { - _, ok := any.GetCachedValue().(*ExtensionOptionDynamicFeeTx) +func HasDynamicFeeExtensionOption(codecAny *codectypes.Any) bool { + _, ok := codecAny.GetCachedValue().(*ExtensionOptionDynamicFeeTx) return ok } diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 13626e35a9..a173cff820 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -41,6 +41,7 @@ import ( rpctypes "github.com/evmos/ethermint/rpc/types" ethermint "github.com/evmos/ethermint/types" + "github.com/evmos/ethermint/x/evm/statedb" "github.com/evmos/ethermint/x/evm/types" ) @@ -424,6 +425,7 @@ func execTrace[T traceRequest]( msgCb func( ctx sdk.Context, cfg *EVMConfig, + traceConfig *types.TraceConfig, ) (*core.Message, error), ) ([]byte, error) { var zero T @@ -457,7 +459,7 @@ func execTrace[T traceRequest]( return nil, status.Errorf(codes.Internal, "failed to load evm config: %s", err.Error()) } - msg, err := msgCb(ctx, cfg) + msg, err := msgCb(ctx, cfg, req.GetTraceConfig()) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -484,9 +486,14 @@ func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*typ c, req, k, - func(ctx sdk.Context, cfg *EVMConfig) (*core.Message, error) { + func(ctx sdk.Context, cfg *EVMConfig, traceConfig *types.TraceConfig) (*core.Message, error) { signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(ctx.BlockHeight())) - cfg.Tracer = types.NewNoOpTracer() + tracer, err := newTacer(&logger.Config{}, cfg.TxConfig, traceConfig) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + cfg.Tracer = tracer + cfg.DebugTrace = true for i, tx := range req.Predecessors { ethTx := tx.AsTransaction() msg, err := core.TransactionToMessage(ethTx, signer, cfg.BaseFee) @@ -601,7 +608,7 @@ func (k Keeper) TraceCall(c context.Context, req *types.QueryTraceCallRequest) ( c, req, k, - func(ctx sdk.Context, cfg *EVMConfig) (*core.Message, error) { + func(ctx sdk.Context, cfg *EVMConfig, _ *types.TraceConfig) (*core.Message, error) { var args types.TransactionArgs err := json.Unmarshal(req.Args, &args) if err != nil { @@ -628,6 +635,31 @@ func (k Keeper) TraceCall(c context.Context, req *types.QueryTraceCallRequest) ( }, nil } +func newTacer(logConfig *logger.Config, txConfig statedb.TxConfig, traceConfig *types.TraceConfig) (tracers.Tracer, error) { + tracer := logger.NewStructLogger(logConfig) + if traceConfig != nil && traceConfig.Tracer != "" { + txIndex, err := ethermint.SafeInt(txConfig.TxIndex) + if err != nil { + return nil, err + } + tCtx := &tracers.Context{ + BlockHash: txConfig.BlockHash, + TxIndex: txIndex, + TxHash: txConfig.TxHash, + } + var cfg json.RawMessage + if traceConfig.TracerJsonConfig != "" { + cfg = json.RawMessage(traceConfig.TracerJsonConfig) + } + tracer, err := tracers.DefaultDirectory.New(traceConfig.Tracer, tCtx, cfg) + if err != nil { + return nil, err + } + return tracer, nil + } + return tracer, nil +} + // prepareTrace prepare trace on one Ethereum message, it returns a tuple: (traceResult, nextLogIndex, error). func (k *Keeper) prepareTrace( ctx sdk.Context, @@ -663,28 +695,11 @@ func (k *Keeper) prepareTrace( Overrides: overrides, } - tracer = logger.NewStructLogger(&logConfig) - - txIndex, err := ethermint.SafeInt(txConfig.TxIndex) + tracer, err = newTacer(&logConfig, txConfig, traceConfig) if err != nil { return nil, 0, status.Error(codes.Internal, err.Error()) } - tCtx := &tracers.Context{ - BlockHash: txConfig.BlockHash, - TxIndex: txIndex, - TxHash: txConfig.TxHash, - } - if traceConfig.Tracer != "" { - var cfg json.RawMessage - if traceConfig.TracerJsonConfig != "" { - cfg = json.RawMessage(traceConfig.TracerJsonConfig) - } - if tracer, err = tracers.DefaultDirectory.New(traceConfig.Tracer, tCtx, cfg); err != nil { - return nil, 0, status.Error(codes.Internal, err.Error()) - } - } - // Define a meaningful timeout of a single transaction trace if traceConfig.Timeout != "" { if timeout, err = time.ParseDuration(traceConfig.Timeout); err != nil { diff --git a/x/evm/types/codec.go b/x/evm/types/codec.go index 9b681d4846..babecead77 100644 --- a/x/evm/types/codec.go +++ b/x/evm/types/codec.go @@ -92,14 +92,14 @@ func PackTxData(txData TxData) (*codectypes.Any, error) { // UnpackTxData unpacks an Any into a TxData. It returns an error if the // client state can't be unpacked into a TxData. -func UnpackTxData(any *codectypes.Any) (TxData, error) { - if any == nil { +func UnpackTxData(codecAny *codectypes.Any) (TxData, error) { + if codecAny == nil { return nil, errorsmod.Wrap(errortypes.ErrUnpackAny, "protobuf Any message cannot be nil") } - txData, ok := any.GetCachedValue().(TxData) + txData, ok := codecAny.GetCachedValue().(TxData) if !ok { - return nil, errorsmod.Wrapf(errortypes.ErrUnpackAny, "cannot unpack Any into TxData %T", any) + return nil, errorsmod.Wrapf(errortypes.ErrUnpackAny, "cannot unpack Any into TxData %T", codecAny) } return txData, nil From 64bd2de950f6362c4e4b1b8152f23bb7e8e1ac61 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 12 Nov 2024 18:45:54 +0800 Subject: [PATCH 3/5] Problem: different maxGasWanted config leads hash mismatch (#560) this bug was introduced in https://github.com/crypto-org-chain/ethermint/commit/773438f47b95c4db11a4b90f7747a7ee5705c935 --- CHANGELOG.md | 1 + app/ante/eth.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e59663687d..6e82638a44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#545](https://github.com/crypto-org-chain/ethermint/pull/545) Fix state overwrite in debug trace APIs. * (rpc) [#554](https://github.com/crypto-org-chain/ethermint/pull/554) No trace detail on insufficient balance. * (rpc) [#558](https://github.com/crypto-org-chain/ethermint/pull/558) New tracer in predecessors to trace balance correctly when `debug_traceTransaction`. +* (ante) [#560](https://github.com/crypto-org-chain/ethermint/pull/560) Check gasWanted only in checkTx mode. ### Improvements diff --git a/app/ante/eth.go b/app/ante/eth.go index 67a95113e0..ca608777a7 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -146,7 +146,7 @@ func CheckEthGasConsume( // We can't trust the tx gas limit, because we'll refund the unused gas. gasLimit := msgEthTx.GetGas() - if maxGasWanted != 0 { + if ctx.IsCheckTx() && maxGasWanted != 0 { gasLimit = min(gasLimit, maxGasWanted) } if gasWanted > math.MaxInt64-gasLimit { From 4fb45a3b9aba7c29353442d16ef3a291fa1080a7 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 12 Nov 2024 21:02:28 +0800 Subject: [PATCH 4/5] Problem: wrong gas price when using basefee of minus one height when trace tx (#559) * Problem: wrong gas price when using basefee of minus one height when trace tx * add basefee req --------- Signed-off-by: mmsqe --- CHANGELOG.md | 1 + client/docs/swagger-ui/swagger.yaml | 9 +- proto/ethermint/evm/v1/query.proto | 4 +- rpc/backend/tracing.go | 7 + rpc/backend/tracing_test.go | 4 + x/evm/keeper/grpc_query.go | 11 ++ x/evm/types/interfaces.go | 1 + x/evm/types/query.pb.go | 255 +++++++++++++++++----------- 8 files changed, 190 insertions(+), 102 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e82638a44..9a65a26d30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#545](https://github.com/crypto-org-chain/ethermint/pull/545) Fix state overwrite in debug trace APIs. * (rpc) [#554](https://github.com/crypto-org-chain/ethermint/pull/554) No trace detail on insufficient balance. * (rpc) [#558](https://github.com/crypto-org-chain/ethermint/pull/558) New tracer in predecessors to trace balance correctly when `debug_traceTransaction`. +* (rpc) [#559](https://github.com/crypto-org-chain/ethermint/pull/559) Use basefee of transaction height instead of minus one height when `debug_traceTransaction`. * (ante) [#560](https://github.com/crypto-org-chain/ethermint/pull/560) Check gasWanted only in checkTx mode. ### Improvements diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index eaa4cc6a98..bf0dd950b4 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -3730,12 +3730,19 @@ paths: format: byte - name: chain_id description: >- - chain_id is the the eip155 chain id parsed from the requested block + chain_id is the eip155 chain id parsed from the requested block header. in: query required: false type: string format: int64 + - name: base_fee + description: >- + base_fee is the base fee based on the block_number of requested + transaction. + in: query + required: false + type: string tags: - Query /ethermint/evm/v1/validator_account/{cons_address}: diff --git a/proto/ethermint/evm/v1/query.proto b/proto/ethermint/evm/v1/query.proto index 8898dd7287..e96a7af804 100644 --- a/proto/ethermint/evm/v1/query.proto +++ b/proto/ethermint/evm/v1/query.proto @@ -267,8 +267,10 @@ message QueryTraceTxRequest { google.protobuf.Timestamp block_time = 7 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // proposer_address is the proposer of the requested block 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 + // chain_id is the eip155 chain id parsed from the requested block header int64 chain_id = 9; + // base_fee is the base fee based on the block_number of requested transaction + string base_fee = 10 [(gogoproto.customtype) = "cosmossdk.io/math.Int"]; } // QueryTraceTxResponse defines TraceTx response diff --git a/rpc/backend/tracing.go b/rpc/backend/tracing.go index fe70f9eca7..12282f42b4 100644 --- a/rpc/backend/tracing.go +++ b/rpc/backend/tracing.go @@ -26,6 +26,7 @@ import ( rpctypes "github.com/evmos/ethermint/rpc/types" ethermint "github.com/evmos/ethermint/types" evmtypes "github.com/evmos/ethermint/x/evm/types" + feemarkettypes "github.com/evmos/ethermint/x/feemarket/types" "github.com/pkg/errors" ) @@ -117,6 +118,12 @@ func (b *Backend) TraceTransaction(hash common.Hash, config *rpctypes.TraceConfi // 0 is a special value in `ContextWithHeight` contextHeight = 1 } + // Get basefee from transaction height + res, err := b.queryClient.FeeMarket.Params(rpctypes.ContextWithHeight(transaction.Height), &feemarkettypes.QueryParamsRequest{}) + if err != nil { + return nil, err + } + traceTxRequest.BaseFee = &res.Params.BaseFee traceResult, err := b.queryClient.TraceTx(rpctypes.ContextWithHeight(contextHeight), &traceTxRequest) if err != nil { return nil, err diff --git a/rpc/backend/tracing_test.go b/rpc/backend/tracing_test.go index 1cf69ffe61..454da33611 100644 --- a/rpc/backend/tracing_test.go +++ b/rpc/backend/tracing_test.go @@ -129,6 +129,8 @@ func (suite *BackendTestSuite) TestTraceTransaction() { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterBlockMultipleTxs(client, 1, []types.Tx{txBz, txBz2}) + feeMarketClient := suite.backend.queryClient.FeeMarket.(*mocks.FeeMarketQueryClient) + RegisterFeeMarketParams(feeMarketClient, 1) RegisterTraceTransactionWithPredecessors(queryClient, msgEthereumTx, []*evmtypes.MsgEthereumTx{msgEthereumTx}) }, &types.Block{Header: types.Header{Height: 1, ChainID: ChainID}, Data: types.Data{Txs: []types.Tx{txBz, txBz2}}}, @@ -169,6 +171,8 @@ func (suite *BackendTestSuite) TestTraceTransaction() { queryClient := suite.backend.queryClient.QueryClient.(*mocks.EVMQueryClient) client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterBlock(client, 1, txBz) + feeMarketClient := suite.backend.queryClient.FeeMarket.(*mocks.FeeMarketQueryClient) + RegisterFeeMarketParams(feeMarketClient, 1) RegisterTraceTransaction(queryClient, msgEthereumTx) }, &types.Block{Header: types.Header{Height: 1}, Data: types.Data{Txs: []types.Tx{txBz}}}, diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index a173cff820..038f90acfb 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -422,6 +422,7 @@ func execTrace[T traceRequest]( c context.Context, req T, k Keeper, + baseFee *big.Int, msgCb func( ctx sdk.Context, cfg *EVMConfig, @@ -459,6 +460,10 @@ func execTrace[T traceRequest]( return nil, status.Errorf(codes.Internal, "failed to load evm config: %s", err.Error()) } + if baseFee != nil { + cfg.BaseFee = baseFee + } + msg, err := msgCb(ctx, cfg, req.GetTraceConfig()) if err != nil { return nil, status.Error(codes.Internal, err.Error()) @@ -482,10 +487,15 @@ func execTrace[T traceRequest]( // executes the given message in the provided environment. The return value will // be tracer dependent. func (k Keeper) TraceTx(c context.Context, req *types.QueryTraceTxRequest) (*types.QueryTraceTxResponse, error) { + var baseFee *big.Int + if req != nil && req.BaseFee != nil { + baseFee = big.NewInt(req.BaseFee.Int64()) + } resultData, err := execTrace( c, req, k, + baseFee, func(ctx sdk.Context, cfg *EVMConfig, traceConfig *types.TraceConfig) (*core.Message, error) { signer := ethtypes.MakeSigner(cfg.ChainConfig, big.NewInt(ctx.BlockHeight())) tracer, err := newTacer(&logger.Config{}, cfg.TxConfig, traceConfig) @@ -608,6 +618,7 @@ func (k Keeper) TraceCall(c context.Context, req *types.QueryTraceCallRequest) ( c, req, k, + nil, func(ctx sdk.Context, cfg *EVMConfig, _ *types.TraceConfig) (*core.Message, error) { var args types.TransactionArgs err := json.Unmarshal(req.Args, &args) diff --git a/x/evm/types/interfaces.go b/x/evm/types/interfaces.go index 3d30a27f6c..fea304940e 100644 --- a/x/evm/types/interfaces.go +++ b/x/evm/types/interfaces.go @@ -63,6 +63,7 @@ type StakingKeeper interface { // FeeMarketKeeper type FeeMarketKeeper interface { GetBaseFee(ctx sdk.Context) *big.Int + CalculateBaseFee(ctx sdk.Context) *big.Int GetParams(ctx sdk.Context) feemarkettypes.Params } diff --git a/x/evm/types/query.pb.go b/x/evm/types/query.pb.go index 253948b1c9..dfbdc84575 100644 --- a/x/evm/types/query.pb.go +++ b/x/evm/types/query.pb.go @@ -951,8 +951,10 @@ type QueryTraceTxRequest struct { BlockTime time.Time `protobuf:"bytes,7,opt,name=block_time,json=blockTime,proto3,stdtime" json:"block_time"` // proposer_address is the proposer of the requested block 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 + // 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"` + // base_fee is the base fee based on the block_number of requested transaction + BaseFee *cosmossdk_io_math.Int `protobuf:"bytes,10,opt,name=base_fee,json=baseFee,proto3,customtype=cosmossdk.io/math.Int" json:"base_fee,omitempty"` } func (m *QueryTraceTxRequest) Reset() { *m = QueryTraceTxRequest{} } @@ -1500,105 +1502,106 @@ func init() { func init() { proto.RegisterFile("ethermint/evm/v1/query.proto", fileDescriptor_e15a877459347994) } var fileDescriptor_e15a877459347994 = []byte{ - // 1566 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0x4d, 0x6f, 0x13, 0xc7, - 0x1b, 0xcf, 0xc6, 0x4e, 0xec, 0x8c, 0x13, 0xc8, 0x7f, 0x48, 0xfe, 0x38, 0xdb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 0x9d, 0x32, 0xf6, 0xe4, 0x0d, 0x66, - 0xe4, 0xea, 0x87, 0x62, 0x51, 0xbb, 0x0a, 0x16, 0x05, 0x8e, 0x4f, 0x50, 0xbd, 0x56, 0x41, 0x8c, - 0x78, 0x7d, 0x97, 0x39, 0x01, 0xa6, 0x2d, 0xe2, 0xf6, 0xe3, 0xc8, 0xf0, 0xb5, 0x8b, 0x91, 0x5b, - 0x3d, 0x54, 0xc0, 0x52, 0x8c, 0x36, 0x79, 0xb1, 0x75, 0x70, 0x34, 0x40, 0xd5, 0xab, 0x31, 0x00, - 0xfb, 0x1a, 0xaf, 0x16, 0x04, 0xd1, 0x8e, 0xef, 0xe7, 0x57, 0x71, 0xcf, 0xdb, 0x32, 0x88, 0x3a, - 0x47, 0x47, 0x05, 0x91, 0x76, 0x55, 0x1a, 0xfb, 0x98, 0x11, 0x0f, 0xd9, 0xa3, 0x8d, 0xc1, 0x59, - 0x90, 0xd8, 0xc7, 0x07, 0x32, 0xde, 0xf8, 0x30, 0x64, 0x7e, 0x4b, 0x9a, 0xef, 0x28, 0x93, 0xe6, - 0xe7, 0xc0, 0x44, 0x0b, 0xd5, 0x9b, 0x81, 0x71, 0x7f, 0xa2, 0x9d, 0x03, 0xb3, 0x32, 0x94, 0x2a, - 0xaf, 0x74, 0xc9, 0x75, 0xf0, 0xbf, 0xd0, 0x39, 0x69, 0x02, 0x82, 0x24, 0x8f, 0x7d, 0x71, 0x6a, - 0xda, 0x14, 0x63, 0xed, 0x36, 0x80, 0x42, 0x70, 0xaf, 0x7d, 0x8d, 0xd8, 0x34, 0x30, 0x01, 0x41, - 0x52, 0x64, 0x8c, 0xaf, 0x5f, 0x8c, 0xe1, 0x25, 0x00, 0xba, 0xb5, 0x49, 0xdc, 0x2d, 0x53, 0x58, - 0xd3, 0xfd, 0xa0, 0xd5, 0x79, 0x21, 0xd3, 0xfd, 0x9a, 0x27, 0x0b, 0x99, 0x7e, 0xa3, 0xfb, 0x54, - 0x66, 0xe8,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, 0xa5, 0x70, 0xeb, 0x1b, 0x52, 0x94, 0x7a, 0x5a, 0xe1, 0x30, 0x7f, 0x04, 0x2d, - 0x72, 0xe7, 0xc2, 0x93, 0x17, 0x39, 0xe5, 0xe9, 0x8b, 0x9c, 0xf2, 0xfc, 0x45, 0x4e, 0x79, 0xf4, - 0x32, 0x37, 0xf6, 0xf4, 0x65, 0x6e, 0xec, 0x97, 0x97, 0xb9, 0xb1, 0x4f, 0xd7, 0x42, 0x14, 0x00, - 0xb7, 0x38, 0x03, 0xe8, 0x6a, 0x69, 0x0b, 0x3d, 0x82, 0x06, 0x94, 0x27, 0x05, 0xe3, 0x78, 0xe7, - 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x0f, 0xce, 0x6b, 0x84, 0x14, 0x00, 0x00, + // 1576 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0xc6, 0x4e, 0xec, 0x8c, 0x93, 0x36, 0xdf, 0x69, 0xf2, 0xad, 0xb3, 0x24, 0x76, 0xba, + 0x69, 0x7e, 0xb5, 0xe9, 0x2e, 0x31, 0x55, 0x25, 0x7a, 0xa1, 0x8d, 0x95, 0x96, 0xd2, 0x16, 0x95, + 0x25, 0xe2, 0x80, 0x84, 0xac, 0xf1, 0x7a, 0xba, 0xb6, 0xe2, 0xdd, 0x71, 0x77, 0xc6, 0xc6, 0xe9, + 0x0f, 0x0e, 0x08, 0x4a, 0x51, 0x25, 0x54, 0x09, 0x89, 0x23, 0xea, 0x7f, 0xc0, 0xbf, 0xd1, 0x63, + 0x25, 0x84, 0x84, 0x38, 0x14, 0xd4, 0x72, 0xe0, 0x2f, 0xe0, 0xc0, 0x09, 0xcd, 0xec, 0xac, 0xbd, + 0xf6, 0x7a, 0xed, 0x14, 0x15, 0xa9, 0x12, 0x27, 0xef, 0xbc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 0x95, 0xca, 0x3e, 0x64, 0xc4, 0x43, 0xf6, 0x68, 0x65, 0x70, 0x16, + 0x24, 0xf6, 0xf1, 0x81, 0x8c, 0x37, 0xfe, 0x19, 0x52, 0xbf, 0x25, 0xd5, 0x77, 0x84, 0x49, 0xf5, + 0x73, 0x60, 0xa2, 0x85, 0xea, 0xcd, 0x40, 0xb9, 0xbf, 0xd0, 0xce, 0x81, 0x59, 0x19, 0x4a, 0x95, + 0x97, 0x32, 0x72, 0x1d, 0xfc, 0x2f, 0x74, 0x4e, 0xaa, 0x80, 0x20, 0xc9, 0x63, 0x5f, 0x9c, 0x9a, + 0x36, 0xc5, 0xb7, 0x76, 0x1b, 0x40, 0xc1, 0xb8, 0xd7, 0xbe, 0x46, 0x6c, 0x1a, 0xa8, 0x80, 0x20, + 0x29, 0x32, 0xc6, 0x97, 0x2f, 0xbe, 0xe1, 0x25, 0x00, 0xba, 0xb5, 0x49, 0xd8, 0x96, 0x29, 0xac, + 0xe9, 0x7e, 0xd0, 0xea, 0xbc, 0x90, 0xe9, 0x7e, 0xcd, 0x93, 0x85, 0x4c, 0xbf, 0xd1, 0xbd, 0x2a, + 0x33, 0x74, 0x32, 0x04, 0xf2, 0x6b, 0x45, 0x5e, 0x6c, 0xa0, 0x5c, 0xe2, 0xdc, 0x04, 0xc9, 0x3a, + 0xb1, 0xb9, 0x75, 0x89, 0x8d, 0x4c, 0x61, 0x5e, 0xef, 0x2f, 0x9f, 0xfa, 0x35, 0x62, 0x9b, 0x82, + 0x05, 0x5e, 0x1e, 0x00, 0x6a, 0x7d, 0x24, 0x28, 0x5f, 0x4f, 0x18, 0x95, 0x36, 0x27, 0xef, 0xe1, + 0x86, 0x28, 0x92, 0x12, 0xb7, 0x76, 0x5d, 0x02, 0x0c, 0xa8, 0x12, 0xe0, 0x39, 0x30, 0xe9, 0x17, + 0x53, 0x71, 0x41, 0x99, 0x42, 0x36, 0x0a, 0xd1, 0x3f, 0xb1, 0x93, 0x7c, 0xf2, 0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0x00, 0x00, 0xff, 0xff, + 0xf0, 0x03, 0x0d, 0x87, 0xba, 0x14, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2807,6 +2810,18 @@ func (m *QueryTraceTxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.BaseFee != nil { + { + size := m.BaseFee.Size() + i -= size + if _, err := m.BaseFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } if m.ChainId != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) i-- @@ -3517,6 +3532,10 @@ func (m *QueryTraceTxRequest) Size() (n int) { if m.ChainId != 0 { n += 1 + sovQuery(uint64(m.ChainId)) } + if m.BaseFee != nil { + l = m.BaseFee.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -5771,6 +5790,42 @@ func (m *QueryTraceTxRequest) Unmarshal(dAtA []byte) error { break } } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v cosmossdk_io_math.Int + m.BaseFee = &v + if err := m.BaseFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) From 6464c221e6aecce1e91f365f02ab096666bab26f Mon Sep 17 00:00:00 2001 From: yihuang Date: Thu, 14 Nov 2024 16:10:37 +0800 Subject: [PATCH 5/5] Problem: nil pointer error with legacy tx format (#562) * Problem: nil pointer error with legacy tx format * Update CHANGELOG.md Signed-off-by: yihuang --------- Signed-off-by: yihuang --- CHANGELOG.md | 1 + x/evm/types/eth.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a65a26d30..ecc8368d17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -78,6 +78,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#558](https://github.com/crypto-org-chain/ethermint/pull/558) New tracer in predecessors to trace balance correctly when `debug_traceTransaction`. * (rpc) [#559](https://github.com/crypto-org-chain/ethermint/pull/559) Use basefee of transaction height instead of minus one height when `debug_traceTransaction`. * (ante) [#560](https://github.com/crypto-org-chain/ethermint/pull/560) Check gasWanted only in checkTx mode. +* (rpc) [#562](https://github.com/crypto-org-chain/ethermint/pull/562) Fix nil pointer panic with legacy transaction format. ### Improvements diff --git a/x/evm/types/eth.go b/x/evm/types/eth.go index 4ac6e9fbaa..e6d39b120a 100644 --- a/x/evm/types/eth.go +++ b/x/evm/types/eth.go @@ -4,6 +4,7 @@ import ( "encoding/json" errorsmod "cosmossdk.io/errors" + errortypes "github.com/cosmos/cosmos-sdk/types/errors" "github.com/ethereum/go-ethereum/common/hexutil" ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/evmos/ethermint/types" @@ -60,6 +61,9 @@ func (tx *EthereumTx) UnmarshalJSON(bz []byte) error { } func (tx EthereumTx) MarshalJSON() ([]byte, error) { + if tx.Transaction == nil { + return []byte("null"), nil + } bz, err := tx.MarshalBinary() if err != nil { return nil, err @@ -68,6 +72,10 @@ func (tx EthereumTx) MarshalJSON() ([]byte, error) { } func (tx EthereumTx) Validate() error { + if tx.Transaction == nil { + return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "raw tx is missing") + } + // prevent txs with 0 gas to fill up the mempool if tx.Gas() == 0 { return errorsmod.Wrap(ErrInvalidGasLimit, "gas limit must not be zero")