From ebd7ef90bcd7ea9cc3a1fdf6d81f828de545d25d Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 1 Nov 2023 21:08:44 +0800 Subject: [PATCH 1/2] Problem: missing assign statedb to ctx --- CHANGELOG.md | 1 + x/evm/keeper/state_transition.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da8c0cc551..7909fb3e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (statedb) [#333](https://github.com/crypto-org-chain/ethermint/pull/333) Support native action in statedb, prepare for precompiles. * (rpc) [#369](https://github.com/crypto-org-chain/ethermint/pull/369) Support state overrides in eth_call. * (precompile) [#371](https://github.com/crypto-org-chain/ethermint/pull/371) Add StateDB itself into native context for precompiles to emit evm logs directly. +* (precompile) [#](https://github.com/crypto-org-chain/ethermint/pull/) Add missing assign statedb to ctx. ### State Machine Breaking diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 9f179e976f..f68c157d82 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -354,7 +354,7 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, return nil, errorsmod.Wrap(err, "failed to apply state override") } } - + ctx = ctx.WithValue(statedb.StateDBContextKey, stateDB) evm := k.NewEVM(ctx, msg, cfg, tracer, stateDB, k.customContracts) leftoverGas := msg.Gas() // Allow the tracer captures the tx level events, mainly the gas consumption. From 285224f0473c374d90ce55c211245442005a758a Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 1 Nov 2023 21:10:44 +0800 Subject: [PATCH 2/2] Update CHANGELOG.md Signed-off-by: mmsqe --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7909fb3e8f..bca04d5fee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (statedb) [#333](https://github.com/crypto-org-chain/ethermint/pull/333) Support native action in statedb, prepare for precompiles. * (rpc) [#369](https://github.com/crypto-org-chain/ethermint/pull/369) Support state overrides in eth_call. * (precompile) [#371](https://github.com/crypto-org-chain/ethermint/pull/371) Add StateDB itself into native context for precompiles to emit evm logs directly. -* (precompile) [#](https://github.com/crypto-org-chain/ethermint/pull/) Add missing assign statedb to ctx. +* (precompile) [#372](https://github.com/crypto-org-chain/ethermint/pull/372) Add missing assign statedb to ctx. ### State Machine Breaking