Skip to content

Commit 1be0904

Browse files
committed
Merge branch 'devnet-ready' into subnet-identities
2 parents e7aee7a + 2fc1e3c commit 1be0904

File tree

27 files changed

+2759
-974
lines changed

27 files changed

+2759
-974
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ serde_json = { version = "1.0.116", default-features = false }
6666
serde_with = { version = "=2.0.0", default-features = false }
6767
smallvec = "1.13.2"
6868
litep2p = { git = "https://github.com/paritytech/litep2p", branch = "master" }
69-
syn = { version = "2", features = ["full", "visit-mut", "visit", "extra-traits", "parsing"] }
69+
syn = { version = "2", features = [
70+
"full",
71+
"visit-mut",
72+
"visit",
73+
"extra-traits",
74+
"parsing",
75+
] }
7076
quote = "1"
7177
proc-macro2 = { version = "1", features = ["span-locations"] }
7278
walkdir = "2"
@@ -76,7 +82,7 @@ subtensor-macros = { path = "support/macros" }
7682
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3", default-features = false }
7783
frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3" }
7884
frame-executive = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3", default-features = false }
79-
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3" , default-features = false }
85+
frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3", default-features = false }
8086
frame-support = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3", default-features = false }
8187
frame-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3", default-features = false }
8288
frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3", default-features = false }
@@ -145,7 +151,7 @@ sp-version = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1
145151
sp-weights = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3", default-features = false }
146152

147153
substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3" }
148-
substrate-fixed = { git = "https://github.com/encointer/substrate-fixed.git", tag = "v0.5.9" }
154+
substrate-fixed = { git = "https://github.com/opentensor/substrate-fixed.git", tag = "v0.5.9" }
149155
substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3" }
150156
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk.git", tag = "v1.10.0-rc3" }
151157
frame-metadata = "16"

pallets/admin-utils/src/benchmarking.rs

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,159 +47,162 @@ mod benchmarks {
4747

4848
#[benchmark]
4949
fn sudo_set_max_difficulty() {
50-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
50+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
5151

5252
#[extrinsic_call]
5353
_(RawOrigin::Root, 1u16/*netuid*/, 10000u64/*max_difficulty*/)/*sudo_set_max_difficulty*/;
5454
}
5555

5656
#[benchmark]
5757
fn sudo_set_min_difficulty() {
58-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
58+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
5959

6060
#[extrinsic_call]
6161
_(RawOrigin::Root, 1u16/*netuid*/, 1000u64/*min_difficulty*/)/*sudo_set_min_difficulty*/;
6262
}
6363

6464
#[benchmark]
6565
fn sudo_set_weights_set_rate_limit() {
66-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
66+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
6767

6868
#[extrinsic_call]
6969
_(RawOrigin::Root, 1u16/*netuid*/, 3u64/*rate_limit*/)/*sudo_set_weights_set_rate_limit*/;
7070
}
7171

7272
#[benchmark]
7373
fn sudo_set_weights_version_key() {
74-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
74+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
7575

7676
#[extrinsic_call]
7777
_(RawOrigin::Root, 1u16/*netuid*/, 1u64/*version_key*/)/*sudo_set_weights_version_key*/;
7878
}
7979

8080
#[benchmark]
8181
fn sudo_set_bonds_moving_average() {
82-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
82+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
8383

8484
#[extrinsic_call]
8585
_(RawOrigin::Root, 1u16/*netuid*/, 100u64/*bonds_moving_average*/)/*sudo_set_bonds_moving_average*/;
8686
}
8787

8888
#[benchmark]
8989
fn sudo_set_max_allowed_validators() {
90-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
90+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
9191

9292
#[extrinsic_call]
9393
_(RawOrigin::Root, 1u16/*netuid*/, 10u16/*max_allowed_validators*/)/*sudo_set_max_allowed_validators*/;
9494
}
9595

9696
#[benchmark]
9797
fn sudo_set_difficulty() {
98-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
98+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
9999

100100
#[extrinsic_call]
101101
_(RawOrigin::Root, 1u16/*netuid*/, 1200000u64/*difficulty*/)/*sudo_set_difficulty*/;
102102
}
103103

104104
#[benchmark]
105105
fn sudo_set_adjustment_interval() {
106-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
106+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
107107

108108
#[extrinsic_call]
109109
_(RawOrigin::Root, 1u16/*netuid*/, 12u16/*adjustment_interval*/)/*sudo_set_adjustment_interval*/;
110110
}
111111

112112
#[benchmark]
113113
fn sudo_set_target_registrations_per_interval() {
114-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
114+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
115115

116116
#[extrinsic_call]
117117
_(RawOrigin::Root, 1u16/*netuid*/, 300u16/*target_registrations*/)/*sudo_set_target_registrations_per_interval*/;
118118
}
119119

120120
#[benchmark]
121121
fn sudo_set_activity_cutoff() {
122-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
122+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
123123

124124
#[extrinsic_call]
125125
_(RawOrigin::Root, 1u16/*netuid*/, 300u16/*activity_cutoff*/)/*sudo_set_activity_cutoff*/;
126126
}
127127

128128
#[benchmark]
129129
fn sudo_set_rho() {
130-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
130+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
131131

132132
#[extrinsic_call]
133133
_(RawOrigin::Root, 1u16/*netuid*/, 300u16/*rho*/)/*sudo_set_rho*/;
134134
}
135135

136136
#[benchmark]
137137
fn sudo_set_kappa() {
138-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);
138+
pallet_subtensor::Pallet::<T>::init_new_network(
139+
1u16, /*netuid*/
140+
1u16, /*sudo_tempo*/
141+
);
139142

140143
#[extrinsic_call]
141144
_(RawOrigin::Root, 1u16/*netuid*/, 3u16/*kappa*/)/*set_kappa*/;
142145
}
143146

