Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions client/consensus/nimbus-consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
5 changes: 4 additions & 1 deletion client/consensus/nimbus-consensus/src/collators/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ pub struct Params<Proposer, BI, ParaClient, RClient, CIDP, CS, ADP = ()> {
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
Expand Down Expand Up @@ -106,6 +108,7 @@ where
para_client,
relay_client,
force_authoring,
full_pov_size,
..
} = params;

Expand Down Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion client/consensus/nimbus-consensus/src/collators/lookahead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ pub struct Params<BI, CIDP, Client, Backend, RClient, CHP, SO, Proposer, CS, DP
pub create_inherent_data_providers: CIDP,
/// 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,
/// The underlying keystore, which should contain Aura consensus keys.
pub keystore: KeystorePtr,
/// A handle to the relay-chain client's "Overseer" or task orchestrator.
Expand Down Expand Up @@ -366,7 +368,7 @@ where
Some(validation_code_hash) => 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.
Expand Down
3 changes: 3 additions & 0 deletions template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ where
overseer_handle,
announce_block,
force_authoring,
true,
)?;
}

Expand All @@ -370,6 +371,7 @@ fn start_consensus(
overseer_handle: OverseerHandle,
announce_block: Arc<dyn Fn(Hash, Option<Vec<u8>>) + 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(),
Expand Down Expand Up @@ -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),
Expand Down