From 9007ac14074c25aed8a1ccf5c0bfc8f0eb507ffd Mon Sep 17 00:00:00 2001 From: Cem Eliguzel Date: Fri, 13 Oct 2023 11:57:05 +0000 Subject: [PATCH 1/6] Fix for the breaking change from polkadot v1.1.0 The pre/post_upgrade methods of a tuple of migrations should not be called directly. --- pallets/maintenance-mode/src/types.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pallets/maintenance-mode/src/types.rs b/pallets/maintenance-mode/src/types.rs index 2a3b5238..5fe500c3 100644 --- a/pallets/maintenance-mode/src/types.rs +++ b/pallets/maintenance-mode/src/types.rs @@ -25,7 +25,7 @@ use frame_support::{ use frame_system::pallet_prelude::BlockNumberFor as BlockNumberOf; use sp_std::marker::PhantomData; #[cfg(feature = "try-runtime")] -use sp_std::vec::Vec; +use sp_runtime::TryRuntimeError; pub struct ExecutiveHooks(PhantomData); @@ -94,20 +94,11 @@ where } #[cfg(feature = "try-runtime")] - fn pre_upgrade() -> Result, sp_runtime::DispatchError> { + fn try_on_runtime_upgrade(checks: bool) -> Result { if Pallet::::maintenance_mode() { - T::MaintenanceExecutiveHooks::pre_upgrade() + T::MaintenanceExecutiveHooks::try_on_runtime_upgrade(checks) } else { - T::NormalExecutiveHooks::pre_upgrade() - } - } - - #[cfg(feature = "try-runtime")] - fn post_upgrade(state: Vec) -> Result<(), sp_runtime::DispatchError> { - if Pallet::::maintenance_mode() { - T::MaintenanceExecutiveHooks::post_upgrade(state) - } else { - T::NormalExecutiveHooks::post_upgrade(state) + T::NormalExecutiveHooks::try_on_runtime_upgrade(checks) } } } From f9981a34e9b1c4b24228d4b1c434afdc113fd322 Mon Sep 17 00:00:00 2001 From: Cem Eliguzel Date: Fri, 13 Oct 2023 12:04:53 +0000 Subject: [PATCH 2/6] Fix formatting --- pallets/maintenance-mode/src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/maintenance-mode/src/types.rs b/pallets/maintenance-mode/src/types.rs index 5fe500c3..0cf4c9cf 100644 --- a/pallets/maintenance-mode/src/types.rs +++ b/pallets/maintenance-mode/src/types.rs @@ -23,9 +23,9 @@ use frame_support::{ weights::Weight, }; use frame_system::pallet_prelude::BlockNumberFor as BlockNumberOf; -use sp_std::marker::PhantomData; #[cfg(feature = "try-runtime")] use sp_runtime::TryRuntimeError; +use sp_std::marker::PhantomData; pub struct ExecutiveHooks(PhantomData); From eab201be6a41ffe967c63b654b59f235fbf1c9c7 Mon Sep 17 00:00:00 2001 From: Cem Eliguzel Date: Sun, 15 Oct 2023 07:56:04 +0000 Subject: [PATCH 3/6] Adds cleanup action --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08f259d7..8f312073 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -242,6 +242,8 @@ jobs: CARGO_INCREMENTAL: "0" SCCACHE_CACHE_SIZE: "100GB" steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@v1.3.0 - name: Checkout uses: actions/checkout@v3 with: From f2c96e734e0962456a72c54b7f8fc0b55ccda085 Mon Sep 17 00:00:00 2001 From: Cem Eliguzel Date: Sun, 15 Oct 2023 08:03:20 +0000 Subject: [PATCH 4/6] Adds cleanup action --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f312073..ecff78ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -244,6 +244,10 @@ jobs: steps: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@v1.3.0 + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false - name: Checkout uses: actions/checkout@v3 with: From 242e5fffd3cdf1e11e14df9e7f17f585b24547ce Mon Sep 17 00:00:00 2001 From: Cem Eliguzel Date: Sun, 15 Oct 2023 08:13:29 +0000 Subject: [PATCH 5/6] Adds cleanup action --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecff78ab..3a62ef01 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -248,6 +248,15 @@ jobs: # this might remove tools that are actually needed, # if set to "true" but frees about 6 GB tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: false + large-packages: false + docker-images: true + swap-storage: true - name: Checkout uses: actions/checkout@v3 with: From 5fa6fefae96251fada510076de4b55d1cfe79799 Mon Sep 17 00:00:00 2001 From: Cem Eliguzel Date: Sun, 15 Oct 2023 10:01:09 +0000 Subject: [PATCH 6/6] Adds cleanup action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a62ef01..7911f933 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -253,7 +253,7 @@ jobs: # "false" if necessary for your workflow android: true dotnet: true - haskell: false + haskell: true large-packages: false docker-images: true swap-storage: true