-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hermes can't write transaction to Ethermint chain (unauthorized error) #3166
Comments
@yihuang @tomtau @hu55a1n1 Do you have any idea what might be going wrong here? I see a reference to the same problem in @hu55a1n1's comment here but I am not sure I understand what the fix was. |
sorry, confused with gravity-bridge relayer ;D |
we always set the |
@romac my hunch is that:
non-evm bank send will just create a normal base account instead of ethaccount, so for signing, it should use sha256 message digest instead of keccak256. you can try to change the address type to cosmos (or |
no, ethm is the correct one for my local chain
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 |
Shouldn't the |
Sorry for the confusion. |
I'm investigating @tomtau insights. Here is the the account I created, it is of type "EthAccount" but I'm still not convinced. You might be correct about the message digest.
And here is the hermes' key:
The two addresses match, so I think the key was imported correctly (and with the correct hd path, etc.). Also the bech32 prefix ( But this is nothing if we sign the wrong payload, right? 😁 |
This should be the code that decides what needs to be signed: hermes/crates/relayer/src/keyring/secp256k1_key_pair.rs Lines 299 to 303 in a577b27
To be sure after these lines I added a println!("address type: {:?}", self.address_type); And I get these logs:
So if I edited
Looks like the same error. |
Oh and just to be sure my relayer keys can actually send transactions on the chain I ran this:
that worked correctly. |
Hm, strange, it's an EthAccount, so your original config should be ok. |
I confirm that |
Anyway I also tried playing a bit with Metamask:
Hermes txs are still rejected. |
That's embarrassing, this was the problem. 😅
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! |
To debug my own mind, the error message the chain gave:
is put in a way that I thought 8 and ethermint_9000-1 are the parameters contained in the transaction, while in reality they are actually what they should be. |
Ah sorry for missing this :/ We'll make sure to highlight this in the config file and in the Hermes guide. We'll see if there is also a way to check for this and report an error otherwise. |
If the field is named as chain-id, it'a probably clearer, otherwise it could be interpreted as an arbitrary unique id :) |
if you think it's worth doing it you can actually retrieve the correct chain id from Tendermint RPC (using the /genesis endpoint) |
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
Then I naively generated a new key for the relayer account (the problem might be here):
Create a new account
Add chain to config.toml
I actually tweaked gas_price to see if it changed anything.
Import key into hermes
Hermes error
previous line is quite long but I think the important bit is the end:
Any ideas? Did I miss something?
Thanks!
Acceptance Criteria
Hermes should write txs correctly to an Ethermint chain :)
For Admin Use
The text was updated successfully, but these errors were encountered: