Skip to content

Conversation

zchn
Copy link

@zchn zchn commented Aug 8, 2025

Summary

This PR introduces a comprehensive automated validation system for all chain metadata fields in the Chain Registry. The new system ensures data quality and consistency across all chains by validating 12 critical fields automatically.

Key Features

🔍 Complete Field Coverage

  • Chain ID: Validates uniqueness and format
  • Chain Name: Ensures directory/metadata consistency
  • RPC/REST/GRPC: Tests endpoint connectivity and health
  • EVM-RPC: Validates JSON-RPC endpoints for EVM chains
  • Address Prefix: Validates against SLIP-173 standards
  • Base Denom: Ensures native token consistency
  • Cointype: Validates against SLIP-44 registry
  • Token Decimals: Validates denom_units accuracy
  • Block Explorers: Tests explorer accessibility
  • Network Type: Validates mainnet/testnet classification

🚀 New Workflows & Scripts

1. Enhanced Chain Validation Workflow

  • File: .github/workflows/enhanced_chain_validation.yml
  • Purpose: Orchestrates comprehensive validation process
  • Triggers: PR events and manual dispatch

2. Core Validation Engine

  • File: .github/workflows/utility/enhanced_validation.mjs
  • Purpose: Validates all 12 chain metadata fields
  • Features:
    • Concurrent validation processing
    • Detailed error categorization
    • SLIP standard cross-referencing

3. Endpoint Health Checker

  • File: .github/workflows/utility/endpoint_health_checker.mjs
  • Purpose: Tests endpoint connectivity and performance
  • Features:
    • Response time monitoring
    • Provider reliability scoring
    • EVM JSON-RPC testing
    • Rate-limited concurrent requests

4. Validation Report Generator

  • File: .github/workflows/utility/generate_validation_report.mjs
  • Purpose: Creates comprehensive validation reports
  • Outputs:
    • Markdown reports with actionable insights
    • JSON summaries for automation
    • Performance metrics and recommendations

Current vs Enhanced Validation

✅ Previously Validated

  • Chain ID uniqueness (validate_data.mjs:64-78)
  • Chain name consistency (validate_data.mjs:501-508)
  • RPC/REST basic testing (apis.py:98-100)
  • Address prefix SLIP-173 validation (validate_data.py:172-183)
  • Base denom asset references (validate_data.mjs:93-119)
  • Cointype SLIP-44 validation (validate_data.py:186-198)
  • Token decimal validation (validate_data.mjs:121-174)
  • Network type schema validation (chain.schema.json:67-68)

🆕 Newly Added

  • EVM-RPC endpoint testing for EVM-compatible chains
  • Block explorer accessibility testing with HTTP health checks
  • GRPC endpoint connectivity testing beyond schema validation
  • Performance monitoring with response time metrics
  • Provider reliability scoring across all endpoint types
  • Comprehensive reporting with actionable recommendations
  • Error categorization (blocking errors vs advisory warnings)

Benefits

🛡️ Data Quality

  • Prevents broken endpoints from being merged
  • Ensures consistent metadata across all chains
  • Validates compliance with industry standards (SLIP-173, SLIP-44)

📊 Monitoring & Insights

  • Real-time endpoint health monitoring
  • Provider performance benchmarking
  • Historical trend tracking capabilities

🔧 Developer Experience

  • Clear, actionable error messages
  • Automated validation reports
  • Reduced manual review overhead

Testing

The validation system has been designed to:

  • Run efficiently with concurrent processing
  • Handle network timeouts gracefully
  • Provide detailed feedback for failures
  • Scale across the entire registry

Usage

The enhanced validation runs automatically on all PRs and can be triggered manually via workflow dispatch. Reports are generated in both human-readable markdown and machine-parseable JSON formats.

Test Plan

  • Validate core validation logic
  • Test endpoint health checking
  • Verify report generation
  • Run full registry validation
  • Performance testing with large datasets
  • Integration testing with existing workflows

🤖 This PR enhances the Chain Registry's data quality assurance by providing comprehensive, automated validation of all critical chain metadata fields.

