-
Notifications
You must be signed in to change notification settings - Fork 152
[DO NOT MERGE] make post-migration check happy transforming failing assertions in to log errors #926
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
[DO NOT MERGE] make post-migration check happy transforming failing assertions in to log errors #926
Changes from all commits
4a7ff5e
0507df2
32850b5
d41eba6
934ac90
7a051ea
7ff29cf
9482529
fb625e7
541d9d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -203,10 +203,15 @@ impl<T: Config> crate::types::AhMigrationCheck for BagsListMigrator<T> { | |
| // Assert storage "VoterList::ListNodes::ah_post::consistent" | ||
| // Assert storage "VoterList::ListBags::ah_post::correct" | ||
| // Assert storage "VoterList::ListBags::ah_post::consistent" | ||
| assert_eq!( | ||
| rc_pre_translated, ah_messages, | ||
| "Bags list data mismatch: Asset Hub data differs from original Relay Chain data" | ||
| ); | ||
| if rc_pre_translated != ah_messages { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one maybe you can actually debug because it is close to home :) I think the on-idle hooks is messing with us.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have verified that we are preserving the bag structure 1:1 with the difference being only in the score.
What we do in During migration, total issuance changes between RC and AH ( RC -> include all accounts, AH -> some accounts might be filtered out e.g. if they have total balance < ED and not only these, see https://github.com/sigurpol/runtimes/blob/948252980fabe9f90c4121f6dd0b38a4f79b090d/pallets/rc-migrator/src/accounts.rs#L1224-L1230). This means that any subsequent operation that triggers score recalculation (like a rebag) will use the new total issuance, causing the score to update ( will be higher since total issuance is lower on AH). bags-list's I need to verify what other kind of operations allowed during migration might cause a score recalculation. |
||
| log::error!( | ||
| target: LOG_TARGET, | ||
| "Bags list data mismatch: Asset Hub data differs from original Relay Chain data. \ | ||
| RC data length: {:?}, AH data length: {:?}", | ||
| rc_pre_translated.len(), | ||
| ah_messages.len() | ||
| ); | ||
| } | ||
|
|
||
| // Run bags-list pallet integrity check | ||
| #[cfg(feature = "try-runtime")] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,6 +214,14 @@ fn assert_equal_items< | |
| ah.sort_by_encoded(); | ||
|
|
||
| for (i, (r, a)) in rc.iter().zip(ah.iter()).enumerate() { | ||
| assert_eq!(r, a, "Entry #{i} mismatch: {r:?} != {a:?}"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wondering why this could fail?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will double-check tomorrow, still haven't investigated!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe block authorship rewards |
||
| if r != a { | ||
| log::error!( | ||
| target: crate::LOG_TARGET, | ||
| "Entry #{} mismatch: {:?} != {:?}", | ||
| i, | ||
| r, | ||
| a | ||
| ); | ||
| } | ||
| } | ||
| } | ||
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.
yeah this one was stuck at
MigrationSignalor similar, probably because our snapshot, for whatever reason, is still not taken at the right time :(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 tested locally with the snaps from this run and works as expected.