Fix auction bench (#6747)

* Adjust command

* Move imports

* Chain-specific blocktime

* update lockfile for {"substrate"}

* cargo update -p sp-io

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix bench

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Export constants from node service

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use constants in CLI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Piotr Mikołajczyk <piomiko41@gmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Oliver Tale-Yazdi
2023-02-20 18:02:07 +01:00
committed by GitHub
parent b13ba77a3b
commit 35a0d69af8
4 changed files with 219 additions and 190 deletions
+205 -181
View File
File diff suppressed because it is too large Load Diff
+9 -4
View File
@@ -649,6 +649,9 @@ pub fn run() -> Result<()> {
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime(cmd)) => {
use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
use sc_service::TaskManager;
use try_runtime_cli::block_building_info::timestamp_with_babe_info;
let runner = cli.create_runner(cmd)?;
let chain_spec = &runner.config().chain_spec;
set_default_ss58_version(chain_spec);
@@ -657,7 +660,6 @@ pub fn run() -> Result<()> {
<E as NativeExecutionDispatch>::ExtendHostFunctions,
>;
use sc_service::TaskManager;
let registry = &runner.config().prometheus_config.as_ref().map(|cfg| &cfg.registry);
let task_manager = TaskManager::new(runner.config().tokio_handle.clone(), *registry)
.map_err(|e| Error::SubstrateService(sc_service::Error::Prometheus(e)))?;
@@ -668,7 +670,8 @@ pub fn run() -> Result<()> {
if chain_spec.is_kusama() {
return runner.async_run(|_| {
Ok((
cmd.run::<service::kusama_runtime::Block, HostFunctionsOf<service::KusamaExecutorDispatch>>(
cmd.run::<service::kusama_runtime::Block, HostFunctionsOf<service::KusamaExecutorDispatch>, _>(
Some(timestamp_with_babe_info(service::kusama_runtime_constants::time::MILLISECS_PER_BLOCK))
)
.map_err(Error::SubstrateCli),
task_manager,
@@ -680,7 +683,8 @@ pub fn run() -> Result<()> {
if chain_spec.is_westend() {
return runner.async_run(|_| {
Ok((
cmd.run::<service::westend_runtime::Block, HostFunctionsOf<service::WestendExecutorDispatch>>(
cmd.run::<service::westend_runtime::Block, HostFunctionsOf<service::WestendExecutorDispatch>, _>(
Some(timestamp_with_babe_info(service::westend_runtime_constants::time::MILLISECS_PER_BLOCK))
)
.map_err(Error::SubstrateCli),
task_manager,
@@ -692,7 +696,8 @@ pub fn run() -> Result<()> {
{
return runner.async_run(|_| {
Ok((
cmd.run::<service::polkadot_runtime::Block, HostFunctionsOf<service::PolkadotExecutorDispatch>>(
cmd.run::<service::polkadot_runtime::Block, HostFunctionsOf<service::PolkadotExecutorDispatch>, _>(
Some(timestamp_with_babe_info(service::polkadot_runtime_constants::time::MILLISECS_PER_BLOCK))
)
.map_err(Error::SubstrateCli),
task_manager,
+4 -4
View File
@@ -121,13 +121,13 @@ pub use sp_runtime::{
};
#[cfg(feature = "kusama-native")]
pub use kusama_runtime;
pub use {kusama_runtime, kusama_runtime_constants};
#[cfg(feature = "polkadot-native")]
pub use polkadot_runtime;
pub use {polkadot_runtime, polkadot_runtime_constants};
#[cfg(feature = "rococo-native")]
pub use rococo_runtime;
pub use {rococo_runtime, rococo_runtime_constants};
#[cfg(feature = "westend-native")]
pub use westend_runtime;
pub use {westend_runtime, westend_runtime_constants};
/// The maximum number of active leaves we forward to the [`Overseer`] on startup.
#[cfg(any(test, feature = "full-node"))]
+1 -1
View File
@@ -1883,7 +1883,7 @@ mod benchmarking {
pallet_babe::Pallet::<T>::on_initialize(duration + now + T::EndingPeriod::get());
let authorities = pallet_babe::Pallet::<T>::authorities();
let next_authorities = authorities.clone();
pallet_babe::Pallet::<T>::enact_epoch_change(authorities, next_authorities);
pallet_babe::Pallet::<T>::enact_epoch_change(authorities, next_authorities, None);
}
}: {