From 7777cf8ca76612bb0918f1b667f03b9c200000db Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Mon, 27 Oct 2025 14:34:05 -0400 Subject: [PATCH 1/2] Evm No Cosmos Field Decorator --- x/evm/ante/no_cosmos_fields.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/x/evm/ante/no_cosmos_fields.go b/x/evm/ante/no_cosmos_fields.go index a4b5b4eba6..891efd4a69 100644 --- a/x/evm/ante/no_cosmos_fields.go +++ b/x/evm/ante/no_cosmos_fields.go @@ -14,7 +14,16 @@ func NewEVMNoCosmosFieldsDecorator() EVMNoCosmosFieldsDecorator { return EVMNoCosmosFieldsDecorator{} } +type protoTxProvider interface { + GetProtoTx() *txtypes.Tx +} + func (d EVMNoCosmosFieldsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + txWrapper, ok := tx.(protoTxProvider) + if ok { + tx = txWrapper.GetProtoTx() + } + txBody, ok := tx.(interface { GetBody() *txtypes.TxBody }) From a7e8d28b5e4c2dd5f6b373f4022f73ed186efb76 Mon Sep 17 00:00:00 2001 From: kbhat1 Date: Mon, 27 Oct 2025 14:56:03 -0400 Subject: [PATCH 2/2] separate proto tx --- x/evm/ante/no_cosmos_fields.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/x/evm/ante/no_cosmos_fields.go b/x/evm/ante/no_cosmos_fields.go index 891efd4a69..80f07693f6 100644 --- a/x/evm/ante/no_cosmos_fields.go +++ b/x/evm/ante/no_cosmos_fields.go @@ -19,12 +19,14 @@ type protoTxProvider interface { } func (d EVMNoCosmosFieldsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { - txWrapper, ok := tx.(protoTxProvider) - if ok { - tx = txWrapper.GetProtoTx() + protoTx := tx + if txWrapper, ok := tx.(protoTxProvider); ok { + if inner := txWrapper.GetProtoTx(); inner != nil { + protoTx = inner + } } - txBody, ok := tx.(interface { + txBody, ok := protoTx.(interface { GetBody() *txtypes.TxBody }) if ok { @@ -40,7 +42,7 @@ func (d EVMNoCosmosFieldsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul } } - txAuth, ok := tx.(interface { + txAuth, ok := protoTx.(interface { GetAuthInfo() *txtypes.AuthInfo }) if ok { @@ -69,6 +71,10 @@ func (d EVMNoCosmosFieldsDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simul if len(sigs) > 0 { return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "signatures must be empty for EVM txs") } + } else if rawSigTx, ok := protoTx.(interface { + GetSignatures() [][]byte + }); ok && len(rawSigTx.GetSignatures()) > 0 { + return ctx, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "signatures must be empty for EVM txs") } return next(ctx, tx, simulate)