[HRMP] Check messages order before enqueing them#9326
[HRMP] Check messages order before enqueing them#9326serban300 merged 12 commits intoparitytech:masterfrom
Conversation
|
/cmd prdoc --audience runtime_dev --bump patch |
…time_dev --bump patch'
| ]; | ||
| messages.check_messages_order(); | ||
|
|
||
| // Unsorted messages shouldn't be accepted |
There was a problem hiding this comment.
I see that you verify sorted and unsorted messages within one test named check_messages_order_works. It might be just my perception but when I read check_messages_order_works, I assume that it verifies happy path; though, this test verifies both: happy and unhappy path.
My small suggestion here:
- either move this unsorted assertion to the very top to show at the very beginning what is NOT accepted,
- or split the test into two, or even better use table-driven tests to clearly show what's the input and what's the expected state
There was a problem hiding this comment.
Done. Move the unsorted assertions to the top and added some comments. Not sure in table driven testing is worth the effort for these very simple use cases.
There was a problem hiding this comment.
Had to move the logic and removed these tests. Defined other ones. And split them in multiple test cases for success vs failure.
|
A test would also be nice. I know that we now only can have some panicking test, but better than nothing. |
|
Yes, agree, trying to add one |
|
Added some tests |
bd78cc5
Related to #8860 This PR adds a check in order to ensure that the collator has respected the proper order when sending the HRMP messages to the runtime. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrii <ndk@parity.io> (cherry picked from commit bd78cc5)
|
Successfully created backport PR for |
Backport #9326 into `unstable2507` from serban300. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Co-authored-by: Serban Iorga <serban@parity.io> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrii <ndk@parity.io>
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-9326-to-stable2506
git worktree add --checkout .worktree/backport-9326-to-stable2506 backport-9326-to-stable2506
cd .worktree/backport-9326-to-stable2506
git reset --hard HEAD^
git cherry-pick -x bd78cc52b6271e2463b32de80410ab26602fc616
git push --force-with-lease |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin unstable2507
git worktree add -d .worktree/backport-9326-to-unstable2507 origin/unstable2507
cd .worktree/backport-9326-to-unstable2507
git switch --create backport-9326-to-unstable2507
git cherry-pick -x bd78cc52b6271e2463b32de80410ab26602fc616 |
Related to #8860 This PR adds a check in order to ensure that the collator has respected the proper order when sending the HRMP messages to the runtime. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrii <ndk@parity.io>
Related to #8860
This PR adds a check in order to ensure that the collator has respected the proper order when sending the HRMP messages to the runtime.