Skip to content
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

refactor: Replace MinimumStake with MinimumTotalStake in creator-staking pallet #253

Merged
merged 8 commits into from
Feb 2, 2024

Conversation

F3Joule
Copy link
Member

@F3Joule F3Joule commented Feb 1, 2024

Release notes

  • When staking, the MinimumTotalStake in the staking system is considered instead of MinimumStake per creator.
  • When moving stake, the individual per creator stake should just remain more than zero.
  • There may be known issues when trying to unstake, if it will result to going bellow MinimumTotalStake; still doable with move + batch unstake.

Release Checklist

  • Verify spec_version has been incremented since the last release.
  • Verify pallet and extrinsic ordering has stayed the same. Bump transaction_version if not.
  • Verify new extrinsics have been correctly whitelisted/blacklisted for BaseCallFilter
  • There are benchmarks for newly created extrinsics
  • Verify weights have been updated for any modified runtime logic
  • There are tests for newly created logic.
  • All the tests pass.
  • Ensure migrations run correctly

@F3Joule F3Joule self-assigned this Feb 1, 2024
@F3Joule F3Joule added the enhancement New feature or request label Feb 1, 2024
pallets/creator-staking/src/functions.rs Outdated Show resolved Hide resolved
Co-Authored-By: Oleh Mell <[email protected]>
Co-Authored-By: Alex Siman <[email protected]>
@F3Joule F3Joule requested a review from olehmell February 2, 2024 12:36
@F3Joule F3Joule marked this pull request as ready for review February 2, 2024 13:20
@F3Joule F3Joule requested a review from siman February 2, 2024 13:24
@F3Joule
Copy link
Member Author

F3Joule commented Feb 2, 2024

Metadata comparison check (extrinsics ordering) results:

Metadata comparison:
Date: Fri  2 Feb 2024 15:31:48 EET
Reference: wss://para.subsocial.network
Target version: subsocial-collator 0.2.2-bac7a0398e0
Chain: dev
----------------------------------------------------------------------
              [Spec] name: subsocial-parachain
                     spec_version: 38 -> 39
                     transaction_version: 8
          [Metadata] version: 14
           [Modules] num: 38
                          [System] idx: 0 (calls: 8, storage: 17)
                 [ParachainSystem] idx: 1 (calls: 4, storage: 22)
                       [Timestamp] idx: 3 (calls: 1, storage: 3)
                        [Balances] idx: 10 (calls: 6, storage: 6)
                        [Treasury] idx: 12 (calls: 5, storage: 5)
               [CollatorSelection] idx: 21 (calls: 5, storage: 6)
                         [Session] idx: 22 (calls: 2, storage: 8)
                         [Vesting] idx: 26 (calls: 5, storage: 3)
                           [Proxy] idx: 27 (calls: 10, storage: 3)
                        [Multisig] idx: 29 (calls: 4, storage: 2)
                       [XcmpQueue] idx: 30 (calls: 9, storage: 11)
                     [PolkadotXcm] idx: 31 (calls: 10, storage: 12)
                        [DmpQueue] idx: 33 (calls: 1, storage: 6)
                         [Domains] idx: 60 (calls: 9, storage: 8)
                          [Energy] idx: 61 (calls: 2, storage: 4)
                       [FreeProxy] idx: 62 (calls: 1, storage: 2)
                  [CreatorStaking] idx: 63 (calls: 14, storage: 13)
                    [EvmAddresses] idx: 64 (calls: 2, storage: 3)
             [ResourceDiscussions] idx: 65 (calls: 2, storage: 2)
                           [Roles] idx: 71 (calls: 8, storage: 6)
                  [AccountFollows] idx: 72 (calls: 3, storage: 4)
                        [Profiles] idx: 73 (calls: 3, storage: 2)
                    [SpaceFollows] idx: 74 (calls: 3, storage: 4)
                  [SpaceOwnership] idx: 75 (calls: 3, storage: 2)
                          [Spaces] idx: 76 (calls: 4, storage: 4)
                     [PostFollows] idx: 77 (calls: 2, storage: 4)
                           [Posts] idx: 78 (calls: 6, storage: 6)
                       [Reactions] idx: 79 (calls: 6, storage: 5)
                            [Sudo] idx: 255 (calls: 4, storage: 2)

------------------------------ SUMMARY ------------------------------- 
⚠️ This filter is here to help spotting changes that should be reviewed carefully. 
⚠️ It catches only index changes, deletions and value decreases. 
## Deletions
 n/a 
## Index changes
 n/a
## Decreases
 n/a
----------------------------------------------------------------------

@F3Joule
Copy link
Member Author

F3Joule commented Feb 2, 2024

Try runtime results:

initialized state externalities with storage root 0xdbf8d8bf3766ecf0afed1dd0e410bf26ccaba98e5b266318c9b854b5213b7511 and state_version V0
original spec: RuntimeString::Owned("subsocial-parachain")-38, code hash: 71d9eed8a1448bb81e6bcb1b78973f541c61c662fb8f506e832c44d7d6756636
new spec: RuntimeString::Owned("subsocial-parachain")-39, code hash: 81cc426660f8ab9b033fffa5004b71a35c5d42648e9229667904a4b36a55ffff
⚠️ ParachainSystem declares internal migrations (which *might* execute). On-chain `StorageVersion(2)` vs current storage version `StorageVersion(2)`
⚠️ XcmpQueue declares internal migrations (which *might* execute). On-chain `StorageVersion(3)` vs current storage version `StorageVersion(2)`
⚠️ PolkadotXcm declares internal migrations (which *might* execute). On-chain `StorageVersion(0)` vs current storage version `StorageVersion(1)`
⚠️ DmpQueue declares internal migrations (which *might* execute). On-chain `StorageVersion(2)` vs current storage version `StorageVersion(1)`
TryRuntime_on_runtime_upgrade executed without errors. Consumed weight = (200000000 ps, 0 byte), total weight = (500000000000 ps, 5242880 byte) (0.04 %, 0.00 %).

@F3Joule F3Joule merged commit c525607 into main Feb 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants