feat(telemetry): add avalanche threshold and close time consensus attributes

Record the close time voting threshold and consensus state on
consensus.update_positions and consensus.check spans:

- xrpl.consensus.close_time_threshold: the avCT_CONSENSUS_PCT (75%)
  threshold required for close time agreement
- xrpl.consensus.have_close_time_consensus: whether validators
  reached close time consensus in this iteration

These attributes enable dashboards to show how the close time
voting process converges (or stalls) across consensus iterations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-04-27 19:48:09 +01:00
parent 6157624103
commit 86ef6ff2cf
3 changed files with 25 additions and 3 deletions

View File

@@ -668,12 +668,17 @@ details.
thresholds based on `currentAgreeTime`. Threshold values come from
`ConsensusParms::avalancheCutoffs` (defined in `ConsensusParms.h`).
The escalation states are `ConsensusParms::AvalancheState::{init, mid, late, stuck}`.
Record the effective threshold as an attribute on the span:
- `xrpl.consensus.threshold_percent` — current threshold from `avalancheCutoffs`
Record the effective threshold and close time consensus state:
- `xrpl.consensus.threshold_percent` — consensus threshold (avCT_CONSENSUS_PCT = 75%)
- `xrpl.consensus.close_time_threshold` — close time voting threshold (avCT_CONSENSUS_PCT)
- `xrpl.consensus.have_close_time_consensus` — whether close time consensus was reached
- `xrpl.consensus.avalanche_threshold` — the avalanche-escalated weight from `getNeededWeight()`
These are recorded on both `consensus.update_positions` and `consensus.check` spans.
**Key modified files**:
- `src/xrpld/consensus/Consensus.h` — `haveConsensus()` method
- `src/xrpld/consensus/Consensus.h` — `haveConsensus()` and `updateOurPositions()` methods
---