Skip to content

a custom signer function as been defined for message cosmos.evm.erc20.v1.MsgConvertERC20 #1080

@dreamer-zq

Description

@dreamer-zq

When integrating evm (v0.6.0) with cosmos-sdk v0.53.6, an error occurs during startup if Dependency Injection (DI) is used to inject MsgConvertERC20CustomGetSigner. The error manifests as a panic: error calling provider github.com/cosmos/cosmos-sdk/runtime.ProvideInterfaceRegistry (...): a custom signer function has been defined for message cosmos.evm.erc20.v1.MsgConvertERC20 which already has a signer field defined with (cosmos.msg.v1.signer).

The root cause is that MsgConvertERC20 was defined with the option (cosmos.msg.v1.signer) = "sender", yet a CustomGetSigner was simultaneously defined; this conflict triggered a validation error.

The reason this error did not occur in the current evm version is that the validation step—specifically interfaceRegistry.SigningContext().Validate()—was not executed during the construction of the InterfaceRegistry.

evm code: https://github.com/cosmos/evm/blob/v0.1.0/encoding/config.go#L21-L55
cosmos code: https://github.com/cosmos/cosmos-sdk/blob/v0.53.6/runtime/module.go#L182

Solution: Remove the (cosmos.msg.v1.signer) = "sender" definition for MsgConvertERC20 in the proto file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions