mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
Refactor primitives (#1383)
* create a v1 primitives module * Improve guide on availability types * punctuate * new parachains runtime uses new primitives * tests of new runtime now use new primitives * add ErasureChunk to guide * export erasure chunk from v1 primitives * subsystem crate uses v1 primitives * node-primitives uses new v1 primitives * port overseer to new primitives * new-proposer uses v1 primitives (no ParachainHost anymore) * fix no-std compilation for primitives * service-new uses v1 primitives * network-bridge uses new primitives * statement distribution uses v1 primitives * PoV distribution uses v1 primitives; add PoV::hash fn * move parachain to v0 * remove inclusion_inherent module and place into v1 * remove everything from primitives crate root * remove some unused old types from v0 primitives * point everything else at primitives::v0 * squanch some warns up * add RuntimeDebug import to no-std as well * port over statement-table and validation * fix final errors in validation and node-primitives * add dummy Ord impl to committed candidate receipt * guide: update CandidateValidationMessage * add primitive for validationoutputs * expand CandidateValidationMessage further * bikeshed * add some impls to omitted-validation-data and available-data * expand CandidateValidationMessage * make erasure-coding generic over v1/v0 * update usages of erasure-coding * implement commitments.hash() * use Arc<Pov> for CandidateValidation * improve new erasure-coding method names * fix up candidate backing * update docs a bit * fix most tests and add short-circuiting to make_pov_available * fix remainder of candidate backing tests * squanching warns * squanch it up * some fallout * overseer fallout * free from polkadot-test-service hell
This commit is contained in:
committed by
GitHub
parent
6957847b6b
commit
3b13cd9a85
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)),
|
||||
)
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user