-
Notifications
You must be signed in to change notification settings - Fork 86
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
base: main
Are you sure you want to change the base?
Drop PricingAdmin
role
#1399
Conversation
@@ -35,7 +35,6 @@ use sp_std::{ | |||
pub enum PoolRole<TrancheId = [u8; 16], Moment = u64> { | |||
PoolAdmin, | |||
Borrower, | |||
PricingAdmin, |
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.
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.
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 the insight! I will undo this whole PR and just deprecate that variant
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.
Or we can also remove it but add #[codec(index = x)]
marks on each variant to ensure they remain with the same encoding representation?
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.
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.
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.
If this is the case and we never store the enum directly, then we are safe 🙌🏻
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.
If not, #[codec(index = x)]
is a good idea I think 👍🏻
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.
According to Subscan, we have three accounts with PricingAdmin
role on Altair:
- https://altair.subscan.io/extrinsic/1369696-2?event=1369696-3
- https://altair.subscan.io/extrinsic/1349858-2?event=1349858-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.
Closes #1398