debug-consensus banner
ruvnet ruvnet

debug-consensus

Development community intermediate

Description

Perform a comprehensive analysis of the QR-Avalanche consensus state to debug and diagnose any consensus-related issues in the QuDAG network.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

Repository README

This is the README for ruvnet/QuDAG, shared by 10 entries in this directory. It describes the repository, not this entry specifically.

debug-consensus

Perform a comprehensive analysis of the QR-Avalanche consensus state to debug and diagnose any consensus-related issues in the QuDAG network.

Debugging Instructions

You are the Consensus Agent responsible for debugging the QR-Avalanche consensus mechanism. Conduct a thorough analysis following these steps:

  1. **Initial Consensus State Assessment**

    • Check the current consensus round and network participation
    • Verify Byzantine fault tolerance threshold (f < n/3)
    • Assess overall consensus health score
    • Identify any immediate red flags or anomalies
  2. **Voting Analysis Deep Dive**

    • Trace vote propagation across the network
    • Verify vote signatures and validity
    • Analyze vote aggregation and counting logic
    • Identify missing votes or non-participating nodes
    • Detect and investigate any conflicting votes
  3. **DAG State Examination**

    • Count total nodes vs finalized nodes
    • Identify pending and orphaned nodes
    • Detect fork branches and their weights
    • Verify DAG consistency and integrity
    • Check for any structural anomalies
  4. **Finality Investigation**

    • Verify finality rules are being followed
    • Check checkpoint consistency across nodes
    • Analyze any reorganizations or rollbacks
    • Measure time-to-finality metrics
    • Identify finality bottlenecks or delays
  5. **Performance Analysis**

    • Measure consensus throughput (TPS)
    • Analyze vote propagation latency (p50, p99)
    • Calculate average round duration
    • Assess message overhead per round
    • Identify performance bottlenecks

Debug Focus Areas

When debugging, you can focus on specific areas:

  • voting - Deep dive into vote propagation and validation
  • finality - Analyze finality achievement and delays
  • forks - Investigate fork detection and resolution
  • performance - Profile consensus performance metrics
  • conflicts - Focus on conflicting votes or states
  • all - Comprehensive analysis of all areas

Debugging Process

  1. **Data Collection Phase**

    • Gather consensus logs for the specified timeframe
    • Collect vote messages and their propagation paths
    • Record finality checkpoints and transitions
    • Monitor resource usage (CPU, memory, network)
  2. **Analysis Phase**

    • Check consensus invariants:
      • Safety: No conflicting finalized blocks
      • Liveness: Consensus progresses under synchrony
      • Performance: Sub-second finality achieved
    • Verify QR-Avalanche algorithm correctness
    • Validate Byzantine node behavior bounds
  3. **Diagnosis Phase**

    • Identify root causes of any issues found
    • Trace problematic transactions or votes
    • Pinpoint network communication failures
    • Detect any malicious or faulty nodes
  4. **Recommendation Phase**

    • Suggest immediate fixes for critical issues
    • Propose optimizations for performance
    • Recommend configuration changes
    • Identify areas needing further investigation

Expected Debug Output

Generate a com