-
Notifications
You must be signed in to change notification settings - Fork 9
🏗️ Vesting pallet block number provider migration #474
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
🏗️ Vesting pallet block number provider migration #474
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4aeec9b
to
526d838
Compare
a529926
to
84ca86b
Compare
b348aa7
to
783f62f
Compare
84ca86b
to
ff5663f
Compare
b73b726
to
e78457e
Compare
e78457e
to
7692995
Compare
fd9083a
to
6514ee3
Compare
7692995
to
b69858e
Compare
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.
Pull Request Overview
This PR migrates the vesting pallet block number provider by adding a new unchecked migration for vesting info. The key changes include adding a new migration call in lib.rs, introducing the vesting migration implementation, and updating the custom migrations module to include vesting.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
runtimes/polimec/src/lib.rs | New migration reference added for vesting |
runtimes/polimec/src/custom_migrations/vesting.rs | New migration implementation for vesting info |
runtimes/polimec/src/custom_migrations/mod.rs | Updated module exports to include vesting module |
Comments suppressed due to low confidence (1)
runtimes/polimec/src/custom_migrations/vesting.rs:25
- The LOG constant is incorrectly named with 'linear_release::migration::v1'; consider renaming it to better reflect the vesting migration, such as 'vesting::migration::v1'.
const LOG: &str = "linear_release::migration::v1";
87d78cf
to
b5c0764
Compare
6514ee3
to
1207e4e
Compare
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.
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
runtimes/polimec/src/custom_migrations/vesting.rs:125
- Using assert macros in post_upgrade may cause panics during runtime upgrade verification. Consider returning a DispatchError instead to handle migration mismatches gracefully.
assert_ne!(pre_vesting_info.starting_block(), post_vesting_info.starting_block(), "Starting block not adjusted");
76dac0d
to
d41707b
Compare
79fc906
to
820b987
Compare
820b987
to
79fc906
Compare
d41707b
to
76dac0d
Compare
79fc906
to
820b987
Compare
76dac0d
to
d41707b
Compare
820b987
to
79fc906
Compare
d41707b
to
76dac0d
Compare
76dac0d
to
d41707b
Compare
79fc906
to
820b987
Compare
820b987
to
79fc906
Compare
d41707b
to
76dac0d
Compare
79fc906
to
820b987
Compare
76dac0d
to
d41707b
Compare
d41707b
to
7272202
Compare
This pull request introduces updates to the vesting system, runtime configurations, and testing utilities. The changes include a new vesting migration implementation, adjustments to the relay chain block number handling, and cleanup of deprecated code. Below is a summary of the most important changes:
Vesting System Enhancements:
UncheckedMigrationToV1
) to adjust starting blocks and per-block release rates based on the relay chain block number. This migration ensures compatibility with async backing and includes pre- and post-upgrade checks. ([[1]](https://github.com/Polimec/polimec-node/pull/474/files#diff-ea2b22ffeac81f446db7cb39b4e30fc16643687632adcab75288f8ca5f63617cR1-R149)
,[[2]](https://github.com/Polimec/polimec-node/pull/474/files#diff-63e5609b322bad6be8ef1b127b8161c52602cff85ab9cf67f6b5ac03be68fc3aR21-R22)
,[[3]](https://github.com/Polimec/polimec-node/pull/474/files#diff-fa44a5ad015c5d189a690374b9164d3a58b7218228b56c151327dd62d143ee1bL190-R193)
)LinearReleaseVestingMigration
implementation, which was replaced by the new vesting migration approach. ([runtimes/polimec/src/custom_migrations/linear_release.rsL1-L110](https://github.com/Polimec/polimec-node/pull/474/files#diff-c47feabf076eb45e19f973367310bbee30b1b6c39cec965f9a22c5bb0cdb6d0cL1-L110)
)Runtime Configuration Updates:
pallet_vesting::Config
to useRelaychainDataProvider<Runtime>
as theBlockNumberProvider
, aligning block number calculations with the relay chain. ([runtimes/polimec/src/lib.rsL938-R936](https://github.com/Polimec/polimec-node/pull/474/files#diff-fa44a5ad015c5d189a690374b9164d3a58b7218228b56c151327dd62d143ee1bL938-R936)
)Testing Improvements:
set_relay_chain_block_number
for setting the relay chain block number in tests, replacing direct calls toPolimecSystem::set_block_number
. ([[1]](https://github.com/Polimec/polimec-node/pull/474/files#diff-efc2ea8d587d168e507866db12407b1bddb338abcb020d2a83ed001106f38c8aL17-R45)
,[[2]](https://github.com/Polimec/polimec-node/pull/474/files#diff-efc2ea8d587d168e507866db12407b1bddb338abcb020d2a83ed001106f38c8aL92-R106)
,[[3]](https://github.com/Polimec/polimec-node/pull/474/files#diff-efc2ea8d587d168e507866db12407b1bddb338abcb020d2a83ed001106f38c8aL126-R137)
)[integration-tests/src/tests/vest.rsL104-R115](https://github.com/Polimec/polimec-node/pull/474/files#diff-efc2ea8d587d168e507866db12407b1bddb338abcb020d2a83ed001106f38c8aL104-R115)
)Dependency and Code Cleanup:
sp-io
to the workspace and standard dependencies inCargo.toml
to support the new vesting migration logic. ([[1]](https://github.com/Polimec/polimec-node/pull/474/files#diff-098063d62f6a6569d719395ff78cb479908fc67c99289cba0ce85c4a182a088aR77)
,[[2]](https://github.com/Polimec/polimec-node/pull/474/files#diff-098063d62f6a6569d719395ff78cb479908fc67c99289cba0ce85c4a182a088aR181)
)sp_std::fmt::Debug
withcore::fmt::Debug
. ([pallets/funding/src/benchmarking.rsL100-R100](https://github.com/Polimec/polimec-node/pull/474/files#diff-ffb567ea90cf81e3ccb0bf17050102829044c0b8693fe8a0a7c6cf776a588123L100-R100)
)