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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into prgn-subsystem-util
Browse files Browse the repository at this point in the history
  • Loading branch information
coriolinus committed Jul 10, 2020
2 parents 2b2a638 + 64d0c7a commit 9be53fa
Show file tree
Hide file tree
Showing 92 changed files with 3,169 additions and 1,415 deletions.
69 changes: 69 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ members = [
"node/core/backing",
"node/subsystem",
"node/test-helpers/subsystem",
"node/test-service",

"parachain/test-parachains",
"parachain/test-parachains/adder",
Expand Down
15 changes: 15 additions & 0 deletions Process.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Batch: Availability and Validity]
owner = "rphmeier"
whitelist = []
matrix_room_id = "!wQXGIDhhJQSVXKqPwi:matrix.parity.io"

[Batch: Codebase Restructure]
owner = "rphmeier"
whitelist = []
matrix_room_id = "!wQXGIDhhJQSVXKqPwi:matrix.parity.io"

[Cumulus]
owner = "bkchr"
whitelist = []
matrix_room_id = "!wQXGIDhhJQSVXKqPwi:matrix.parity.io"

8 changes: 3 additions & 5 deletions availability-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
use futures::prelude::*;
use futures::channel::{mpsc, oneshot};
use keystore::KeyStorePtr;
use polkadot_primitives::{
use polkadot_primitives::v0::{
Hash, Block,
parachain::{
PoVBlock, AbridgedCandidateReceipt, ErasureChunk,
ParachainHost, AvailableData, OmittedValidationData,
},
PoVBlock, AbridgedCandidateReceipt, ErasureChunk,
ParachainHost, AvailableData, OmittedValidationData,
};
use sp_runtime::traits::HashFor;
use sp_blockchain::Result as ClientResult;
Expand Down
13 changes: 5 additions & 8 deletions availability-store/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ use kvdb_rocksdb::{Database, DatabaseConfig};
use kvdb::{KeyValueDB, DBTransaction};
use codec::{Encode, Decode};
use polkadot_erasure_coding as erasure;
use polkadot_primitives::{
Hash,
parachain::{
ErasureChunk, AvailableData, AbridgedCandidateReceipt,
},
use polkadot_primitives::v0::{
Hash, ErasureChunk, AvailableData, AbridgedCandidateReceipt,
};
use parking_lot::Mutex;

Expand Down Expand Up @@ -273,7 +270,7 @@ impl Store {
// If there are no block data in the store at this point,
// check that they can be reconstructed now and add them to store if they can.
if self.execution_data(&candidate_hash).is_none() {
if let Ok(available_data) = erasure::reconstruct(
if let Ok(available_data) = erasure::reconstruct_v0(
n_validators as usize,
v.iter().map(|chunk| (chunk.chunk.as_ref(), chunk.index as usize)),
)
Expand Down Expand Up @@ -390,7 +387,7 @@ impl Store {
mod tests {
use super::*;
use polkadot_erasure_coding::{self as erasure};
use polkadot_primitives::parachain::{
use polkadot_primitives::v0::{
Id as ParaId, BlockData, AvailableData, PoVBlock, OmittedValidationData,
};

Expand Down Expand Up @@ -489,7 +486,7 @@ mod tests {
let available_data = available_data(&[42; 8]);
let n_validators = 5;

let erasure_chunks = erasure::obtain_chunks(
let erasure_chunks = erasure::obtain_chunks_v0(
n_validators,
&available_data,
).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions availability-store/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ use consensus_common::{
import_queue::CacheKeyId,
};
use sp_core::traits::SpawnNamed;
use polkadot_primitives::{Block, BlockId, Hash};
use polkadot_primitives::parachain::{
use polkadot_primitives::v0::{
Block, BlockId, Hash,
ParachainHost, ValidatorId, AbridgedCandidateReceipt, AvailableData,
ValidatorPair, ErasureChunk,
};
Expand Down
4 changes: 2 additions & 2 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use log::info;
use service::{IdentifyVariant, self};
#[cfg(feature = "service-rewr")]
use service_new::{IdentifyVariant, self as service};
use sc_cli::{CliConfiguration, SubstrateCli, Result, RuntimeVersion, Role};
use sc_cli::{SubstrateCli, Result, RuntimeVersion, Role};
use crate::cli::{Cli, Subcommand};

fn get_exec_name() -> Option<String> {
Expand Down Expand Up @@ -198,7 +198,7 @@ pub fn run() -> Result<()> {
}
},
Some(Subcommand::ValidationWorker(cmd)) => {
sc_cli::init_logger("", cli.run.base.log_rotation_opt()?)?;
sc_cli::init_logger("", None)?;

if cfg!(feature = "browser") {
Err(sc_cli::Error::Input("Cannot run validation worker in browser".into()))
Expand Down
21 changes: 10 additions & 11 deletions collator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ use log::warn;
use sc_client_api::{StateBackend, BlockchainEvents};
use sp_blockchain::HeaderBackend;
use sp_core::Pair;
use polkadot_primitives::{
use polkadot_primitives::v0::{
BlockId, Hash, Block, DownwardMessage,
parachain::{
self, BlockData, DutyRoster, HeadData, Id as ParaId,
PoVBlock, ValidatorId, CollatorPair, LocalValidationData, GlobalValidationSchedule,
}
BlockData, DutyRoster, HeadData, Id as ParaId,
PoVBlock, ValidatorId, CollatorPair, LocalValidationData, GlobalValidationSchedule,
Collation, CollationInfo, collator_signature_payload,
};
use polkadot_cli::{
ProvideRuntimeApi, ParachainHost, IdentifyVariant,
Expand All @@ -69,7 +68,7 @@ use polkadot_cli::{
pub use polkadot_cli::service::Configuration;
pub use polkadot_cli::Cli;
pub use polkadot_validation::SignedStatement;
pub use polkadot_primitives::parachain::CollatorId;
pub use polkadot_primitives::v0::CollatorId;
pub use sc_network::PeerId;
pub use service::RuntimeApiCollection;
pub use sc_cli::SubstrateCli;
Expand Down Expand Up @@ -164,7 +163,7 @@ pub async fn collate<P>(
downward_messages: Vec<DownwardMessage>,
mut para_context: P,
key: Arc<CollatorPair>,
) -> Option<parachain::Collation>
) -> Option<Collation>
where
P: ParachainContext,
P::ProduceCandidate: Send,
Expand All @@ -181,13 +180,13 @@ pub async fn collate<P>(
};

let pov_block_hash = pov_block.hash();
let signature = key.sign(&parachain::collator_signature_payload(
let signature = key.sign(&collator_signature_payload(
&relay_parent,
&local_id,
&pov_block_hash,
));

let info = parachain::CollationInfo {
let info = CollationInfo {
parachain_index: local_id,
relay_parent,
collator: key.public(),
Expand All @@ -196,7 +195,7 @@ pub async fn collate<P>(
pov_block_hash,
};

let collation = parachain::Collation {
let collation = Collation {
info,
pov: pov_block,
};
Expand Down Expand Up @@ -456,7 +455,7 @@ where

#[cfg(not(feature = "service-rewr"))]
fn compute_targets(para_id: ParaId, session_keys: &[ValidatorId], roster: DutyRoster) -> HashSet<ValidatorId> {
use polkadot_primitives::parachain::Chain;
use polkadot_primitives::v0::Chain;

roster.validator_duty.iter().enumerate()
.filter(|&(_, c)| c == &Chain::Parachain(para_id))
Expand Down
5 changes: 5 additions & 0 deletions core-primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,8 @@ pub enum DownwardMessage<AccountId = crate::AccountId> {
/// XCMP message for the Parachain.
XCMPMessage(sp_std::vec::Vec<u8>),
}

/// V1 primitives.
pub mod v1 {
pub use super::*;
}
Loading

0 comments on commit 9be53fa

Please sign in to comment.