diff --git a/client/consensus/nimbus-consensus/Cargo.toml b/client/consensus/nimbus-consensus/Cargo.toml index a931ac9..a8ef147 100644 --- a/client/consensus/nimbus-consensus/Cargo.toml +++ b/client/consensus/nimbus-consensus/Cargo.toml @@ -46,7 +46,3 @@ futures = { workspace = true } log = { workspace = true } parking_lot = { workspace = true } tracing = { workspace = true } - -[features] -# Allows collator to use full PoV size for block building -full-pov-size = [] diff --git a/client/consensus/nimbus-consensus/src/collators/basic.rs b/client/consensus/nimbus-consensus/src/collators/basic.rs index f5ecc24..9925fb2 100644 --- a/client/consensus/nimbus-consensus/src/collators/basic.rs +++ b/client/consensus/nimbus-consensus/src/collators/basic.rs @@ -58,6 +58,8 @@ pub struct Params { pub collator_key: CollatorPair, /// Force production of the block even if the collator is not eligible pub force_authoring: bool, + /// Allows the use of the full Proof of Validity budget + pub full_pov_size: bool, /// A builder for inherent data builders. pub create_inherent_data_providers: CIDP, /// The collator service used for bundling proposals into collations and announcing @@ -106,6 +108,7 @@ where para_client, relay_client, force_authoring, + full_pov_size, .. } = params; @@ -175,7 +178,7 @@ where .await ); - let allowed_pov_size = if cfg!(feature = "full-pov-size") { + let allowed_pov_size = if full_pov_size { validation_data.max_pov_size } else { // Set the block limit to 50% of the maximum PoV size. diff --git a/client/consensus/nimbus-consensus/src/collators/lookahead.rs b/client/consensus/nimbus-consensus/src/collators/lookahead.rs index 14a42fd..460ac2d 100644 --- a/client/consensus/nimbus-consensus/src/collators/lookahead.rs +++ b/client/consensus/nimbus-consensus/src/collators/lookahead.rs @@ -65,6 +65,8 @@ pub struct Params validation_code_hash, }; - let allowed_pov_size = if cfg!(feature = "full-pov-size") { + let allowed_pov_size = if params.full_pov_size { max_pov_size } else { // Set the block limit to 50% of the maximum PoV size. diff --git a/template/node/src/service.rs b/template/node/src/service.rs index b6bdbcb..65c7392 100644 --- a/template/node/src/service.rs +++ b/template/node/src/service.rs @@ -348,6 +348,7 @@ where overseer_handle, announce_block, force_authoring, + true, )?; } @@ -370,6 +371,7 @@ fn start_consensus( overseer_handle: OverseerHandle, announce_block: Arc>) + Send + Sync>, force_authoring: bool, + full_pov_size: bool, ) -> Result<(), sc_service::Error> { let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), @@ -399,6 +401,7 @@ fn start_consensus( keystore, collator_service, force_authoring, + full_pov_size, additional_digests_provider: (), collator_key, //authoring_duration: Duration::from_millis(500),