Skip to content

Conversation

@fastfadingviolets
Copy link

@fastfadingviolets fastfadingviolets commented Feb 11, 2025

PR(Pull Request) Overview

Added a metric to expose the last block height at which a consumer chain received a validator set update. This allows validators to ensure that relay channels are still up and that the ccv module is working as expected. I couldn't find an uptime_test.go so I didn't add a test, but let me know where it should go and I'll add it.

Changes

  • Major feature addition or modification
  • Bug fix
  • Code improvement
  • Documentation update

Related Issue

Description of Changes

Added code to fetch the block height when a consumer chain last received a validator set update. Exposed a prometheus metric with the block time. Also added a commented-out example alert rule in uptime.yaml that'll alert when it's been > 5000 blocks since the last valset update. This can be indicative of relayer issues, and should be investigated in all cases.

Testing Method

  1. Try the following config.yaml:
chains: 
  - display_name: 'gaia-1'
    chain_id: cosmoshub-4
    tracking_addresses: []
    nodes:
      - rpc: 'https://cosmos-rpc.stakeandrelax.net/'
        api: 'https://cosmos-api.stakeandrelax.net/'
        grpc: 'cosmos-grpc.stakeandrelax.net:15090'
  - display_name: 'neutron'
    chain_id: neutron-1
    tracking_addresses: []
    nodes:
      - rpc: 'https://rpc.neutron.quokkastake.io/'
        api: 'https://api.neutron.quokkastake.io/'
        grpc: 'rpc.neutron.quokkastake.io:9090'
    provider_nodes:
      - rpc: 'https://cosmos-rpc.stakeandrelax.net/'
        api: 'https://cosmos-api.stakeandrelax.net/'
        grpc: 'cosmos-grpc.stakeandrelax.net:15090'
  1. cvms will now expose a metric called cvms_uptime_last_ccv_update that should give you the block height at last CCV update for Neutron mainnet.
  2. You may then query it as max by(chain_id) (cvms_block_height) - on(chain_id) cvms_uptime_last_ccv_update and it looks like this:
    Screenshot 2025-02-11 at 4 32 04 PM

Additional Information

This allows validators to ensure that relay channels are still up and
that the ccv module is still working as expected
@jeongseup
Copy link
Contributor

Thank you for contributing @fastfadingviolets I'll review this PR for a few days. our team is developing babylon and axelar amplifier packages. Please understand us

@fastfadingviolets
Copy link
Author

Thank you for contributing @fastfadingviolets I'll review this PR for a few days. our team is developing babylon and axelar amplifier packages. Please understand us

No worries @jeongseup totally get it, please take your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants