Skip to content

Commit 676ad8c

Browse files
committed
wip crv3
1 parent c213d2c commit 676ad8c

File tree

15 files changed

+334
-87
lines changed

15 files changed

+334
-87
lines changed

Cargo.lock

Lines changed: 32 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ sp-crypto-ec-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", t
197197
getrandom = { version = "0.2.15", features = ["custom"], default-features = false }
198198
sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2409", default-features = false }
199199
# w3f-bls = { git = "https://github.com/w3f/bls", default-features = false, version = "0.1.8" }
200-
w3f-bls = { version = "0.1.3", default-features = false }
200+
w3f-bls = { version = "=0.1.3", default-features = false }
201201
ark-crypto-primitives = { version = "0.4.0", default-features = false, features = [ "r1cs", "snark" ] }
202202
ark-scale = { version = "0.0.11", default-features = false, features = ["hazmat"] }
203203
sp-ark-bls12-381 = { git = "https://github.com/paritytech/substrate-curves", default-features = false }
@@ -208,7 +208,7 @@ ark-ec = { version = "0.4.0", default-features = false }
208208
ark-std = { version = "0.4.0", default-features = false }
209209
anyhow = "1.0.81"
210210
sha2 = { version = "0.10.8", default-features = false }
211-
etf-crypto-primitives = { git = "https://github.com/ideal-lab5/etf-sdk", rev = "0796744c10e4bce8c6202fd6c025be409f6a4ffe", default-features = false }
211+
tle = { git = "https://github.com/ideal-lab5/tle", rev = "6226d8a73b6c0dcc5d4f3671193d58ada21ce88f", default-features = false }
212212
rand_chacha = { version = "0.3.1", default-features = false }
213213

214214
frame-metadata = "16"

