Skip to content

Commit 8f9e841

Browse files
Merge pull request #725 from opentensor/feat/fast_tempo_for_fast_blocks
Add short default tempo to fast-blocks feature
2 parents ae40d0f + 1011425 commit 8f9e841

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

runtime/src/lib.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,18 @@ impl pallet_commitments::Config for Runtime {
848848
type RateLimit = CommitmentRateLimit;
849849
}
850850

851+
#[cfg(not(feature = "fast-blocks"))]
852+
pub const INITIAL_SUBNET_TEMPO: u16 = 99;
853+
854+
#[cfg(feature = "fast-blocks")]
855+
pub const INITIAL_SUBNET_TEMPO: u16 = 10;
856+
857+
#[cfg(not(feature = "fast-blocks"))]
858+
pub const INITIAL_CHILDKEY_TAKE_RATELIMIT: u64 = 216000; // 30 days at 12 seconds per block
859+
860+
#[cfg(feature = "fast-blocks")]
861+
pub const INITIAL_CHILDKEY_TAKE_RATELIMIT: u64 = 5;
862+
851863
// Configure the pallet subtensor.
852864
parameter_types! {
853865
pub const SubtensorInitialRho: u16 = 10;
@@ -860,7 +872,7 @@ parameter_types! {
860872
pub const SubtensorInitialValidatorPruneLen: u64 = 1;
861873
pub const SubtensorInitialScalingLawPower: u16 = 50; // 0.5
862874
pub const SubtensorInitialMaxAllowedValidators: u16 = 128;
863-
pub const SubtensorInitialTempo: u16 = 99;
875+
pub const SubtensorInitialTempo: u16 = INITIAL_SUBNET_TEMPO;
864876
pub const SubtensorInitialDifficulty: u64 = 10_000_000;
865877
pub const SubtensorInitialAdjustmentInterval: u16 = 100;
866878
pub const SubtensorInitialAdjustmentAlpha: u64 = 0; // no weight to previous value.
@@ -883,7 +895,7 @@ parameter_types! {
883895
pub const SubtensorInitialMaxBurn: u64 = 100_000_000_000; // 100 tao
884896
pub const SubtensorInitialTxRateLimit: u64 = 1000;
885897
pub const SubtensorInitialTxDelegateTakeRateLimit: u64 = 216000; // 30 days at 12 seconds per block
886-
pub const SubtensorInitialTxChildKeyTakeRateLimit: u64 = 216000; // 30 days at 12 seconds per block
898+
pub const SubtensorInitialTxChildKeyTakeRateLimit: u64 = INITIAL_CHILDKEY_TAKE_RATELIMIT;
887899
pub const SubtensorInitialRAORecycledForRegistration: u64 = 0; // 0 rao
888900
pub const SubtensorInitialSenateRequiredStakePercentage: u64 = 1; // 1 percent of total stake
889901
pub const SubtensorInitialNetworkImmunity: u64 = 7 * 7200;

0 commit comments

Comments
 (0)