This repository was 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.
election-provider-multi-phase: Add extrinsic to challenge signed submissions #11099
election-provider-multi-phase: Add extrinsic to challenge signed submissions #11099
Changes from 7 commits
0de2102
b0dc752
b482437
89ffbde
d1a1ce5
d088cef
347cc5d
7ae1414
3e021b0
8b46d39
d886352
191790d
fb41c5b
a3a30c7
e1c7826
4749743
96dc255
3cf87f0
af8baf0
dd12583
5f72594
2416197
719d684
0d16e12
5167594
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The reward of the challenger should be the deposit of the challengee. @emostov wdyt? trying to avoid adding more and more configs.
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.
The reward needs to be less than the deposit so we don't encourage users to spam the system by submitting a bogus solution, then challenging it and claiming back their own solution and claiming back their deposit.
To achieve this we can have a config that is something like
ChallengeDepositDiff
, e.g. if the deposit is 100 andChallengeDepositDiff
is 5, then reward base would be 95There 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, good point. The reward can just be a
Perbill
of the deposit then? I think this is slightly more intuitive than a diff.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.
Similarly, I think the slashable deposit of the challenger should be dynamic and should be simply the same as the amount of the deposit of the solution that you are going after.
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.
Same issue: do not use the storage maps directly, see
get_submission
inSignedSubmissions
.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'd have to make
get_submission
publicThere 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.
Like Kian mention,
T::MinimumSlashableAmount::get()
should be replaced with the deposit for the solutionThere 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.
As pointed out before, this is still not complete. You need to remove the item from all 2 corresponding storage items. All in all, you should never use these storage items directly. Instead, you should only work toward creating clear abstractions in the
SignedSubmissions
struct wrapper.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.
the newly created method
pop
still applies here?