File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed
pallets/subtensor/src/migrations Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 59
59
60
60
- name : Patch non-fast-block node
61
61
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
63
64
64
65
- name : Build and push Docker image
65
66
uses : docker/build-push-action@v6
Original file line number Diff line number Diff line change @@ -24,14 +24,14 @@ pub fn migrate_reset_bonds_moving_average<T: Config>() -> Weight {
24
24
) ;
25
25
26
26
// ------------------------------
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
28
28
// ------------------------------
29
29
30
30
let mut reset_entries_count = 0u64 ;
31
31
32
32
for netuid in BondsMovingAverage :: < T > :: iter_keys ( ) {
33
33
BondsMovingAverage :: < T > :: mutate ( netuid, |average| {
34
- * average = 975000 ;
34
+ * average = ( * average ) . min ( 975000 ) ;
35
35
} ) ;
36
36
reset_entries_count = reset_entries_count. saturating_add ( 1 ) ;
37
37
}
Original file line number Diff line number Diff line change @@ -39,10 +39,7 @@ pub fn migrate_reset_max_burn<T: Config>() -> Weight {
39
39
weight = weight
40
40
. saturating_add ( T :: DbWeight :: get ( ) . reads_writes ( reset_entries_count, reset_entries_count) ) ;
41
41
42
- log:: info!(
43
- "Reset {} subnets from BondsMovingAverage." ,
44
- reset_entries_count
45
- ) ;
42
+ log:: info!( "Reset {} subnets from MaxBurn." , reset_entries_count) ;
46
43
47
44
// ------------------------------
48
45
// Step 2: Mark Migration as Completed
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
207
207
// `spec_version`, and `authoring_version` are the same between Wasm and native.
208
208
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
209
209
// the compatible custom types.
210
- spec_version : 266 ,
210
+ spec_version : 267 ,
211
211
impl_version : 1 ,
212
212
apis : RUNTIME_API_VERSIONS ,
213
213
transaction_version : 1 ,
You can’t perform that action at this time.
0 commit comments