Add pools to centrifuge runtime#1233
Conversation
|
@offerijns can you take a look at the pool parameters? |
|
Regarding things like the various minimum time parameters - I believe in Altair we have several of these configured differently based on if the benchmarks are being built (since the benches do everything in a single block). Development runtime just sets them to unsafe defaults all the time, since it doesn't matter there. |
|
I ended up pushing the temp loans enablement for now because some stuff is still broken, but I didn't want to keep the whole branch on my laptop any longer. The only remaining known issue is that the Once that's done and we confirm the whole benchmark stack is playing nicely, we can rip out the loans stuff again in preparation for the new version to land. |
|
Ran the benchmarks locally: First failure here: |
|
I'm going to take the freedom to rebase this to the latest main in order to be able to create another PR with the loan addition. |
5359e41 to
7706d1e
Compare
|
PR with the loans addition: #1254 |
|
I rebase it and fix minor errors |
This is needed in order to make it available to the RPCs
* Removing the check if the MinUpdateDelay is passed, as this is part of the pallet-pool-system checks already * ScheduledUpdateDetails now note the time of submission of an update rather than the time when it is scheduled. logically, there is no "scheduled" time as the update can still be blocked by redemptions or other stuff in the future
wischli
left a comment
There was a problem hiding this comment.
I have some remarks and found at least two blockers (happy to be corrected).
| type WeightInfo = pallet_elections_phragmen::weights::SubstrateWeight<Self>; | ||
| // NOTE: Benchmarks are failing with | ||
| // "Error: Input("failed to submit candidacy")" | ||
| type WeightInfo = (); |
There was a problem hiding this comment.
I want to raise my concern for merging with default weights. Phragmen is not recommended to be used on Parachains due to its O(n^3) complexity. Has anyone dug into the issue?
There was a problem hiding this comment.
No. I am not sure why we need it at all for council rotation and if there might be a more lightweight approach. Anyways, the error I found while testing the benchmark on Altair a year ago.
I did not run them again for Centrifuge.
| } | ||
|
|
||
| /// Checks whether the given `who` has the role | ||
| /// of a `TrancehInvestor` for the given pool. |
There was a problem hiding this comment.
| /// of a `TrancehInvestor` for the given pool. | |
| /// of a `TrancheInvestor` for the given pool. |
| PoolSystem: pallet_pool_system::{Pallet, Call, Storage, Event<T>} = 181, | ||
| Permissions: pallet_permissions::{Pallet, Call, Storage, Event<T>} = 182, | ||
| Investments: pallet_investments::{Pallet, Call, Storage, Event<T>} = 183, | ||
| InterestAccrual: pallet_interest_accrual::{Pallet, Storage, Event<T>, Config<T>} = 184, |
There was a problem hiding this comment.
pallet_interest_accrual sets the StorageVersion to Release::v2 in its GenesisBuild. However, we don't run any migration for Centrifuge. As a result, the StorageVersion storage will default to 0. This needs to be addressed.
Additionally, pallet_interest_accrual still uses the old scheme of handling StorageVersion, but this is another story. With the "new" way, the pallet would actually be initialized with the latest version for Centrifuge runtime.
There was a problem hiding this comment.
That was a very good catch!
By now, can it be fixed applying the migration as it is done in altair?
cc @branan
There was a problem hiding this comment.
All we need to do is set pallet_interest_accrual::StorageVersion to ReleaseV2. As there is no storage trie yet on the Centrifuge runtime, no other migration is required.
Theoretically, we could also handle this the next time we bump the version but let's not start such inconsistencies.
| type WeightInfo = pallet_elections_phragmen::weights::SubstrateWeight<Self>; | ||
| // NOTE: Benchmarks are failing with | ||
| // "Error: Input("failed to submit candidacy")" | ||
| type WeightInfo = (); |
There was a problem hiding this comment.
No. I am not sure why we need it at all for council rotation and if there might be a more lightweight approach. Anyways, the error I found while testing the benchmark on Altair a year ago.
I did not run them again for Centrifuge.
wischli
left a comment
There was a problem hiding this comment.
Once the branch is rebased to master, let's rerun benchmarks to include pallet_elections_phragmen. But even with the default weights, it should be fine. So no blocker.
|
|
||
| pub struct SetStorageVersionToV2<T>(sp_std::marker::PhantomData<T>); | ||
|
|
||
| impl<T: Config> OnRuntimeUpgrade for SetStorageVersionToV2<T> { |
There was a problem hiding this comment.
In theory we could change Release::default() to be V2 now, and the unpopulated storage key would be V2 on Centrifuge without us needing to run a migration
There was a problem hiding this comment.
Removed and defaulted to V2.
|
/benchmark centrifuge |
|
✅ Uploaded benchmarks for: |
4915a47
Description
This PR adds all relvant pallets, struct logic to the the Centrifuge runtime.
Fixes #1224, #1225, #1226
Changes and Descriptions
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tasks:
Write integration test for creating a pool→ not possible currently, as integration-tests, Issue see Integration-Test for Altair and Centrifuge #1288Release Process
Checklist: https://centrifuge.hackmd.io/@mq/H1tt-AT9s?type=view