Skip to content

Add AtStake legacy migrations#1448

Merged
Chralt98 merged 8 commits intochralt98-add-async-backingfrom
chralt98-atstake-legacy-migration
Nov 26, 2025
Merged

Add AtStake legacy migrations#1448
Chralt98 merged 8 commits intochralt98-add-async-backingfrom
chralt98-atstake-legacy-migration

Conversation

@Chralt98
Copy link
Copy Markdown
Member

@Chralt98 Chralt98 commented Nov 13, 2025

What does it do?

  • Included multi block migration functionality to convert the old collator snapshot storage entries to the new format in the parachain staking pallet for AtStake storage item

Look for the adjustments in moonbeam here.

What important points should reviewers know?

try-runtime-zeitgeist-output.txt

try-runtime-battery-station-output.txt

The above file is the try-runtime output of the migration for zeitgeist mainnet and battery station testnet.

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues?

References

… calculations

- Updated logging in `relay_timestamp.rs` to improve readability of warning messages regarding missing TIMESTAMP_NOW.
- Modified `migrate_old_collator_snapshot` function in `pallet_parachain_staking.rs` to accept a parameter for item count, adjusting weight calculations accordingly.
- Added new features for legacy migration in `Cargo.toml` of the zeitgeist runtime.
- Included migration functionality in the zeitgeist runtime library.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 13, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chralt98-atstake-legacy-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Chralt98 Chralt98 self-assigned this Nov 13, 2025
@Chralt98 Chralt98 added the s:in-progress The pull requests is currently being worked on label Nov 13, 2025
- Removed the `migrate_old_collator_snapshot` function from the parachain staking weights file.
- Updated `Cargo.toml` to include `pallet-migrations` in the Zeitgeist runtime.
- Modified the Zeitgeist runtime to integrate migration logic and defined `MultiBlockMigrations`.
- Enhanced benchmark configuration to include `pallet_migrations`.
- Created `legacy_keys.rs` and `mod.rs` for runtime migrations in both battery-station and zeitgeist runtimes.
- Implemented legacy migration structures for both battery-station and zeitgeist, allowing for the migration of legacy staking data.
type MigrationStatusHandler = ();
type FailedMigrationHandler = frame_support::migrations::FreezeChainOnFailedMigration;
type MaxServiceWeight = MigrationsMaxServiceWeight;
type WeightInfo = pallet_migrations::weights::SubstrateWeight<Runtime>;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use calculated weights of our own benchmark machine here!

@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Nov 18, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 18, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.32%. Comparing base (82dea73) to head (0caabd9).
⚠️ Report is 6 commits behind head on chralt98-add-async-backing.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                     Coverage Diff                     @@
##           chralt98-add-async-backing    #1448   +/-   ##
===========================================================
  Coverage                       93.32%   93.32%           
===========================================================
  Files                             181      181           
  Lines                           34769    34769           
===========================================================
  Hits                            32448    32448           
  Misses                           2321     2321           
Flag Coverage Δ
tests 93.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:review-needed The pull request requires reviews labels Nov 18, 2025
@mergify mergify bot added s:in-progress The pull requests is currently being worked on and removed s:review-needed The pull request requires reviews labels Nov 20, 2025
@Chralt98 Chralt98 added s:review-needed The pull request requires reviews and removed s:in-progress The pull requests is currently being worked on labels Nov 21, 2025
@Chralt98 Chralt98 merged commit 1854945 into chralt98-add-async-backing Nov 26, 2025
12 checks passed
@Chralt98 Chralt98 deleted the chralt98-atstake-legacy-migration branch November 26, 2025 10:40
@Chralt98 Chralt98 added s:accepted This pull request is ready for merge and removed s:review-needed The pull request requires reviews labels Nov 26, 2025
Chralt98 added a commit that referenced this pull request Nov 26, 2025
* Add pallet-async-backing and update block time parameters to 6000ms

* Refactor constants and improve formatting in relay timestamp module

* Add sp-timestamp dependency and update runtime versions to 62 and transaction version to 35

* Update pallet-parachain-staking source reference and remove old collator snapshot weight function

* feat: Update download script for Polkadot binaries and improve error handling

