-
Notifications
You must be signed in to change notification settings - Fork 746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tvl pool staking #1322
Tvl pool staking #1322
Conversation
The storage migration works with
|
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.
Thanks for the effort so far!
I have two broad questions:
- Your comments and the
try_state
code indicate that the
TVL must be equal to or less than the total balance of all PoolMembers
But it is not clear when this inaccuracy can exist? the TVL, since it is tracking slashes as well, should always be accurate from what I can see.
- You have slightly changed the definition of TVL in this PR. Let me elaborate a bit on how pools work: Pools take some balance from the user, transfer it to the pool account, and issue/burn equivalent points in return. You can imagine it as a bridge: You lock DOTs, and you get points in return. The only functions in which this bridging happens is the
brun
andissue
.
DOT <-- burn/issue --> Points
The point of TVL in my mind was to track this process. It should track the total amount of DOTs that have been exchanged for points in the pool pallet.
If you agree with this, while your approach is also likely equivalent, it is different from what I have in mind. You don't need to query staking before and after unbond. You only need to track successful calls to burn
and issue
. This is more or less what the original PR was doing.
cc @Ank4n @gpestana would be good to get your eyes on this as well.
For my understanding the perfect definition of Thus the With the effect of the This is the explanation why I did it different. I was just happy this way as I could have everything stay in check with my opinionated definition of This should also answer the first question. As I'm completely fine to just do it as you wish but I quickly wanted to write up my thoughts behind the change of concept. @kianenigma |
I do understand though, that there is also the way of looking at the |
Okay, I see a good point here and I will rephrase: The TVL that I suggested only tracks If your approach was significantly more complicated, I would perhaps argue that we should look at the scope where this is used and see which one is more suitable, but your approach is also fine. The context where we need this is as the two scenarios below:
With that in mind, I am convinced that your definition of total value locked is better. |
@Ank4n @kianenigma I have adressed the latest comments, merged master recently and improved the CI failures. Are we ready to merge? 👀 |
bot fmt |
@Ank4n https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/3859788 was started for your command Comment |
@Ank4n Command |
/tip medium |
@PieWol Contributor did not properly post their account address. Make sure the pull request description (or user bio) has: "{network} address: {address}". |
/tip medium |
@kianenigma A medium (5 KSM) tip was successfully submitted for @PieWol (HHEEgVzcqL3kCXgsxSfJMbsTy8dxoTctuXtpY94n4s8F4pS on kusama). https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/referenda |
* master: (24 commits) Init System Parachain storage versions and add migration check jobs to CI (#1344) no-bound derives: Use absolute path for `core` (#1763) migrate alliance, fast-unstake and bags list to use derive-impl (#1636) Tvl pool staking (#1322) improve service error (#1734) frame-support: `RuntimeDebug\Eq\PartialEq` impls for `Imbalance` (#1717) Point documentation links to monorepo (#1741) [NPoS] Fix for Reward Deficit in the pool (#1255) Move import queue from `ChainSync` to `SyncingEngine` (#1736) Enable mocking contracts (#1331) Revert "fix(review-bot): pull secrets from `master` environment" (#1748) Remove kusama and polkadot runtime crates (#1731) Use `Extensions` to register offchain worker custom extensions (#1719) [RPC-Spec-V2] chainHead: use integer for block index and adjust RuntimeVersion JSON format (#1666) fix(review-bot): pull secrets from `master` environment (#1745) Fix `subkey inspect` output text padding (#1744) archive: Implement height, hashByHeight and call (#1582) rpc/client: Propagate `rpc_methods` method to reported methods (#1713) rococo-runtime: `RococoGenesisExt` removed (#1490) PVF: more filesystem sandboxing (#1373) ...
* tsv-disabling-node-side: (24 commits) Init System Parachain storage versions and add migration check jobs to CI (#1344) no-bound derives: Use absolute path for `core` (#1763) migrate alliance, fast-unstake and bags list to use derive-impl (#1636) Tvl pool staking (#1322) improve service error (#1734) frame-support: `RuntimeDebug\Eq\PartialEq` impls for `Imbalance` (#1717) Point documentation links to monorepo (#1741) [NPoS] Fix for Reward Deficit in the pool (#1255) Move import queue from `ChainSync` to `SyncingEngine` (#1736) Enable mocking contracts (#1331) Revert "fix(review-bot): pull secrets from `master` environment" (#1748) Remove kusama and polkadot runtime crates (#1731) Use `Extensions` to register offchain worker custom extensions (#1719) [RPC-Spec-V2] chainHead: use integer for block index and adjust RuntimeVersion JSON format (#1666) fix(review-bot): pull secrets from `master` environment (#1745) Fix `subkey inspect` output text padding (#1744) archive: Implement height, hashByHeight and call (#1582) rpc/client: Propagate `rpc_methods` method to reported methods (#1713) rococo-runtime: `RococoGenesisExt` removed (#1490) PVF: more filesystem sandboxing (#1373) ...
What does this PR do? - Introduced the TotalValueLocked storage for nomination-pools. - introduced a slashing api in mock.rs - additional test for tracking a slashing event towards a pool without sub-pools - migration for the nomination-pools (V6 to V7) with `VersionedMigration` Why are these changes needed? this is the continuation of the work by @kianenigma in this [PR](paritytech/substrate#13319) How were these changes implemented and what do they affect? - It's an extra StorageValue that's modified whenever funds flow in or out of staking for any of the `bonded_account` of `BondedPools` - The `PoolSlashed`event is now emitted even when no `SubPools` are found Closes paritytech#155 KSM: HHEEgVzcqL3kCXgsxSfJMbsTy8dxoTctuXtpY94n4s8F4pS --------- Co-authored-by: Liam Aharon <[email protected]> Co-authored-by: Kian Paimani <[email protected]> Co-authored-by: Ankan <[email protected]> Co-authored-by: Ankan <[email protected]> Co-authored-by: command-bot <>
* encode and estimate Rococo/Wococo/Kusama/Polkadot messages * allow send-message for non-bundled chains * weight -> dispatch-weight * fmt * fix spelling
What does this PR do?
VersionedMigration
Why are these changes needed?
this is the continuation of the work by @kianenigma in this PR
How were these changes implemented and what do they affect?
bonded_account
ofBondedPools
PoolSlashed
event is now emitted even when noSubPools
are foundCloses #155
KSM: HHEEgVzcqL3kCXgsxSfJMbsTy8dxoTctuXtpY94n4s8F4pS