Skip to content
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

Extend Safe Mode Extend #619

Merged
merged 1 commit into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pallets/subtensor/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,23 +565,23 @@ pub fn migrate_populate_staking_hotkeys<T: Config>() -> Weight {
if stake > 0 {
let mut hotkeys = StakingHotkeys::<T>::get(&coldkey);
storage_reads = storage_reads.saturating_add(1); // Read from StakingHotkeys storage

// Add the hotkey if it's not already in the vector
if !hotkeys.contains(&hotkey) {
hotkeys.push(hotkey);
keys_touched = keys_touched.saturating_add(1);

// Update longest hotkey vector info
if longest_hotkey_vector < hotkeys.len() {
longest_hotkey_vector = hotkeys.len();
longest_coldkey = Some(coldkey.clone());
}

// Update the StakingHotkeys storage
StakingHotkeys::<T>::insert(&coldkey, hotkeys);
storage_writes = storage_writes.saturating_add(1); // Write to StakingHotkeys storage
}

// Accrue weight for reads and writes
weight = weight.saturating_add(T::DbWeight::get().reads_writes(2, 1));
}
Expand All @@ -603,4 +603,3 @@ pub fn migrate_populate_staking_hotkeys<T: Config>() -> Weight {
Weight::zero()
}
}

4 changes: 2 additions & 2 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// `spec_version`, and `authoring_version` are the same between Wasm and native.
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
// the compatible custom types.
spec_version: 159,
spec_version: 160,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down Expand Up @@ -294,7 +294,7 @@ parameter_types! {

pub const RootEnterDuration: BlockNumber = 5 * 60 * 24; // 24 hours

pub const RootExtendDuration: BlockNumber = 5 * 60 * 3; // 3 hours
pub const RootExtendDuration: BlockNumber = 5 * 60 * 12; // 12 hours

pub const DisallowPermissionlessEntering: Option<Balance> = None;
pub const DisallowPermissionlessExtending: Option<Balance> = None;
Expand Down
Loading