You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sugondat/chain/pallets/length-fee-adjustment/src/lib.rs
+104-4
Original file line number
Diff line number
Diff line change
@@ -38,13 +38,27 @@ mod tests;
38
38
/// `pallet_transaction_type::Config`.
39
39
///
40
40
/// `targeted_length_fee_adjustment` is updated at the end of each block inside `on_finalize`
41
+
///
42
+
/// The pallet also implements `cumulus_pallet_parachain_system::OnSystemEvent` which is used to update `NextLenghtMultiplier`
43
+
/// when blocks are skipped, the implementation follows the following formula to update the multiplier:
44
+
///
45
+
/// ```ignore
46
+
/// c_traffic = c_traffic * e^(-target*v*n)
47
+
/// ```
48
+
///
49
+
/// where the exponential is evaluated with the first SkippedBlocksNumberTerms terms, specified in the pallet Config, of the Taylor Series expansion of e^x.
41
50
#[frame_support::pallet]
42
51
pubmod pallet {
43
52
53
+
use cumulus_pallet_parachain_system::OnSystemEvent;
44
54
use frame_support::pallet_prelude::*;
45
55
use frame_system::pallet_prelude::*;
46
56
use pallet_transaction_payment::{Multiplier,OnChargeTransaction};
47
-
use sp_runtime::{traits::Get,FixedPointNumber,Perquintill,SaturatedConversion,Saturating};
57
+
use polkadot_primitives::v6::PersistedValidationData;
0 commit comments