Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Some PoC-3 GRANDPA tweaks (#181)
Browse files Browse the repository at this point in the history
* call on_finalise after triggering curated_grandpa change

* make grandpa rounds shorter for faster finalization
  • Loading branch information
rphmeier authored Mar 22, 2019
1 parent e1b97b2 commit 4501a48
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions runtime/src/curated_grandpa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ decl_module! {
voters.swap(remaining - 1, voter_index);
}

// finalisation order is undefined, so grandpa's on_finalise might
// have already been called. calling it again is OK though.
let _ = grandpa::Module::<T>::schedule_change(voters, T::BlockNumber::zero(), None);
grandpa::Module::<T>::on_finalise(block_number);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"),
impl_name: create_runtime_str!("parity-polkadot"),
authoring_version: 1,
spec_version: 105,
spec_version: 106,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
};
Expand Down
2 changes: 1 addition & 1 deletion service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ construct_service_factory! {
{
let voter = grandpa::run_grandpa(
grandpa::Config {
gossip_duration: Duration::new(4, 0), // FIXME: make this available through chainspec?
gossip_duration: Duration::from_millis(500),
local_key: key.clone(),
justification_period: 4096,
name: Some(service.config.name.clone()),
Expand Down

0 comments on commit 4501a48

Please sign in to comment.