Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Non-Interactive Staking #12610

Merged
merged 57 commits into from
Dec 5, 2022
Merged

Non-Interactive Staking #12610

merged 57 commits into from
Dec 5, 2022

Conversation

gavofyork
Copy link
Member

@gavofyork gavofyork commented Nov 3, 2022

Polkadot Companion: paritytech/polkadot#6352

A major re-work of the gilts pallet to now become NIS (non-interactive staking) pallet.

  • Allow partial thawing.
  • Enforce throttling for thawing.
  • Allow manual deficit funding.
  • Replace AdminOrigin for a target getter.
  • Introduce FundOrigin for automatic deficit funding.
  • Allow receipts to be transferred through nonfungibles trait API.
  • Introduce optional counterpart receipts via fungibles trait impl.
  • Replace some confusing terms.
  • Refactoring.
  • Additions to defensive traits.
  • Additions to per-things.

TODO

  • Instead of MaxIntakeBids it should take MaxIntakeWeight.
  • Benchmarks.
  • Check if upgrade would need some initialisation.

Future

  • Consider using Scheduler instead of on_initialize.

@gavofyork gavofyork added the A3-in_progress Pull request is in progress. No review needed at this stage. label Nov 3, 2022
@gavofyork gavofyork marked this pull request as ready for review November 3, 2022 14:16
@gavofyork gavofyork added A0-please_review Pull request needs code review. and removed A3-in_progress Pull request is in progress. No review needed at this stage. labels Nov 3, 2022
@gavofyork gavofyork changed the title Introduce counterpart receipts items to non-interactive staking Non-Interactive Staking Nov 3, 2022
@gavofyork gavofyork added B7-runtimenoteworthy C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit. labels Nov 3, 2022
@gavofyork gavofyork requested a review from ggwpez November 3, 2022 17:17
gavofyork and others added 10 commits November 22, 2022 05:03
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Relaxes the check for the NIS account balance in the fund_deficit bench
from equality from to checking for 99.999% equality. The exact deviation
for the kitchensink runtime config is 1.24e-10 percent but could vary if
the config is changed.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
@ggwpez
Copy link
Member

ggwpez commented Nov 23, 2022

Just companions are missing, the other CI failures are unrelated.

@kianenigma
Copy link
Contributor

Have some questions still regarding #12610 (comment), also posted in the parity forum.

@gavofyork gavofyork merged commit 0ab43bc into master Dec 5, 2022
@gavofyork gavofyork deleted the gav-ref-nis branch December 5, 2022 13:37
@ggwpez ggwpez restored the gav-ref-nis branch December 5, 2022 13:58
@ggwpez ggwpez deleted the gav-ref-nis branch December 9, 2022 12:23
ltfschoen pushed a commit to ltfschoen/substrate that referenced this pull request Feb 22, 2023
* Improve naming.

* More improvements to naming

* Fungible counterpart

* Shared pot instead of reserve

* Transferable receipts

* Better naming

* Use u128 for counterpart

* Partial thawing

* Docs

* Remove AdminOrigin

* Integrate into Kitchen Sink

* Thaw throttling

* Remove todo

* Docs

* Fix benchmarks

* Building

* Tests work

* New benchmarks

* Benchmarking tests

* Test new defensive_saturating_* functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Formatting

* Update frame/nis/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Apply suggestions from code review

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Events added

* Fix kitchensink

* Update frame/nis/src/lib.rs

Co-authored-by: Xiliang Chen <[email protected]>

* Review niggles

* Remove genesis build requirements

* Grumbles

* Fixes

* Fixes

* Fixes

* Update frame/nis/src/lib.rs

Co-authored-by: Kian Paimani <[email protected]>

* Update primitives/runtime/src/traits.rs

Co-authored-by: Kian Paimani <[email protected]>

* Formatting

* Fixes

* Fix node genesis config

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix node chain specs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use free asset ID as counterpart

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Account for rounding errors in fund_deficit bench

Relaxes the check for the NIS account balance in the fund_deficit bench
from equality from to checking for 99.999% equality. The exact deviation
for the kitchensink runtime config is 1.24e-10 percent but could vary if
the config is changed.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix

* Rename

* Fixes

* Fixes

* Formatting

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Xiliang Chen <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Improve naming.

* More improvements to naming

* Fungible counterpart

* Shared pot instead of reserve

* Transferable receipts

* Better naming

* Use u128 for counterpart

* Partial thawing

* Docs

* Remove AdminOrigin

* Integrate into Kitchen Sink

* Thaw throttling

* Remove todo

* Docs

* Fix benchmarks

* Building

* Tests work

* New benchmarks

* Benchmarking tests

* Test new defensive_saturating_* functions

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Formatting

* Update frame/nis/src/lib.rs

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Apply suggestions from code review

Co-authored-by: Oliver Tale-Yazdi <[email protected]>

* Events added

* Fix kitchensink

* Update frame/nis/src/lib.rs

Co-authored-by: Xiliang Chen <[email protected]>

* Review niggles

* Remove genesis build requirements

* Grumbles

* Fixes

* Fixes

* Fixes

* Update frame/nis/src/lib.rs

Co-authored-by: Kian Paimani <[email protected]>

* Update primitives/runtime/src/traits.rs

Co-authored-by: Kian Paimani <[email protected]>

* Formatting

* Fixes

* Fix node genesis config

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix node chain specs

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Use free asset ID as counterpart

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Account for rounding errors in fund_deficit bench

Relaxes the check for the NIS account balance in the fund_deficit bench
from equality from to checking for 99.999% equality. The exact deviation
for the kitchensink runtime config is 1.24e-10 percent but could vary if
the config is changed.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* clippy

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* fmt

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix

* Rename

* Fixes

* Fixes

* Formatting

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Xiliang Chen <[email protected]>
Co-authored-by: Kian Paimani <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D2-notlive 💤 PR contains changes in a runtime directory that is not deployed to a chain that requires an audit.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants