From fd19394fba6485e7daa6b0544c370cd6918331bb Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 25 Jun 2021 21:28:28 +0800 Subject: [PATCH] ante: don't skip `EthSigVerificationDecorator` for `RecheckTx` (#186) Because it set the `From` field which is relied by other handlers Closes #185 --- app/ante/eth.go | 8 +++----- app/ante/eth_test.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/ante/eth.go b/app/ante/eth.go index 872eca6e..824ce6e7 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -45,12 +45,10 @@ func NewEthSigVerificationDecorator(ek EVMKeeper) EthSigVerificationDecorator { // AnteHandle validates checks that the registered chain id is the same as the one on the message, and // that the signer address matches the one defined on the message. +// It's not skipped for RecheckTx, because it set `From` address which is critical from other ante handler to work. +// Failure in RecheckTx will prevent tx to be included into block, especially when CheckTx succeed, in which case user +// won't see the error message. func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { - // no need to verify signatures on recheck tx - if ctx.IsReCheckTx() { - return next(ctx, tx, simulate) - } - if len(tx.GetMsgs()) != 1 { return ctx, stacktrace.Propagate( sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "only 1 ethereum msg supported per tx, got %d", len(tx.GetMsgs())), diff --git a/app/ante/eth_test.go b/app/ante/eth_test.go index 9719d21c..acbca76b 100644 --- a/app/ante/eth_test.go +++ b/app/ante/eth_test.go @@ -33,7 +33,7 @@ func (suite AnteTestSuite) TestEthSigVerificationDecorator() { reCheckTx bool expPass bool }{ - {"ReCheckTx", nil, true, true}, + {"ReCheckTx", nil, true, false}, {"invalid transaction type", &invalidTx{}, false, false}, { "invalid sender",