-
Notifications
You must be signed in to change notification settings - Fork 21
CLI Commands for State Management (#573) #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
CLI Commands for State Management (#573) #577
Conversation
…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.
- Add comprehensive CLI commands: singularity state list/get/stats/repair - Implement CSV/JSON export functionality with timestamps - Add manual recovery/repair operations with dry-run mode - Support filtering by deal ID, state, provider, client, and time range - Add comprehensive unit and integration tests - Include complete documentation and user guide - Implement safety features with audit logging for all operations Addresses data-preservation-programs#573
- Resolved conflict in service/statetracker/statetracker.go by keeping the cleaned up struct definition with basic fields properly organized under their respective comment sections - Removed the PieceCID mapping logic to match develop branch - Maintained the proper struct organization without duplicate fields
…larity into feature/cli-state-management
The mapping logic from PieceCID to ProposalID was lost during the recent merge with origin/develop. This fixes the TestCreateErrorMetadata test failure by restoring the compatibility mapping that was implemented in commit b640cb2. - Add mapping from PieceCID to ProposalID when ProposalID is empty - Add mapping from PieceCID to PublishCID for test compatibility - Fixes TestCreateErrorMetadata test failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anjor this a draft pr... Can we get this to a level worth reviewing please? Documentation written and in the correct place, and unit and integration tests written. Also make sure remove any ai slop.
@anjor — I'll review it first thing in the morning. I got sidetracked with some UI deployment work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we consider moving the state command (and its subcommands) under the existing deal command group?
singularity deal state list
singularity deal state get <deal-id>
singularity deal state repair ...
@Sankara-Jefferson is this what you had in mind? |
I can no longer see it:
|
@Sankara-Jefferson it's under deal now as you suggested.
|
@anjor yes, that works for me. It looks better. Thei is ready for merging, @ianconsolata. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only one minor change, and some questions. @lanzafame Can you do another review and let us know if @anjor has addressed all your concerns?
Summary
singularity state list/get/stats/repair
Changes
singularity state
Test Plan
Resolves #573