Skip to content

Commit 573717c

Browse files
authored
Merge pull request #1886 from opentensor/feat/reduce-tx-fees
Reduce tx fees
2 parents 4690aaf + e588143 commit 573717c

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

pallets/subtensor/src/macros/dispatches.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ mod dispatches {
186186
/// - On failure for each failed item in the batch.
187187
///
188188
#[pallet::call_index(100)]
189-
#[pallet::weight((Weight::from_parts(81_450_000, 0)
189+
#[pallet::weight((Weight::from_parts(64_320_000, 0)
190190
.saturating_add(T::DbWeight::get().reads(8))
191191
.saturating_add(T::DbWeight::get().writes(2)), DispatchClass::Normal, Pays::No))]
192192
pub fn batch_commit_weights(
@@ -413,7 +413,7 @@ mod dispatches {
413413
/// - Attempting to set weights with max value exceeding limit.
414414
///
415415
#[pallet::call_index(8)]
416-
#[pallet::weight((Weight::from_parts(2_090_000, 0)
416+
#[pallet::weight((Weight::from_parts(2_033_000, 0)
417417
.saturating_add(T::DbWeight::get().reads(0_u64))
418418
.saturating_add(T::DbWeight::get().writes(0_u64)), DispatchClass::Normal, Pays::No))]
419419
pub fn set_tao_weights(
@@ -454,7 +454,7 @@ mod dispatches {
454454
/// - The hotkey we are delegating is not owned by the calling coldket.
455455
///
456456
#[pallet::call_index(1)]
457-
#[pallet::weight((Weight::from_parts(3_000_000, 0)
457+
#[pallet::weight((Weight::from_parts(2_363_000, 0)
458458
.saturating_add(T::DbWeight::get().reads(0))
459459
.saturating_add(T::DbWeight::get().writes(0)), DispatchClass::Normal, Pays::Yes))]
460460
pub fn become_delegate(_origin: OriginFor<T>, _hotkey: T::AccountId) -> DispatchResult {
@@ -827,7 +827,7 @@ mod dispatches {
827827
/// - The ip type v4 or v6.
828828
///
829829
#[pallet::call_index(5)]
830-
#[pallet::weight((Weight::from_parts(24_350_000, 0)
830+
#[pallet::weight((Weight::from_parts(30_170_000, 0)
831831
.saturating_add(T::DbWeight::get().reads(4))
832832
.saturating_add(T::DbWeight::get().writes(1)), DispatchClass::Normal, Pays::No))]
833833
pub fn serve_prometheus(
@@ -1931,7 +1931,7 @@ mod dispatches {
19311931
/// Will charge based on the weight even if the hotkey is already associated with a coldkey.
19321932
#[pallet::call_index(91)]
19331933
#[pallet::weight((
1934-
Weight::from_parts(20_300_000, 0).saturating_add(T::DbWeight::get().reads_writes(3, 3)),
1934+
Weight::from_parts(19_930_000, 0).saturating_add(T::DbWeight::get().reads_writes(3, 3)),
19351935
DispatchClass::Operational,
19361936
Pays::Yes
19371937
))]

pallets/subtensor/src/tests/staking.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,10 @@ fn test_add_stake_dispatch_info_ok() {
3434
netuid,
3535
amount_staked,
3636
});
37-
assert_eq!(
38-
call.get_dispatch_info(),
39-
DispatchInfo {
40-
call_weight: frame_support::weights::Weight::from_parts(2_495_500_000, 0),
41-
extension_weight: frame_support::weights::Weight::zero(),
42-
class: DispatchClass::Normal,
43-
pays_fee: Pays::Yes
44-
}
45-
);
37+
let di = call.get_dispatch_info();
38+
assert_eq!(di.extension_weight, frame_support::weights::Weight::zero(),);
39+
assert_eq!(di.class, DispatchClass::Normal,);
40+
assert_eq!(di.pays_fee, Pays::Yes,);
4641
});
4742
}
4843
#[test]

pallets/transaction-fee/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl WeightToFeePolynomial for LinearWeightToFee {
4747
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
4848
let coefficient = WeightToFeeCoefficient {
4949
coeff_integer: 0,
50-
coeff_frac: Perbill::from_parts(500_000), // 0.5 unit per weight
50+
coeff_frac: Perbill::from_parts(50_000), // 0.05 unit per weight
5151
negative: false,
5252
degree: 1,
5353
};

0 commit comments

Comments
 (0)