Companion for Trim compact solution for length during preparation (#2649)

* Companion for Trim compact solution for length during preparation

https://github.com/paritytech/substrate/pull/8317

* eliminate potential for overflow in OffchainSolutionLengthLimit

* Apply suggestions from code review

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* update substrate: cargo update -p sp-io

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Peter Goodspeed-Niklaus
2021-04-13 15:53:51 +02:00
committed by GitHub
parent f1f9192a38
commit f822381c4c
5 changed files with 169 additions and 155 deletions
+8
View File
@@ -118,6 +118,14 @@ parameter_types! {
.max_extrinsic
.expect("Normal extrinsics have weight limit configured by default; qed")
.saturating_sub(BlockExecutionWeight::get());
/// A limit for off-chain phragmen unsigned solution length.
///
/// We allow up to 90% of the block's size to be consumed by the solution.
pub OffchainSolutionLengthLimit: u32 = Perbill::from_rational(90_u32, 100) *
*BlockLength::get()
.max
.get(DispatchClass::Normal);
}
/// Parameterized slow adjusting fee updated based on