Skip to content

Commit

Permalink
Made all tx 50x more expensive. Adjuested weight for remark and set_code
Browse files Browse the repository at this point in the history
  • Loading branch information
markopoloparadox committed Jan 15, 2024
1 parent 944b995 commit 8270e25
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
3 changes: 2 additions & 1 deletion runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ impl pallet_tips::Config for Runtime {
}

parameter_types! {
pub const WeightFee: Balance = PICO_AVL;
// Temporary increased price of all transactions by 50x
pub const WeightFee: Balance = 50 * PICO_AVL;
pub const TransactionByteFee: Balance = 100 * NANO_AVL; // 100 nanoAVL
pub const OperationalFeeMultiplier: u8 = 5u8;
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(50); // target_utilization 50%
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
/// Per convention: if the runtime behavior changes, increment spec_version
/// and set impl_version to 0. This paramenter is typically incremented when
/// there's an update to the transaction_version.
spec_version: 17,
spec_version: 18,
/// The version of the implementation of the specification. Nodes can ignore this. It is only
/// used to indicate that the code is different. As long as the authoring_version and the
/// spec_version are the same, the code itself might have changed, but the native and Wasm
Expand Down
27 changes: 7 additions & 20 deletions runtime/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,16 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
/// The range of component `b` is `[0, 4718592]`.
fn remark(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 4_804_000 picoseconds.
Weight::from_parts(60_500_4_990_000, 0)
// Manually changed the value to be higher
Weight::from_parts(2_000_000_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 0
.saturating_add(Weight::from_parts(532, 0).saturating_mul(b.into()))
}
/// The range of component `b` is `[0, 4718592]`.
fn remark_with_event(b: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 16_078_000 picoseconds.
Weight::from_parts(60_500_4_990_000, 0)
// Manually changed the value to be higher
Weight::from_parts(2_000_000_000, 0)
.saturating_add(Weight::from_parts(0, 0))
// Standard Error: 4
.saturating_add(Weight::from_parts(1_734, 0).saturating_mul(b.into()))
Expand All @@ -87,15 +81,12 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `System::Digest` (r:1 w:1)
/// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Proof: `System::Dige st` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: UNKNOWN KEY `0x3a636f6465` (r:0 w:1)
/// Proof: UNKNOWN KEY `0x3a636f6465` (r:0 w:1)
fn set_code() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1485`
// Minimum execution time: 1_165_620_414_000 picoseconds.
Weight::from_parts(1_208_693_195_000, 0)
// Manually changed the value to be lower
Weight::from_parts(20_000_000_000, 0)
.saturating_add(Weight::from_parts(0, 1485))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2))
Expand All @@ -105,10 +96,6 @@ impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
/// Storage: UNKNOWN KEY `0x3a636f6465` (r:0 w:1)
/// Proof: UNKNOWN KEY `0x3a636f6465` (r:0 w:1)
fn set_code_without_checks() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `1485`
// Minimum execution time: 4_176_897_000 picoseconds.
Weight::from_parts(4_311_210_000, 0)
.saturating_add(Weight::from_parts(0, 1485))
.saturating_add(T::DbWeight::get().reads(1))
Expand Down

0 comments on commit 8270e25

Please sign in to comment.