diff --git a/app/ante/evm/sig_checker.go b/app/ante/evm/sig_checker.go index 4d0a03c..dffe39c 100644 --- a/app/ante/evm/sig_checker.go +++ b/app/ante/evm/sig_checker.go @@ -45,10 +45,12 @@ func (esvd EthSigVerificationDecorator) AnteHandle(ctx cosmos.Context, tx cosmos return ctx, err } - // set up the sender to the transaction field if not already + // sender bytes should be equal with the one defined on the message if sender != common.Address(cosmos.MustAccAddressFromBech32(msgEthTx.From)) { return ctx, errors.New("sender address does not match the one defined on the message") } + + // Need to overwrite the From field with EVM address for future use msgEthTx.From = sender.Hex() } diff --git a/ethereum/rpc/tx.go b/ethereum/rpc/tx.go index ac85255..3a0ebcd 100644 --- a/ethereum/rpc/tx.go +++ b/ethereum/rpc/tx.go @@ -45,6 +45,8 @@ func (b *BackendImpl) SendTx(ctx context.Context, signedTx *ethtypes.Transaction if err != nil { return err } + // FIXME: This is a temporary fix to set the From address in the transaction, + // protoMsgV2 need this field to be set and the address must be a bech32 address ethereumTx.From = sdktypes.AccAddress(from.Bytes()).String() // Query params to use the EVM denomination diff --git a/x/evm/types/tx_wrapper.go b/x/evm/types/tx_wrapper.go index d603898..98b8b8d 100644 --- a/x/evm/types/tx_wrapper.go +++ b/x/evm/types/tx_wrapper.go @@ -149,6 +149,7 @@ func (msg *MsgEthereumTx) BuildTx(b client.TxBuilder, evmDenom string) (signing. builder.SetExtensionOptions(option) + // FIXME: protoV2 message need msg.From, so we cannot leave it as empty anymore // A valid msg should have empty `From` //msg.From = ""