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

Warp sync part I #9227

Merged
29 commits merged into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f41b6ff
Started warp sync
arkpar Jun 17, 2021
dd80234
BABE & GRANDPA recovery
arkpar Jun 25, 2021
32983ea
Warp sync protocol
arkpar Jun 28, 2021
c1bd69b
Sync warp proofs first
arkpar Jun 29, 2021
6b3c686
Merge branch 'master' of github.com:paritytech/substrate into a-warp-…
arkpar Jul 15, 2021
e5991c1
Added basic documentation
arkpar Jul 15, 2021
61ecbd5
Apply suggestions from code review
arkpar Jul 17, 2021
61eb22a
Style changes
arkpar Jul 17, 2021
a6d3787
Merge branch 'master' of github.com:paritytech/substrate into a-warp-…
arkpar Jul 17, 2021
9d3c2da
Merge branch 'master' of github.com:paritytech/substrate into a-warp-…
arkpar Jul 17, 2021
681452b
Apply suggestions from code review
arkpar Jul 17, 2021
5e4e225
Merge commit '1d5abf0' into a-warp-sync
arkpar Jul 22, 2021
4a4bd28
Merge branch 'master' of github.com:paritytech/substrate into a-warp-…
arkpar Jul 22, 2021
2b577bf
fmt
arkpar Jul 22, 2021
e562fd5
Apply suggestions from code review
arkpar Jul 22, 2021
1c27a28
Fixed chage trie pruning wrt missing blocks
arkpar Jul 23, 2021
8dfd07f
Restore parent finalization
arkpar Jul 23, 2021
fc8b9fc
fmt
arkpar Jul 23, 2021
2e3ad35
Merge branch 'master' of github.com:paritytech/substrate into a-warp-…
arkpar Jul 23, 2021
f07d173
fmt
arkpar Jul 23, 2021
401b98d
Revert pwasm-utils bump
arkpar Jul 23, 2021
d95ca0e
Change error type & check API version
arkpar Jul 29, 2021
f2c9dd7
Apply suggestions from code review
arkpar Jul 30, 2021
0569ac0
Merge branch 'a-warp-sync' of github.com:paritytech/substrate into a-…
arkpar Jul 30, 2021
bf12779
Build fix
arkpar Jul 30, 2021
9aea448
Fixed target block check
arkpar Jul 30, 2021
f2cde3f
Merge branch 'master' of github.com:paritytech/substrate into a-warp-…
arkpar Jul 30, 2021
78de046
Formatting
arkpar Jul 30, 2021
b6e8bfe
Merge branch 'master' of github.com:paritytech/substrate into a-warp-…
arkpar Aug 2, 2021
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
63 changes: 19 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ members = [
"client/executor/wasmi",
"client/executor/wasmtime",
"client/finality-grandpa",
"client/finality-grandpa-warp-sync",
"client/informant",
"client/keystore",
"client/light",
Expand Down
11 changes: 11 additions & 0 deletions bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
}

config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config());
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
));

let (network, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
Expand All @@ -172,6 +176,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
import_queue,
on_demand: None,
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;

if config.offchain_worker.enabled {
Expand Down Expand Up @@ -380,6 +385,11 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
telemetry: telemetry.as_ref().map(|x| x.handle()),
})?;

let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
));

let (network, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
Expand All @@ -389,6 +399,7 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
import_queue,
on_demand: Some(on_demand.clone()),
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;

if config.offchain_worker.enabled {
Expand Down
4 changes: 4 additions & 0 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ impl_runtime_apis! {
Grandpa::grandpa_authorities()
}

fn current_set_id() -> fg_primitives::SetId {
Grandpa::current_set_id()
}

fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
Expand Down
2 changes: 0 additions & 2 deletions bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ sc-service = { version = "0.10.0-dev", default-features = false, path = "../../.
sc-tracing = { version = "4.0.0-dev", path = "../../../client/tracing" }
sc-telemetry = { version = "4.0.0-dev", path = "../../../client/telemetry" }
sc-authority-discovery = { version = "0.10.0-dev", path = "../../../client/authority-discovery" }
sc-finality-grandpa-warp-sync = { version = "0.10.0-dev", path = "../../../client/finality-grandpa-warp-sync", optional = true }

# frame dependencies
pallet-indices = { version = "4.0.0-dev", path = "../../../frame/indices" }
Expand Down Expand Up @@ -161,7 +160,6 @@ cli = [
"frame-benchmarking-cli",
"substrate-frame-cli",
"sc-service/db",
"sc-finality-grandpa-warp-sync",
"structopt",
"substrate-build-script-utils",
"try-runtime-cli",
Expand Down
21 changes: 11 additions & 10 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,10 @@ pub fn new_full_base(
let auth_disc_publish_non_global_ips = config.network.allow_non_globals_in_dht;

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(),
import_setup.1.shared_authority_set().clone(),
),
);
let warp_sync = Arc::new(grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
import_setup.1.shared_authority_set().clone(),
));

let (network, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
Expand All @@ -248,6 +242,7 @@ pub fn new_full_base(
import_queue,
on_demand: None,
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;

if config.offchain_worker.enabled {
Expand Down Expand Up @@ -512,6 +507,11 @@ pub fn new_light_base(
telemetry.as_ref().map(|x| x.handle()),
)?;

let warp_sync = Arc::new(grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
));

let (network, system_rpc_tx, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
Expand All @@ -521,6 +521,7 @@ pub fn new_light_base(
import_queue,
on_demand: Some(on_demand.clone()),
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
})?;

let enable_grandpa = !config.disable_grandpa;
Expand Down
4 changes: 4 additions & 0 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,10 @@ impl_runtime_apis! {
Grandpa::grandpa_authorities()
}

fn current_set_id() -> fg_primitives::SetId {
Grandpa::current_set_id()
}

fn submit_report_equivocation_unsigned_extrinsic(
equivocation_proof: fg_primitives::EquivocationProof<
<Block as BlockT>::Hash,
Expand Down
3 changes: 3 additions & 0 deletions client/cli/src/arg_enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ arg_enum! {
Fast,
// Download blocks without executing them. Download latest state without proofs.
FastUnsafe,
// Prove finality and download the latest state.
Warp,
}
}

Expand All @@ -253,6 +255,7 @@ impl Into<sc_network::config::SyncMode> for SyncMode {
sc_network::config::SyncMode::Fast { skip_proofs: false, storage_chain_mode: false },
SyncMode::FastUnsafe =>
sc_network::config::SyncMode::Fast { skip_proofs: true, storage_chain_mode: false },
SyncMode::Warp => sc_network::config::SyncMode::Warp,
}
}
}
Expand Down
Loading