Skip to content
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

Used Contracts #603

Merged
merged 9 commits into from
Sep 18, 2023
Merged

Used Contracts #603

merged 9 commits into from
Sep 18, 2023

Conversation

peterjan
Copy link
Member

@peterjan peterjan commented Sep 18, 2023

This PR updates the upload manager to return a set of used contracts. This avoids looping the sectors after calling upload/migrate and build it manually, but it also makes sure the contracts contain potential renewals.

@peterjan
Copy link
Member Author

peterjan commented Sep 18, 2023

Was going to add a commit that improves fetchUsedContracts but I see you are doing something similar in #602 so I'll wait for that. I would personally do both, but I agree that it's mostly useful in fetchUsedContracts so we might be able to drop this in favour of #602 . It's more correct though to do it in both the uploader and the bus I think 🤔

edit: added it anyway, was almost done and took diff. approach

@peterjan peterjan changed the title Contract Renewals Used Contracts Sep 18, 2023
@peterjan peterjan marked this pull request as ready for review September 18, 2023 12:05
worker/worker.go Outdated
}
used[ss.Host] = fcid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait why is that? Can't you directly pass used to UpdateSlab instead of looping over slab.Shards again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no you can't because it'll only contain the used contracts for the migrated shards, I updated the code though so migrateSlab takes care of that for you

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok in that case can we rename Migrate to UploadShards? It was quite confusing to me that in one place we call Migrate and are able to return used without modification and in another we call migrateSlabs and we still have to merge the maps.
Only to realise that Migrate isn't actually migrating but only uploading.

@peterjan peterjan merged commit 6afb988 into master Sep 18, 2023
6 checks passed
@peterjan peterjan deleted the pj/renewals branch September 18, 2023 15:16
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.

2 participants