fix: nil pointer panic in ApplyNativeMessage (#660)

* Problem: nil pointer panic in ApplyNativeMessage

Solution:
- pass NoOpTracer

* use NewTracer

* changelog
This commit is contained in:
yihuang 2021-10-13 16:57:12 +08:00 committed by GitHub
parent 89e2b29aed
commit 2e067590a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (deps) [tharsis#655](https://github.com/tharsis/ethermint/pull/665) Bump Cosmos SDK version to [`v0.44.2`](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.2). * (deps) [tharsis#655](https://github.com/tharsis/ethermint/pull/665) Bump Cosmos SDK version to [`v0.44.2`](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.44.2).
* (evm) [tharsis#650](https://github.com/tharsis/ethermint/pull/650) Fix panic when flattening the cache context in case transaction is reverted. * (evm) [tharsis#650](https://github.com/tharsis/ethermint/pull/650) Fix panic when flattening the cache context in case transaction is reverted.
* (rpc, test) [tharsis#608](https://github.com/tharsis/ethermint/pull/608) Fix rpc test. * (rpc, test) [tharsis#608](https://github.com/tharsis/ethermint/pull/608) Fix rpc test.
* (evm) [tharsis#660](https://github.com/tharsis/ethermint/pull/660) Fix nil pointer panic in ApplyNativeMessage.
## [v0.7.0] - 2021-10-07 ## [v0.7.0] - 2021-10-07

View File

@ -370,7 +370,8 @@ func (k *Keeper) ApplyNativeMessage(msg core.Message) (*types.MsgEthereumTxRespo
baseFee := k.feeMarketKeeper.GetBaseFee(ctx) baseFee := k.feeMarketKeeper.GetBaseFee(ctx)
evm := k.NewEVM(msg, ethCfg, params, coinbase, baseFee, nil) tracer := types.NewTracer(k.tracer, msg, ethCfg, ctx.BlockHeight(), k.debug)
evm := k.NewEVM(msg, ethCfg, params, coinbase, baseFee, tracer)
ret, err := k.ApplyMessage(evm, msg, ethCfg, true) ret, err := k.ApplyMessage(evm, msg, ethCfg, true)
if err != nil { if err != nil {