Skip to content

feat: add monitoring for signer agreement state conflict #6008

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

fdefelici
Copy link
Contributor

@fdefelici fdefelici commented Apr 14, 2025

Description

This change implement prometheus monitoring metrics for signer agreement state conflict.
Basically counting the times the current signer is in conflict with the signer set due to: Burn Block Delay, Stacks Block Delay, Miner View.

Futhermore, monitoring about Signer state upgrade (started in this PR #5981) has been completed collecting the Protocol Upgrade state

Applicable issues

Additional info (benefits, drawbacks, caveats)

About the conflict "Stacks Block Delay", I'm not sure where to collect it. Any guidance would be helpful.

Eventually, we could also:

  • extend the state update change metric (SignerAgreementStateChangeReason) to take into account the case where the signer capitulate on the miner viewpoint:
    if current_miner != new_miner {
    info!("Capitulating local state machine's current miner viewpoint";
    "current_miner" => ?current_miner,
    "new_miner" => ?new_miner,
    );
    *self = Self::Initialized(SignerStateMachine {
    burn_block,
    burn_block_height,
    current_miner: (&new_miner).into(),
    active_signer_protocol_version,
    });
    }
  • add an new metric to measure the latency required by the signer to reach the agreement with the signer set (basically computed at end of the LocalStateMachine::capitulate_viewpoint(..) method, if the signer can just capitulate once per tenure and considering only the case where some state changes exists)

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • New integration test(s) added to bitcoin-tests.yml

@fdefelici fdefelici self-assigned this Apr 14, 2025
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.15%. Comparing base (aab7784) to head (5af8521).
Report is 14 commits behind head on develop.

Files with missing lines Patch % Lines
stacks-signer/src/v0/signer_state.rs 66.66% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6008      +/-   ##
===========================================
+ Coverage    84.10%   84.15%   +0.05%     
===========================================
  Files          528      523       -5     
  Lines       385675   384561    -1114     
  Branches       323        0     -323     
===========================================
- Hits        324355   323623     -732     
+ Misses       61312    60938     -374     
+ Partials         8        0       -8     
Files with missing lines Coverage Δ
stacks-signer/src/monitoring/mod.rs 90.90% <100.00%> (+0.66%) ⬆️
stacks-signer/src/monitoring/prometheus.rs 100.00% <ø> (ø)
stacks-signer/src/v0/signer_state.rs 90.84% <66.66%> (-0.39%) ⬇️

... and 48 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d4cc3a...5af8521. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aldur aldur added this to the 3.1.0.0.9 milestone Apr 15, 2025
@aldur aldur moved this to Status: 💻 In Progress in Stacks Core Eng Apr 15, 2025
@aldur aldur moved this from Status: 💻 In Progress to Status: In Review in Stacks Core Eng Apr 15, 2025
@aldur aldur moved this from Status: In Review to Status: 💻 In Progress in Stacks Core Eng Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: 💻 In Progress
Development

Successfully merging this pull request may close these issues.

2 participants