-
Notifications
You must be signed in to change notification settings - Fork 666
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
migrations: state difference guard and recorder #4204
base: master
Are you sure you want to change the base?
Conversation
StateDiffGuard
initial implf3cc891
to
730d9a9
Compare
8e68898
to
ddf1711
Compare
#[derive(Default, Debug)] | ||
pub struct StateDiffGuard { | ||
// Storage prefixes that are expected to change. | ||
whitelisted_prefixes: BTreeSet<StoragePrefix>, |
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.
whitelisted_prefixes: BTreeSet<StoragePrefix>, | |
must_change_prefixes: BTreeSet<StoragePrefix>, |
The name here is not really expressing that they must change. It is also possible to make this more abstract by having a Map<Prefix, Change>
where Change
can be { Can | Must } x { Change | NotChange }
(PS: not sure if these enum values are correct - hopefully you get the idea), but i think its fine for the beginning.
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.
made some improvements here, let me know if it's in the right direction, thanks)
e93ecb2
to
d1e0384
Compare
The CI pipeline was cancelled due to failure one of the required jobs. |
d1e0384
to
12e6f44
Compare
This looks like a very good PR. @dastansam sorry for the delay, are you still around for finishing? @ggwpez @liamaharon and I can provide reviews. |
What I see missing is integrating this into |
thanks, for sure. Looking forward for your reviews) |
Motivation
Adds a guard that prevents unexpected storage changes.
StateDiffGuard
:AnythingElse
if present.part of #240
polkadot address: 16FqwPZ8GRC5U5D4Fu7W33nA55ZXzXGWHwmbnE1eT6pxuqcT