diff --git a/OpenTelemetryPlan/Phase4_taskList.md b/OpenTelemetryPlan/Phase4_taskList.md index 3817183a22..e6aba7edbf 100644 --- a/OpenTelemetryPlan/Phase4_taskList.md +++ b/OpenTelemetryPlan/Phase4_taskList.md @@ -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 --- diff --git a/src/xrpld/app/consensus/ConsensusSpanNames.h b/src/xrpld/app/consensus/ConsensusSpanNames.h index d668d3df67..77c2ad6bb5 100644 --- a/src/xrpld/app/consensus/ConsensusSpanNames.h +++ b/src/xrpld/app/consensus/ConsensusSpanNames.h @@ -100,6 +100,15 @@ inline constexpr auto establishCount = join(xrplConsensus, makeStr("establish_co /// "xrpl.consensus.proposers_agreed" inline constexpr auto proposersAgreed = join(xrplConsensus, makeStr("proposers_agreed")); +// Avalanche threshold attributes +/// "xrpl.consensus.avalanche_threshold" +inline constexpr auto avalancheThreshold = join(xrplConsensus, makeStr("avalanche_threshold")); +/// "xrpl.consensus.close_time_threshold" +inline constexpr auto closeTimeThreshold = join(xrplConsensus, makeStr("close_time_threshold")); +/// "xrpl.consensus.have_close_time_consensus" +inline constexpr auto haveCloseTimeConsensus = + join(xrplConsensus, makeStr("have_close_time_consensus")); + // Consensus check attributes /// "xrpl.consensus.agree_count" inline constexpr auto agreeCount = join(xrplConsensus, makeStr("agree_count")); diff --git a/src/xrpld/consensus/Consensus.h b/src/xrpld/consensus/Consensus.h index caf2a02a90..1ae026f0d5 100644 --- a/src/xrpld/consensus/Consensus.h +++ b/src/xrpld/consensus/Consensus.h @@ -1588,6 +1588,10 @@ Consensus::updateOurPositions(std::unique_ptr const& } } + span.setAttribute(cons_span::attr::haveCloseTimeConsensus, haveCloseTimeConsensus_); + span.setAttribute( + cons_span::attr::closeTimeThreshold, static_cast(parms.avCT_CONSENSUS_PCT)); + if (!ourNewSet && ((consensusCloseTime != asCloseTime(result_->position.closeTime())) || result_->position.isStale(ourCutoff))) @@ -1741,6 +1745,10 @@ Consensus::haveConsensus(std::unique_ptr const& clog span.setAttribute(cons_span::attr::agreeCount, static_cast(agree)); span.setAttribute(cons_span::attr::disagreeCount, static_cast(disagree)); span.setAttribute(cons_span::attr::convergePercent, static_cast(convergePercent_)); + span.setAttribute(cons_span::attr::haveCloseTimeConsensus, haveCloseTimeConsensus_); + span.setAttribute( + cons_span::attr::thresholdPercent, + static_cast(adaptor_.parms().avCT_CONSENSUS_PCT)); char const* stateStr = "no"; if (result_->state == ConsensusState::Yes)