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

Add move stake feature to creator staking pallet #242

Merged
merged 14 commits into from
Dec 6, 2023
Merged

Conversation

F3Joule
Copy link
Member

@F3Joule F3Joule commented Nov 9, 2023

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.
  • There are tests for newly created logic.
  • All the tests pass.
  • Verify new extrinsics have been correctly whitelisted/blacklisted for BaseCallFilter
  • Ensure migrations run correctly

@F3Joule F3Joule self-assigned this Nov 9, 2023
@F3Joule F3Joule added enhancement New feature or request feature-release A new feature PR ready to release labels Nov 9, 2023
pallets/creator-staking/src/lib.rs Show resolved Hide resolved
pallets/creator-staking/src/lib.rs Outdated Show resolved Hide resolved
pallets/creator-staking/src/lib.rs Outdated Show resolved Hide resolved
@F3Joule F3Joule marked this pull request as ready for review December 4, 2023 23:41
@F3Joule
Copy link
Member Author

F3Joule commented Dec 4, 2023

Extrinsics ordering check (metadata comparison):

Metadata comparison:
Date: Mon 4 Dec 2023 19:37:19 EET
Reference: wss://para.subsocial.network
Target version: subsocial-collator 0.2.0-121e84833ea
Chain: dev
----------------------------------------------------------------------
              [Spec] name: subsocial-parachain
                     spec_version: 33 -> 34
                     transaction_version: 6 -> 7
          [Metadata] version: 14
           [Modules] num: 33
                          [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)
               [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)
                       [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: 13 -> 14, storage: 13)
                                   [+] calls: moveStake
                             [claimBackerReward] idx: 7 -> 8 (args: 2)
                                                 (u64, bool)
                            [claimCreatorReward] idx: 8 -> 9 (args: 2)
                                                 (u64, u32)
                            [setMaintenanceMode] idx: 9 -> 10 (args: 1)
                                                 (bool)
                                   [forceNewEra] idx: 10 -> 11 (args: 0)
                   [setRewardDistributionConfig] idx: 11 -> 12 (args: 1)
                                                 (PalletCreatorStakingRewardDistributionConfig)
                             [setPerBlockReward] idx: 12 -> 13 (args: 1)
                                                 (u128)
                           [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)
                           [Posts] idx: 77 (calls: 6, storage: 6)
                       [Reactions] idx: 78 (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
 34: [claimBackerReward] idx: 7 -> 8 (args: 2)
36: [claimCreatorReward] idx: 8 -> 9 (args: 2)
38: [setMaintenanceMode] idx: 9 -> 10 (args: 1)
40: [forceNewEra] idx: 10 -> 11 (args: 0)
41: [setRewardDistributionConfig] idx: 11 -> 12 (args: 1)
43: [setPerBlockReward] idx: 12 -> 13 (args: 1)

## Decreases
 n/a 
----------------------------------------------------------------------

Rename `calculate_final_unstaking_amount` to `calculate_and_apply_stake_decrease`
Update transaction_version to 7
@F3Joule
Copy link
Member Author

F3Joule commented Dec 5, 2023

Try runtime result

initialized state externalities with storage root 0x46c2033412feb1afd7541f08d9e58238c6bbf5de5adc3773e7c258775de18458 and state_version V0
original spec: RuntimeString::Owned("subsocial-parachain")-33, code hash: fa95f644593ed8e0ae2705031d21eeb7c950443b5b5a14f6c8c7366fb4280e90
new spec: RuntimeString::Owned("subsocial-parachain")-34, code hash: 13c12b2eb9314c4d96a57e5a2c62e4ca65c0f182057e7607d9ac01050073503e
⚠️ 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 requested a review from olehmell December 5, 2023 11:02
@F3Joule F3Joule merged commit bdf4d2b into main Dec 6, 2023
2 checks passed
@F3Joule F3Joule deleted the f3/cs-move-stake branch December 6, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-release A new feature PR ready to release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants