Skip to content

Commit

Permalink
100x base_weight to increase min tx cost
Browse files Browse the repository at this point in the history
  • Loading branch information
ToufeeqP committed Mar 28, 2024
1 parent 6296f1b commit cc5bb2a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pallets/system/src/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ impl BlockWeights {
Some(Weight::zero())
};
WeightsPerClass {
base_extrinsic: constants::ExtrinsicBaseWeight::get(),
base_extrinsic: constants::ExtrinsicBaseWeight::get().saturating_mul(100),
max_extrinsic: None,
max_total: initial,
reserved: initial,
Expand Down
3 changes: 2 additions & 1 deletion runtime/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ pub mod system {
pub RuntimeBlockWeights: SystemBlockWeights = SystemBlockWeights::builder()
.base_block(BlockExecutionWeight::get())
.for_class(DispatchClass::all(), |weights| {
weights.base_extrinsic = ExtrinsicBaseWeight::get();
// Note: To make min tx cost at least 0.1 AVAIL, BaseWeight has been increased by 100x
weights.base_extrinsic = ExtrinsicBaseWeight::get().saturating_mul(100);
})
.for_class(DispatchClass::Normal, |weights| {
weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
Expand Down

2 comments on commit cc5bb2a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: cc5bb2a Previous: 33f7951 Ratio
commitment_builder/64 4074232756 ns/iter (± 9963679) 4343451680 ns/iter (± 92231152) 0.94
commitment_builder/128 4424947690 ns/iter (± 29440292) 4647446215 ns/iter (± 137494514) 0.95
commitment_builder/256 2197885990 ns/iter (± 46941680) 2367397557 ns/iter (± 42776582) 0.93

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: cc5bb2a Previous: 909af7f Ratio
commitment_builder_64 Instructions 41958885435 ops (± 0) 41972869826 ops (± 0) 1.00
commitment_builder_64 L1 Accesses 51408855900 ops (± 0) 51407870438 ops (± 0) 1.00
commitment_builder_64 L2 Accesses 885113 ops (± 0) 893120 ops (± 0) 0.99
commitment_builder_64 RAM Accesses 166421 ops (± 0) 191298 ops (± 0) 0.87
commitment_builder_64 Estimated Cycles 51419106200 ops (± 0) 51419031468 ops (± 0) 1.00
commitment_builder_128 Instructions 54189608231 ops (± 0) 54204175550 ops (± 0) 1.00
commitment_builder_128 L1 Accesses 68302867889 ops (± 0) 68301951624 ops (± 0) 1.00
commitment_builder_128 L2 Accesses 1202386 ops (± 0) 1258510 ops (± 0) 0.96
commitment_builder_128 RAM Accesses 275087 ops (± 0) 242507 ops (± 0) 1.13
commitment_builder_128 Estimated Cycles 68318507864 ops (± 0) 68316731919 ops (± 0) 1.00
commitment_builder_256 Instructions 31749297599 ops (± 0) 31758548180 ops (± 0) 1.00
commitment_builder_256 L1 Accesses 40828245309 ops (± 0) 40833274463 ops (± 0) 1.00
commitment_builder_256 L2 Accesses 6693762 ops (± 0) 6788005 ops (± 0) 0.99
commitment_builder_256 RAM Accesses 271062 ops (± 0) 239352 ops (± 0) 1.13
commitment_builder_256 Estimated Cycles 40871201289 ops (± 0) 40875591808 ops (± 0) 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.