-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(state): display DealIDs from market actor for sectors #13140
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: master
Are you sure you want to change the base?
fix(state): display DealIDs from market actor for sectors #13140
Conversation
The 'lotus state sector' command was showing empty DealIDs for sectors that actually contain deals. This occurred because for actors v13+, deal IDs are stored in the market actor's ProviderSectors HAMT, not in the sector's DeprecatedDealIDs field. This fix: - Adds dual DealIDs display showing both deprecated and market sources - Retrieves deal IDs from market actor's ProviderSectors HAMT for v13+ - Maintains backward compatibility with older network versions - Provides clear labeling of data sources - Handles errors gracefully with informative messages Resolves issue where sectors containing deals incorrectly showed 'DealIDs: []' instead of the actual deal IDs. Example output after fix: DealIDs (deprecated): [] DealIDs (market): [84864966]
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.
Pull Request Overview
This PR fixes an issue where the "lotus state sector" command failed to display deal IDs for sectors with deals by adding dual DealIDs display functionality. Key changes include:
- Dual display of deal IDs from both the deprecated field and the market actor's ProviderSectors HAMT (for actors v13+).
- New function getMarketDealIDs for retrieving deal IDs from the market actor.
- Improved error handling and clear output labelling.
Improve code readability and maintainability by refactoring the getMarketDealIDs function into three focused helper functions: - getMinerActorID: Handles miner address to actor ID conversion - loadMarketState: Manages market actor state loading - extractSectorDealIDs: Extracts deal IDs from ProviderSectors HAMT Each function now has a single responsibility, making the code easier to understand, test, and maintain.
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.
looks pretty good, I think this will be appreciated by some folks who have lost this direct insight
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.
looks good to me, without having tried it out though
The 'lotus state sector' command was showing empty DealIDs for sectors that actually contain deals. This occurred because for actors v13+, deal IDs are stored in the market actor's ProviderSectors HAMT, not in the sector's DeprecatedDealIDs field.
This fix:
Resolves issue where sectors containing deals incorrectly showed 'DealIDs: []' instead of the actual deal IDs.
Example output after fix:
Related Issues
#12791
Proposed Changes
cli/state.go
: Added dual DealIDs display functionalityAdditional Info
lotus state sector f08403 16357
showing actual deal ID[100951959]
Technical details:
market.Load()
to access market actor stateProviderSectors()
HAMT for efficient deal ID lookupaddress.IDFromAddress()
Checklist
Before you mark the PR ready for review, please make sure that: