Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
fix: nil pointer panic in ApplyNativeMessage (#660)
Browse files Browse the repository at this point in the history
* Problem: nil pointer panic in ApplyNativeMessage

Solution:
- pass NoOpTracer

* use NewTracer

* changelog
  • Loading branch information
yihuang authored Oct 13, 2021
1 parent 89e2b29 commit 2e06759
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
* (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.
* (evm) [tharsis#660](https://github.com/tharsis/ethermint/pull/660) Fix nil pointer panic in ApplyNativeMessage.

## [v0.7.0] - 2021-10-07

Expand Down
3 changes: 2 additions & 1 deletion x/evm/keeper/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ func (k *Keeper) ApplyNativeMessage(msg core.Message) (*types.MsgEthereumTxRespo

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)
if err != nil {
Expand Down

0 comments on commit 2e06759

Please sign in to comment.