From ea42f734dc4a366264b8a123eb5d260b7af9e0ba Mon Sep 17 00:00:00 2001 From: Andreas Doerr Date: Wed, 12 May 2021 16:03:48 +0200 Subject: [PATCH] Use BeefyParams (#3013) --- polkadot/Cargo.lock | 8 ++++---- polkadot/node/service/src/lib.rs | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index 8556b2b934..728cd01676 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -458,7 +458,7 @@ checksum = "6736e2428df2ca2848d846c43e88745121a6654696e349ce0054a420815a7409" [[package]] name = "beefy-gadget" version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#bbe388331d9e80ec282b53a15c2dce56b342cefd" +source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#6008d67f94262f955017fad3c1648e3206756a60" dependencies = [ "beefy-primitives", "futures 0.3.14", @@ -486,7 +486,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#bbe388331d9e80ec282b53a15c2dce56b342cefd" +source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#6008d67f94262f955017fad3c1648e3206756a60" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -507,7 +507,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#bbe388331d9e80ec282b53a15c2dce56b342cefd" +source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#6008d67f94262f955017fad3c1648e3206756a60" dependencies = [ "parity-scale-codec", "sp-api", @@ -4535,7 +4535,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "0.1.0" -source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#bbe388331d9e80ec282b53a15c2dce56b342cefd" +source = "git+https://github.com/paritytech/grandpa-bridge-gadget?branch=master#6008d67f94262f955017fad3c1648e3206756a60" dependencies = [ "beefy-primitives", "frame-support", diff --git a/polkadot/node/service/src/lib.rs b/polkadot/node/service/src/lib.rs index a8554d075c..fde49cacd8 100644 --- a/polkadot/node/service/src/lib.rs +++ b/polkadot/node/service/src/lib.rs @@ -974,14 +974,18 @@ pub fn new_full( // We currently only run the BEEFY gadget on the Rococo and Wococo testnets. if !disable_beefy && (chain_spec.is_rococo() || chain_spec.is_wococo()) { - let gadget = beefy_gadget::start_beefy_gadget::<_, beefy_primitives::ecdsa::AuthorityPair, _, _, _, _>( - client.clone(), - keystore_opt.clone(), - network.clone(), - beefy_link, - network.clone(), - if chain_spec.is_wococo() { 4 } else { 8 }, - prometheus_registry.clone() + let beefy_params = beefy_gadget::BeefyParams { + client: client.clone(), + backend: backend.clone(), + key_store: keystore_opt.clone(), + network: network.clone(), + signed_commitment_sender: beefy_link, + min_block_delta: if chain_spec.is_wococo() { 4 } else { 8 }, + prometheus_registry: prometheus_registry.clone(), + }; + + let gadget = beefy_gadget::start_beefy_gadget::<_, beefy_primitives::ecdsa::AuthorityPair, _, _, _>( + beefy_params ); // Wococo's purpose is to be a testbed for BEEFY, so if it fails we'll