Skip to content

Commit 32b124f

Browse files
committed
Merge branch 'devnet-ready' into l0r1s/crowdloan-contributors-limit
2 parents 79490d3 + c059205 commit 32b124f

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

.github/workflows/docker-localnet.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ jobs:
5959

6060
- name: Patch non-fast-block node
6161
run: |
62-
sed -i 's|7 \* 24 \* 60 \* 60 / 12 // 7 days|5 // Only 5 blocks for tests|' runtime/src/lib.rs
62+
perl -0777 -i -pe 's|7 \* 24 \* 60 \* 60 / 12 // 7 days|5 // Only 5 blocks for tests|' runtime/src/lib.rs
63+
perl -0777 -i -pe 's|pub fn DefaultPendingCooldown<T: Config>\(\) -> u64 \{\s*if cfg!\(feature = "fast-blocks"\) \{\s*return 15;\s*\}\s*7_200\s*\}|pub fn DefaultPendingCooldown<T: Config>() -> u64 {\n 15\n }|g' pallets/subtensor/src/lib.rs
6364
6465
- name: Build and push Docker image
6566
uses: docker/build-push-action@v6

pallets/subtensor/src/migrations/migrate_reset_bonds_moving_average.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ pub fn migrate_reset_bonds_moving_average<T: Config>() -> Weight {
2424
);
2525

2626
// ------------------------------
27-
// Step 1: Reset all subnet's BondsMovingAverage to 975000
27+
// Step 1: Reset all subnet's BondsMovingAverage to 975000 if the value exceeds 975000
2828
// ------------------------------
2929

3030
let mut reset_entries_count = 0u64;
3131

3232
for netuid in BondsMovingAverage::<T>::iter_keys() {
3333
BondsMovingAverage::<T>::mutate(netuid, |average| {
34-
*average = 975000;
34+
*average = (*average).min(975000);
3535
});
3636
reset_entries_count = reset_entries_count.saturating_add(1);
3737
}

pallets/subtensor/src/migrations/migrate_reset_max_burn.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ pub fn migrate_reset_max_burn<T: Config>() -> Weight {
3939
weight = weight
4040
.saturating_add(T::DbWeight::get().reads_writes(reset_entries_count, reset_entries_count));
4141

42-
log::info!(
43-
"Reset {} subnets from BondsMovingAverage.",
44-
reset_entries_count
45-
);
42+
log::info!("Reset {} subnets from MaxBurn.", reset_entries_count);
4643

4744
// ------------------------------
4845
// Step 2: Mark Migration as Completed

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
207207
// `spec_version`, and `authoring_version` are the same between Wasm and native.
208208
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
209209
// the compatible custom types.
210-
spec_version: 266,
210+
spec_version: 267,
211211
impl_version: 1,
212212
apis: RUNTIME_API_VERSIONS,
213213
transaction_version: 1,

0 commit comments

Comments
 (0)