Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
58feb41
Send high-level consensus telemetry by default
cmichi Mar 18, 2019
ec9d66b
Notify telemetry on finalized
cmichi Mar 21, 2019
1deceea
Send used authority set to telemetry
cmichi Apr 3, 2019
7743147
Do not send commit message telemetry by default
cmichi Apr 3, 2019
8066144
Fix typo
cmichi Apr 9, 2019
b18916f
Revert "Send used authority set to telemetry"
cmichi Apr 10, 2019
539b94f
Allow for notifications on telemetry connect
cmichi Apr 9, 2019
7018af1
Send authority set to telemetry on change
cmichi Apr 10, 2019
a9c8b7f
Merge branch 'master' into 'cmichi-send-high-level-consensus-telemetr…
cmichi Apr 10, 2019
ff8cf0e
Merge branch 'master' into cmichi-send-high-level-consensus-telemetry…
cmichi Apr 10, 2019
8ff8561
Make telemetry onconnect hoook optional
cmichi Apr 10, 2019
f66d7a9
Merge branch 'master' into 'cmichi-send-high-level-consensus-telemetr…
cmichi Apr 10, 2019
b4949f3
Introduce GrandpaParams struct to condense parameters
cmichi Apr 13, 2019
5c639a8
Remove debug statement
cmichi Apr 13, 2019
aa0287e
Fix tests
cmichi Apr 13, 2019
95ae8dd
Rename parameter
cmichi Apr 13, 2019
537ad80
Fix tests
cmichi Apr 13, 2019
6b1f2a8
Rename struct
cmichi Apr 13, 2019
78eb232
Do not send verbosity level
cmichi Apr 15, 2019
75a8cb4
Combine imports
cmichi Apr 15, 2019
389b704
Implement comments
cmichi Apr 15, 2019
61782dd
Merge branch 'master' into cmichi-send-high-level-consensus-telemetry…
cmichi Apr 15, 2019
ac0722a
Run cargo build --all
cmichi Apr 15, 2019
b6a27d5
Remove noisy telemetry
cmichi Apr 15, 2019
4a04a91
Add docs for public items
cmichi Apr 15, 2019
3f55b25
Unbox and support Clone trait
cmichi Apr 16, 2019
474699e
Merge branch 'master' into cmichi-send-high-level-consensus-telemetry…
cmichi Apr 16, 2019
ed45607
Merge branch 'master' into cmichi-send-high-level-consensus-telemetry…
cmichi Apr 23, 2019
1fb49f5
Fix merge
cmichi Apr 23, 2019
862e06c
Fix merge
cmichi Apr 23, 2019
f89f687
Update core/finality-grandpa/src/lib.rs
rphmeier Apr 23, 2019
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
Prev Previous commit
Next Next commit
Introduce GrandpaParams struct to condense parameters
  • Loading branch information
cmichi committed Apr 13, 2019
commit b4949f3a3aa286e854f7b0f29a729b9e63e2da10
26 changes: 20 additions & 6 deletions core/finality-grandpa/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,15 +450,20 @@ fn register_finality_tracker_inherent_data_provider<B, E, Block: BlockT<Hash=H25
}
}

/// Parameters used to run Grandpa.
pub struct GrandpaParams<'a, B, E, Block: BlockT<Hash=H256>, N, RA> {
pub config: Config,
pub link: LinkHalf<B, E, Block, RA>,
pub network: N,
pub inherent_data_providers: InherentDataProviders,
pub on_exit: Box<Future<Item=(),Error=()> + Send + 'static>,
pub telemetry_notify: Option<TelemetryHookOnConnect<'a>>,
}

/// 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<B, E, Block: BlockT<Hash=H256>, N, RA>(
config: Config,
link: LinkHalf<B, E, Block, RA>,
network: N,
inherent_data_providers: InherentDataProviders,
on_exit: impl Future<Item=(),Error=()> + Send + 'static,
telemetry_notify: Option<TelemetryHookOnConnect>,
grandpa_params: GrandpaParams<B, E, Block, N, RA>
) -> ::client::error::Result<impl Future<Item=(),Error=()> + Send + 'static> where
Block::Hash: Ord,
B: Backend<Block, Blake2Hasher> + 'static,
Expand All @@ -470,6 +475,15 @@ pub fn run_grandpa<B, E, Block: BlockT<Hash=H256>, N, RA>(
DigestItemFor<Block>: DigestItem<AuthorityId=AuthorityId>,
RA: Send + Sync + 'static,
{
let GrandpaParams {
config,
link,
network,
inherent_data_providers,
on_exit,
telemetry_notify
} = grandpa_params;

use futures::future::{self, Loop as FutureLoop};

let network = NetworkBridge::new(network, config.clone());
Expand Down
19 changes: 10 additions & 9 deletions node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,21 @@ construct_service_factory! {
executor: &executor,
};

executor.spawn(grandpa::run_grandpa(
grandpa::Config {
let grandpa_config = grandpa::GrandpaParams{
config: grandpa::Config {
local_key,
// FIXME #1578 make this available through chainspec
gossip_duration: Duration::from_millis(333),
justification_period: 4096,
name: Some(service.config.name.clone())
name: Some(service.config.name.clone()),
},
link_half,
service.network(),
service.config.custom.inherent_data_providers.clone(),
service.on_exit(),
Some(telemetry_notify),
)?);
link: link_half,
network: service.network(),
inherent_data_providers: service.config.custom.inherent_data_providers.clone(),
on_exit: Box::new(service.on_exit()),
telemetry_notify: Some(telemetry_notify),
};
executor.spawn(grandpa::run_grandpa(grandpa_config)?);

Ok(service)
}
Expand Down