Skip to content
Snippets Groups Projects
Commit 8f733a6c authored by André Silva's avatar André Silva Committed by GitHub
Browse files

use max_block_proposal_slot_portion (#499)


* use max_block_proposal_slot_portion

* remove patch now that Substrate PR is merged

Co-authored-by: default avatarRobert Habermeier <rphmeier@gmail.com>
parent 12a2b285
Branches
No related merge requests found
This diff is collapsed.
...@@ -110,6 +110,7 @@ where ...@@ -110,6 +110,7 @@ where
slot_duration: SlotDuration, slot_duration: SlotDuration,
telemetry: Option<TelemetryHandle>, telemetry: Option<TelemetryHandle>,
block_proposal_slot_portion: SlotProportion, block_proposal_slot_portion: SlotProportion,
max_block_proposal_slot_portion: Option<SlotProportion>,
) -> Self ) -> Self
where where
Client: ProvideRuntimeApi<B> Client: ProvideRuntimeApi<B>
...@@ -149,6 +150,7 @@ where ...@@ -149,6 +150,7 @@ where
keystore, keystore,
telemetry, telemetry,
block_proposal_slot_portion, block_proposal_slot_portion,
max_block_proposal_slot_portion,
}); });
Self { Self {
...@@ -253,6 +255,7 @@ pub struct BuildAuraConsensusParams<PF, BI, RBackend, CIDP, Client, BS, SO> { ...@@ -253,6 +255,7 @@ pub struct BuildAuraConsensusParams<PF, BI, RBackend, CIDP, Client, BS, SO> {
pub slot_duration: SlotDuration, pub slot_duration: SlotDuration,
pub telemetry: Option<TelemetryHandle>, pub telemetry: Option<TelemetryHandle>,
pub block_proposal_slot_portion: SlotProportion, pub block_proposal_slot_portion: SlotProportion,
pub max_block_proposal_slot_portion: Option<SlotProportion>,
} }
/// Build the [`AuraConsensus`]. /// Build the [`AuraConsensus`].
...@@ -273,6 +276,7 @@ pub fn build_aura_consensus<P, Block, PF, BI, RBackend, CIDP, Client, SO, BS, Er ...@@ -273,6 +276,7 @@ pub fn build_aura_consensus<P, Block, PF, BI, RBackend, CIDP, Client, SO, BS, Er
slot_duration, slot_duration,
telemetry, telemetry,
block_proposal_slot_portion, block_proposal_slot_portion,
max_block_proposal_slot_portion,
}: BuildAuraConsensusParams<PF, BI, RBackend, CIDP, Client, BS, SO>, }: BuildAuraConsensusParams<PF, BI, RBackend, CIDP, Client, BS, SO>,
) -> Box<dyn ParachainConsensus<Block>> ) -> Box<dyn ParachainConsensus<Block>>
where where
...@@ -327,6 +331,7 @@ where ...@@ -327,6 +331,7 @@ where
slot_duration, slot_duration,
telemetry, telemetry,
block_proposal_slot_portion, block_proposal_slot_portion,
max_block_proposal_slot_portion,
) )
.build() .build()
} }
...@@ -352,6 +357,7 @@ struct AuraConsensusBuilder<P, Block, PF, BI, RBackend, CIDP, Client, SO, BS, Er ...@@ -352,6 +357,7 @@ struct AuraConsensusBuilder<P, Block, PF, BI, RBackend, CIDP, Client, SO, BS, Er
slot_duration: SlotDuration, slot_duration: SlotDuration,
telemetry: Option<TelemetryHandle>, telemetry: Option<TelemetryHandle>,
block_proposal_slot_portion: SlotProportion, block_proposal_slot_portion: SlotProportion,
max_block_proposal_slot_portion: Option<SlotProportion>,
} }
impl<Block, PF, BI, RBackend, CIDP, Client, SO, BS, P, Error> impl<Block, PF, BI, RBackend, CIDP, Client, SO, BS, P, Error>
...@@ -409,6 +415,7 @@ where ...@@ -409,6 +415,7 @@ where
slot_duration: SlotDuration, slot_duration: SlotDuration,
telemetry: Option<TelemetryHandle>, telemetry: Option<TelemetryHandle>,
block_proposal_slot_portion: SlotProportion, block_proposal_slot_portion: SlotProportion,
max_block_proposal_slot_portion: Option<SlotProportion>,
) -> Self { ) -> Self {
Self { Self {
_phantom: PhantomData, _phantom: PhantomData,
...@@ -425,6 +432,7 @@ where ...@@ -425,6 +432,7 @@ where
slot_duration, slot_duration,
telemetry, telemetry,
block_proposal_slot_portion, block_proposal_slot_portion,
max_block_proposal_slot_portion,
} }
} }
...@@ -498,6 +506,7 @@ where ...@@ -498,6 +506,7 @@ where
self.slot_duration, self.slot_duration,
self.telemetry, self.telemetry,
self.block_proposal_slot_portion, self.block_proposal_slot_portion,
self.max_block_proposal_slot_portion,
)) ))
} }
} }
...@@ -483,6 +483,8 @@ pub async fn start_rococo_parachain_node( ...@@ -483,6 +483,8 @@ pub async fn start_rococo_parachain_node(
slot_duration, slot_duration,
// We got around 500ms for proposing // We got around 500ms for proposing
block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32), block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32),
// And a maximum of 750ms if slots are skipped
max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)),
telemetry, telemetry,
})) }))
}, },
...@@ -899,6 +901,8 @@ where ...@@ -899,6 +901,8 @@ where
slot_duration, slot_duration,
// We got around 500ms for proposing // We got around 500ms for proposing
block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32), block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32),
// And a maximum of 750ms if slots are skipped
max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)),
telemetry: telemetry2, telemetry: telemetry2,
}) })
}), }),
......
...@@ -625,6 +625,7 @@ pub fn node_config( ...@@ -625,6 +625,7 @@ pub fn node_config(
rpc_http_threads: None, rpc_http_threads: None,
rpc_cors: None, rpc_cors: None,
rpc_methods: Default::default(), rpc_methods: Default::default(),
rpc_max_payload: None,
prometheus_config: None, prometheus_config: None,
telemetry_endpoints: None, telemetry_endpoints: None,
telemetry_external_transport: None, telemetry_external_transport: None,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment