Commit f7b0396
[AHM/Staking/VMP] Paginated Offence Reports + Retries for Validator Set (#9619)
* Please see the full design do
[here](https://docs.google.com/document/d/1l2COWct1f-gC8nM0tq7Xs8pBWeAP6pX0LociWC6enUg/edit?tab=t.0)
* closes paritytech/srlabs_findings#520
This PR makes the following changes:
#### Common
* `SendToRelayChain` and `SendToAssetHub` traits now return a result,
allowing the caller to know if the underlying XCM was sent or not.
* Adds a number of testing facilities to `pallet-root-offences`, and
`staking-async/papi-tests`. Both of which can be ignored in the review.
#### Offences
* `SendToAssetHub::relay_new_offence` is removed. Instead, we use the
new `relay_new_offence_paged` which is a vector of self-contained
offences, not requiring us to group offences per session in each
message.
* Offences are not sent immediately anymore.
* Instead, they are stored in a paginated `OffenceSendQueue`.
* `on-init`, we grab one page of this storage map, and sent it.
#### Session Report
* Session reports now also have a retry mechanism.
* Upon each failure, we emit an `UnexpectedEvent`
* If our retries run out and we still can't send the session report, we
will emit a different `UnexpectedEvent`. We also retore the validator
points that we meant to send, and merge them back, so that they are sent
in the next session report.
#### Validator Set
* Similar to offences, they are not sent immediately anymore.
* Instead, they are stored in a storage item, and are sent on subsequent
on-inits.
* A maximum retry count is added.
### Review notes
As noted above, ignore all changes in
* `staking-async/runtimes`
* `staking-async/runtimes/papi-tests`
* `root-offences`
As they are only related to testing.
---------
Co-authored-by: Ankan <[email protected]>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>1 parent ae7177e commit f7b0396
40 files changed
Lines changed: 2729 additions & 970 deletions
File tree
- cumulus/parachains/runtimes/assets/asset-hub-westend
- src
- polkadot/runtime/westend/src
- weights
- prdoc
- substrate/frame
- election-provider-multi-block/src
- root-offences/src
- staking-async
- ah-client/src
- ahm-test
- src
- ah
- rc
- rc-client/src
- runtimes
- papi-tests
- src
- tests
- parachain/src
- preset-store
- rc
- constants/src
- src
- src
- pallet
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| 141 | + | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| |||
301 | 303 | | |
302 | 304 | | |
303 | 305 | | |
| 306 | + | |
304 | 307 | | |
305 | 308 | | |
306 | 309 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
| |||
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | | - | |
| 354 | + | |
354 | 355 | | |
355 | 356 | | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
359 | | - | |
| 360 | + | |
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
793 | 793 | | |
794 | 794 | | |
795 | 795 | | |
796 | | - | |
| 796 | + | |
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
| |||
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
855 | | - | |
856 | | - | |
857 | | - | |
858 | | - | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
863 | 851 | | |
864 | 852 | | |
865 | 853 | | |
866 | 854 | | |
867 | 855 | | |
868 | 856 | | |
869 | 857 | | |
870 | | - | |
871 | | - | |
| 858 | + | |
872 | 859 | | |
873 | 860 | | |
874 | 861 | | |
875 | 862 | | |
876 | 863 | | |
877 | | - | |
878 | | - | |
879 | | - | |
880 | | - | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
881 | 892 | | |
882 | 893 | | |
883 | 894 | | |
| |||
893 | 904 | | |
894 | 905 | | |
895 | 906 | | |
896 | | - | |
| 907 | + | |
| 908 | + | |
897 | 909 | | |
898 | 910 | | |
899 | 911 | | |
| |||
2143 | 2155 | | |
2144 | 2156 | | |
2145 | 2157 | | |
2146 | | - | |
2147 | 2158 | | |
2148 | 2159 | | |
2149 | 2160 | | |
| |||
Lines changed: 0 additions & 78 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
307 | 306 | | |
308 | 307 | | |
309 | 308 | | |
| |||
0 commit comments