grandpa: rewrite warp sync proof generation (#8148)

* grandpa: use AuthoritySetChanges to generate warp sync proof

* node: init grandpa warp sync protocol

* grandpa: iterator for AuthoritySetChanges

* grandpa: rewrite warp sync proof generation

* grandpa: remove old code for warp sync generation

* grandpa: fix indentation

* grandpa: fix off by one

* grandpa: use binary search to find start idx when generating warp sync proof

* grandpa: add method to verify warp sync proofs

* grandpa: remove unnecessary code to skip authority set changes

* grandpa: add test for warp sync proof generation and verification

* grandpa: add missing docs

* grandpa: remove trailing comma
This commit is contained in:
André Silva
2021-02-25 08:44:51 +00:00
committed by GitHub
parent 8a0e8ea9a6
commit 94c29ff666
10 changed files with 463 additions and 538 deletions
+8 -3
View File
@@ -197,9 +197,14 @@ pub fn new_full_base(
config.network.extra_sets.push(grandpa::grandpa_peers_set_config());
#[cfg(feature = "cli")]
config.network.request_response_protocols.push(sc_finality_grandpa_warp_sync::request_response_config_for_chain(
&config, task_manager.spawn_handle(), backend.clone(),
));
config.network.request_response_protocols.push(
sc_finality_grandpa_warp_sync::request_response_config_for_chain(
&config,
task_manager.spawn_handle(),
backend.clone(),
import_setup.1.shared_authority_set().clone(),
)
);
let (network, network_status_sinks, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {