[Version-unspecific] Add HaltChain ExInfo - #check-lint-warning

Closes #60 (closed) Replacing !395 (closed) Replacing !231 (closed) Partially replacing !527 (closed)

Overview

This MR introduces a new Halt Chain monitoring system that enables MAYAChain to dynamically respond to halt-related Mimir changes on THORChain. The implementation establishes a centralized Extensible External Information (ExInfo) reporting framework with specialized reporters, starting with Halt Chain status monitoring.

Problem Statement

Currently, MAYAChain lacks a systematic approach to monitor and respond to halt signals from THORChain. There is no mechanism to track changes in critical Mimir values that control chain halting, potentially leaving MAYAChain operating when it should be halted.

Solution

A new universal ExInfo Dispatcher architecture is introduced to centralize external information processing. The framework is designed to be extensible for various future use cases, with THORCHain Halt Chain monitoring as the first implementation.

Key Changes

1. Universal ExInfo Dispatcher Framework

  • Centralized coordinator for all external information reporting
  • Plugin architecture supporting multiple specialized "Reporters"
  • Provides unified trigger mechanisms for periodic checks
  • Extensible Design: The dispatcher is chain-agnostic and can accommodate future reporters for various external data sources

2. HaltChain Reporter (First "Reporter" Implementation)

  • Monitors specific THORChain Mimir values related to chain halting:
    • HaltTHORChain, HaltChainGlobal, HaltTrading, NodePauseChainGlobal - Global THORChain halt
    • Halt<chain>Chain, Halt<chain>Trading, SolvencyHalt<chain>Chain (eg HaltBTCChain, HaltETHChain, etc.) - Per-chain halt status
  • Detects changes in halt status and reports them to MAYAChain
  • Mayanode sets/resets HaltTHORTrading in case of THORChain halt/unhalt
  • Mayanode sets/resets HaltChainAgg (eg HaltAVAXChainAgg) in case of specific chain halt/unhalt on Thornode
  • Ensures MAYAChain remains synchronized with Thornode's operational state

3. Dual Trigger Mechanism

  • Periodic Runner: Regular interval checks (configurable per chain)
  • Non-blocking Processing: Asynchronous execution to prevent blocking main operations

4. MAYAChain Integration

  • ExInfo reports are sent to MAYANode via MsgExInfo messages
  • Implements consensus rules for HaltChain decisions (HasMinority() requirement)
  • Maintains synchronization with THORChain's halt state

Framework Extensibility

Future Applications

The ExInfo dispatcher mechanism is designed as a universal framework that can support various external information sources in the future:

  • Solvency Monitoring: Add a SolvencyReporter for financial health checks
  • Network Status: Reporters for chain connectivity and performance metrics
  • Security Feeds: External threat intelligence and security alerts
  • Oracle Data: Price feeds and external data verification
  • Governance Signals: Monitoring external governance proposals and votes

Easy Integration

Adding new reporters requires only:

  1. Implementing the Reporter interface
  2. Registering with the dispatcher
  3. Defining appropriate trigger intervals
  4. Implementing consensus rules in MAYANode for the specific ReasonId

Technical Implementation

New Packages and Components

  • exinfo/dispatcher.go - Central coordination logic
  • exinfo/haltchain_reporter.go - Halt-specific monitoring
  • exinfo/types.go - Shared data structures and interfaces

Configuration

  • Configurable check intervals for each chain
  • Mimir key mappings for halt status monitoring
  • Consensus threshold settings for halt decisions

Testing

Comprehensive testing includes:

Unit Tests

  • HaltChain reporter functionality
  • Dispatcher coordination logic
  • Mimir change detection and processing

Simulation Tests

  • Real-world scenario testing with THORChain integration
  • Mimir value manipulation to simulate halt/unhalt conditions
  • Verification of MAYAChain's response to halt status changes

Benefits

  • Proactive Monitoring: Automatic detection of THORChain halt status changes
  • Safety: Ensures MAYAChain halts when THORChain is halted
  • Extensibility: Framework designed for future external information reporters
  • Modularity: Clean separation between dispatcher logic and reporter implementations

Future Considerations

This MR establishes the foundation for additional external information reporters while specifically implementing the critical Halt Chain monitoring functionality. The architecture is designed to accommodate future enhancements without major refactoring.

Summary by CodeRabbit

  • New Features

    • ExInfo halt-chain reporting system with message, handler, dispatching, and multi-chain detection; new halt-chain simulation actor and tests.
  • Bug Fixes

    • Guarded git metadata resolution for non-repo builds; added retry loop for contract deployment checks.
  • Improvements

    • THORChain mimir checks integrated across flows; build ldflags/version metadata expanded; SIGNER seed phrase exposed to simulation containers; Docker test library path stabilized.

✏️ Tip: You can customize this high-level summary in your review settings.

Edited by Ghost User

Merge request reports

Loading
Loading