-
Notifications
You must be signed in to change notification settings - Fork 155
Cancel auctions on Coretime launch #215
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
Merged
fellowship-merge-bot
merged 14 commits into
polkadot-fellows:main
from
eskimor:rk-cancel-auctions
Mar 8, 2024
+41
−1
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c0cdefd
Cancel parachain auctions.
381154a
Fixes.
ccbd323
Changelog entry.
4efd20d
Merge branch 'main' into rk-cancel-auctions
eskimor b9f3a4c
Also cancel scheduled auction.
cee34c3
Update CHANGELOG.md
eskimor 2673d2f
Update relay/kusama/src/lib.rs
eskimor 2e64175
Merge branch 'main' into rk-cancel-auctions
eskimor c823062
Merge branch 'main' into rk-cancel-auctions
eskimor c87bd73
Add debug logs to try-runtime.
d840503
Merge remote-tracking branch 'fork/rk-cancel-auctions' into rk-cancel…
750457f
Log to runtime target.
36cad81
Lower log level.
68671d4
Merge branch 'main' into rk-cancel-auctions
bkchr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1745,6 +1745,9 @@ pub type Migrations = (migrations::Unreleased, migrations::Permanent); | |
| #[allow(deprecated, missing_docs)] | ||
| pub mod migrations { | ||
| use super::*; | ||
| use frame_support::traits::OnRuntimeUpgrade; | ||
| use pallet_scheduler::WeightInfo as SchedulerWeightInfo; | ||
| use runtime_common::auctions::WeightInfo as AuctionsWeightInfo; | ||
| #[cfg(feature = "try-runtime")] | ||
| use sp_core::crypto::ByteArray; | ||
|
|
||
|
|
@@ -1849,6 +1852,41 @@ pub mod migrations { | |
| } | ||
| } | ||
|
|
||
| /// Cancel all ongoing auctions. | ||
| /// | ||
| /// Any leases that come into existence after coretime was launched will not be served. Yet, | ||
| /// any ongoing auctions must be cancelled. | ||
| /// | ||
| /// Safety: | ||
| /// | ||
| /// - After coretime is launched, there are no auctions anymore. So if this forgotten to | ||
| /// be removed after the runtime upgrade, running this again on the next one is harmless. | ||
| /// - I am assuming scheduler `TaskName`s are unique, so removal of the scheduled entry | ||
| /// multiple times should also be fine. | ||
| pub struct CancelAuctions; | ||
| impl OnRuntimeUpgrade for CancelAuctions { | ||
| fn on_runtime_upgrade() -> Weight { | ||
| if let Err(err) = Auctions::cancel_auction(frame_system::RawOrigin::Root.into()) { | ||
|
eskimor marked this conversation as resolved.
|
||
| log::debug!(target: "runtime", "Cancelling auctions failed: {:?}", err); | ||
| } | ||
| // Cancel scheduled auction as well: | ||
| if let Err(err) = Scheduler::cancel_named( | ||
| pallet_custom_origins::Origin::AuctionAdmin.into(), | ||
|
eskimor marked this conversation as resolved.
|
||
| [ | ||
| 0x5c, 0x68, 0xbf, 0x0c, 0x2d, 0x11, 0x04, 0x91, 0x6b, 0xa5, 0xa4, 0xde, 0xe6, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trusting you on this name here ;) |
||
| 0xb8, 0x14, 0xe8, 0x2b, 0x27, 0x93, 0x78, 0x4c, 0xb6, 0xe7, 0x69, 0x04, 0x00, | ||
| 0x1a, 0x59, 0x49, 0xc1, 0x63, 0xb1, | ||
| ], | ||
| ) { | ||
| log::debug!(target: "runtime", "Cancelling scheduled auctions failed: {:?}", err); | ||
| } | ||
| weights::runtime_common_auctions::WeightInfo::<Runtime>::cancel_auction() | ||
| .saturating_add(weights::pallet_scheduler::WeightInfo::<Runtime>::cancel_named( | ||
| <Runtime as pallet_scheduler::Config>::MaxScheduledPerBlock::get(), | ||
| )) | ||
| } | ||
| } | ||
|
|
||
| /// Unreleased migrations. Add new ones here: | ||
| pub type Unreleased = ( | ||
| pallet_nomination_pools::migration::versioned::V7ToV8<Runtime>, | ||
|
|
@@ -1872,6 +1910,7 @@ pub mod migrations { | |
| ImOnlinePalletName, | ||
| <Runtime as frame_system::Config>::DbWeight, | ||
| >, | ||
| CancelAuctions, | ||
| ); | ||
|
|
||
| /// Migrations/checks that do not need to be versioned and can run on every update. | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.