Skip to content

Commit e0c8250

Browse files
authored
Merge pull request #2068 from opentensor/fix-dispatches-merge
Fix/dispatches revert
2 parents 7628080 + 4520bdf commit e0c8250

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

pallets/subtensor/src/macros/dispatches.rs

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -457,18 +457,18 @@ mod dispatches {
457457
/// * `TooManyUnrevealedCommits`:
458458
/// - Attempting to commit when the user has more than the allowed limit of unrevealed commits.
459459
///
460-
#[pallet::call_index(99)]
461-
#[pallet::weight((Weight::from_parts(77_750_000, 0)
462-
.saturating_add(T::DbWeight::get().reads(9_u64))
463-
.saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))]
464-
pub fn commit_crv3_weights(
465-
origin: T::RuntimeOrigin,
466-
netuid: NetUid,
467-
commit: BoundedVec<u8, ConstU32<MAX_CRV3_COMMIT_SIZE_BYTES>>,
468-
reveal_round: u64,
469-
) -> DispatchResult {
470-
Self::do_commit_timelocked_weights(origin, netuid, commit, reveal_round, 4)
471-
}
460+
// #[pallet::call_index(99)]
461+
// #[pallet::weight((Weight::from_parts(77_750_000, 0)
462+
// .saturating_add(T::DbWeight::get().reads(9_u64))
463+
// .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))]
464+
// pub fn commit_crv3_weights(
465+
// origin: T::RuntimeOrigin,
466+
// netuid: NetUid,
467+
// commit: BoundedVec<u8, ConstU32<MAX_CRV3_COMMIT_SIZE_BYTES>>,
468+
// reveal_round: u64,
469+
// ) -> DispatchResult {
470+
// Self::do_commit_timelocked_weights(origin, netuid, commit, reveal_round, 4)
471+
// }
472472

473473
/// ---- Used to commit encrypted commit-reveal v3 weight values to later be revealed for mechanisms.
474474
///
@@ -1314,8 +1314,8 @@ mod dispatches {
13141314
/// User register a new subnetwork
13151315
#[pallet::call_index(59)]
13161316
#[pallet::weight((Weight::from_parts(235_400_000, 0)
1317-
.saturating_add(T::DbWeight::get().reads(37_u64))
1318-
.saturating_add(T::DbWeight::get().writes(51_u64)), DispatchClass::Normal, Pays::Yes))]
1317+
.saturating_add(T::DbWeight::get().reads(39_u64))
1318+
.saturating_add(T::DbWeight::get().writes(57_u64)), DispatchClass::Normal, Pays::Yes))]
13191319
pub fn register_network(origin: OriginFor<T>, hotkey: T::AccountId) -> DispatchResult {
13201320
Self::do_register_network(origin, &hotkey, 1, None)
13211321
}
@@ -1601,8 +1601,8 @@ mod dispatches {
16011601
/// User register a new subnetwork
16021602
#[pallet::call_index(79)]
16031603
#[pallet::weight((Weight::from_parts(234_200_000, 0)
1604-
.saturating_add(T::DbWeight::get().reads(36_u64))
1605-
.saturating_add(T::DbWeight::get().writes(50_u64)), DispatchClass::Normal, Pays::Yes))]
1604+
.saturating_add(T::DbWeight::get().reads(38_u64))
1605+
.saturating_add(T::DbWeight::get().writes(56_u64)), DispatchClass::Normal, Pays::Yes))]
16061606
pub fn register_network_with_identity(
16071607
origin: OriginFor<T>,
16081608
hotkey: T::AccountId,
@@ -2358,5 +2358,16 @@ mod dispatches {
23582358
commit_reveal_version,
23592359
)
23602360
}
2361+
2362+
/// Remove a subnetwork
2363+
/// The caller must be root
2364+
#[pallet::call_index(120)]
2365+
#[pallet::weight((Weight::from_parts(119_000_000, 0)
2366+
.saturating_add(T::DbWeight::get().reads(6))
2367+
.saturating_add(T::DbWeight::get().writes(31)), DispatchClass::Operational, Pays::No))]
2368+
pub fn root_dissolve_network(origin: OriginFor<T>, netuid: NetUid) -> DispatchResult {
2369+
ensure_root(origin)?;
2370+
Self::do_dissolve_network(netuid)
2371+
}
23612372
}
23622373
}

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
220220
// `spec_version`, and `authoring_version` are the same between Wasm and native.
221221
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
222222
// the compatible custom types.
223-
spec_version: 317,
223+
spec_version: 318,
224224
impl_version: 1,
225225
apis: RUNTIME_API_VERSIONS,
226226
transaction_version: 1,

0 commit comments

Comments
 (0)