remove on_exit from grandpa (#5098)

This commit is contained in:
Gavin Wood
2020-03-05 13:38:16 +01:00
committed by GitHub
parent 91b44299d8
commit ab58a08a53
5 changed files with 7 additions and 30 deletions
+4 -8
View File
@@ -536,7 +536,7 @@ fn register_finality_tracker_inherent_data_provider<Block: BlockT, Client>(
}
/// Parameters used to run Grandpa.
pub struct GrandpaParams<Block: BlockT, C, N, SC, VR, X> {
pub struct GrandpaParams<Block: BlockT, C, N, SC, VR> {
/// Configuration for the GRANDPA service.
pub config: Config,
/// A link to the block import worker.
@@ -545,8 +545,6 @@ pub struct GrandpaParams<Block: BlockT, C, N, SC, VR, X> {
pub network: N,
/// The inherent data providers.
pub inherent_data_providers: InherentDataProviders,
/// Handle to a future that will resolve on exit.
pub on_exit: X,
/// If supplied, can be used to hook on telemetry connection established events.
pub telemetry_on_connect: Option<futures::channel::mpsc::UnboundedReceiver<()>>,
/// A voting rule used to potentially restrict target votes.
@@ -557,8 +555,8 @@ pub struct GrandpaParams<Block: BlockT, C, N, SC, VR, X> {
/// Run a GRANDPA voter as a task. Provide configuration and a link to a
/// block import worker that has already been instantiated with `block_import`.
pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR, X>(
grandpa_params: GrandpaParams<Block, C, N, SC, VR, X>,
pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR>(
grandpa_params: GrandpaParams<Block, C, N, SC, VR>,
) -> sp_blockchain::Result<impl Future<Output = ()> + Unpin + Send + 'static> where
Block::Hash: Ord,
BE: Backend<Block> + 'static,
@@ -567,7 +565,6 @@ pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR, X>(
VR: VotingRule<Block, C> + Clone + 'static,
NumberFor<Block>: BlockNumberOps,
DigestFor<Block>: Encode,
X: futures::Future<Output=()> + Clone + Send + Unpin + 'static,
C: ClientForGrandpa<Block, BE> + 'static,
{
let GrandpaParams {
@@ -575,7 +572,6 @@ pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR, X>(
link,
network,
inherent_data_providers,
on_exit,
telemetry_on_connect,
voting_rule,
prometheus_registry,
@@ -647,7 +643,7 @@ pub fn run_grandpa_voter<Block: BlockT, BE: 'static, C, N, SC, VR, X>(
let telemetry_task = telemetry_task
.then(|_| future::pending::<()>());
Ok(future::select(future::select(voter_work, on_exit), telemetry_task).map(drop))
Ok(future::select(voter_work, telemetry_task).map(drop))
}
/// Future that powers the voter.