Skip to content

Conversation

anjor
Copy link
Collaborator

@anjor anjor commented Jul 24, 2025

Summary

  • Enhances StateTracker with comprehensive metadata collection for all on-chain events
  • Adds special handling for slashed and expired deals with detailed logging
  • Implements error categorization system with 10 specific categories
  • Provides enhanced metadata structure with 20+ new contextual fields

Changes

  • Enhanced StateTracker: Comprehensive metadata collection and error categorization
  • Special Event Handling: Dedicated logic for slashing, expiration, and activation events
  • Error System: 10 categorized error types with detailed context
  • Enhanced Testing: 296+ lines of new tests covering all functionality
  • Improved Logging: Rich contextual information for all deal transitions

Test Plan

  • All existing functionality preserved and enhanced
  • Comprehensive test coverage for new error categorization
  • Integration tests for enhanced metadata handling
  • Special event handling verified (slashing, expiration)

Resolves #572

…ion-programs#572

Enhanced DealTracker and StateTracker integration with comprehensive on-chain event handling:

**StateTracker Enhancements:**
- Added enhanced metadata tracking with error categorization
- Improved error handling with specific error categories (network, provider, client, chain, etc.)
- Extended metadata fields for comprehensive deal tracking
- Added helper functions for error categorization and metadata creation
- Implemented TrackStateChangeWithError for better error tracking

**DealTracker Enhancements:**
- Enhanced state change tracking with detailed metadata for all deal transitions
- Added special handling for critical deal events (slashed, expired, activated)
- Improved logging for deal state transitions with contextual information
- Enhanced expiration handling for both active deals and proposals
- Better tracking of external deal discovery with comprehensive metadata

**Special Handling for Critical Events:**
- Deal slashing: Enhanced logging and metadata with slashing epoch details
- Deal expiration: Detailed tracking of natural expiration with epoch information
- Proposal expiration: Comprehensive handling of unactivated proposals
- Deal activation: Proper tracking with sector start epoch information

**Comprehensive Testing:**
- Added 296+ lines of new unit and integration tests
- Enhanced test coverage for error categorization and metadata creation
- Integration tests for slashed deal detection and handling
- Tests for external deal discovery with enhanced metadata
- Comprehensive expiration testing for deals and proposals

**Key Features:**
- Error categorization system for better analytics and debugging
- Enhanced metadata collection including piece size, verified status, pricing
- Improved recovery mechanisms for missing state changes
- Better performance monitoring and error tracking
- Comprehensive logging for all deal lifecycle events

All tests pass and the implementation maintains backward compatibility while significantly enhancing the deal tracking capabilities.
@Sankara-Jefferson
Copy link
Collaborator

@anjor, this branch has merge conflicts with develop. Could you resolve them before we proceed with final review?

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.

Extend Deal Tracker Integration
2 participants