pallets/admin-utils/src/lib.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub mod pallet {
3131
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
3232

3333
/// Implementation of the AuraInterface
34-
type Aura: crate::AuraInterface<Self::AuthorityId, Self::MaxAuthorities>;
34+
type Aura: crate::AuraInterface<<Self as Config>::AuthorityId, Self::MaxAuthorities>;
3535

3636
/// The identifier type for an authority.
3737
type AuthorityId: Member
@@ -71,10 +71,10 @@ pub mod pallet {
7171
/// It is only callable by the root account.
7272
/// The extrinsic will call the Aura pallet to change the authorities.
7373
#[pallet::call_index(0)]
74-
#[pallet::weight(T::WeightInfo::swap_authorities(new_authorities.len() as u32))]
74+
#[pallet::weight(<T as Config>::WeightInfo::swap_authorities(new_authorities.len() as u32))]
7575
pub fn swap_authorities(
7676
origin: OriginFor<T>,
77-
new_authorities: BoundedVec<T::AuthorityId, T::MaxAuthorities>,
77+
new_authorities: BoundedVec<<T as Config>::AuthorityId, T::MaxAuthorities>,
7878
) -> DispatchResult {
7979
ensure_root(origin)?;
8080

@@ -90,7 +90,7 @@ pub mod pallet {
9090
/// It is only callable by the root account.
9191
/// The extrinsic will call the Subtensor pallet to set the default take.
9292
#[pallet::call_index(1)]
93-
#[pallet::weight(T::WeightInfo::sudo_set_default_take())]
93+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_default_take())]
9494
pub fn sudo_set_default_take(origin: OriginFor<T>, default_take: u16) -> DispatchResult {
9595
ensure_root(origin)?;
9696
pallet_subtensor::Pallet::<T>::set_max_delegate_take(default_take);
@@ -114,7 +114,7 @@ pub mod pallet {
114114
/// It is only callable by the root account or subnet owner.
115115
/// The extrinsic will call the Subtensor pallet to set the serving rate limit.
116116
#[pallet::call_index(3)]
117-
#[pallet::weight(T::WeightInfo::sudo_set_serving_rate_limit())]
117+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_serving_rate_limit())]
118118
pub fn sudo_set_serving_rate_limit(
119119
origin: OriginFor<T>,
120120
netuid: u16,
@@ -134,7 +134,7 @@ pub mod pallet {
134134
/// It is only callable by the root account or subnet owner.
135135
/// The extrinsic will call the Subtensor pallet to set the minimum difficulty.
136136
#[pallet::call_index(4)]
137-
#[pallet::weight(T::WeightInfo::sudo_set_min_difficulty())]
137+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_min_difficulty())]
138138
pub fn sudo_set_min_difficulty(
139139
origin: OriginFor<T>,
140140
netuid: u16,
@@ -159,7 +159,7 @@ pub mod pallet {
159159
/// It is only callable by the root account or subnet owner.
160160
/// The extrinsic will call the Subtensor pallet to set the maximum difficulty.
161161
#[pallet::call_index(5)]
162-
#[pallet::weight(T::WeightInfo::sudo_set_max_difficulty())]
162+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_max_difficulty())]
163163
pub fn sudo_set_max_difficulty(
164164
origin: OriginFor<T>,
165165
netuid: u16,
@@ -184,7 +184,7 @@ pub mod pallet {
184184
/// It is only callable by the root account or subnet owner.
185185
/// The extrinsic will call the Subtensor pallet to set the weights version key.
186186
#[pallet::call_index(6)]
187-
#[pallet::weight(T::WeightInfo::sudo_set_weights_version_key())]
187+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_weights_version_key())]
188188
pub fn sudo_set_weights_version_key(
189189
origin: OriginFor<T>,
190190
netuid: u16,
@@ -209,7 +209,7 @@ pub mod pallet {
209209
/// It is only callable by the root account or subnet owner.
210210
/// The extrinsic will call the Subtensor pallet to set the weights set rate limit.
211211
#[pallet::call_index(7)]
212-
#[pallet::weight(T::WeightInfo::sudo_set_weights_set_rate_limit())]
212+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_weights_set_rate_limit())]
213213
pub fn sudo_set_weights_set_rate_limit(
214214
origin: OriginFor<T>,
215215
netuid: u16,
@@ -237,7 +237,7 @@ pub mod pallet {
237237
/// It is only callable by the root account, not changeable by the subnet owner.
238238
/// The extrinsic will call the Subtensor pallet to set the adjustment interval.
239239
#[pallet::call_index(8)]
240-
#[pallet::weight(T::WeightInfo::sudo_set_adjustment_interval())]
240+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_adjustment_interval())]
241241
pub fn sudo_set_adjustment_interval(
242242
origin: OriginFor<T>,
243243
netuid: u16,
@@ -292,7 +292,7 @@ pub mod pallet {
292292
/// It is only callable by the root account or subnet owner.
293293
/// The extrinsic will call the Subtensor pallet to set the adjustment beta.
294294
#[pallet::call_index(12)]
295-
#[pallet::weight(T::WeightInfo::sudo_set_max_weight_limit())]
295+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_max_weight_limit())]
296296
pub fn sudo_set_max_weight_limit(
297297
origin: OriginFor<T>,
298298
netuid: u16,
@@ -317,7 +317,7 @@ pub mod pallet {
317317
/// It is only callable by the root account or subnet owner.
318318
/// The extrinsic will call the Subtensor pallet to set the immunity period.
319319
#[pallet::call_index(13)]
320-
#[pallet::weight(T::WeightInfo::sudo_set_immunity_period())]
320+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_immunity_period())]
321321
pub fn sudo_set_immunity_period(
322322
origin: OriginFor<T>,
323323
netuid: u16,
@@ -342,7 +342,7 @@ pub mod pallet {
342342
/// It is only callable by the root account or subnet owner.
343343
/// The extrinsic will call the Subtensor pallet to set the minimum allowed weights.
344344
#[pallet::call_index(14)]
345-
#[pallet::weight(T::WeightInfo::sudo_set_min_allowed_weights())]
345+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_min_allowed_weights())]
346346
pub fn sudo_set_min_allowed_weights(
347347
origin: OriginFor<T>,
348348
netuid: u16,
@@ -367,7 +367,7 @@ pub mod pallet {
367367
/// It is only callable by the root account.
368368
/// The extrinsic will call the Subtensor pallet to set the maximum allowed UIDs for a subnet.
369369
#[pallet::call_index(15)]
370-
#[pallet::weight(T::WeightInfo::sudo_set_max_allowed_uids())]
370+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_max_allowed_uids())]
371371
pub fn sudo_set_max_allowed_uids(
372372
origin: OriginFor<T>,
373373
netuid: u16,
@@ -395,7 +395,7 @@ pub mod pallet {
395395
/// It is only callable by the root account or subnet owner.
396396
/// The extrinsic will call the Subtensor pallet to set the kappa.
397397
#[pallet::call_index(16)]
398-
#[pallet::weight(T::WeightInfo::sudo_set_kappa())]
398+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_kappa())]
399399
pub fn sudo_set_kappa(origin: OriginFor<T>, netuid: u16, kappa: u16) -> DispatchResult {
400400
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;
401401

@@ -412,7 +412,7 @@ pub mod pallet {
412412
/// It is only callable by the root account or subnet owner.
413413
/// The extrinsic will call the Subtensor pallet to set the rho.
414414
#[pallet::call_index(17)]
415-
#[pallet::weight(T::WeightInfo::sudo_set_rho())]
415+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_rho())]
416416
pub fn sudo_set_rho(origin: OriginFor<T>, netuid: u16, rho: u16) -> DispatchResult {
417417
pallet_subtensor::Pallet::<T>::ensure_subnet_owner_or_root(origin, netuid)?;
418418

@@ -429,7 +429,7 @@ pub mod pallet {
429429
/// It is only callable by the root account or subnet owner.
430430
/// The extrinsic will call the Subtensor pallet to set the activity cutoff.
431431
#[pallet::call_index(18)]
432-
#[pallet::weight(T::WeightInfo::sudo_set_activity_cutoff())]
432+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_activity_cutoff())]
433433
pub fn sudo_set_activity_cutoff(
434434
origin: OriginFor<T>,
435435
netuid: u16,
@@ -511,7 +511,7 @@ pub mod pallet {
511511
/// It is only callable by the root account.
512512
/// The extrinsic will call the Subtensor pallet to set the target registrations per interval.
513513
#[pallet::call_index(21)]
514-
#[pallet::weight(T::WeightInfo::sudo_set_target_registrations_per_interval())]
514+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_target_registrations_per_interval())]
515515
pub fn sudo_set_target_registrations_per_interval(
516516
origin: OriginFor<T>,
517517
netuid: u16,
@@ -539,7 +539,7 @@ pub mod pallet {
539539
/// It is only callable by the root account or subnet owner.
540540
/// The extrinsic will call the Subtensor pallet to set the minimum burn.
541541
#[pallet::call_index(22)]
542-
#[pallet::weight(T::WeightInfo::sudo_set_min_burn())]
542+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_min_burn())]
543543
pub fn sudo_set_min_burn(
544544
origin: OriginFor<T>,
545545
netuid: u16,
@@ -564,7 +564,7 @@ pub mod pallet {
564564
/// It is only callable by the root account or subnet owner.
565565
/// The extrinsic will call the Subtensor pallet to set the maximum burn.
566566
#[pallet::call_index(23)]
567-
#[pallet::weight(T::WeightInfo::sudo_set_max_burn())]
567+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_max_burn())]
568568
pub fn sudo_set_max_burn(
569569
origin: OriginFor<T>,
570570
netuid: u16,
@@ -589,7 +589,7 @@ pub mod pallet {
589589
/// It is only callable by the root account or subnet owner.
590590
/// The extrinsic will call the Subtensor pallet to set the difficulty.
591591
#[pallet::call_index(24)]
592-
#[pallet::weight(T::WeightInfo::sudo_set_difficulty())]
592+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_difficulty())]
593593
pub fn sudo_set_difficulty(
594594
origin: OriginFor<T>,
595595
netuid: u16,
@@ -613,7 +613,7 @@ pub mod pallet {
613613
/// It is only callable by the root account.
614614
/// The extrinsic will call the Subtensor pallet to set the maximum allowed validators.
615615
#[pallet::call_index(25)]
616-
#[pallet::weight(T::WeightInfo::sudo_set_max_allowed_validators())]
616+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_max_allowed_validators())]
617617
pub fn sudo_set_max_allowed_validators(
618618
origin: OriginFor<T>,
619619
netuid: u16,
@@ -646,7 +646,7 @@ pub mod pallet {
646646
/// It is only callable by the root account or subnet owner.
647647
/// The extrinsic will call the Subtensor pallet to set the bonds moving average.
648648
#[pallet::call_index(26)]
649-
#[pallet::weight(T::WeightInfo::sudo_set_bonds_moving_average())]
649+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_bonds_moving_average())]
650650
pub fn sudo_set_bonds_moving_average(
651651
origin: OriginFor<T>,
652652
netuid: u16,
@@ -671,7 +671,7 @@ pub mod pallet {
671671
/// It is only callable by the root account.
672672
/// The extrinsic will call the Subtensor pallet to set the maximum registrations per block.
673673
#[pallet::call_index(27)]
674-
#[pallet::weight(T::WeightInfo::sudo_set_max_registrations_per_block())]
674+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_max_registrations_per_block())]
675675
pub fn sudo_set_max_registrations_per_block(
676676
origin: OriginFor<T>,
677677
netuid: u16,
@@ -742,7 +742,7 @@ pub mod pallet {
742742
/// It is only callable by the root account.
743743
/// The extrinsic will call the Subtensor pallet to set the tempo.
744744
#[pallet::call_index(30)]
745-
#[pallet::weight(T::WeightInfo::sudo_set_tempo())]
745+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_tempo())]
746746
pub fn sudo_set_tempo(origin: OriginFor<T>, netuid: u16, tempo: u16) -> DispatchResult {
747747
ensure_root(origin)?;
748748
ensure!(
@@ -964,7 +964,7 @@ pub mod pallet {
964964
/// It is only callable by the root account or subnet owner.
965965
/// The extrinsic will call the Subtensor pallet to set the value.
966966
#[pallet::call_index(49)]
967-
#[pallet::weight(T::WeightInfo::sudo_set_commit_reveal_weights_enabled())]
967+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_commit_reveal_weights_enabled())]
968968
pub fn sudo_set_commit_reveal_weights_enabled(
969969
origin: OriginFor<T>,
970970
netuid: u16,
@@ -1037,7 +1037,7 @@ pub mod pallet {
10371037
///
10381038
/// # Errors
10391039
/// * `DispatchError::BadOrigin` - If the origin is not the root account.
1040-
// #[pallet::weight(T::WeightInfo::sudo_set_hotkey_emission_tempo())]
1040+
// #[pallet::weight(<T as Config>::WeightInfo::sudo_set_hotkey_emission_tempo())]
10411041
#[pallet::call_index(52)]
10421042
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
10431043
pub fn sudo_set_hotkey_emission_tempo(
@@ -1080,7 +1080,7 @@ pub mod pallet {
10801080
///
10811081
// - Consider adding a check to ensure the `netuid` corresponds to an existing network.
10821082
// - Implement a mechanism to gradually adjust the max stake to prevent sudden changes.
1083-
// #[pallet::weight(T::WeightInfo::sudo_set_network_max_stake())]
1083+
// #[pallet::weight(<T as Config>::WeightInfo::sudo_set_network_max_stake())]
10841084
#[pallet::call_index(53)]
10851085
#[pallet::weight((0, DispatchClass::Operational, Pays::No))]
10861086
pub fn sudo_set_network_max_stake(
@@ -1188,7 +1188,7 @@ pub mod pallet {
11881188
/// # Weight
11891189
/// Weight is handled by the `#[pallet::weight]` attribute.
11901190
#[pallet::call_index(57)]
1191-
#[pallet::weight(T::WeightInfo::sudo_set_commit_reveal_weights_interval())]
1191+
#[pallet::weight(<T as Config>::WeightInfo::sudo_set_commit_reveal_weights_interval())]
11921192
pub fn sudo_set_commit_reveal_weights_interval(
11931193
origin: OriginFor<T>,
11941194
netuid: u16,
@@ -1213,7 +1213,7 @@ pub mod pallet {
12131213
}
12141214

12151215
impl<T: Config> sp_runtime::BoundToRuntimeAppPublic for Pallet<T> {
1216-
type Public = T::AuthorityId;
1216+
type Public = <T as Config>::AuthorityId;
12171217
}
12181218

12191219
// Interfaces to interact with other pallets

0 commit comments

Comments
 (0)