This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds ability to clear obsolete reports in Offences pallet #14048
base: master
Are you sure you want to change the base?
Adds ability to clear obsolete reports in Offences pallet #14048
Changes from 25 commits
b1b843d
72564c2
ecfe969
b6546b5
c666aa0
9bbe6e3
5b4954e
8e97ca6
d3b7560
81c4f99
7927788
8176c15
544ed3e
217a484
5bae7e1
74accc2
15b8f46
cd23321
1fa5c13
8f62f4c
4a334f5
6b9bc38
e6e2f1d
003127f
d085786
d84cf00
42c4d90
6ac1857
30df0ed
b4be535
8fde92c
5f0a4f9
62f7c65
fe5d2c7
392fca3
509502b
6a58757
4e2d07e
ed41f99
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Please try to break lines at 100 chars.
I am not sure if the formatter does it, but many editors support a vertical line that makes it easy to do it manually.
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.
and why
unwrap_or_default
? if we go to default, there must have been a bug, no? then it can be adefensive_unwrap_or_default
, or an early return.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.
It will go to default when the vector is empty?
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.
No. If it is empty it just returns
Ok(vec![])
, an error here means that the storage is corrupted.DQ but why is this double-encode anyway? Why not store
Vec<StorageReportOf<T>>
?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.
Is there any upper limit to the length of this vector?
We always need to keep the weight of
on_initialize
bounded…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.
Good point, I'd expect that the session reports can be very large, especially if there's a bug. We should be able to clear the offences through governance when these are resulting from a bug, but still it's better to bound a loop
on_initialize
.Perhaps we should instead queue clearing offences and process a fixed number
on_initialize
, until the queue is empty (simple multi-block clearing process).