-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add try_state
check to Pallet MessageQueue
#13502
Add try_state
check to Pallet MessageQueue
#13502
Conversation
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 will take a look at the failing tests. Probably not all of them keep the invariants because of mocked storage.
change if let to while let and modify bump_service_head function Co-authored-by: Oliver Tale-Yazdi <[email protected]>
a8f922f
to
a9624a3
Compare
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.
Looks pretty good, thanks.
Please put your address for a tip like described here: https://github.com/paritytech/substrate-tip-bot#pull-request-body
The CI will also need a format, then we can fix the remaining tests.
|
||
// No state to check | ||
if ServiceHead::<T>::get().is_none() { | ||
return Ok(()) |
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 there are still a few assumptions about books even if they are not in the ready ring, but it is okay for a first version.
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
/tip small |
@juangirini A small tip was successfully submitted for gitofdeepanshu (12y2pdexQRzCvR7rj6HhMYkLbL3atjikGptSit78eeGWn6ma on polkadot). https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.polkadot.io#/treasury/tips |
Hey @gitofdeepanshu thanks for your contribution! Would you apply those changes requested by @ggwpez so we can give a final review before merging it? |
Hey @gitofdeepanshu would you be able to take this over again? |
I will do it this week, apologies for delay! |
frame/message-queue/src/mock.rs
Outdated
{ | ||
new_test_ext::<T>().execute_with(|| { | ||
test(); | ||
MessageQueue::do_try_state().unwrap(); |
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.
perfecto 👍
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
@gitofdeepanshu I am very sorry this took ages to get merged and had a few rebase conflicts now resolved but still it is falling due to the fact that the |
Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions. |
bot rebase |
Error: Command 'Command { std: cd "/storage/repositories/substrate" && "git" "push" "--porcelain" "gitofdeepanshu" "feat/try-state_message-queue", kill_on_drop: false }' failed with status Some(1); output: error: failed to push some refs to 'https://github.com/gitofdeepanshu/substrate.git' |
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
try_state
check to Pallet MessageQueue
bot merge |
* feat: Add try_state for message_queue * Update frame/message-queue/src/lib.rs change if let to while let and modify bump_service_head function Co-authored-by: Oliver Tale-Yazdi <[email protected]> * feat: update try_state, add checks for storage * fix: add try_state builder for remaining tests * Update frame/message-queue/src/mock.rs Co-authored-by: Oliver Tale-Yazdi <[email protected]> * chore: assert statement to ensure * Fix tests Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Use ensure instead of assert Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Fix function signature and feature gate Signed-off-by: Oliver Tale-Yazdi <[email protected]> * Cleanup code Signed-off-by: Oliver Tale-Yazdi <[email protected]> --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Oliver Tale-Yazdi <[email protected]> Co-authored-by: Juan <[email protected]>
Fix #13115
Description
Add try_state hook implementation for pallet message-queue.
Assumptions:
If serviceHead points to a ready Queue (i.e. has some value), then BookState of that Queue has:
For a particular BookState of Queue present in ReadyRing, all pages from begin to end-1 should have:
Test Status
5 tests are failing, if assumptions are correct then these tests are not a part of valid state.
failures:
tests::bump_service_head_bails
tests::bump_service_head_trivial_works
tests::bump_service_head_works
tests::execute_overweight_works
tests::reap_page_permanent_overweight_works
Polkadot address: 12y2pdexQRzCvR7rj6HhMYkLbL3atjikGptSit78eeGWn6ma