144147
#[benchmark]
145148
fn sudo_set_max_allowed_uids() {
146-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
149+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
147150

148151
#[extrinsic_call]
149152
_(RawOrigin::Root, 1u16/*netuid*/, 4097u16/*max_allowed_uids*/)/*sudo_set_max_allowed_uids*/;
150153
}
151154

152155
#[benchmark]
153156
fn sudo_set_min_allowed_weights() {
154-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
157+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
155158

156159
#[extrinsic_call]
157160
_(RawOrigin::Root, 1u16/*netuid*/, 10u16/*max_allowed_uids*/)/*sudo_set_min_allowed_weights*/;
158161
}
159162

160163
#[benchmark]
161164
fn sudo_set_immunity_period() {
162-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
165+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
163166

164167
#[extrinsic_call]
165168
_(RawOrigin::Root, 1u16/*netuid*/, 100u16/*immunity_period*/)/*sudo_set_immunity_period*/;
166169
}
167170

168171
#[benchmark]
169172
fn sudo_set_max_weight_limit() {
170-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
173+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
171174

172175
#[extrinsic_call]
173176
_(RawOrigin::Root, 1u16/*netuid*/, 100u16/*max_weight_limit*/)/*sudo_set_max_weight_limit*/;
174177
}
175178

176179
#[benchmark]
177180
fn sudo_set_max_registrations_per_block() {
178-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
181+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
179182

180183
#[extrinsic_call]
181184
_(RawOrigin::Root, 1u16/*netuid*/, 100u16/*max_registrations*/)/*sudo_set_max_registrations_per_block*/;
182185
}
183186

184187
#[benchmark]
185188
fn sudo_set_max_burn() {
186-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
189+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
187190

188191
#[extrinsic_call]
189192
_(RawOrigin::Root, 1u16/*netuid*/, 10u64/*max_burn*/)/*sudo_set_max_burn*/;
190193
}
191194

192195
#[benchmark]
193196
fn sudo_set_min_burn() {
194-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
197+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
195198

196199
#[extrinsic_call]
197200
_(RawOrigin::Root, 1u16/*netuid*/, 10u64/*min_burn*/)/*sudo_set_min_burn*/;
198201
}
199202

200203
#[benchmark]
201204
fn sudo_set_network_registration_allowed() {
202-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
205+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
203206

204207
#[extrinsic_call]
205208
_(RawOrigin::Root, 1u16/*netuid*/, true/*registration_allowed*/)/*sudo_set_network_registration_allowed*/;
@@ -212,45 +215,54 @@ mod benchmarks {
212215
let tempo: u16 = 15;
213216
let modality: u16 = 0;
214217
215-
T::Subtensor::init_new_network(netuid, tempo);
218+
pallet_subtensor::Pallet::<T>::init_new_network(netuid, tempo);
216219
217220
}: sudo_set_tempo(RawOrigin::<AccountIdOf<T>>::Root, netuid, tempo)
218221
*/
219222
#[benchmark]
220223
fn sudo_set_tempo() {
221-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
224+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
222225

223226
#[extrinsic_call]
224227
_(RawOrigin::Root, 1u16/*netuid*/, 1u16/*tempo*/)/*sudo_set_tempo*/;
225228
}
226229

227230
#[benchmark]
228231
fn sudo_set_commit_reveal_weights_interval() {
229-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);
232+
pallet_subtensor::Pallet::<T>::init_new_network(
233+
1u16, /*netuid*/
234+
1u16, /*sudo_tempo*/
235+
);
230236

231237
#[extrinsic_call]
232238
_(RawOrigin::Root, 1u16/*netuid*/, 3u64/*interval*/)/*set_commit_reveal_weights_interval()*/;
233239
}
234240

235241
#[benchmark]
236242
fn sudo_set_commit_reveal_weights_enabled() {
237-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);
243+
pallet_subtensor::Pallet::<T>::init_new_network(
244+
1u16, /*netuid*/
245+
1u16, /*sudo_tempo*/
246+
);
238247

239248
#[extrinsic_call]
240249
_(RawOrigin::Root, 1u16/*netuid*/, true/*enabled*/)/*set_commit_reveal_weights_enabled*/;
241250
}
242251

243252
#[benchmark]
244253
fn sudo_set_hotkey_emission_tempo() {
245-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*sudo_tempo*/);
254+
pallet_subtensor::Pallet::<T>::init_new_network(
255+
1u16, /*netuid*/
256+
1u16, /*sudo_tempo*/
257+
);
246258

247259
#[extrinsic_call]
248260
_(RawOrigin::Root, 1u64/*emission_tempo*/)/*set_hotkey_emission_tempo*/;
249261
}
250262

251263
#[benchmark]
252264
fn sudo_set_network_max_stake() {
253-
T::Subtensor::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
265+
pallet_subtensor::Pallet::<T>::init_new_network(1u16 /*netuid*/, 1u16 /*tempo*/);
254266

255267
#[extrinsic_call]
256268
_(RawOrigin::Root, 1u16/*netuid*/, 1_000_000_000_000_000u64/*max_stake*/)/*sudo_set_network_max_stake*/;

0 commit comments

Comments
 (0)