-
Notifications
You must be signed in to change notification settings - Fork 79
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
fix(market): clean up provider_sectors when empty #1539
Conversation
7740632
to
88fda7f
Compare
88fda7f
to
20a3b45
Compare
It looks correct, yes.
IIRc, we need to do another cleanup of dead deals. I'd do that all at the same time. |
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.
Thanks for fixing this
This would become a FIP thing, wouldn't it? Should I open a discussion about it? And why do we have dead deals to clean up? Was there some old behaviour we're still living with? filecoin-project/FIPs#956 exists, do we just add it to the list in there? |
I'm talking about the change made in filecoin-project/FIPs#950. But... that's a more complex migration than simply removing empty records. Honestly, I'd do nothing for now and add it to the todo list for the next time we touch this state. |
OK, this is cleaned up now and has test coverage. I didn't need to add any more tests, just make it much more strict about what it expected to be in ProvidersSectors in the various cases. With the new test changes but with the old logic in place, these tests would fail as they hit the case where a removal ends up with a zero-length list:
|
83b5a3c
to
da20b65
Compare
da20b65
to
444a205
Compare
* fix(market): clean up provider_sectors when empty * fix(market): extend tests to ensure no empty sector/deal map
We have this invariant complaining with nv22,
no deal ids in sector X
for the newProviderSectors
mapping: https://github.com/filecoin-project/go-state-types/blob/ad909a3d6ebef5ebc5688b4310e954e27da2203b/builtin/v13/market/invariants.go#L294I don't think it's the migration that's the cause of this since it's checking the
len==0
case: https://github.com/filecoin-project/go-state-types/blob/ad909a3d6ebef5ebc5688b4310e954e27da2203b/builtin/v13/migration/miner.go#L76-L78We have 2 ways that we remove items from
provider_sectors
in actors,pop_sector_deal_ids
andremove_sector_deal_ids
. The former does cleanup when empty. But the latter just removes and saves. This PR proposes removing in both cases when we get to an emptyDealID
array.Before I write any tests for this I want to check if this is correct. Also, if this is correct, should we propose a small cleanup migration for nv23 to get rid of the empty ones?