Skip to content

Commit b1feb3c

Browse files
author
Samuel Dare
committed
feat: reduce arb period to 18 hours for testnet
1 parent 41feafc commit b1feb3c

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

pallets/subtensor/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,11 @@ pub mod pallet {
394394
vec![]
395395
}
396396
#[pallet::type_value]
397-
/// Default stake interval.
397+
/// Default arbitration period.
398+
/// This value represents the default arbitration period in blocks.
399+
/// The period is set to 18 hours, assuming a block time of 12 seconds.
398400
pub fn DefaultArbitrationPeriod<T: Config>() -> u64 {
399-
7200 * 3
401+
5400 // 18 hours * 60 minutes/hour * 5 blocks/minute
400402
}
401403
#[pallet::storage] // ---- StorageItem Global Used Work.
402404
pub type ArbitrationPeriod<T: Config> =

pallets/subtensor/tests/staking.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3188,7 +3188,7 @@ fn test_arbitrated_coldkey_swap_success() {
31883188
);
31893189

31903190
// Check that drain block is set correctly
3191-
let drain_block: u64 = 7200 * 3 + 1;
3191+
let drain_block: u64 = 5400 + 1;
31923192

31933193
log::info!(
31943194
"ColdkeysToSwapAtBlock before scheduling: {:?}",
@@ -3205,7 +3205,7 @@ fn test_arbitrated_coldkey_swap_success() {
32053205
pallet_subtensor::ColdkeysToSwapAtBlock::<Test>::get(drain_block)
32063206
);
32073207

3208-
// Make 7200 * 4 blocks pass
3208+
// Make 5400 blocks pass
32093209
run_to_block(drain_block);
32103210

32113211
// Run unstaking
@@ -3385,8 +3385,8 @@ fn test_arbitrated_coldkey_swap_with_no_stake() {
33853385
nonce
33863386
));
33873387

3388-
// Make 7200 * 4 blocks pass, simulating on_idle for each block
3389-
let drain_block: u64 = 7200 * 3 + 1;
3388+
// Make 5400 blocks pass, simulating on_idle for each block
3389+
let drain_block: u64 = 5400 + 1;
33903390
for _ in 0..drain_block {
33913391
next_block();
33923392
SubtensorModule::on_idle(System::block_number(), Weight::MAX);
@@ -3446,8 +3446,8 @@ fn test_arbitrated_coldkey_swap_with_multiple_stakes() {
34463446
nonce
34473447
));
34483448

3449-
// Make 7200 * 4 blocks pass, simulating on_idle for each block
3450-
let drain_block: u64 = 7200 * 3 + 1;
3449+
// Make 5400 blocks pass, simulating on_idle for each block
3450+
let drain_block: u64 = 5400 + 1;
34513451
for _ in 0..drain_block {
34523452
next_block();
34533453
SubtensorModule::on_idle(System::block_number(), Weight::MAX);
@@ -3530,7 +3530,7 @@ fn test_arbitrated_coldkey_swap_multiple_arbitrations() {
35303530
);
35313531

35323532
// Simulate the passage of blocks and on_idle calls
3533-
for i in 0..(7200 * 3 + 1) {
3533+
for i in 0..(5400 + 1) {
35343534
// Simulate 10 blocks
35353535
next_block();
35363536
SubtensorModule::on_idle(System::block_number(), Weight::MAX);
@@ -3744,8 +3744,8 @@ fn test_concurrent_arbitrated_coldkey_swaps() {
37443744
current_block,
37453745
nonce2
37463746
));
3747-
// Make 7200 * 3 blocks pass
3748-
let drain_block: u64 = 7200 * 3 + 1;
3747+
// Make 5400 blocks pass
3748+
let drain_block: u64 = 5400 + 1;
37493749
run_to_block(drain_block);
37503750

37513751
// Run arbitration

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
139139
// `spec_version`, and `authoring_version` are the same between Wasm and native.
140140
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
141141
// the compatible custom types.
142-
spec_version: 188,
142+
spec_version: 189,
143143
impl_version: 1,
144144
apis: RUNTIME_API_VERSIONS,
145145
transaction_version: 1,

0 commit comments

Comments
 (0)