feat: add a metric to let cosmos consumer chains see their last valset update #48
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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
cvms_uptime_last_ccv_updatethat should give you the block height at last CCV update for Neutron mainnet.max by(chain_id) (cvms_block_height) - on(chain_id) cvms_uptime_last_ccv_updateand it looks like this:Additional Information