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

Remove duplicate metadata from pool-system #1285

Merged
merged 8 commits into from
Apr 4, 2023
Merged

Remove duplicate metadata from pool-system #1285

merged 8 commits into from
Apr 4, 2023

Conversation

branan
Copy link
Contributor

@branan branan commented Mar 27, 2023

Description

Remove duplicate metadata hash stored in the

Fixes #1261

Changes and Descriptions

  • Remove metadata hash from pool-system pallet
  • Remove unused error variant from pool-system
  • Update benchmarks and tests for removal
  • Update all runtimes for removal

Checklist:

  • I have added Rust doc comments to structs, enums, traits and functions
  • I have made corresponding changes to the documentation
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or that my feature works

@branan
Copy link
Contributor Author

branan commented Mar 27, 2023

@mustermeiszer @lemunozm This is targeting the branch to add pools to Centrifuge since it will conflict with that branch, and since we need to make sure to include it as part of the final inclusion of the loans refactor + release.

As long as this ships to altair in the same release as the loans refactor (or at least, ships after we delete the existing test pool but before we add a new one), we don't need to bother with a migration.

lemunozm
lemunozm previously approved these changes Mar 27, 2023
Copy link
Contributor

@lemunozm lemunozm left a comment

Choose a reason for hiding this comment

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

LGTM!

we don't need to bother with a migration.

Do you mean now? We are modifying the pools storage, although we are not shipping this to altair, we need to do some kind of migration for altair before we launch there, isn't it?

Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

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

Nice! But we need a migration for Altair, right?

@branan
Copy link
Contributor Author

branan commented Mar 28, 2023

I think I misunderstood how much of the pools/loans storage we were removing, I had assume we would nuke the whole testing pool from Altair. If we're only going to do loans, then we will indeed need a migration here.

I got the migration half done already before I had the realization about removing storages, so I'll get it wrapped up and pushed 👍

@branan
Copy link
Contributor Author

branan commented Mar 30, 2023

Since this is no longer tied to the loans refactor/release schedule, I'm going to retarget it at main. We can try to land it as part of the initial release on Centrifuge to avoid the migration, but it's not critical.

@branan branan force-pushed the fix/pool-metadata branch from 904e76e to 75886b3 Compare March 30, 2023 07:11
@branan branan requested a review from hieronx as a code owner March 30, 2023 07:11
Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

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

Can we maybe even nuke the storage? Easier to migrate, but the migration itself already looks good at the first view.

Comment on lines +172 to +181
pub enum Release {
V0,
V1,
}

impl Default for Release {
fn default() -> Self {
Self::V0
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we use the new versioning that is automatically supported for pallets. Cc @wischli for how this works ^^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding of that is that its based around the crate's version number. We... don't really use/maintain those right now. I agree we should move to the new versioning, though.

My thought was that we'll need to figure out some sort of versioning / release-stream system anyway once pools are on cent-chain (because we won't want new features to land simultaneously on altair & cfg). We should roll pallet versioning into that, and then we can switch to the new pallet version storage. WDYT? (again /cc @wischli )

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is a basic u16 value.

@branan
Copy link
Contributor Author

branan commented Mar 31, 2023

As far as nuking goes, that's more complicated (many additional storage keys) and involves two pallets (this one and pool-registry). I don't think it's worth it, necessarily?

mustermeiszer
mustermeiszer previously approved these changes Apr 4, 2023
Copy link
Collaborator

@mustermeiszer mustermeiszer left a comment

Choose a reason for hiding this comment

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

I would merge this directly after #1233.

Base automatically changed from feature/add-pools-to-centrifuge to main April 4, 2023 13:51
@branan branan force-pushed the fix/pool-metadata branch from 75886b3 to cba8e6b Compare April 4, 2023 15:46
@branan branan enabled auto-merge (squash) April 4, 2023 15:47
hieronx
hieronx previously approved these changes Apr 4, 2023
@branan branan merged commit 0ad8064 into main Apr 4, 2023
@wischli wischli mentioned this pull request Apr 6, 2023
4 tasks
@NunoAlexandre NunoAlexandre deleted the fix/pool-metadata branch June 28, 2023 07:26
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.

4 participants