diff --git a/pallets/subtensor/src/benchmarks.rs b/pallets/subtensor/src/benchmarks.rs index 6dd539099..98307f521 100644 --- a/pallets/subtensor/src/benchmarks.rs +++ b/pallets/subtensor/src/benchmarks.rs @@ -1066,38 +1066,6 @@ mod pallet_benchmarks { ); } - #[benchmark] - fn commit_crv3_weights() { - let hotkey: T::AccountId = whitelisted_caller(); - let netuid = NetUid::from(1); - let vec_commit: Vec = vec![0; MAX_CRV3_COMMIT_SIZE_BYTES as usize]; - let commit: BoundedVec<_, _> = vec_commit.try_into().unwrap(); - let round: u64 = 0; - - Subtensor::::init_new_network(netuid, 1); - Subtensor::::set_network_pow_registration_allowed(netuid, true); - SubtokenEnabled::::insert(netuid, true); - - let reg_fee = Subtensor::::get_burn(netuid); - Subtensor::::add_balance_to_coldkey_account(&hotkey, reg_fee.to_u64().saturating_mul(2)); - - assert_ok!(Subtensor::::burned_register( - RawOrigin::Signed(hotkey.clone()).into(), - netuid, - hotkey.clone() - )); - - Subtensor::::set_commit_reveal_weights_enabled(netuid, true); - - #[extrinsic_call] - _( - RawOrigin::Signed(hotkey.clone()), - netuid, - commit.clone(), - round, - ); - } - #[benchmark] fn decrease_take() { let coldkey: T::AccountId = whitelisted_caller(); diff --git a/pallets/subtensor/src/macros/dispatches.rs b/pallets/subtensor/src/macros/dispatches.rs index e82fecb3e..618244487 100644 --- a/pallets/subtensor/src/macros/dispatches.rs +++ b/pallets/subtensor/src/macros/dispatches.rs @@ -249,48 +249,6 @@ mod dispatches { Self::do_reveal_weights(origin, netuid, uids, values, salt, version_key) } - /// ---- Used to commit encrypted commit-reveal v3 weight values to later be revealed. - /// - /// # Args: - /// * `origin`: (`::RuntimeOrigin`): - /// - The committing hotkey. - /// - /// * `netuid` (`u16`): - /// - The u16 network identifier. - /// - /// * `commit` (`Vec`): - /// - The encrypted compressed commit. - /// The steps for this are: - /// 1. Instantiate [`WeightsTlockPayload`] - /// 2. Serialize it using the `parity_scale_codec::Encode` trait - /// 3. Encrypt it following the steps (here)[https://github.com/ideal-lab5/tle/blob/f8e6019f0fb02c380ebfa6b30efb61786dede07b/timelock/src/tlock.rs#L283-L336] - /// to produce a [`TLECiphertext`] type. - /// 4. Serialize and compress using the `ark-serialize` `CanonicalSerialize` trait. - /// - /// * reveal_round (`u64`): - /// - The drand reveal round which will be avaliable during epoch `n+1` from the current - /// epoch. - /// - /// # Raises: - /// * `CommitRevealV3Disabled`: - /// - Attempting to commit when the commit-reveal mechanism is disabled. - /// - /// * `TooManyUnrevealedCommits`: - /// - Attempting to commit when the user has more than the allowed limit of unrevealed commits. - /// - #[pallet::call_index(99)] - #[pallet::weight((Weight::from_parts(77_750_000, 0) - .saturating_add(T::DbWeight::get().reads(7_u64)) - .saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))] - pub fn commit_crv3_weights( - origin: T::RuntimeOrigin, - netuid: NetUid, - commit: BoundedVec>, - reveal_round: u64, - ) -> DispatchResult { - Self::do_commit_timelocked_weights(origin, netuid, commit, reveal_round, 4) - } - /// ---- The implementation for batch revealing committed weights. /// /// # Args: @@ -803,7 +761,7 @@ mod dispatches { /// Attempt to adjust the senate membership to include a hotkey #[pallet::call_index(63)] - #[pallet::weight((Weight::from_parts(60_720_000, 0) + #[pallet::weight((Weight::from_parts(75_430_000, 0) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(4)), DispatchClass::Normal, Pays::Yes))] pub fn adjust_senate(origin: OriginFor, hotkey: T::AccountId) -> DispatchResult { diff --git a/pallets/subtensor/src/transaction_extension.rs b/pallets/subtensor/src/transaction_extension.rs index 537562fab..8ec9c4770 100644 --- a/pallets/subtensor/src/transaction_extension.rs +++ b/pallets/subtensor/src/transaction_extension.rs @@ -223,20 +223,6 @@ where Err(CustomTransactionError::StakeAmountTooLow.into()) } } - Some(Call::commit_crv3_weights { - netuid, - reveal_round, - .. - }) => { - if Self::check_weights_min_stake(who, *netuid) { - if *reveal_round < pallet_drand::LastStoredRound::::get() { - return Err(CustomTransactionError::InvalidRevealRound.into()); - } - Ok((Default::default(), Some(who.clone()), origin)) - } else { - Err(CustomTransactionError::StakeAmountTooLow.into()) - } - } Some(Call::commit_timelocked_weights { netuid, reveal_round, diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index cc9c02eca..644a85ebc 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -220,7 +220,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: 309, + spec_version: 310, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,