Closed tot-truong closed 6 months ago
Can confirm, having the same issue. Hermes creates completely different Injective address - as compared to injectived
or rly
.
Thanks for reporting this!
You mean the problem appears when you skip specifying --hd-path "m/44'/60'/0'/0/0"
as parameter to keys add
command ?
I mean injective uses "m/44'/60'/0'/0/0". I would have expected Hermes to create the same key as the injetived would create but in either case - with or without the hd-path parameter - I do not get the the expected key.
On Thu, 9 May 2024, 00:19 Adi Seredinschi, @.***> wrote:
Thanks for reporting this!
You mean the problem appears when you skip specifying --hd-path "m/44'/60'/0'/0/0" as parameter to keys add command ?
— Reply to this email directly, view it on GitHub https://github.com/informalsystems/hermes/issues/3985#issuecomment-2100941359, or unsubscribe https://github.com/notifications/unsubscribe-auth/AY4WK5CVPP2ALCMCAU3NS4LZBJGBPAVCNFSM6AAAAABHLLCJOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBQHE2DCMZVHE . You are receiving this because you authored the thread.Message ID: @.***>
Any updates here? Bug can be reproduce and Injective addresses arent properly created - even with hd path m/44'/60'/0'/0/0
(results to different address compared to using injectived
cli).
According to the Injective documentation:
By default, the keyring generates a eth_secp256k1 keypair. The keyring also supports ed25519 keys, which may be created by passing the
--algo ed25519
flag. A keyring can of course hold both types of keys simultaneously.
If I configure address_type
accordingly:
[[chain]]
id = 'injective-1'
# ...
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }
I then get the expected address:
$ hermes --config injective.toml keys add --chain injective-1 --key-name test --hd-path "m/44'/60'/0'/0/0" --mnemonic-file mnemonic.txt --overwrite
2024-05-22T09:36:52.022765Z INFO ThreadId(01) running Hermes v1.8.2+25f547595
2024-05-22T09:36:52.023353Z WARN ThreadId(01) key test will be overwritten
SUCCESS Restored key 'test' (inj1mzy2fz8wzq069r8z20m2fcvsdye3pr7qrwfvx7) on chain injective-1
@tot-truong What do you think we could document better on the Hermes side to prevent such issues? The address_type
config is mentioned in the config.toml
, but perhaps we should have a dedicated section in the guide?
According to the Injective documentation:
By default, the keyring generates a eth_secp256k1 keypair. The keyring also supports ed25519 keys, which may be created by passing the
--algo ed25519
flag. A keyring can of course hold both types of keys simultaneously.If I configure
address_type
accordingly:[[chain]] id = 'injective-1' # ... address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }
I then get the expected address:
$ hermes --config injective.toml keys add --chain injective-1 --key-name test --hd-path "m/44'/60'/0'/0/0" --mnemonic-file mnemonic.txt --overwrite 2024-05-22T09:36:52.022765Z INFO ThreadId(01) running Hermes v1.8.2+25f547595 2024-05-22T09:36:52.023353Z WARN ThreadId(01) key test will be overwritten SUCCESS Restored key 'test' (inj1mzy2fz8wzq069r8z20m2fcvsdye3pr7qrwfvx7) on chain injective-1
@romac we have tested with address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }
and it generates wrong injective address.
Have u tried restoring key using injectived
? In our case injectived
produces a different address.
Is the address I got not the very same address output by injectived
? inj1mzy2fz8wzq069r8z20m2fcvsdye3pr7qrwfvx7
I will try with injectived
as soon as I get a chance, in the meantime can you please share full logs and Hermes config with the address_type
I shared above?
Is the address I got not the very same address output by
injectived
?inj1mzy2fz8wzq069r8z20m2fcvsdye3pr7qrwfvx7
I will try with
injectived
as soon as I get a chance, in the meantime can you please share full logs and Hermes config with theaddress_type
I shared above?
Even when adding the address type to the hermes config
[[chain]]
id = 'injective-1'
# ...
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }
I still get the wrong address
$ echo "that upper concert rice water duck body deny mom bulb crop warfare ugly focus worry expand ribbon gift exist knee pave zoo simple hazard" > mnemonic.txt;hermes --config main.toml keys add --overwrite --chain injective-1 --key-name test --hd-path "m/44'/60'/0'/0/0" --mnemonic-file mnemonic.txt
2024-06-03T01:52:39.199791Z INFO ThreadId(01) running Hermes v1.8.2
2024-06-03T01:52:39.200152Z WARN ThreadId(01) key test will be overwritten
SUCCESS Restored key 'test' (inj1etzf7nsxsqs8xhtnw0qu0kzateqj9qcgwm3l66) on chain injective-1
I wonder if the reason is that your on a different version than me on Hermes?
Hermes v1.8.2 vs v1.8.2+25f547595
Here is the full main.toml
[global]
log_level = "info"
[mode.clients]
enabled = true
refresh = true
misbehaviour = true
[mode.connections]
enabled = false
[mode.channels]
enabled = false
[mode.packets]
enabled = true
clear_interval = 100
clear_on_start = true
tx_confirmation = false
auto_register_counterparty_payee = false
[mode.packets.ics20_max_memo_size]
enabled = true
size = 32768
[mode.packets.ics20_max_receiver_size]
enabled = true
size = 2048
[rest]
enabled = false
host = "127.0.0.1"
port = 3000
[telemetry]
enabled = false
host = "127.0.0.1"
port = 3001
[telemetry.buckets.latency_submitted]
start = 500
end = 20000
buckets = 10
[telemetry.buckets.latency_confirmed]
start = 1000
end = 30000
buckets = 10
[[chains]]
type = "CosmosSdk"
id = "injective-1"
rpc_addr = "https://rpc-injective.whispernode.com/"
grpc_addr = "https://injective-grpc.publicnode.com/"
rpc_timeout = "10s"
# trusted_node = false
account_prefix = "inj"
key_name = 'injective_relayer'
key_store_type = "Test"
store_prefix = "ibc"
default_gas = 100000
max_gas = 400000
gas_multiplier = 1.1
max_msg_num = 1 # 30 / relay only 1 packet, otherwise max gas is exceeded
max_tx_size = 180000
# max_grpc_decoding_size = 33554432
# query_packets_chunk_size = 50
clock_drift = "5s"
max_block_time = "30s"
client_refresh_rate = "1/3"
ccv_consumer_chain = false
memo_prefix = 'test'
sequential_batch_tx = false
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }
[chains.event_source]
mode = "push"
url = "wss://rpc-injective.whispernode.com/websocket"
batch_delay = "500ms"
[chains.trust_threshold]
numerator = 2
denominator = 3
[chains.gas_price]
price = 700000000.0
denom = "inj"
[chains.packet_filter]
policy = "allow"
list = [
]
[chains.packet_filter.min_fees]
# [chains.dynamic_gas_price]
# enabled = false
# multiplier = 1.1
# max = 0.6
[chains.address_type]
derivation = "cosmos"
[chains.excluded_sequences]
# [tracing_server]
# enabled = false
# port = 5555
You are specifying address_type
twice and therefore overriding the correct definition by the wrong one.
Try removing the second one
[chains.address_type]
derivation = "cosmos"
and only keep
address_type = { derivation = 'ethermint', proto_type = { pk_type = '/ethermint.crypto.v1.ethsecp256k1.PubKey' } }
echo "that upper concert rice water duck body deny mom bulb crop warfare ugly focus worry expand ribbon gift exist knee pave zoo simple hazard" > mnemonic.txt;hermes --config main.toml keys add --overwrite --chain injective-1 --key-name test --hd-path "m/44'/60'/0'/0/0" --mnemonic-file mnemonic.txt
Thanks 100x, that worked! The proper address is now created!
Summary of Bug
When adding a key to Hermes it creates the wrong address for the injective-1 mainnet (compared using injectived).
Version
hermes 1.8.2
Steps to Reproduce
Using injectived => inj1mzy2fz8wzq069r8z20m2fcvsdye3pr7qrwfvx7
hd-path "m/44'/60'/0'/0/0" => inj1etzf7nsxsqs8xhtnw0qu0kzateqj9qcgwm3l66 => EXPECTED inj1mzy2fz8wzq069r8z20m2fcvsdye3pr7qrwfvx7
No hd path set => inj1yvvuw3nm4fphmxjeuwhjek6wqmvepnze94kjxv
Hermes config main.toml
Acceptance Criteria
For Admin Use