Skip to content

Commit

Permalink
doc: leave some TODOs for sig verification, protov2 added some extra …
Browse files Browse the repository at this point in the history
…checks, so need to use a hacky way to pass them for now
  • Loading branch information
dumbeng committed Aug 19, 2024
1 parent aab722f commit be32f60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/ante/evm/sig_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
2 changes: 2 additions & 0 deletions ethereum/rpc/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions x/evm/types/tx_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

Expand Down

0 comments on commit be32f60

Please sign in to comment.