mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Add pruning to bechmarks & update weights. (#918)
* Insert headers in benchmarks. * Fix benchmarks. * Lower number of headers. * Avoid hardcoding numbers. * Update weights. * cargo fmt --all * Remove todo. * Fix test. * Address review comments. * Fix borrowed value.
This commit is contained in:
committed by
Bastian Köcher
parent
fd44cab992
commit
479e51c67b
@@ -409,16 +409,30 @@ impl pallet_session::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
// This is a pretty unscientific cap.
|
||||
//
|
||||
// Note that once this is hit the pallet will essentially throttle incoming requests down to one
|
||||
// call per block.
|
||||
/// This is a pretty unscientific cap.
|
||||
///
|
||||
/// Note that once this is hit the pallet will essentially throttle incoming requests down to one
|
||||
/// call per block.
|
||||
pub const MaxRequests: u32 = 50;
|
||||
}
|
||||
|
||||
// Number of headers to keep.
|
||||
//
|
||||
// Assuming the worst case of every header being finalized, we will keep headers at least for a
|
||||
// week.
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
parameter_types! {
|
||||
/// Number of headers to keep in benchmarks.
|
||||
///
|
||||
/// In benchmarks we always populate with full number of `HeadersToKeep` to make sure that
|
||||
/// pruning is taken into account.
|
||||
///
|
||||
/// Note: This is lower than regular value, to speed up benchmarking setup.
|
||||
pub const HeadersToKeep: u32 = 1024;
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "runtime-benchmarks"))]
|
||||
parameter_types! {
|
||||
/// Number of headers to keep.
|
||||
///
|
||||
/// Assuming the worst case of every header being finalized, we will keep headers at least for a
|
||||
/// week.
|
||||
pub const HeadersToKeep: u32 = 7 * bp_rialto::DAYS as u32;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user