Bump substrate/polkadot/cumulus (#1962)

* Bump substrate/polkadot/cumulus

* sp_finality_grandpa - >sp_consensus_grandpa

* sp_beefy -> sp_consensus_beefy

* pallet_randomness_collective_flip -> pallet_insecure_randomness_collective_flip

* fix

* Cumulus parachain stuff

* Cumulus parachain stuff one more

* Millau/Rialto runtimes

* Removed pallet_insecure_randomness_collective_flip

* Millau node

* Removed session historial

* TMP: just try disable all fetches

* Docs in gitlab.yml
This commit is contained in:
Branislav Kontur
2023-03-14 13:03:40 +01:00
committed by Bastian Köcher
parent a1c6502d9a
commit 874ab44e00
38 changed files with 184 additions and 157 deletions
+7 -6
View File
@@ -19,9 +19,9 @@ millau-runtime = { path = "../runtime" }
# Substrate Dependencies
beefy-gadget = { git = "https://github.com/paritytech/substrate", branch = "master" }
beefy-gadget-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-beefy = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus-beefy = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus-beefy-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-beefy = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
node-inspect = { git = "https://github.com/paritytech/substrate", branch = "master" }
@@ -33,8 +33,8 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-finality-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }
@@ -42,10 +42,11 @@ sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "mast
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
+2 -2
View File
@@ -19,10 +19,10 @@ use millau_runtime::{
BridgeRialtoParachainMessagesConfig, BridgeWestendGrandpaConfig, GenesisConfig, GrandpaConfig,
SessionConfig, SessionKeys, Signature, SudoConfig, SystemConfig, WASM_BINARY,
};
use sp_beefy::crypto::AuthorityId as BeefyId;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_consensus_beefy::crypto::AuthorityId as BeefyId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::{sr25519, Pair, Public};
use sp_finality_grandpa::AuthorityId as GrandpaId;
use sp_runtime::traits::{IdentifyAccount, Verify};
/// "Names" of the authorities accounts at local testnet.
+37 -28
View File
@@ -20,8 +20,8 @@ use jsonrpsee::RpcModule;
use millau_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::BlockBackend;
use sc_consensus_aura::{CompatibilityMode, ImportQueueParams, SlotProportion, StartAuraParams};
use sc_consensus_grandpa::SharedVoterState;
pub use sc_executor::NativeElseWasmExecutor;
use sc_finality_grandpa::SharedVoterState;
use sc_keystore::LocalKeystore;
use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
use sc_telemetry::{Telemetry, TelemetryWorker};
@@ -64,15 +64,15 @@ pub fn new_partial(
sc_consensus::DefaultImportQueue<Block, FullClient>,
sc_transaction_pool::FullPool<Block, FullClient>,
(
sc_finality_grandpa::GrandpaBlockImport<
sc_consensus_grandpa::GrandpaBlockImport<
FullBackend,
Block,
FullClient,
FullSelectChain,
>,
sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
beefy_gadget::BeefyVoterLinks<Block>,
beefy_gadget::BeefyRPCLinks<Block>,
sc_consensus_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
sc_consensus_beefy::BeefyVoterLinks<Block>,
sc_consensus_beefy::BeefyRPCLinks<Block>,
Option<Telemetry>,
),
>,
@@ -123,7 +123,7 @@ pub fn new_partial(
client.clone(),
);
let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import(
client.clone(),
&client,
select_chain.clone(),
@@ -131,10 +131,11 @@ pub fn new_partial(
)?;
let (beefy_block_import, beefy_voter_links, beefy_rpc_links) =
beefy_gadget::beefy_block_import_and_links(
sc_consensus_beefy::beefy_block_import_and_links(
grandpa_block_import.clone(),
backend.clone(),
client.clone(),
config.prometheus_registry().cloned(),
);
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
@@ -183,6 +184,8 @@ fn remote_keystore(_url: &str) -> Result<Arc<LocalKeystore>, &'static str> {
/// Builds a new service for a full client.
pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError> {
use sc_network_common::sync::warp::WarpSyncParams;
let sc_service::PartialComponents {
client,
backend,
@@ -209,38 +212,41 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
// Note: GrandPa is pushed before the Polkadot-specific protocols. This doesn't change
// anything in terms of behaviour, but makes the logs more consistent with the other
// Substrate nodes.
let grandpa_protocol_name = sc_finality_grandpa::protocol_standard_name(
let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name(
&client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"),
&config.chain_spec,
);
config
.network
.extra_sets
.push(sc_finality_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()));
.push(sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()));
let beefy_gossip_proto_name =
beefy_gadget::gossip_protocol_name(genesis_hash, config.chain_spec.fork_id());
sc_consensus_beefy::gossip_protocol_name(genesis_hash, config.chain_spec.fork_id());
// `beefy_on_demand_justifications_handler` is given to `beefy-gadget` task to be run,
// while `beefy_req_resp_cfg` is added to `config.network.request_response_protocols`.
let (beefy_on_demand_justifications_handler, beefy_req_resp_cfg) =
beefy_gadget::communication::request_response::BeefyJustifsRequestHandler::new(
sc_consensus_beefy::communication::request_response::BeefyJustifsRequestHandler::new(
genesis_hash,
config.chain_spec.fork_id(),
client.clone(),
config.prometheus_registry().cloned(),
);
config
.network
.extra_sets
.push(beefy_gadget::communication::beefy_peers_set_config(beefy_gossip_proto_name.clone()));
.push(sc_consensus_beefy::communication::beefy_peers_set_config(
beefy_gossip_proto_name.clone(),
));
config.network.request_response_protocols.push(beefy_req_resp_cfg);
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
Vec::default(),
));
let (network, system_rpc_tx, tx_handler_controller, network_starter) =
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
client: client.clone(),
@@ -248,7 +254,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
spawn_handle: task_manager.spawn_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync: Some(warp_sync),
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)),
})?;
if config.offchain_worker.enabled {
@@ -269,12 +275,12 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let shared_voter_state = SharedVoterState::empty();
let rpc_extensions_builder = {
use sc_finality_grandpa::FinalityProofProvider as GrandpaFinalityProofProvider;
use sc_consensus_grandpa::FinalityProofProvider as GrandpaFinalityProofProvider;
use beefy_gadget_rpc::{Beefy, BeefyApiServer};
use mmr_rpc::{Mmr, MmrApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use sc_finality_grandpa_rpc::{Grandpa, GrandpaApiServer};
use sc_consensus_beefy_rpc::{Beefy, BeefyApiServer};
use sc_consensus_grandpa_rpc::{Grandpa, GrandpaApiServer};
use sc_rpc::DenyUnsafe;
use substrate_frame_rpc_system::{System, SystemApiServer};
@@ -329,6 +335,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
keystore: keystore_container.sync_keystore(),
task_manager: &mut task_manager,
transaction_pool: transaction_pool.clone(),
sync_service: sync_service.clone(),
rpc_builder: rpc_extensions_builder,
backend: backend.clone(),
system_rpc_tx,
@@ -369,8 +376,8 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
force_authoring,
backoff_authoring_blocks,
keystore: keystore_container.sync_keystore(),
sync_oracle: network.clone(),
justification_sync_link: network.clone(),
sync_oracle: sync_service.clone(),
justification_sync_link: sync_service.clone(),
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
max_block_proposal_slot_portion: None,
telemetry: telemetry.as_ref().map(|x| x.handle()),
@@ -391,15 +398,16 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
let justifications_protocol_name = beefy_on_demand_justifications_handler.protocol_name();
let payload_provider = sp_beefy::mmr::MmrRootProvider::new(client.clone());
let beefy_params = beefy_gadget::BeefyParams {
let payload_provider = sp_consensus_beefy::mmr::MmrRootProvider::new(client.clone());
let beefy_params = sc_consensus_beefy::BeefyParams {
client: client.clone(),
backend,
payload_provider,
runtime: client,
key_store: keystore.clone(),
network_params: beefy_gadget::BeefyNetworkParams {
network_params: sc_consensus_beefy::BeefyNetworkParams {
network: network.clone(),
sync: sync_service.clone(),
gossip_protocol_name: beefy_gossip_proto_name,
justifications_protocol_name,
_phantom: core::marker::PhantomData::<Block>,
@@ -414,10 +422,10 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
task_manager.spawn_essential_handle().spawn_blocking(
"beefy-gadget",
None,
beefy_gadget::start_beefy_gadget::<_, _, _, _, _, _>(beefy_params),
sc_consensus_beefy::start_beefy_gadget::<_, _, _, _, _, _, _>(beefy_params),
);
let grandpa_config = sc_finality_grandpa::Config {
let grandpa_config = sc_consensus_grandpa::Config {
// FIXME #1578 make this available through chainspec
gossip_duration: Duration::from_millis(333),
justification_period: 512,
@@ -436,11 +444,12 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
// and vote data availability than the observer. The observer has not
// been tested extensively yet and having most nodes in a network run it
// could lead to finality stalls.
let grandpa_config = sc_finality_grandpa::GrandpaParams {
let grandpa_config = sc_consensus_grandpa::GrandpaParams {
config: grandpa_config,
link: grandpa_link,
network,
voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
sync: sync_service,
voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(),
prometheus_registry,
shared_voter_state,
telemetry: telemetry.as_ref().map(|x| x.handle()),
@@ -451,7 +460,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
task_manager.spawn_essential_handle().spawn_blocking(
"grandpa-voter",
None,
sc_finality_grandpa::run_grandpa_voter(grandpa_config)?,
sc_consensus_grandpa::run_grandpa_voter(grandpa_config)?,
);
}
+3 -5
View File
@@ -31,7 +31,7 @@ pallet-shift-session-manager = { path = "../../../modules/shift-session-manager"
# Substrate Dependencies
sp-beefy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-beefy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -43,8 +43,7 @@ pallet-beefy = { git = "https://github.com/paritytech/substrate", branch = "mast
pallet-beefy-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["historical"]}
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -80,7 +79,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran
[features]
default = ["std"]
std = [
"sp-beefy/std",
"sp-consensus-beefy/std",
"bp-messages/std",
"bp-millau/std",
"bp-parachains/std",
@@ -106,7 +105,6 @@ std = [
"pallet-bridge-relayers/std",
"pallet-grandpa/std",
"pallet-mmr/std",
"pallet-randomness-collective-flip/std",
"pallet-session/std",
"pallet-shift-session-manager/std",
"pallet-sudo/std",
+24 -15
View File
@@ -41,9 +41,9 @@ use pallet_grandpa::{
};
use pallet_transaction_payment::{FeeDetails, Multiplier, RuntimeDispatchInfo};
use sp_api::impl_runtime_apis;
use sp_beefy::{crypto::AuthorityId as BeefyId, mmr::MmrLeafVersion, ValidatorSet};
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
use sp_consensus_beefy::{crypto::AuthorityId as BeefyId, mmr::MmrLeafVersion, ValidatorSet};
use sp_core::OpaqueMetadata;
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{Block as BlockT, IdentityLookup, Keccak256, NumberFor, OpaqueKeys},
@@ -223,8 +223,6 @@ impl frame_system::Config for Runtime {
type MaxConsumers = frame_support::traits::ConstU32<16>;
}
impl pallet_randomness_collective_flip::Config for Runtime {}
impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type MaxAuthorities = ConstU32<10>;
@@ -234,23 +232,21 @@ impl pallet_aura::Config for Runtime {
impl pallet_beefy::Config for Runtime {
type BeefyId = BeefyId;
type MaxAuthorities = ConstU32<10>;
type MaxSetIdSessionEntries = ConstU64<0>;
type OnNewValidatorSet = MmrLeaf;
type WeightInfo = ();
type KeyOwnerProof = sp_core::Void;
type EquivocationReportSystem = ();
}
impl pallet_grandpa::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type KeyOwnerProofSystem = ();
type KeyOwnerProof =
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
KeyTypeId,
GrandpaId,
)>>::IdentificationTuple;
type HandleEquivocation = ();
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
type WeightInfo = ();
type MaxAuthorities = ConstU32<10>;
type MaxSetIdSessionEntries = ConstU64<0>;
type KeyOwnerProof = sp_core::Void;
type EquivocationReportSystem = ();
}
/// MMR helper types.
@@ -292,7 +288,7 @@ parameter_types! {
pub struct BeefyDummyDataProvider;
impl sp_beefy::mmr::BeefyDataProvider<()> for BeefyDummyDataProvider {
impl sp_consensus_beefy::mmr::BeefyDataProvider<()> for BeefyDummyDataProvider {
fn extra_data() {}
}
@@ -555,7 +551,6 @@ construct_runtime!(
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>},
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event},
ShiftSessionManager: pallet_shift_session_manager::{Pallet},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage},
// BEEFY Bridges support.
Beefy: pallet_beefy::{Pallet, Storage, Config<T>},
@@ -743,7 +738,7 @@ impl_runtime_apis! {
}
}
impl sp_beefy::BeefyApi<Block> for Runtime {
impl sp_consensus_beefy::BeefyApi<Block> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
Beefy::genesis_block()
}
@@ -751,6 +746,20 @@ impl_runtime_apis! {
fn validator_set() -> Option<ValidatorSet<BeefyId>> {
Beefy::validator_set()
}
fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: sp_consensus_beefy::EquivocationProof<
NumberFor<Block>,
sp_consensus_beefy::crypto::AuthorityId,
sp_consensus_beefy::crypto::Signature
>,
_key_owner_proof: sp_consensus_beefy::OpaqueKeyOwnershipProof,
) -> Option<()> { None }
fn generate_key_ownership_proof(
_set_id: sp_consensus_beefy::ValidatorSetId,
_authority_id: sp_consensus_beefy::crypto::AuthorityId,
) -> Option<sp_consensus_beefy::OpaqueKeyOwnershipProof> { None }
}
impl pallet_mmr::primitives::MmrApi<
@@ -45,6 +45,7 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network-sync = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master"}
@@ -38,11 +38,12 @@ use cumulus_client_service::{
prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams,
};
use cumulus_primitives_core::ParaId;
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface};
use cumulus_relay_chain_interface::RelayChainInterface;
use sc_consensus::ImportQueue;
// Substrate Imports
use sc_executor::{NativeElseWasmExecutor, NativeExecutionDispatch};
use sc_network::{NetworkBlock, NetworkService};
use sc_network::NetworkBlock;
use sc_network_sync::SyncingService;
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
use sp_api::ConstructRuntimeApi;
@@ -54,7 +55,6 @@ use substrate_prometheus_endpoint::Registry;
type BlockNumber = u32;
type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::BlakeTwo256>;
pub type Block = sp_runtime::generic::Block<Header, sp_runtime::OpaqueExtrinsic>;
type Hash = sp_core::H256;
type ParachainClient<RuntimeApi> =
TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<ParachainRuntimeExecutor>>;
@@ -236,7 +236,7 @@ where
&TaskManager,
Arc<dyn RelayChainInterface>,
Arc<sc_transaction_pool::FullPool<Block, ParachainClient<RuntimeApi>>>,
Arc<NetworkService<Block, Hash>>,
Arc<SyncingService<Block>>,
SyncCryptoStorePtr,
bool,
) -> Result<Box<dyn ParachainConsensus<Block>>, sc_service::Error>,
@@ -257,10 +257,7 @@ where
None,
)
.await
.map_err(|e| match e {
RelayChainError::ServiceError(polkadot_service::Error::Sub(x)) => x,
s => s.to_string().into(),
})?;
.map_err(|e| sc_service::Error::Application(Box::new(e) as Box<_>))?;
let client = params.client.clone();
let backend = params.backend.clone();
@@ -272,7 +269,7 @@ where
let transaction_pool = params.transaction_pool.clone();
let import_queue_service = params.import_queue.service();
let (network, system_rpc_tx, tx_handler_controller, start_network) =
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &parachain_config,
client: client.clone(),
@@ -282,7 +279,7 @@ where
block_announce_validator_builder: Some(Box::new(|_| {
Box::new(block_announce_validator)
})),
warp_sync: None,
warp_sync_params: None,
})?;
let rpc_client = client.clone();
@@ -300,18 +297,23 @@ where
keystore: params.keystore_container.sync_keystore(),
backend: backend.clone(),
network: network.clone(),
sync_service: sync_service.clone(),
system_rpc_tx,
tx_handler_controller,
telemetry: telemetry.as_mut(),
})?;
let announce_block = {
let network = network.clone();
Arc::new(move |hash, data| network.announce_block(hash, data))
let sync_service = sync_service.clone();
Arc::new(move |hash, data| sync_service.announce_block(hash, data))
};
let relay_chain_slot_duration = Duration::from_secs(6);
let overseer_handle = relay_chain_interface
.overseer_handle()
.map_err(|e| sc_service::Error::Application(Box::new(e)))?;
if validator {
let parachain_consensus = build_consensus(
client.clone(),
@@ -321,7 +323,7 @@ where
&task_manager,
relay_chain_interface.clone(),
transaction_pool,
network,
sync_service,
params.keystore_container.sync_keystore(),
force_authoring,
)?;
@@ -340,6 +342,7 @@ where
import_queue: import_queue_service,
collator_key: collator_key.expect("Command line arguments do not allow this. qed"),
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle),
};
start_collator(params).await?;
@@ -352,6 +355,7 @@ where
relay_chain_interface,
relay_chain_slot_duration,
import_queue: import_queue_service,
recovery_handle: Box::new(overseer_handle),
};
start_full_node(params)?;
@@ -52,7 +52,6 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate"
## Substrate Pallet Dependencies
pallet-aura = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -116,7 +115,6 @@ std = [
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
"pallet-bridge-relayers/std",
"pallet-randomness-collective-flip/std",
"pallet-timestamp/std",
"pallet-sudo/std",
"pallet-transaction-payment/std",
@@ -302,8 +302,6 @@ impl parachain_info::Config for Runtime {}
impl cumulus_pallet_aura_ext::Config for Runtime {}
impl pallet_randomness_collective_flip::Config for Runtime {}
parameter_types! {
pub const RelayLocation: MultiLocation = MultiLocation::parent();
pub const RelayNetwork: NetworkId = CustomNetworkId::Rialto.as_network_id();
@@ -588,7 +586,6 @@ construct_runtime!(
System: frame_system::{Pallet, Call, Storage, Config, Event<T>},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event<T>},
ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Storage, Inherent, Event<T>} = 20,
+2 -2
View File
@@ -18,7 +18,7 @@ rialto-runtime = { path = "../runtime" }
# Substrate Dependencies
sp-beefy = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-beefy = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master" }
@@ -29,7 +29,7 @@ sc-service = { git = "https://github.com/paritytech/substrate", branch = "master
sp-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
# Polkadot Dependencies
+2 -2
View File
@@ -23,10 +23,10 @@ use rialto_runtime::{
};
use serde_json::json;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_beefy::crypto::AuthorityId as BeefyId;
use sp_consensus_babe::AuthorityId as BabeId;
use sp_consensus_beefy::crypto::AuthorityId as BeefyId;
use sp_consensus_grandpa::AuthorityId as GrandpaId;
use sp_core::{sr25519, Pair, Public};
use sp_finality_grandpa::AuthorityId as GrandpaId;
use sp_runtime::traits::{IdentifyAccount, Verify};
/// "Names" of the authorities accounts at local testnet.
+4 -3
View File
@@ -26,7 +26,7 @@ pallet-shift-session-manager = { path = "../../../modules/shift-session-manager"
# Substrate Dependencies
sp-beefy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
sp-consensus-beefy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -39,7 +39,7 @@ pallet-beefy = { git = "https://github.com/paritytech/substrate", branch = "mast
pallet-beefy-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["historical"]}
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -78,7 +78,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran
[features]
default = ["std"]
std = [
"sp-beefy/std",
"sp-consensus-beefy/std",
"bp-messages/std",
"bp-millau/std",
"bp-relayers/std",
@@ -103,6 +103,7 @@ std = [
"pallet-grandpa/std",
"pallet-mmr/std",
"pallet-xcm/std",
"pallet-session/std",
"pallet-shift-session-manager/std",
"pallet-sudo/std",
"pallet-timestamp/std",
+33 -28
View File
@@ -39,8 +39,8 @@ use pallet_grandpa::{
use pallet_transaction_payment::{FeeDetails, Multiplier, RuntimeDispatchInfo};
use sp_api::impl_runtime_apis;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_beefy::{crypto::AuthorityId as BeefyId, mmr::MmrLeafVersion, ValidatorSet};
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
use sp_consensus_beefy::{crypto::AuthorityId as BeefyId, mmr::MmrLeafVersion, ValidatorSet};
use sp_core::OpaqueMetadata;
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
traits::{AccountIdLookup, Block as BlockT, Keccak256, NumberFor, OpaqueKeys},
@@ -225,56 +225,47 @@ parameter_types! {
impl pallet_babe::Config for Runtime {
type EpochDuration = EpochDuration;
type ExpectedBlockTime = ExpectedBlockTime;
type MaxAuthorities = ConstU32<10>;
// session module is the trigger
type EpochChangeTrigger = pallet_babe::ExternalTrigger;
// equivocation related configuration - we don't expect any equivocations in our testnets
type KeyOwnerProofSystem = ();
type KeyOwnerProof = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
KeyTypeId,
pallet_babe::AuthorityId,
)>>::Proof;
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
KeyTypeId,
pallet_babe::AuthorityId,
)>>::IdentificationTuple;
type HandleEquivocation = ();
type DisabledValidators = ();
type WeightInfo = ();
type MaxAuthorities = ConstU32<10>;
// equivocation related configuration - we don't expect any equivocations in our testnets
type KeyOwnerProof = sp_core::Void;
type EquivocationReportSystem = ();
}
impl pallet_beefy::Config for Runtime {
type BeefyId = BeefyId;
type MaxAuthorities = ConstU32<10>;
type MaxSetIdSessionEntries = ConstU64<0>;
type OnNewValidatorSet = MmrLeaf;
type WeightInfo = ();
type KeyOwnerProof = sp_core::Void;
type EquivocationReportSystem = ();
}
impl pallet_grandpa::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type MaxAuthorities = ConstU32<10>;
type KeyOwnerProofSystem = ();
type KeyOwnerProof =
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
KeyTypeId,
GrandpaId,
)>>::IdentificationTuple;
type HandleEquivocation = ();
// TODO: update me (https://github.com/paritytech/parity-bridges-common/issues/78)
type WeightInfo = ();
type MaxAuthorities = ConstU32<10>;
type MaxSetIdSessionEntries = ConstU64<0>;
type KeyOwnerProof = sp_core::Void;
type EquivocationReportSystem = ();
}
impl pallet_mmr::Config for Runtime {
const INDEXING_PREFIX: &'static [u8] = b"mmr";
type Hashing = Keccak256;
type Hash = <Keccak256 as sp_runtime::traits::Hash>::Output;
type LeafData = pallet_beefy_mmr::Pallet<Runtime>;
type OnNewRoot = pallet_beefy_mmr::DepositBeefyDigest<Runtime>;
type WeightInfo = ();
type LeafData = pallet_beefy_mmr::Pallet<Runtime>;
}
parameter_types! {
@@ -296,7 +287,7 @@ parameter_types! {
pub struct BeefyDummyDataProvider;
impl sp_beefy::mmr::BeefyDataProvider<()> for BeefyDummyDataProvider {
impl sp_consensus_beefy::mmr::BeefyDataProvider<()> for BeefyDummyDataProvider {
fn extra_data() {}
}
@@ -616,7 +607,7 @@ impl_runtime_apis! {
}
}
impl sp_beefy::BeefyApi<Block> for Runtime {
impl sp_consensus_beefy::BeefyApi<Block> for Runtime {
fn beefy_genesis() -> Option<BlockNumber> {
Beefy::genesis_block()
}
@@ -624,6 +615,20 @@ impl_runtime_apis! {
fn validator_set() -> Option<ValidatorSet<BeefyId>> {
Beefy::validator_set()
}
fn submit_report_equivocation_unsigned_extrinsic(
_equivocation_proof: sp_consensus_beefy::EquivocationProof<
NumberFor<Block>,
sp_consensus_beefy::crypto::AuthorityId,
sp_consensus_beefy::crypto::Signature
>,
_key_owner_proof: sp_consensus_beefy::OpaqueKeyOwnershipProof,
) -> Option<()> { None }
fn generate_key_ownership_proof(
_set_id: sp_consensus_beefy::ValidatorSetId,
_authority_id: sp_consensus_beefy::crypto::AuthorityId,
) -> Option<sp_consensus_beefy::OpaqueKeyOwnershipProof> { None }
}
impl pallet_mmr::primitives::MmrApi<
+1 -1
View File
@@ -25,7 +25,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
[dev-dependencies]
sp-beefy = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-beefy = { git = "https://github.com/paritytech/substrate", branch = "master" }
mmr-lib = { package = "ckb-merkle-mountain-range", version = "0.3.2" }
pallet-beefy-mmr = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master" }
+1 -1
View File
@@ -419,7 +419,7 @@ mod tests {
use frame_support::{assert_noop, assert_ok, traits::Get};
use mock::*;
use mock_chain::*;
use sp_beefy::mmr::BeefyAuthoritySet;
use sp_consensus_beefy::mmr::BeefyAuthoritySet;
use sp_runtime::DispatchError;
fn next_block() {
+2 -2
View File
@@ -32,7 +32,7 @@ use sp_runtime::{
Perbill,
};
pub use sp_beefy::crypto::{AuthorityId as BeefyId, Pair as BeefyPair};
pub use sp_consensus_beefy::crypto::{AuthorityId as BeefyId, Pair as BeefyPair};
use sp_core::crypto::Wraps;
use sp_runtime::traits::Keccak256;
@@ -49,7 +49,7 @@ pub type TestBridgedMmrHashing = BridgedMmrHashing<TestRuntime, ()>;
pub type TestBridgedMmrHash = BridgedMmrHash<TestRuntime, ()>;
pub type TestBridgedBeefyMmrLeafExtra = BridgedBeefyMmrLeafExtra<TestRuntime, ()>;
pub type TestBridgedMmrProof = BridgedMmrProof<TestRuntime, ()>;
pub type TestBridgedRawMmrLeaf = sp_beefy::mmr::MmrLeaf<
pub type TestBridgedRawMmrLeaf = sp_consensus_beefy::mmr::MmrLeaf<
TestBridgedBlockNumber,
TestBridgedBlockHash,
TestBridgedMmrHash,
+2 -2
View File
@@ -30,7 +30,7 @@ use bp_beefy::{BeefyPayload, Commitment, ValidatorSetId, MMR_ROOT_PAYLOAD_ID};
use codec::Encode;
use pallet_mmr::NodeIndex;
use rand::Rng;
use sp_beefy::mmr::{BeefyNextAuthoritySet, MmrLeafVersion};
use sp_consensus_beefy::mmr::{BeefyNextAuthoritySet, MmrLeafVersion};
use sp_core::Pair;
use sp_runtime::traits::{Hash, Header as HeaderT};
use std::collections::HashMap;
@@ -188,7 +188,7 @@ impl HeaderBuilder {
next_validator_keys.iter().map(|pair| pair.public()).collect::<Vec<_>>();
let next_validators_mmr_root =
get_authorities_mmr_root::<TestRuntime, (), _>(next_validators.iter());
let leaf = sp_beefy::mmr::MmrLeaf {
let leaf = sp_consensus_beefy::mmr::MmrLeaf {
version: MmrLeafVersion::new(1, 0),
parent_number_and_hash: (header.number().saturating_sub(1), *header.parent_hash()),
beefy_next_authority_set: BeefyNextAuthoritySet {
+1 -1
View File
@@ -163,7 +163,7 @@ mod tests {
use crate::{mock::*, mock_chain::*, *};
use bp_beefy::{BeefyPayload, MMR_ROOT_PAYLOAD_ID};
use frame_support::{assert_noop, assert_ok};
use sp_beefy::ValidatorSet;
use sp_consensus_beefy::ValidatorSet;
#[test]
fn submit_commitment_checks_metadata() {
+2 -2
View File
@@ -22,7 +22,7 @@ bp-header-chain = { path = "../../primitives/header-chain", default-features = f
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -48,7 +48,7 @@ std = [
"frame-benchmarking/std",
"log/std",
"scale-info/std",
"sp-finality-grandpa/std",
"sp-consensus-grandpa/std",
"sp-runtime/std",
"sp-std/std",
"sp-trie/std",
+1 -1
View File
@@ -49,7 +49,7 @@ use bp_test_utils::{
};
use frame_benchmarking::{benchmarks_instance_pallet, whitelisted_caller};
use frame_system::RawOrigin;
use sp_finality_grandpa::AuthorityId;
use sp_consensus_grandpa::AuthorityId;
use sp_runtime::traits::{One, Zero};
use sp_std::vec::Vec;
+7 -7
View File
@@ -45,7 +45,7 @@ use bp_header_chain::{
use bp_runtime::{BlockNumberOf, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule};
use finality_grandpa::voter_set::VoterSet;
use frame_support::{dispatch::PostDispatchInfo, ensure};
use sp_finality_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID};
use sp_consensus_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID};
use sp_runtime::{
traits::{Header as HeaderT, Zero},
SaturatedConversion,
@@ -403,7 +403,7 @@ pub mod pallet {
/// Returned value will indicate if a change was enacted or not.
pub(crate) fn try_enact_authority_change<T: Config<I>, I: 'static>(
header: &BridgedHeader<T, I>,
current_set_id: sp_finality_grandpa::SetId,
current_set_id: sp_consensus_grandpa::SetId,
) -> Result<bool, sp_runtime::DispatchError> {
let mut change_enacted = false;
@@ -584,7 +584,7 @@ impl<T: Config<I>, I: 'static> HeaderChain<BridgedChain<T, I>> for GrandpaChainH
pub(crate) fn find_scheduled_change<H: HeaderT>(
header: &H,
) -> Option<sp_finality_grandpa::ScheduledChange<H::Number>> {
) -> Option<sp_consensus_grandpa::ScheduledChange<H::Number>> {
use sp_runtime::generic::OpaqueDigestItemId;
let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID);
@@ -603,7 +603,7 @@ pub(crate) fn find_scheduled_change<H: HeaderT>(
/// extracts it.
pub(crate) fn find_forced_change<H: HeaderT>(
header: &H,
) -> Option<(H::Number, sp_finality_grandpa::ScheduledChange<H::Number>)> {
) -> Option<(H::Number, sp_consensus_grandpa::ScheduledChange<H::Number>)> {
use sp_runtime::generic::OpaqueDigestItemId;
let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID);
@@ -695,7 +695,7 @@ mod tests {
fn change_log(delay: u64) -> Digest {
let consensus_log =
ConsensusLog::<TestNumber>::ScheduledChange(sp_finality_grandpa::ScheduledChange {
ConsensusLog::<TestNumber>::ScheduledChange(sp_consensus_grandpa::ScheduledChange {
next_authorities: vec![(ALICE.into(), 1), (BOB.into(), 1)],
delay,
});
@@ -706,7 +706,7 @@ mod tests {
fn forced_change_log(delay: u64) -> Digest {
let consensus_log = ConsensusLog::<TestNumber>::ForcedChange(
delay,
sp_finality_grandpa::ScheduledChange {
sp_consensus_grandpa::ScheduledChange {
next_authorities: vec![(ALICE.into(), 1), (BOB.into(), 1)],
delay,
},
@@ -717,7 +717,7 @@ mod tests {
fn many_authorities_log() -> Digest {
let consensus_log =
ConsensusLog::<TestNumber>::ScheduledChange(sp_finality_grandpa::ScheduledChange {
ConsensusLog::<TestNumber>::ScheduledChange(sp_consensus_grandpa::ScheduledChange {
next_authorities: std::iter::repeat((ALICE.into(), 1))
.take(MAX_BRIDGED_AUTHORITIES as usize + 1)
.collect(),
+1 -1
View File
@@ -22,7 +22,7 @@ use bp_header_chain::{AuthoritySet, ChainWithGrandpa};
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::{traits::Get, BoundedVec, RuntimeDebugNoBound};
use scale_info::TypeInfo;
use sp_finality_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId};
use sp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId};
use sp_std::marker::PhantomData;
/// A bounded list of Grandpa authorities with associated weights.
+2 -2
View File
@@ -18,7 +18,7 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Dependencies
binary-merkle-tree = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-beefy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-beefy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-beefy-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-mmr = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -35,7 +35,7 @@ std = [
"pallet-mmr/std",
"scale-info/std",
"serde",
"sp-beefy/std",
"sp-consensus-beefy/std",
"sp-runtime/std",
"sp-std/std"
]
+9 -5
View File
@@ -25,7 +25,7 @@ pub use pallet_mmr::{
primitives::{DataOrHash as MmrDataOrHash, Proof as MmrProof},
verify_leaves_proof as verify_mmr_leaves_proof,
};
pub use sp_beefy::{
pub use sp_consensus_beefy::{
crypto::{AuthorityId as EcdsaValidatorId, AuthoritySignature as EcdsaValidatorSignature},
known_payloads::MMR_ROOT_ID as MMR_ROOT_PAYLOAD_ID,
mmr::{BeefyAuthoritySet, MmrLeafVersion},
@@ -51,7 +51,7 @@ use sp_std::prelude::*;
pub trait ChainWithBeefy: Chain {
/// The hashing algorithm used to compute the digest of the BEEFY commitment.
///
/// Corresponds to the hashing algorithm, used by `beefy_gadget::BeefyKeystore`.
/// Corresponds to the hashing algorithm, used by `sc_consensus_beefy::BeefyKeystore`.
type CommitmentHasher: sp_runtime::traits::Hash;
/// The hashing algorithm used to build the MMR.
@@ -95,7 +95,7 @@ pub type BeefyAuthorityIdOf<C> = <C as ChainWithBeefy>::AuthorityId;
/// BEEFY validator set, containing both validator identifiers and the numeric set id.
pub type BeefyAuthoritySetOf<C> = ValidatorSet<BeefyAuthorityIdOf<C>>;
/// BEEFY authority set, containing both validator identifiers and the numeric set id.
pub type BeefyAuthoritySetInfoOf<C> = sp_beefy::mmr::BeefyAuthoritySet<MmrHashOf<C>>;
pub type BeefyAuthoritySetInfoOf<C> = sp_consensus_beefy::mmr::BeefyAuthoritySet<MmrHashOf<C>>;
/// BEEFY validator signature used by given Substrate chain.
pub type BeefyValidatorSignatureOf<C> =
<<C as ChainWithBeefy>::AuthorityId as RuntimeAppPublic>::Signature;
@@ -116,8 +116,12 @@ pub type BeefyMmrLeafExtraOf<C> = <C as ChainWithBeefy>::BeefyMmrLeafExtra;
/// the given Substrate chain.
pub type BeefyAuthorityIdToMerkleLeafOf<C> = <C as ChainWithBeefy>::AuthorityIdToMerkleLeaf;
/// Actual type of leafs in the BEEFY MMR.
pub type BeefyMmrLeafOf<C> =
sp_beefy::mmr::MmrLeaf<BlockNumberOf<C>, HashOf<C>, MmrHashOf<C>, BeefyMmrLeafExtraOf<C>>;
pub type BeefyMmrLeafOf<C> = sp_consensus_beefy::mmr::MmrLeaf<
BlockNumberOf<C>,
HashOf<C>,
MmrHashOf<C>,
BeefyMmrLeafExtraOf<C>,
>;
/// Data required for initializing the BEEFY pallet.
///
+2 -2
View File
@@ -20,7 +20,7 @@ bp-runtime = { path = "../runtime", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -39,7 +39,7 @@ std = [
"frame-support/std",
"scale-info/std",
"sp-core/std",
"sp-finality-grandpa/std",
"sp-consensus-grandpa/std",
"sp-runtime/std",
"sp-std/std",
]
@@ -17,7 +17,7 @@
//! Pallet for checking GRANDPA Finality Proofs.
//!
//! Adapted copy of substrate/client/finality-grandpa/src/justification.rs. If origin
//! will ever be moved to the sp_finality_grandpa, we should reuse that implementation.
//! will ever be moved to the sp_consensus_grandpa, we should reuse that implementation.
use crate::ChainWithGrandpa;
@@ -26,7 +26,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
use finality_grandpa::voter_set::VoterSet;
use frame_support::RuntimeDebug;
use scale_info::TypeInfo;
use sp_finality_grandpa::{AuthorityId, AuthoritySignature, SetId};
use sp_consensus_grandpa::{AuthorityId, AuthoritySignature, SetId};
use sp_runtime::{traits::Header as HeaderT, SaturatedConversion};
use sp_std::{
collections::{btree_map::BTreeMap, btree_set::BTreeSet},
@@ -307,7 +307,7 @@ where
);
// verify authority signature
if !sp_finality_grandpa::check_message_signature_with_buffer(
if !sp_consensus_grandpa::check_message_signature_with_buffer(
&finality_grandpa::Message::Precommit(signed.precommit.clone()),
&signed.id,
&signed.signature,
+2 -2
View File
@@ -29,7 +29,7 @@ use frame_support::PalletError;
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_finality_grandpa::{AuthorityList, ConsensusLog, SetId, GRANDPA_ENGINE_ID};
use sp_consensus_grandpa::{AuthorityList, ConsensusLog, SetId, GRANDPA_ENGINE_ID};
use sp_runtime::{traits::Header as HeaderT, Digest, RuntimeDebug};
use sp_std::boxed::Box;
@@ -145,7 +145,7 @@ pub struct GrandpaConsensusLogReader<Number>(sp_std::marker::PhantomData<Number>
impl<Number: Codec> GrandpaConsensusLogReader<Number> {
pub fn find_authorities_change(
digest: &Digest,
) -> Option<sp_finality_grandpa::ScheduledChange<Number>> {
) -> Option<sp_consensus_grandpa::ScheduledChange<Number>> {
// find the first consensus digest with the right ID which converts to
// the right kind of consensus log.
digest
@@ -27,7 +27,7 @@ use bp_test_utils::{
JustificationGeneratorParams, ALICE, BOB, CHARLIE, DAVE, EVE, FERDIE, TEST_GRANDPA_SET_ID,
};
use finality_grandpa::voter_set::VoterSet;
use sp_finality_grandpa::{AuthorityId, AuthorityWeight};
use sp_consensus_grandpa::{AuthorityId, AuthorityWeight};
use sp_runtime::traits::Header as HeaderT;
type TestHeader = sp_runtime::testing::Header;
@@ -76,7 +76,7 @@ fn valid_justification_accepted_with_single_fork() {
#[test]
fn valid_justification_accepted_with_arbitrary_number_of_authorities() {
use finality_grandpa::voter_set::VoterSet;
use sp_finality_grandpa::AuthorityId;
use sp_consensus_grandpa::AuthorityId;
let n = 15;
let required_signatures = required_justification_precommits(n as _);
+2 -2
View File
@@ -11,7 +11,7 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features =
ed25519-dalek = { version = "1.0", default-features = false, features = ["u64_backend"] }
finality-grandpa = { version = "0.16.0", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -23,7 +23,7 @@ std = [
"ed25519-dalek/std",
"finality-grandpa/std",
"sp-application-crypto/std",
"sp-finality-grandpa/std",
"sp-consensus-grandpa/std",
"sp-runtime/std",
"sp-std/std",
]
+1 -1
View File
@@ -19,7 +19,7 @@
use codec::Encode;
use ed25519_dalek::{Keypair, PublicKey, SecretKey, Signature};
use finality_grandpa::voter_set::VoterSet;
use sp_finality_grandpa::{AuthorityId, AuthorityList, AuthorityWeight};
use sp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight};
use sp_runtime::RuntimeDebug;
use sp_std::prelude::*;
+2 -2
View File
@@ -20,7 +20,7 @@
use bp_header_chain::justification::{required_justification_precommits, GrandpaJustification};
use codec::Encode;
use sp_finality_grandpa::{AuthorityId, AuthoritySignature, AuthorityWeight, SetId};
use sp_consensus_grandpa::{AuthorityId, AuthoritySignature, AuthorityWeight, SetId};
use sp_runtime::traits::{Header as HeaderT, One, Zero};
use sp_std::prelude::*;
@@ -170,7 +170,7 @@ pub fn signed_precommit<H: HeaderT>(
) -> finality_grandpa::SignedPrecommit<H::Hash, H::Number, AuthoritySignature, AuthorityId> {
let precommit = finality_grandpa::Precommit { target_hash: target.0, target_number: target.1 };
let encoded = sp_finality_grandpa::localized_payload(
let encoded = sp_consensus_grandpa::localized_payload(
round,
set_id,
&finality_grandpa::Message::Precommit(precommit.clone()),
@@ -29,4 +29,4 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master
[dev-dependencies]
bp-polkadot-core = { path = "../../primitives/polkadot-core" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
@@ -75,8 +75,8 @@ impl From<UtilityCall<Call>> for Call {
mod tests {
use super::*;
use bp_runtime::BasicOperatingMode;
use sp_consensus_grandpa::AuthorityList;
use sp_core::hexdisplay::HexDisplay;
use sp_finality_grandpa::AuthorityList;
use sp_runtime::traits::Header;
use std::str::FromStr;
@@ -7034,7 +7034,7 @@ pub mod api {
)]
pub struct StoredAuthoritySet {
pub authorities: runtime_types::sp_core::bounded::bounded_vec::BoundedVec<(
runtime_types::sp_finality_grandpa::app::Public,
runtime_types::sp_consensus_grandpa::app::Public,
::core::primitive::u64,
)>,
pub set_id: ::core::primitive::u64,
@@ -8115,7 +8115,7 @@ pub mod api {
pub struct Signature(pub [::core::primitive::u8; 64usize]);
}
}
pub mod sp_finality_grandpa {
pub mod sp_consensus_grandpa {
use super::runtime_types;
pub mod app {
use super::runtime_types;
@@ -44,7 +44,7 @@ frame-support = { git = "https://github.com/paritytech/substrate", branch = "mas
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
[dev-dependencies]
@@ -17,7 +17,7 @@
//! Relay errors.
use relay_substrate_client as client;
use sp_finality_grandpa::AuthorityList;
use sp_consensus_grandpa::AuthorityList;
use sp_runtime::traits::MaybeDisplay;
use std::fmt::Debug;
use thiserror::Error;
@@ -30,8 +30,8 @@ use relay_substrate_client::{
BlockNumberOf, Chain, ChainWithGrandpa, Client, Error as SubstrateError, HashOf, HeaderOf,
Subscription, SubstrateFinalityClient, SubstrateGrandpaFinalityClient,
};
use sp_consensus_grandpa::{AuthorityList as GrandpaAuthoritiesSet, GRANDPA_ENGINE_ID};
use sp_core::{storage::StorageKey, Bytes};
use sp_finality_grandpa::{AuthorityList as GrandpaAuthoritiesSet, GRANDPA_ENGINE_ID};
use sp_runtime::{traits::Header, ConsensusEngineId};
use std::marker::PhantomData;
@@ -155,8 +155,8 @@ impl<C: ChainWithGrandpa> Engine<C> for Grandpa<C> {
C::WITH_CHAIN_GRANDPA_PALLET_NAME,
);
let (authority_set, authority_set_id): (
sp_finality_grandpa::AuthorityList,
sp_finality_grandpa::SetId,
sp_consensus_grandpa::AuthorityList,
sp_consensus_grandpa::SetId,
) = target_client
.storage_value(current_authority_set_key, None)
.await?