- Added a function to determine the Polkadot release version, allowing for overrides.
- Enhanced the binary download process with improved logging and error handling.
- Updated the script to ensure binaries are executable after download.
- Changed the copyright year in the script to 2025.
- Removed hardcoded Polkadot release version and replaced it with dynamic determination.

fix(tests): Adjust XCM fee upper limit for forked networks

- Increased the upper limit for XCM fees in common tests to accommodate forked networks.

test: Add logging to runtime upgrade tests for better traceability

- Introduced logging hooks in the runtime upgrade tests to capture key steps and state changes during execution.

chore: Update zombienet configuration for RPC ports

- Modified the produce-blocks.toml file to specify unique RPC ports for relaychain nodes.

* refactor: Update try-runtime dependencies and improve log message formatting in relay timestamp module

* fix: Remove extra newline in copyright section of relay timestamp module

* feat: Enhance relay timestamp handling and adjust block processing velocity for std builds

* feat: Update block time assumptions and adjust related parameters for improved accuracy

* feat: Enhance Polkadot SDK download script for macOS support and improve source retrieval

- Added functionality to build Polkadot binaries from source on macOS.
- Refactored the logic to retrieve the Polkadot source line and commit from Cargo.lock.
- Updated the download script to conditionally build from source or download binaries based on the OS.
- Adjusted the handling of binary downloads to ensure proper permissions and existence checks.

refactor: Update constants for block processing velocity

- Removed conditional compilation for BLOCK_PROCESSING_VELOCITY in std builds, setting it to a constant value of 1 for all builds.

chore: Add `once_cell` dependency to battery-station and zeitgeist runtimes

- Included `once_cell` version 1.20.2 in the dev-dependencies for both runtimes.

test: Refactor integration tests to use new test net reset and execution functions

- Introduced `reset_test_net` and `with_battery_station`/`with_zeitgeist` functions to streamline test setup.
- Updated all relevant tests to utilize the new functions for better readability and maintainability.

fix: Correct copyright notices and comments in various files

- Updated copyright years and fixed typos in comments across multiple files to ensure accuracy and clarity.

* refactor: Remove unused imports and adjust AdjustmentVariable for better fee management

* feat: Add async backing configuration and improve zombienet deployment script for macOS architecture support

* feat: Remove use-noop-message-processor flag for improved benchmarking and update related scripts

* Add `AtStake` legacy migrations (#1448)

* Refactor relay timestamp logging and enhance parachain staking weight calculations

- Updated logging in `relay_timestamp.rs` to improve readability of warning messages regarding missing TIMESTAMP_NOW.
- Modified `migrate_old_collator_snapshot` function in `pallet_parachain_staking.rs` to accept a parameter for item count, adjusting weight calculations accordingly.
- Added new features for legacy migration in `Cargo.toml` of the zeitgeist runtime.
- Included migration functionality in the zeitgeist runtime library.

* Remove legacy migration features and streamline parachain migration handling

* Refactor parachain staking weights and add migration support

- Removed the `migrate_old_collator_snapshot` function from the parachain staking weights file.
- Updated `Cargo.toml` to include `pallet-migrations` in the Zeitgeist runtime.
- Modified the Zeitgeist runtime to integrate migration logic and defined `MultiBlockMigrations`.
- Enhanced benchmark configuration to include `pallet_migrations`.
- Created `legacy_keys.rs` and `mod.rs` for runtime migrations in both battery-station and zeitgeist runtimes.
- Implemented legacy migration structures for both battery-station and zeitgeist, allowing for the migration of legacy staking data.

* Remove parachain feature flag from runtime migrations

* feat: Add pallet_migrations support and update runtime configurations for benchmarks

* Correct copyrights (#1449)

Update copyright years in source files to include 2025

- Updated copyright notices in multiple Rust source files across the project to reflect the new year 2025.
- Ensured consistency in copyright formatting, changing from "2023-2024" to "2023-2025" where applicable.
- This change affects files in the `liquidity_tree`, `orderbook`, `parimutuel`, `prediction-markets`, `swaps`, and `styx` modules.

* Update copyright notices in migration files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s:accepted This pull request is ready for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants