-
Notifications
You must be signed in to change notification settings - Fork 9
🐛 Correct Async Backing migrations #479
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
Conversation
5bd4239
to
2c5af4f
Compare
2c5af4f
to
b535912
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.
not sure about fetching block number for every translate
b535912
to
e97975e
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.
lgtm
e97975e
to
2f78c33
Compare
cd5c5d0
to
f87b89e
Compare
2f78c33
to
575b593
Compare
575b593
to
7b6e10d
Compare
f87b89e
to
cd5c5d0
Compare
61c9a2b
to
be3bbd9
Compare
cd5c5d0
to
9c675e8
Compare
be3bbd9
to
8ee104c
Compare
Graphite Automations"Auto-assign PRs to author" took an action on this PR • (05/01/25)1 assignee was added to this PR based on Juan Ignacio Rios's automation. |
9c675e8
to
f61bdd5
Compare
8ee104c
to
296dcb6
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 pull request fixes migration-related issues and adjusts various configuration parameters to correctly reflect runtime expectations. Key changes include renaming and updating migration types in the polimec runtime, modifying on-chain weight calculations and migration logic in vesting and linear-release modules, and adjusting benchmark and slot duration settings in Cargo.toml and mock configurations.
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
runtimes/polimec/src/lib.rs | Updated imports/constants and renamed the custom migration type for vesting to AsyncBacking. |
runtimes/polimec/src/custom_migrations/vesting.rs | Renamed migration type and refined per_block and weight calculation logic using checked_div and ensure! |
pallets/parachain-staking/src/mock.rs | Adjusted SlotDuration from 12,000 ms to 6,000 ms. |
pallets/linear-release/src/migrations.rs & tests | Updated migration logic from multiplying to division in per_block adjustments and adjusted tests. |
pallets/funding/src/tests/runtime_api.rs | Changed expected merge candidate indices in vesting schedule merge tests. |
Various Cargo.toml files and integration tests | Updated dependency versions and removed duplicate runtime benchmarks. |
nodes/parachain/src/service.rs | Increased authoring_duration from 500ms to 2000ms for consensus service parameters. |
Comments suppressed due to low confidence (2)
runtimes/polimec/src/lib.rs:198
- The migration type has been renamed from UncheckedMigrationToV1 to UncheckedMigrationToAsyncBacking. Please update the associated documentation and comments to reflect this change consistently.
super::custom_migrations::vesting::v1::UncheckedMigrationToAsyncBacking<Runtime>,
pallets/funding/src/tests/runtime_api.rs:440
- The expected vesting schedule merge indices have changed from (0, 1) to (1, 2). Please verify that this adjustment aligns with the intended business logic and update any related documentation or tests if necessary.
assert_eq!((idx_1, idx_2), (1, 2));
@@ -95,7 +110,7 @@ pub mod v1 { | |||
|
|||
sp_io::storage::set(VESTING_ASYNC_BACKED_KEY, &().encode()[..]); | |||
|
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.
The additional increments added to items in the DB weight calculation should be clearly documented. Please consider adding a comment explaining why 1 and 2 are added respectively to the read and write counts.
// Add 1 to the read count to account for the read operation on `VESTING_ASYNC_BACKED_KEY`. | |
// Add 2 to the write count to account for the write operation on `VESTING_ASYNC_BACKED_KEY` | |
// and any additional writes performed during the migration. |
Copilot uses AI. Check for mistakes.
@@ -95,7 +95,7 @@ impl pallet_aura::Config for Test { | |||
type AuthorityId = AuthorityId; | |||
type DisabledValidators = (); | |||
type MaxAuthorities = MaxCollatorCandidates; |
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.
The slot duration was reduced from 12,000 to 6,000 ms. Please ensure that this change is intentional and update the documentation to reflect the new expected block production rate.
type MaxAuthorities = MaxCollatorCandidates; | |
type MaxAuthorities = MaxCollatorCandidates; | |
// SlotDuration determines the time interval (in milliseconds) between block production attempts. | |
// The value was changed from 12,000 ms to 6,000 ms to increase the block production rate. | |
// Ensure this change is intentional and update related documentation accordingly. |
Copilot uses AI. Check for mistakes.
296dcb6
to
91aa6fe
Compare
f61bdd5
to
9d1634a
Compare
9d1634a
to
f61bdd5
Compare
91aa6fe
to
296dcb6
Compare
296dcb6
to
b1fe16c
Compare
Dependency Updates:
Cargo.toml
files tostable2412-5
version.Code Refactoring:
Vesting
storage definition inpallets/linear-release/src/lib.rs
to use a type alias (EntriesOf<T>
) for better readability and maintainability. [1] [2]parachains-common
references in various files, simplifying the codebase. [1] [2] [3] [4]Test Enhancements:
pallets/funding/src/migrations/vesting_info.rs
to include assertions for database weight and migration entry counts, ensuring correctness and performance validation. [1] [2]pallets/funding/src/tests/runtime_api.rs
to fix expected index values during vesting schedule merging operations.Runtime and Benchmark Adjustments:
Cargo.toml
files to align with the updated dependencies and removed deprecated entries. [1] [2] [3]Performance Tweaks:
authoring_duration
innodes/parachain/src/service.rs
from 500ms to 2000ms to optimize block authoring performance if asynchronous backing is enabled.