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

Drop PricingAdmin role #1399

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Drop PricingAdmin role #1399

wants to merge 2 commits into from

Conversation

NunoAlexandre
Copy link
Contributor

Closes #1398

@NunoAlexandre NunoAlexandre self-assigned this Jun 13, 2023
@@ -35,7 +35,6 @@ use sp_std::{
pub enum PoolRole<TrancheId = [u8; 16], Moment = u64> {
PoolAdmin,
Borrower,
PricingAdmin,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is not so easy 😖, removing that enum variant will give other internal memory representations for the next variants, so I think we need several migrations in different pallets to get this to work fine.

If this is not viable, maybe marking it as deprecated can be enough, to get a warning if somebody uses it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the insight! I will undo this whole PR and just deprecate that variant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or we can also remove it but add #[codec(index = x)] marks on each variant to ensure they remain with the same encoding representation?

Copy link
Contributor

Choose a reason for hiding this comment

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

We store the permissions as bit fields though (see the block of code just after this enum). So I don't think we're ever using the enum variant index in storage.

Copy link
Contributor

Choose a reason for hiding this comment

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

If this is the case and we never store the enum directly, then we are safe 🙌🏻

Copy link
Contributor

Choose a reason for hiding this comment

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

If not, #[codec(index = x)] is a good idea I think 👍🏻

Copy link
Contributor

@wischli wischli left a comment

Choose a reason for hiding this comment

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

According to Subscan, we have three accounts with PricingAdmin role on Altair:

  1. https://altair.subscan.io/extrinsic/1369696-2?event=1369696-3
  2. https://altair.subscan.io/extrinsic/1349858-2?event=1349858-3
  3. https://altair.subscan.io/extrinsic/1369696-2?event=1369696-7

Centrifuge is fine as no permissions have been added so far.

As a consequence, we need to write a migration, removing this storage entry.

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.

Remove PricingAdmin
4 participants