-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Configurable call fee refund for signed submissions #11002
Conversation
if not overly complicated, can we make it such that you specify how many of the "non-winnings" get a refund? i.e 'type MaxFullRefunds'. This way we can enable and merge this on Kusama ahead of time as well. |
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.
Just some comments 😄
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.
As discussed elsewhere, when we push out a solution in the middle of the signed phase we should also refund that potentially.
For these solutions, I presume we always refund their call-fee? hard to decide on it.
@niklasad1 @ggwpez can either of you take a second look! much appreciated. |
.filter(|k| { | ||
if self.deletion_overlay.contains(k) { | ||
// Remove submissions that should be deleted. | ||
SignedSubmissionsMap::<T>::remove(k); |
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 SignedSubmissionsMap::<T>::remove(k)
(side-effects) in filter is a bit unexpected...
Personally I would prefer filter_map
or something even if the actual iterator isn't affected by it.
Co-authored-by: Niklas Adolfsson <[email protected]>
bot merge |
Error: "Check reviews" status is not passing for paritytech/polkadot#5309 |
bot merge |
Error: "Check reviews" status is not passing for paritytech/polkadot#5309 |
bot merge |
Error: "Check reviews" status is not passing for paritytech/polkadot#5309 |
bot merge |
* Refund call fee for all non-invalid signed submissions * Clean up * Fix benchmarks * Remove reward from struct * WIP SignedMaxRefunds * Apply suggestions from code review * Add test for ejected call_fee refunds * Add test for number of calls refunded * Account for read op in mutate * Apply suggestions from code review * Add to node runtime * Don't refund ejected solutions * Update frame/election-provider-multi-phase/src/lib.rs Co-authored-by: Kian Paimani <[email protected]> * Inegrity test SignedMaxRefunds * Use reward handle to refund call fee * Fix node runtime build * Drain in order of submission * Update frame/election-provider-multi-phase/src/signed.rs * save * Update frame/election-provider-multi-phase/src/signed.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Update frame/election-provider-multi-phase/src/signed.rs Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
* Refund call fee for all non-invalid signed submissions * Clean up * Fix benchmarks * Remove reward from struct * WIP SignedMaxRefunds * Apply suggestions from code review * Add test for ejected call_fee refunds * Add test for number of calls refunded * Account for read op in mutate * Apply suggestions from code review * Add to node runtime * Don't refund ejected solutions * Update frame/election-provider-multi-phase/src/lib.rs Co-authored-by: Kian Paimani <[email protected]> * Inegrity test SignedMaxRefunds * Use reward handle to refund call fee * Fix node runtime build * Drain in order of submission * Update frame/election-provider-multi-phase/src/signed.rs * save * Update frame/election-provider-multi-phase/src/signed.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Update frame/election-provider-multi-phase/src/signed.rs Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
* Refund call fee for all non-invalid signed submissions * Clean up * Fix benchmarks * Remove reward from struct * WIP SignedMaxRefunds * Apply suggestions from code review * Add test for ejected call_fee refunds * Add test for number of calls refunded * Account for read op in mutate * Apply suggestions from code review * Add to node runtime * Don't refund ejected solutions * Update frame/election-provider-multi-phase/src/lib.rs Co-authored-by: Kian Paimani <[email protected]> * Inegrity test SignedMaxRefunds * Use reward handle to refund call fee * Fix node runtime build * Drain in order of submission * Update frame/election-provider-multi-phase/src/signed.rs * save * Update frame/election-provider-multi-phase/src/signed.rs Co-authored-by: Niklas Adolfsson <[email protected]> * Update frame/election-provider-multi-phase/src/signed.rs Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
Previously, the winning solution had it deposit unreserved, and was rewarded with the reward base + call fee. All other unchecked solutions had their deposit unreserved, but still lost their call fee. This PR changes things so a runtime can be configured to refund the call fees for some (or all) of the stored, non-winning solutions.
Configuring
SignedMaxRefunds
:The first
x
unchecked solutions can get their call fee refunded by settingSignedMaxRefunds
tox
. This will lead to no ejected solutions getting a refund.polkadot companion: paritytech/polkadot#5309