hermes: Hermes can't write transaction to Ethermint chain (unauthorized error)

Summary of Bug

Can’t get Hermes to write txs to (local) Ethermint chain.

Version

hermes 1.3.0

Steps to Reproduce

Launch a local ethermint chain
$ git clone https://github.com/evmos/ethermint
$ cd ethermint
$ ./init.sh

Then I naively generated a new key for the relayer account (the problem might be here):

Create a new account
$ ethermintd keys add relayer

# took note of the mnemonic output and pasted into /tmp/m
$ echo -n 'memory bus [...] seek benefit' > /tmp/m

# fund the new account
$ ethermintd tx bank send mykey 'ethm1pqspvm4j3cl68z2tgfnm5h3zdglkxhwapkgg8e' 100000photon --fees 20photon --yes
Add chain to config.toml
[[chains]]
id = 'ethermint'
rpc_addr = 'http://localhost:26657'
grpc_addr = 'http://localhost:9090'
websocket_addr = 'ws://localhost:26657/websocket'
rpc_timeout = '15s'
account_prefix = 'ethm'
key_name = 'wallet'
store_prefix = 'ibc'
gas_price = { price = 10000, denom = 'aphoton' }
max_gas = 10000000
clock_drift = '5s'
trust_threshold = { numerator = '2', denominator = '3' }
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }

I actually tweaked gas_price to see if it changed anything.

Import key into hermes
$ cargo run keys add --mnemonic-file /tmp/m --chain ethermint --hd-path "m/44'/60'/0'/0/0"
SUCCESS Restored key 'wallet' (ethm1pqspvm4j3cl68z2tgfnm5h3zdglkxhwapkgg8e) on chain ethermint
Hermes error
$ hermes create client --host-chain ethermint --reference-chain otherchain

2023-03-14T15:44:51.776038Z  INFO ThreadId(01) using default configuration from '/Users/antonio/.hermes/config.toml'
2023-03-14T15:44:51.777293Z  INFO ThreadId(01) running Hermes v1.3.0+4602d8cd
2023-03-14T15:44:51.820651Z ERROR ThreadId(25) send_messages_and_wait_commit{chain=ethermint tracking_id=create client}:send_tx_with_account_sequence_retry{chain=ethermint account.sequence=0}: failed to broadcast tx with unrecoverable error response=Response { code: Err(4), data: b"", log: "\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SigVerificationDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/sigverify.go:302\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SigGasConsumeDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/sigverify.go:194\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateSigCountDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/sigverify.go:384\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SetPubKeyDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/sigverify.go:126\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.DeductFeeDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/fee.go:67\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ConsumeTxSizeGasDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/basic.go:142\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateMemoDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/basic.go:66\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/evmos/ethermint/app/ante.MinGasPriceDecorator.AnteHandle\n\tgithub.com/evmos/ethermint/app/ante/fees.go:89\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.TxTimeoutHeightDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/basic.go:205\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateBasicDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/basic.go:34\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.RejectExtensionOptionsDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/ext.go:52\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SetUpContextDecorator.AnteHandle\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/setup.go:62\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/evmos/ethermint/app/ante.RejectMessagesDecorator.AnteHandle\n\tgithub.com/evmos/ethermint/app/ante/reject_msgs.go:40\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\ngithub.com/evmos/ethermint/app/ante.NewAnteHandler.func1\n\tgithub.com/evmos/ethermint/app/ante/ante.go:88\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/baseapp/baseapp.go:685\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).CheckTx\n\tgithub.com/cosmos/cosmos-sdk@v0.46.8/baseapp/abci.go:244\ngithub.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync\n\tgithub.com/tendermint/tendermint@v0.34.24/abci/client/local_client.go:104\ngithub.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync\n\tgithub.com/tendermint/tendermint@v0.34.24/proxy/app_conn.go:126\nsignature verification failed; please verify account number (8) and chain-id (ethermint_9000-1): unauthorized", hash: Hash::Sha256(1801BF323F6C80D47D479E71FB738E64F1B56240362C664917B2CA6E3807A8DB) } diagnostic=unknown TX sync response error: 4
SUCCESS ChainError(
    "check_tx (broadcast_tx_sync) on chain ethermint for Tx hash 1801BF323F6C80D47D479E71FB738E64F1B56240362C664917B2CA6E3807A8DB reports error: code=Err(4), log=\"\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SigVerificationDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/sigverify.go:302\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SigGasConsumeDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/sigverify.go:194\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateSigCountDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/sigverify.go:384\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SetPubKeyDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/sigverify.go:126\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.DeductFeeDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/fee.go:67\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ConsumeTxSizeGasDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/basic.go:142\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateMemoDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/basic.go:66\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/evmos/ethermint/app/ante.MinGasPriceDecorator.AnteHandle\\n\\tgithub.com/evmos/ethermint/app/ante/fees.go:89\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.TxTimeoutHeightDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/basic.go:205\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.ValidateBasicDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/basic.go:34\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.RejectExtensionOptionsDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/ext.go:52\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/cosmos/cosmos-sdk/x/auth/ante.SetUpContextDecorator.AnteHandle\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/x/auth/ante/setup.go:62\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/evmos/ethermint/app/ante.RejectMessagesDecorator.AnteHandle\\n\\tgithub.com/evmos/ethermint/app/ante/reject_msgs.go:40\\ngithub.com/cosmos/cosmos-sdk/types.ChainAnteDecorators.func1\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/types/handler.go:40\\ngithub.com/evmos/ethermint/app/ante.NewAnteHandler.func1\\n\\tgithub.com/evmos/ethermint/app/ante/ante.go:88\\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).runTx\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/baseapp/baseapp.go:685\\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).CheckTx\\n\\tgithub.com/cosmos/cosmos-sdk@v0.46.8/baseapp/abci.go:244\\ngithub.com/tendermint/tendermint/abci/client.(*localClient).CheckTxAsync\\n\\tgithub.com/tendermint/tendermint@v0.34.24/abci/client/local_client.go:104\\ngithub.com/tendermint/tendermint/proxy.(*appConnMempool).CheckTxAsync\\n\\tgithub.com/tendermint/tendermint@v0.34.24/proxy/app_conn.go:126\\nsignature verification failed; please verify account number (8) and chain-id (ethermint_9000-1): unauthorized\"",
)

previous line is quite long but I think the important bit is the end:

signature verification failed; please verify account number (8) and chain-id (ethermint_9000-1): unauthorized

Any ideas? Did I miss something?

Thanks!

Acceptance Criteria

Hermes should write txs correctly to an Ethermint chain 😃


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

we always set the id field in [[chains]] to full chain-id ethermint_9000-1 , not sure if that makes any difference.

That’s embarrassing, this was the problem. 😅

afaiu id in config is just a friendly name you give to that config, the actual chain-id is automatically fetched from the chain using Tendermint RPC

I don’t know who told me that but my “afaiu” should’ve triggered a bell for myself lol

So…sorry folks. Thanks @yihuang who actually spotted the issue really quickly.

Always set the hermes id to the actual chain id of your chain!