mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
HRMP benchmarks (#3876)
* wip template for hrmp benchmarks * add all of the benchmarks, first draft * File was not saved :/ * cargo +nightly fmt * Use configs * add configs * Fix rococo * Final touches * revert fmt changes, one last time * Fix wrappings * Fix a bunch of tests * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::hrmp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_hrmp.rs * add to westend * actually use everything * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::hrmp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_hrmp.rs * Update runtime/parachains/src/hrmp.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * use real weight in wnd * reorg * minor cleanup * weigh some of the internal stuff as well * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=runtime_parachains::hrmp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/runtime_parachains_hrmp.rs * cargo run --quiet --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=runtime_parachains::hrmp --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/runtime_parachains_hrmp.rs * add files * Master.into() * add validation * fmt * fmt * final fixes * all runtimes build * undo formatting * Update runtime/parachains/src/hrmp.rs Co-authored-by: Zeke Mostov <z.mostov@gmail.com> * non-controversial changes * do it the parachain-way: use const instead of type configs for simplicity. * borrow assert_storage_consistency_exhaustive * move assert_storage_consistency_exhaustive to Pallet, so it can be reused for benchmarks as well. * fix typo Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> Co-authored-by: Sergey Shulepov <s.pepyakin@gmail.com> Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
This commit is contained in:
@@ -319,6 +319,10 @@ pub enum InconsistentError<BlockNumber> {
|
||||
},
|
||||
/// `validation_upgrade_delay` is less than or equal 1.
|
||||
ValidationUpgradeDelayIsTooLow { validation_upgrade_delay: BlockNumber },
|
||||
/// Maximum number of HRMP outbound channels exceeded.
|
||||
MaxHrmpOutboundChannelsExceeded,
|
||||
/// Maximum number of HRMP inbound channels exceeded.
|
||||
MaxHrmpInboundChannelsExceeded,
|
||||
}
|
||||
|
||||
impl<BlockNumber> HostConfiguration<BlockNumber>
|
||||
@@ -381,6 +385,15 @@ where
|
||||
})
|
||||
}
|
||||
|
||||
if self.hrmp_max_parachain_outbound_channels > crate::hrmp::HRMP_MAX_OUTBOUND_CHANNELS_BOUND
|
||||
{
|
||||
return Err(MaxHrmpOutboundChannelsExceeded)
|
||||
}
|
||||
|
||||
if self.hrmp_max_parachain_inbound_channels > crate::hrmp::HRMP_MAX_INBOUND_CHANNELS_BOUND {
|
||||
return Err(MaxHrmpInboundChannelsExceeded)
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1608,11 +1621,11 @@ mod tests {
|
||||
hrmp_recipient_deposit: 4905,
|
||||
hrmp_channel_max_capacity: 3921,
|
||||
hrmp_channel_max_total_size: 7687,
|
||||
hrmp_max_parachain_inbound_channels: 3722,
|
||||
hrmp_max_parathread_inbound_channels: 1967,
|
||||
hrmp_max_parachain_inbound_channels: 37,
|
||||
hrmp_max_parathread_inbound_channels: 19,
|
||||
hrmp_channel_max_message_size: 8192,
|
||||
hrmp_max_parachain_outbound_channels: 100,
|
||||
hrmp_max_parathread_outbound_channels: 200,
|
||||
hrmp_max_parachain_outbound_channels: 10,
|
||||
hrmp_max_parathread_outbound_channels: 20,
|
||||
hrmp_max_message_num_per_candidate: 20,
|
||||
ump_max_individual_weight: 909,
|
||||
pvf_checking_enabled: true,
|
||||
|
||||
Reference in New Issue
Block a user