-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Initial integration of Gilts pallet (Kusama) #2587
Conversation
/benchmark runtime westend slots |
Finished benchmark for branch: gav-kusama-gilts Benchmark: Benchmark Runtime Westend Pallet cargo run --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=slots --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/ Results
Compiling sp-std v3.0.0 (https://github.com/paritytech/substrate.git?branch=master#ac1f7ff3) Caused by: --- stderr �[0m�[0m�[1m�[36m Blocking�[0m waiting for file lock on package cache �[0m�[1m�[33mwarning�[0m�[0m�[1m: function is never used: �[0m�[1m�[33mwarning�[0m�[0m�[1m: 2 warnings emitted�[0m �[0m�[0m�[1m�[32m Compiling�[0m sp-timestamp v3.0.0 (https://github.com/paritytech/substrate?branch=master#ac1f7ff3) �[0m�[1m�[33mwarning�[0m�[0m�[1m: 1 warning emitted�[0m �[0m�[0m�[1m�[32m Compiling�[0m pallet-offences-benchmarking v3.0.0 (https://github.com/paritytech/substrate?branch=master#ac1f7ff3) �[0m�[1m�[38;5;9merror[E0599]�[0m�[0m�[1m: no function or associated item named �[0m�[1m�[38;5;9merror[E0599]�[0m�[0m�[1m: no function or associated item named �[0m�[1m�[38;5;9merror�[0m�[0m�[1m: aborting due to 3 previous errors�[0m �[0m�[1mFor more information about this error, try To learn more, run the command again with --verbose. |
/benchmark runtime kusama pallet_gilt |
Finished benchmark for branch: gav-kusama-gilts Benchmark: Benchmark Runtime Kusama Pallet cargo run --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_gilt --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/ ResultsCompiling kusama-runtime v0.8.29 (/home/shawntabrizi/bench-bot/git/polkadot/runtime/kusama) Caused by: --- stderr �[0m�[1m�[33mwarning�[0m�[0m�[1m: function is never used: �[0m�[1m�[33mwarning�[0m�[0m�[1m: function is never used: �[0m�[1m�[33mwarning�[0m�[0m�[1m: 2 warnings emitted�[0m �[0m�[1m�[33mwarning�[0m�[0m�[1m: associated function is never used: �[0m�[1m�[33mwarning�[0m�[0m�[1m: 1 warning emitted�[0m �[0m�[0m�[1m�[32m Compiling�[0m kusama-runtime v0.8.29 (/home/shawntabrizi/bench-bot/git/polkadot/runtime/kusama) �[0m�[1m�[38;5;9merror[E0599]�[0m�[0m�[1m: no function or associated item named �[0m�[1m�[38;5;9merror[E0599]�[0m�[0m�[1m: no function or associated item named �[0m�[1m�[38;5;9merror�[0m�[0m�[1m: aborting due to 3 previous errors�[0m �[0m�[1mFor more information about this error, try To learn more, run the command again with --verbose. |
We do need to slash gilts whenever validators get slashed, which never got implemented. |
…o gav-kusama-gilts
Not sure what you mean here @burdges . The point of gilts is to ensure that the proportion of the capital remains the same over time. That's how this is implemented. With the inclusion of paritytech/substrate#8299, then we can ensure that the treasury funds don't make it into the issuance calculation, so if stakers (or anyone else) on the system get slashed, then that slash won't form part of the issuance whose proportion is being honoured. That said, if the treasury elects to spend the slashed funds and they go back into circulation, then the gilt holders will rightly "benefit", in so much as the issuance of which a proportion they hold will increase, no longer being in the treasury. One thing that is added now is the |
I have not worked out any details, so maybe that suffices, but.. Inflation exists to pay stakers for validators, and staking incurs slashing risk, so either
We choose 2 if our goal is a smaller delta. We could also restate the question as: Are gilts meant to be a "bet" that some slashing occurs? If not, then slashing gilts ala 2 makes gilts slashing neutral, in the sense that if gilts get penalized like the average staker gets penalized. Actually there exist other options like changing the culture to refund more slashes, and thereby lower the slashing risks, but this dichotomy still roughly exists. |
this is one difference (and why staking rewards will generally be substantially greater merely retaining equal proportion of issuance). the other is that staking only requires a lockup of 7/28 days (kusama/polkadot). with gilts, the lockup could be many months or years, depending on the market. gilts are not a direct alternative to staking. whereas staking is expected to account for 50-75% of issuance and allow for as much capital to be placed in as is desired (with the only drawback being a very graceful reduction in rewards), gilts are strictly capped at some proportion of issuance (e.g. 10%) and their market bids instead on lock-time. the deal cannot be characterised as "giving up rewards that outperform base inflation for the advantage of no slashing", since there is an auction for lock-duration. if market participants are overwhelmingly in favour of that particular tradeoff, then it just means that the lock-duration with be accordingly large. if the market prefers a small (and inherently avoidable) risk of slashing for rewards that outperform inflation then the lock-duration will be correspondingly smaller. |
I missed this part before, interesting.
Issuance means total dots here I guess. It's sounds mostly harmless actually.. |
/benchmark runtime kusama pallet_gilt |
/benchmark runtime kusama pallet_gilt |
Finished benchmark for branch: gav-kusama-gilts Benchmark: Benchmark Runtime Kusama Pallet cargo run --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_gilt --extrinsic="*" --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/ ResultsPallet: "pallet_gilt", Extrinsic: "place_bid", Lowest values: [], Highest values: [], Steps: [50], Repeat: 20
|
…n=kusama-dev --steps=50 --repeat=20 --pallet=pallet_gilt --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/
.saturating_sub(auction_proportion) | ||
.saturating_sub(gilt_proportion); | ||
|
||
let stake = Perquintill::from_rational(total_staked, non_gilt_issuance); |
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 don't completely understand why stake rate is total_staked/non_gilt_issuance
and ideal_stake is 75% minus 75% of gilt target.
Gilt target says to be "The target proportion of gilts within total issuance."
. Why isn't the stake rate total_staked/total issuance (including gilt issuance)
then. (or why isn't ideal_stake just 75%)
But I think I misunderstand gilt target meaning.
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.
@AlistairStewart - the gilt_proportion = gilt_target * 3 / 4
came from your direction - could you explain? Also, is the formula correct with comparing the ideal_stake
(which explicitly removes the portion expected for gilts from its numerator) with the stake
(which only counts non-gilt issuance for its denominator). They do indeed seem mismatched.
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.
apart from not understanding how we use gilt info in the ideal_stake https://github.com/paritytech/polkadot/pull/2587/files#r629483645 implementation is good to me
@shawntabrizi final review appreciated. |
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 did not dive deep into ideal_stake
, but I assume Al will jump in to clarify.
Other parts look okay. Important TODO to make this stuff work w/ slots counter.
How does teleported asset work with this? i.e. KSM teleported to Statemine. Am I right that teleported assert will be removed from total issuance? |
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.
LGTM except not knowing where some magic numbers (75% stake, up to 60 auctions etc.) come from, but I assume they have sufficient reasoning.
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Also bumps Substrate to use the latest Gilt pallet.