/debug-consensus Command
Perform a comprehensive analysis of the QR-Avalanche consensus state to debug and diagnose any consensus-related issues in the QuDAG network.
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:
-
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
-
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
-
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
-
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
-
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 validationfinality- Analyze finality achievement and delaysforks- Investigate fork detection and resolutionperformance- Profile consensus performance metricsconflicts- Focus on conflicting votes or statesall- Comprehensive analysis of all areas
Debugging Process
-
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)
-
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
- Check consensus invariants:
-
Diagnosis Phase
- Identify root causes of any issues found
- Trace problematic transactions or votes
- Pinpoint network communication failures
- Detect any malicious or faulty nodes
-
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 comprehensive debug report containing:
-
QR-Avalanche Consensus Status
- Algorithm implementation status
- Current round and network size
- Byzantine threshold verification
- Overall consensus health score
-
Detailed Voting Analysis
- Active voter participation rate
- Vote distribution across options
- List of missing or delayed votes
- Conflict detection and resolution
-
DAG State Tracking Report
- Node counts (total, finalized, pending, orphaned)
- Fork branch analysis
- DAG growth patterns
- Structural integrity verification
-
Finality Information
- Last finalized block details
- Current finality depth
- Average time to finality
- Finality queue analysis
-
Performance Metrics
- Consensus transactions per second
- Vote latency percentiles
- Round duration statistics
- Message overhead analysis
Troubleshooting Common Issues
- Stalled Consensus: Check for network partitions or insufficient voters
- Slow Finality: Analyze vote propagation delays and network latency
- Fork Storms: Investigate conflicting transactions and resolution logic
- High Message Overhead: Review vote aggregation and gossip parameters
- Byzantine Behavior: Verify threshold bounds and node authentication
Debug Options
- Specify a consensus round number for historical analysis
- Focus on a specific node's perspective
- Enable verbose logging for detailed traces
- Set custom timeframes for analysis (e.g., '5m', '1h', 'all')
Remember to correlate findings across different components and provide actionable insights for resolving any consensus issues discovered.