From de18eda1863a543668cc5e2e5ff48a1073c98fde Mon Sep 17 00:00:00 2001 From: BoThe1K Date: Sat, 11 Feb 2023 01:26:33 +0100 Subject: [PATCH] Add EVM state breakers on new prod --- app/ante/handler_options.go | 3 +-- x/evm/keeper/state_transition.go | 12 ++---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/app/ante/handler_options.go b/app/ante/handler_options.go index a55f9589..d4987c71 100644 --- a/app/ante/handler_options.go +++ b/app/ante/handler_options.go @@ -48,8 +48,7 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { NewEthSetUpContextDecorator(options.EvmKeeper), // outermost AnteDecorator. SetUpContext must be called first NewEthMempoolFeeDecorator(options.EvmKeeper), // Check eth effective gas price against minimal-gas-prices NewEthValidateBasicDecorator(options.EvmKeeper), - // TODO: UNCOMMENT THIS FOR PROD!!!!!! - // NewEthTxPayloadVerificationDecorator(), + NewEthTxPayloadVerificationDecorator(), NewEthSigVerificationDecorator(options.EvmKeeper), NewEthAccountVerificationDecorator(options.AccountKeeper, options.EvmKeeper), NewEthGasConsumeDecorator(options.EvmKeeper, options.MaxTxGasWanted), diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 92c097b8..b9dd1588 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -382,24 +382,16 @@ func (k *Keeper) ApplyMessageWithConfig(ctx sdk.Context, msg core.Message, trace // take over the nonce management from evm: // reset sender's nonce to msg.Nonce() before calling evm on msg nonce // as nonce already increased in db - // TODO: UNCOMMENT THIS FOR PROD!!!!!! - // stateDB.SetNonce(sender.Address(), msg.Nonce()) + stateDB.SetNonce(sender.Address(), msg.Nonce()) if contractCreation { // no need to increase nonce here as contract as during contract creation: // - tx.origin nonce increase automatically // - if IsEIP158 enabled, contract nonce will be set as 1 - - // NOTE: REMOVE THIS FOR PROD!!!!!!!!!!! - stateDB.SetNonce(sender.Address(), msg.Nonce()) ret, _, leftoverGas, vmErr = evm.Create(sender, msg.Data(), leftoverGas, msg.Value()) - - // NOTE: REMOVE THIS FOR PROD!!!!!!!!!!! - stateDB.SetNonce(sender.Address(), msg.Nonce()+1) } else { // should be incresed before call on nonce from msg so we make sure nonce remaining same as on init tx - // TODO: UNCOMMENT THIS FOR PROD!!!!!! - // stateDB.SetNonce(sender.Address(), msg.Nonce()+1) + stateDB.SetNonce(sender.Address(), msg.Nonce()+1) ret, leftoverGas, vmErr = evm.Call(sender, *msg.To(), msg.Data(), leftoverGas, msg.Value()) }