Kevin Kz and others added 3 commits August 8, 2025 17:49
## Analysis Complete\!

Enhanced GitHub workflows to automatically validate all chain metadata fields:

### Current Validation Status:

**✅ Already Tested Fields:**
1. **Chain ID**: Validated in .github/workflows/utility/validate_data.mjs:64-78 - Checks uniqueness across registry
2. **Chain Name**: Validated in .github/workflows/utility/validate_data.mjs:501-508 - Ensures directory name matches chain_name field
3. **RPC**: Tested in .github/workflows/tests/apis.py:98 - Tests /status endpoint for connectivity
4. **REST**: Tested in .github/workflows/tests/apis.py:100 - Tests /cosmos/base/tendermint/v1beta1/syncing endpoint
5. **Address Prefix**: Validated in .github/workflows/utility/validate_data.py:172-183 - Checks bech32_prefix against SLIP-173
6. **Base Denom**: Validated in .github/workflows/utility/validate_data.mjs:93-119 - Ensures fee/staking tokens exist in assetlist
7. **Cointype**: Validated in .github/workflows/utility/validate_data.py:186-198 - Checks slip44 against SLIP-44 registry
8. **Native Token Decimals**: Validated in .github/workflows/utility/validate_data.mjs:121-174 - Checks denom_units exponent values
9. **Mainnet/Testnet**: Schema validated in chain.schema.json:67-68 - Ensures network_type is valid enum value

**⚠️ Partially Tested Fields:**
10. **GRPC**: Schema defined in chain.schema.json:348-353 but no connectivity testing
11. **Block Explorer URL**: Schema defined in chain.schema.json:375-379 but no accessibility testing

**❌ Missing Tests:**
12. **EVM-RPC**: Schema supports evm-http-jsonrpc endpoints in chain.schema.json:366-371 but no validation

### New Features Added:

#### 1. Enhanced Chain Validation (.github/workflows/enhanced_chain_validation.yml)
- New workflow that runs comprehensive validation
- Tests all 12 specified fields automatically
- Provides detailed error reporting

#### 2. Enhanced Validation Script (.github/workflows/utility/enhanced_validation.mjs)
- Validates all chain metadata fields
- Tests endpoint connectivity for RPC, REST, GRPC, and EVM-RPC
- Validates token decimals and asset references
- Checks block explorer accessibility
- Cross-references with SLIP standards

#### 3. Endpoint Health Checker (.github/workflows/utility/endpoint_health_checker.mjs)
- Tests actual endpoint connectivity and response times
- Supports concurrent testing with rate limiting
- Provides detailed health metrics by chain and provider
- Tests EVM JSON-RPC endpoints for EVM-compatible chains

#### 4. Validation Report Generator (.github/workflows/utility/generate_validation_report.mjs)
- Creates comprehensive markdown reports
- Shows validation status for all fields
- Provides performance metrics and recommendations
- Links back to specific validation code locations

### Key Improvements:
- **EVM-RPC Testing**: Now validates JSON-RPC endpoints for EVM-compatible chains
- **Block Explorer Validation**: Tests actual accessibility of explorer URLs
- **GRPC Connectivity**: Basic connectivity testing for GRPC endpoints
- **Performance Metrics**: Response time monitoring and health scoring
- **Comprehensive Reporting**: Detailed validation reports with actionable recommendations
- **Error Categorization**: Distinguishes between errors (blocking) and warnings (advisory)

The new workflows ensure all 12 specified fields are automatically validated with detailed reporting and clear paths to fix any issues found.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Added configurable error downgrading to allow specific chain IDs to have
validation errors converted to warnings, enabling the workflow to proceed
to Endpoint Health Checks even when certain chains have validation issues.

## Changes:
- Modified enhanced_validation.mjs to support DOWNGRADE_CHAIN_IDS env var
- Added helper methods addError() and addWarning() for conditional downgrading
- Updated all validation methods to use the new helper methods
- Added logging to show which chain IDs have error downgrading enabled
- Updated workflow YAML to include DOWNGRADE_CHAIN_IDS environment variable

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant