Skip to content
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

Undefined behaviour with compat_mode 0.37 #4178

Closed
5 tasks
faust403 opened this issue Sep 2, 2024 · 5 comments · Fixed by #4181
Closed
5 tasks

Undefined behaviour with compat_mode 0.37 #4178

faust403 opened this issue Sep 2, 2024 · 5 comments · Fixed by #4181
Assignees

Comments

@faust403
Copy link

faust403 commented Sep 2, 2024

Summary of Bug

For some reason hermes doesn't work properly with compat_mode 0.37

Version

hermes version: 1.10.3+e26d356a

Steps to Reproduce

Open you hermes config file and put this piece of config into it:

[[chains]]
id = 'pion-1'
rpc_addr = 'https://rpc-lunara.pion-1.ntrn.tech/'
grpc_addr = 'http://grpc-lunara.pion-1.ntrn.tech:80'
event_source = { mode = 'pull', url = 'wss://rpc-lunara.pion-1.ntrn.tech/websocket', batch_delay = '1s', max_retries = 4 }
rpc_timeout = '40s'
account_prefix = 'neutron'
key_name = 'main'
store_prefix = 'ibc'
default_gas = 5000000
max_gas = 50000000
gas_price = { price = 0.02, denom = 'untrn' }
gas_multiplier = 1.6
dynamic_gas_price = { enabled = true, multiplier = 1.2, max = 0.06 }
max_msg_num = 20
max_tx_size = 2097152
clock_drift = '20s'
max_block_time = '75s'
trusting_period = '5days'
ccv_consumer_chain = true
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'cosmos' }
memo_prefix = 'Relayed by Neutron'

[[chains]]
id = 'mocha-4'
rpc_addr = "https://rpc-mocha-full.avril14th.org"
grpc_addr = "https://celestia-testnet-grpc.publicnode.com:443"
event_source = { mode = 'push', url = 'ws://rpc-mocha.pops.one:26657/websocket', batch_delay = '500ms' }
compat_mode = '0.37'
rpc_timeout = '40s'
account_prefix = 'celestia'
key_name = 'main'
store_prefix = 'ibc'
default_gas = 5000000
max_gas = 50000000
gas_price = { price = 0.01, denom = 'utia' }
gas_multiplier = 1.6
dynamic_gas_price = { enabled = true, multiplier = 1.2, max = 0.06 }
max_msg_num = 20
max_tx_size = 2097152
clock_drift = '20s'
max_block_time = '75s'
trusting_period = '5days'
ccv_consumer_chain = false
trust_threshold = { numerator = '1', denominator = '3' }
address_type = { derivation = 'cosmos' }
memo_prefix = 'Relayed by Neutron'

Right after that try to build a new IBC client on mocha-4 with ref on pion-1
hermes create client --host-chain mocha-4 --reference-chain pion-1

You'll get a 07-tendermint-0 client id which is absurd
image

Nevertheless, try to find this transaction on mintscan and copy the real client id (in reality it's the correct one), try to build a connection between 2 IBC clients (in my case it's pion-1 <-> mocha-4). Btw, client builds successfully when doing it on pion-1 with ref on mocha-4

Type
hermes create connection --a-chain pion-1 --a-client 07-tendermint-377 --b-client 07-tendermint-493
image

As you can see it infinitely tries to open a connection with client 07-tendermint-0

Acceptance Criteria

In the new version of hermes I believe it should be compatible with compat_mode 0.37 because if change this parameter to 0.34 it works fine


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@github-project-automation github-project-automation bot moved this to 🩹 Triage in Hermes Sep 2, 2024
@romac
Copy link
Member

romac commented Sep 3, 2024

To me it looks like the mocha-4 testnet uses Cosmos SDK 0.46.16 together with Celestia's fork of Tendermint 0.34.29, meaning that the appropriate value for compat_mode is indeed 0.34:

$ hermes health-check
(...)
2024-09-03T05:41:15.051619Z DEBUG ThreadId(25) health_check{chain=mocha-4}: running diagnostic on version specs: Cosmos SDK 0.46.16, IBC-Go 6.2.2, Tendermint 0.34.29
(...)

Nevertheless, we'll look into exactly why the decoding of the client id fails, as it's not quite expected. We'll also make sure to show a warning in the health check if there is a discrepancy between the specified compat_mode and the version we retrieve from the node.

By the way, what happens when you leave out compat_mode for mocha-4, do you see the same weird behavior or does it work?

Can you also please paste the logs you get if you re-run the create client command with --debug=rpc:

$ hermes --debug=rpc create client --host-chain mocha-4 --reference-chain pion-1

@faust403
Copy link
Author

faust403 commented Sep 3, 2024

It doesn't work with it for some reason
image

Attaching logs
debug.log

@romac
Copy link
Member

romac commented Sep 3, 2024

Thanks for the quick turnaround and for the logs 🙏

That's definitely a bug, as Hermes should pick up on the Tendermint version reported by Celestia. We'll fix this so that you won't have to specify the compat_mode explicitly + add a warning if there is a mismatch between the configured compat_mode (if present) and the one inferred from the chain (if possible).

@romac
Copy link
Member

romac commented Sep 3, 2024

@faust403 Can you please give this PR a try and see if it works for you? #4181

Here when I remove compat_mode from your config I get this when running the health check:

2024-09-03T09:55:09.018348Z  INFO ThreadId(01) running Hermes v1.10.3+e26d356ab-dirty
2024-09-03T09:55:09.018743Z  INFO ThreadId(01) health_check{chain=pion-1}: performing health check...
2024-09-03T09:55:10.283077Z  WARN ThreadId(13) health_check{chain=pion-1}: chain 'pion-1' does not provide a minimum gas price for denomination 'untrn'. This is usually a sign of misconfiguration, please check your chain configuration
2024-09-03T09:55:10.400456Z DEBUG ThreadId(13) health_check{chain=pion-1}: running diagnostic on version specs: Cosmos SDK 0.50.9, IBC-Go 8.2.1, CometBFT 0.38.11
2024-09-03T09:55:11.440153Z DEBUG ThreadId(13) health_check{chain=pion-1}: queried `max_expected_time_per_block`: `30000000000ns`
2024-09-03T09:55:11.440615Z  INFO ThreadId(01) health_check{chain=pion-1}: chain is healthy
2024-09-03T09:55:11.440693Z  INFO ThreadId(01) health_check{chain=mocha-4}: performing health check...
2024-09-03T09:55:12.050028Z DEBUG ThreadId(25) health_check{chain=mocha-4}: running diagnostic on version specs: Cosmos SDK 0.46.16, IBC-Go 6.2.2, Tendermint 0.34.29
2024-09-03T09:55:12.482938Z DEBUG ThreadId(25) health_check{chain=mocha-4}: queried `max_expected_time_per_block`: `75000000000ns`
2024-09-03T09:55:12.483056Z  INFO ThreadId(01) health_check{chain=mocha-4}: chain is healthy

@romac romac self-assigned this Sep 3, 2024
@faust403
Copy link
Author

faust403 commented Sep 3, 2024

Yes, now it works without compat_mode mentioned

@github-project-automation github-project-automation bot moved this from 🩹 Triage to ✅ Done in Hermes Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
2 participants