🏗️ Vesting pallet block number provider migration#474
Merged
Conversation
This was referenced Mar 21, 2025
Contributor
Author
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.
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.
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
Merged
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
Merged
820b987 to
79fc906
Compare
d41707b to
76dac0d
Compare
79fc906 to
820b987
Compare
76dac0d to
d41707b
Compare
d41707b to
7272202
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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))LinearReleaseVestingMigrationimplementation, 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::Configto 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_numberfor 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-ioto the workspace and standard dependencies inCargo.tomlto 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::Debugwithcore::fmt::Debug. ([pallets/funding/src/benchmarking.rsL100-R100](https://github.com/Polimec/polimec-node/pull/474/files#diff-ffb567ea90cf81e3ccb0bf17050102829044c0b8693fe8a0a7c6cf776a588123L100-R100))