Unverified Commit 96af6ead authored by asynchronous rob's avatar asynchronous rob Committed by GitHub
Browse files

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
parent 8845df22
Pipeline #100069 passed with stages
in 25 minutes and 41 seconds
......@@ -79,7 +79,7 @@ use sp_runtime::{ModuleId,
use crate::slots;
use codec::{Encode, Decode};
use sp_std::vec::Vec;
use primitives::parachain::{Id as ParaId, HeadData};
use primitives::v0::{Id as ParaId, HeadData};
pub type BalanceOf<T> =
<<T as slots::Trait>::Currency as Currency<<T as system::Trait>::AccountId>>::Balance;
......@@ -568,7 +568,7 @@ mod tests {
};
use frame_support::traits::{Contains, ContainsLengthBound};
use sp_core::H256;
use primitives::parachain::{Info as ParaInfo, Id as ParaId, Scheduling, ValidationCode};
use primitives::v0::{Info as ParaInfo, Id as ParaId, Scheduling, ValidationCode};
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
use sp_runtime::{
......
......@@ -26,8 +26,8 @@ pub struct ToAuthor<R>(sp_std::marker::PhantomData<R>);
impl<R> OnUnbalanced<NegativeImbalance<R>> for ToAuthor<R>
where
R: balances::Trait + authorship::Trait,
<R as system::Trait>::AccountId: From<primitives::AccountId>,
<R as system::Trait>::AccountId: Into<primitives::AccountId>,
<R as system::Trait>::AccountId: From<primitives::v0::AccountId>,
<R as system::Trait>::AccountId: Into<primitives::v0::AccountId>,
<R as system::Trait>::Event: From<balances::RawEvent<
<R as system::Trait>::AccountId,
<R as balances::Trait>::Balance,
......
......@@ -27,7 +27,7 @@ pub mod slots;
pub mod crowdfund;
pub mod impls;
use primitives::BlockNumber;
use primitives::v0::BlockNumber;
use sp_runtime::{Perquintill, Perbill, FixedPointNumber, traits::Saturating};
use frame_support::{
parameter_types, traits::{Currency},
......
......@@ -37,16 +37,13 @@ use frame_support::{
dispatch::IsSubType,
weights::{DispatchClass, Weight},
};
use primitives::{
Balance,
BlockNumber,
parachain::{
Id as ParaId, Chain, DutyRoster, AttestedCandidate, CompactStatement as Statement, ParachainDispatchOrigin,
UpwardMessage, ValidatorId, ActiveParas, CollatorId, Retriable, OmittedValidationData,
CandidateReceipt, GlobalValidationSchedule, AbridgedCandidateReceipt,
LocalValidationData, Scheduling, ValidityAttestation, NEW_HEADS_IDENTIFIER, PARACHAIN_KEY_TYPE_ID,
ValidatorSignature, SigningContext, HeadData, ValidationCode,
},
use primitives::v0::{
Balance, BlockNumber,
Id as ParaId, Chain, DutyRoster, AttestedCandidate, CompactStatement as Statement, ParachainDispatchOrigin,
UpwardMessage, ValidatorId, ActiveParas, CollatorId, Retriable, OmittedValidationData,
CandidateReceipt, GlobalValidationSchedule, AbridgedCandidateReceipt,
LocalValidationData, Scheduling, ValidityAttestation, NEW_HEADS_IDENTIFIER, PARACHAIN_KEY_TYPE_ID,
ValidatorSignature, SigningContext, HeadData, ValidationCode,
Remark, DownwardMessage
};
use frame_support::{
......@@ -329,7 +326,7 @@ pub trait Trait: CreateSignedTransaction<Call<Self>> + attestations::Trait + ses
>;
/// A type that converts the opaque hash type to exact one.
type BlockHashConversion: Convert<Self::Hash, primitives::Hash>;
type BlockHashConversion: Convert<Self::Hash, primitives::v0::Hash>;
}
/// Origin for the parachains module.
......@@ -1681,13 +1678,10 @@ mod tests {
},
testing::TestXt,
};
use primitives::{
parachain::{
CandidateReceipt, ValidityAttestation, ValidatorId, Info as ParaInfo,
Scheduling, CandidateCommitments,
},
BlockNumber,
Header,
use primitives::v0::{
CandidateReceipt, ValidityAttestation, ValidatorId, Info as ParaInfo,
Scheduling, CandidateCommitments,
BlockNumber, Header,
};
use keyring::Sr25519Keyring;
use frame_support::{
......@@ -1819,7 +1813,7 @@ mod tests {
}
mod time {
use primitives::{Moment, BlockNumber};
use primitives::v0::{Moment, BlockNumber};
pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 1 * HOURS;
// These time units are defined in number of blocks.
......@@ -2246,7 +2240,7 @@ mod tests {
println!("session index {}", i);
Staking::on_finalize(System::block_number());
System::set_block_number((i + 1).into());
Timestamp::set_timestamp(System::block_number() as primitives::Moment * 6000);
Timestamp::set_timestamp(System::block_number() as primitives::v0::Moment * 6000);
// In order to be able to use `System::parent_hash()` in the tests
// we need to first get it via `System::finalize` and then set it
......
......@@ -34,7 +34,7 @@ use frame_support::{
weights::{DispatchClass, Weight},
};
use system::{self, ensure_root, ensure_signed};
use primitives::parachain::{
use primitives::v0::{
Id as ParaId, CollatorId, Scheduling, LOWEST_USER_ID, SwapAux, Info as ParaInfo, ActiveParas,
Retriable, ValidationCode, HeadData,
};
......@@ -213,7 +213,7 @@ fn build<T: Trait>(config: &GenesisConfig<T>) {
Parachains::put(&only_ids);
for (id, code, genesis) in p {
Paras::insert(id, &primitives::parachain::PARACHAIN_INFO);
Paras::insert(id, &primitives::v0::PARACHAIN_INFO);
// no ingress -- a chain cannot be routed to until it is live.
<parachains::Code>::insert(&id, &code);
<parachains::Heads>::insert(&id, &genesis);
......@@ -670,12 +670,10 @@ mod tests {
AccountIdConversion, Extrinsic as ExtrinsicT,
}, testing::{UintAuthorityId, TestXt}, KeyTypeId, Perbill, curve::PiecewiseLinear,
};
use primitives::{
parachain::{
ValidatorId, Info as ParaInfo, Scheduling, LOWEST_USER_ID, AttestedCandidate,
CandidateReceipt, HeadData, ValidityAttestation, CompactStatement as Statement, Chain,
CollatorPair, CandidateCommitments,
},
use primitives::v0::{
ValidatorId, Info as ParaInfo, Scheduling, LOWEST_USER_ID, AttestedCandidate,
CandidateReceipt, HeadData, ValidityAttestation, CompactStatement as Statement, Chain,
CollatorPair, CandidateCommitments,
Balance, BlockNumber, Header, Signature,
};
use frame_support::{
......@@ -869,7 +867,7 @@ mod tests {
// This is needed for a custom `AccountId` type which is `u64` in testing here.
pub mod test_keys {
use sp_core::{crypto::KeyTypeId, sr25519};
use primitives::Signature;
use primitives::v0::Signature;
pub const KEY_TYPE: KeyTypeId = KeyTypeId(*b"test");
......
......@@ -28,7 +28,7 @@ use frame_support::{
traits::{Currency, ReservableCurrency, WithdrawReason, ExistenceRequirement, Get, Randomness},
weights::{DispatchClass, Weight},
};
use primitives::parachain::{
use primitives::v0::{
SwapAux, PARACHAIN_INFO, Id as ParaId, ValidationCode, HeadData,
};
use system::{ensure_signed, ensure_root};
......@@ -890,8 +890,7 @@ mod tests {
traits::{OnInitialize, OnFinalize}
};
use balances;
use primitives::{BlockNumber, Header};
use primitives::parachain::{Id as ParaId, Info as ParaInfo, Scheduling};
use primitives::v0::{BlockNumber, Header, Id as ParaId, Info as ParaInfo, Scheduling};
impl_outer_origin! {
pub enum Origin for Test {}
......
......@@ -16,7 +16,7 @@
/// Money matters.
pub mod currency {
use primitives::Balance;
use primitives::v0::Balance;
pub const DOTS: Balance = 1_000_000_000_000;
pub const DOLLARS: Balance = DOTS / 6;
......@@ -30,7 +30,7 @@ pub mod currency {
/// Time and blocks.
pub mod time {
use primitives::{Moment, BlockNumber};
use primitives::v0::{Moment, BlockNumber};
// Kusama & mainnet
pub const MILLISECS_PER_BLOCK: Moment = 6000;
// Testnet
......@@ -55,7 +55,7 @@ pub mod time {
/// Fee-related.
pub mod fee {
pub use sp_runtime::Perbill;
use primitives::Balance;
use primitives::v0::Balance;
use runtime_common::ExtrinsicBaseWeight;
use frame_support::weights::{
WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients,
......
......@@ -23,9 +23,10 @@
use sp_std::prelude::*;
use sp_core::u32_trait::{_1, _2, _3, _4, _5};
use codec::{Encode, Decode};
use primitives::{
use primitives::v0::{
self as parachain,
AccountId, AccountIndex, Balance, BlockNumber, Hash, Nonce, Signature, Moment,
parachain::{self, ActiveParas, AbridgedCandidateReceipt, SigningContext},
ActiveParas, AbridgedCandidateReceipt, SigningContext,
};
use runtime_common::{
attestations, claims, parachains, registrar, slots, SlowAdjustingFeeUpdate,
......@@ -560,7 +561,7 @@ impl grandpa::Trait for Runtime {
type HandleEquivocation = grandpa::EquivocationHandler<
Self::KeyOwnerIdentification,
primitives::fisherman::FishermanAppCrypto,
primitives::v0::fisherman::FishermanAppCrypto,
Runtime,
Offences,
>;
......@@ -596,7 +597,7 @@ parameter_types! {
}
impl parachains::Trait for Runtime {
type AuthorityId = primitives::fisherman::FishermanAppCrypto;
type AuthorityId = primitives::v0::fisherman::FishermanAppCrypto;
type Origin = Origin;
type Call = Call;
type ParachainCurrency = Balances;
......@@ -939,7 +940,7 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
construct_runtime! {
pub enum Runtime where
Block = Block,
NodeBlock = primitives::Block,
NodeBlock = primitives::v0::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
// Basic stuff; balances is uncallable initially.
......@@ -1147,7 +1148,7 @@ sp_api::impl_runtime_apis! {
fn signing_context() -> SigningContext {
Parachains::signing_context()
}
fn downward_messages(id: parachain::Id) -> Vec<primitives::DownwardMessage> {
fn downward_messages(id: parachain::Id) -> Vec<primitives::v0::DownwardMessage> {
Parachains::downward_messages(id)
}
}
......
......@@ -19,9 +19,7 @@
//! Configuration can change only at session boundaries and is buffered until then.
use sp_std::prelude::*;
use primitives::{
parachain::{ValidatorId},
};
use primitives::v1::ValidatorId;
use frame_support::{
decl_storage, decl_module, decl_error,
dispatch::DispatchResult,
......
......@@ -21,12 +21,10 @@
//! to included.
use sp_std::prelude::*;
use primitives::{
parachain::{
ValidatorId, AbridgedCandidateReceipt, ValidatorIndex, Id as ParaId,
AvailabilityBitfield as AvailabilityBitfield, SignedAvailabilityBitfields, SigningContext,
BackedCandidate, CoreIndex, GroupIndex, CoreAssignment,
},
use primitives::v1::{
ValidatorId, CommittedCandidateReceipt, ValidatorIndex, Id as ParaId,
AvailabilityBitfield as AvailabilityBitfield, SignedAvailabilityBitfields, SigningContext,
BackedCandidate, CoreIndex, GroupIndex, CoreAssignment,
};
use frame_support::{
decl_storage, decl_module, decl_error, ensure, dispatch::DispatchResult, IterableStorageMap,
......@@ -53,13 +51,15 @@ pub struct AvailabilityBitfieldRecord<N> {
}
/// A backed candidate pending availability.
// TODO: split this type and change this to hold a plain `CandidateReceipt`.
// https://github.com/paritytech/polkadot/issues/1357
#[derive(Encode, Decode, PartialEq)]
#[cfg_attr(test, derive(Debug))]
pub struct CandidatePendingAvailability<H, N> {
/// The availability core this is assigned to.
core: CoreIndex,
/// The candidate receipt itself.
receipt: AbridgedCandidateReceipt<H>,
receipt: CommittedCandidateReceipt<H>,
/// The received availability votes. One bit per validator.
availability_votes: BitVec<BitOrderLsb0, u8>,
/// The block number of the relay-parent of the receipt.
......@@ -213,7 +213,10 @@ impl<T: Trait> Module<T> {
let validator_public = &validators[signed_bitfield.validator_index() as usize];
signed_bitfield.check_signature(&signing_context, validator_public).map_err(|_| Error::<T>::InvalidBitfieldSignature)?;
signed_bitfield.check_signature(
&signing_context,
validator_public,
).map_err(|_| Error::<T>::InvalidBitfieldSignature)?;
last_index = Some(signed_bitfield.validator_index());
}
......@@ -331,11 +334,11 @@ impl<T: Trait> Module<T> {
// list.
'a:
for candidate in &candidates {
let para_id = candidate.candidate.parachain_index;
let para_id = candidate.descriptor().para_id;
// we require that the candidate is in the context of the parent block.
ensure!(
candidate.candidate.relay_parent == parent_hash,
candidate.descriptor().relay_parent == parent_hash,
Error::<T>::CandidateNotInParentContext,
);
......@@ -348,17 +351,17 @@ impl<T: Trait> Module<T> {
ensure!(code_upgrade_allowed, Error::<T>::PrematureCodeUpgrade);
ensure!(
candidate.candidate.check_signature().is_ok(),
candidate.descriptor().check_collator_signature().is_ok(),
Error::<T>::NotCollatorSigned,
);
for (i, assignment) in scheduled[skip..].iter().enumerate() {
check_assignment_in_order(assignment)?;
if candidate.candidate.parachain_index == assignment.para_id {
if candidate.descriptor().para_id == assignment.para_id {
if let Some(required_collator) = assignment.required_collator() {
ensure!(
required_collator == &candidate.candidate.collator,
required_collator == &candidate.descriptor().collator,
Error::<T>::WrongCollator,
);
}
......@@ -377,7 +380,7 @@ impl<T: Trait> Module<T> {
// check the signatures in the backing and that it is a majority.
{
let maybe_amount_validated
= primitives::parachain::check_candidate_backing(
= primitives::v1::check_candidate_backing(
&candidate,
&signing_context,
group_vals.len(),
......@@ -419,7 +422,7 @@ impl<T: Trait> Module<T> {
// one more sweep for actually writing to storage.
for (candidate, core) in candidates.into_iter().zip(core_indices.iter().cloned()) {
let para_id = candidate.candidate.parachain_index;
let para_id = candidate.descriptor().para_id;
// initialize all availability votes to 0.
let availability_votes: BitVec<BitOrderLsb0, u8>
......@@ -438,7 +441,7 @@ impl<T: Trait> Module<T> {
fn enact_candidate(
relay_parent_number: T::BlockNumber,
receipt: AbridgedCandidateReceipt<T::Hash>,
receipt: CommittedCandidateReceipt<T::Hash>,
) -> Weight {
let commitments = receipt.commitments;
let config = <configuration::Module<T>>::config();
......@@ -447,15 +450,15 @@ impl<T: Trait> Module<T> {
let mut weight = T::DbWeight::get().reads_writes(1, 0);
if let Some(new_code) = commitments.new_validation_code {
weight += <paras::Module<T>>::schedule_code_upgrade(
receipt.parachain_index,
receipt.descriptor.para_id,
new_code,
relay_parent_number + config.validation_upgrade_delay,
);
}
weight + <paras::Module<T>>::note_new_head(
receipt.parachain_index,
receipt.head_data,
receipt.descriptor.para_id,
commitments.head_data,
relay_parent_number,
)
}
......@@ -495,10 +498,11 @@ const fn availability_threshold(n_validators: usize) -> usize {
mod tests {
use super::*;
use primitives::{BlockNumber, Hash};
use primitives::parachain::{
use primitives::v1::{BlockNumber, Hash};
use primitives::v1::{
SignedAvailabilityBitfield, CompactStatement as Statement, ValidityAttestation, CollatorId,
CandidateCommitments, SignedStatement, AssignmentKind,
CandidateCommitments, SignedStatement, CandidateDescriptor, HeadData, ValidationCode,
AssignmentKind,
};
use frame_support::traits::{OnFinalize, OnInitialize};
use keyring::Sr25519Keyring;
......@@ -545,22 +549,22 @@ mod tests {
fn collator_sign_candidate(
collator: Sr25519Keyring,
candidate: &mut AbridgedCandidateReceipt,
candidate: &mut CommittedCandidateReceipt,
) {
candidate.collator = collator.public().into();
candidate.descriptor.collator = collator.public().into();
let payload = primitives::parachain::collator_signature_payload(
&candidate.relay_parent,
&candidate.parachain_index,
&candidate.pov_block_hash,
let payload = primitives::v1::collator_signature_payload(
&candidate.descriptor.relay_parent,
&candidate.descriptor.para_id,
&candidate.descriptor.pov_hash,
);
candidate.signature = collator.sign(&payload[..]).into();
assert!(candidate.check_signature().is_ok());
candidate.descriptor.signature = collator.sign(&payload[..]).into();
assert!(candidate.descriptor().check_collator_signature().is_ok());
}
fn back_candidate(
candidate: AbridgedCandidateReceipt,
candidate: CommittedCandidateReceipt,
validators: &[Sr25519Keyring],
group: &[ValidatorIndex],
signing_context: &SigningContext,
......@@ -603,7 +607,7 @@ mod tests {
BackingKind::Lacking => false,
};
let successfully_backed = primitives::parachain::check_candidate_backing(
let successfully_backed = primitives::v1::check_candidate_backing(
&backed,
signing_context,
group.len(),
......@@ -674,6 +678,33 @@ mod tests {
)
}
#[derive(Default)]
struct TestCandidateBuilder {
para_id: ParaId,
head_data: HeadData,
pov_hash: Hash,
relay_parent: Hash,
new_validation_code: Option<ValidationCode>,
}
impl TestCandidateBuilder {
fn build(self) -> CommittedCandidateReceipt {
CommittedCandidateReceipt {
descriptor: CandidateDescriptor {
para_id: self.para_id,
pov_hash: self.pov_hash,
relay_parent: self.relay_parent,
..Default::default()
},
commitments: CandidateCommitments {
head_data: self.head_data,
new_validation_code: self.new_validation_code,
..Default::default()
},
}
}
}
#[test]
fn collect_pending_cleans_up_pending() {
let chain_a = ParaId::from(1);
......@@ -895,11 +926,11 @@ mod tests {
<PendingAvailability<Test>>::insert(chain_a, CandidatePendingAvailability {
core: CoreIndex::from(0),
receipt: AbridgedCandidateReceipt {
parachain_index: chain_a,
receipt: TestCandidateBuilder {
para_id: chain_a,
head_data: vec![1, 2, 3, 4].into(),
..Default::default()
},
}.build(),
availability_votes: default_availability_votes(),
relay_parent_number: 0,
backed_in_number: 0,
......@@ -907,11 +938,11 @@ mod tests {
<PendingAvailability<Test>>::insert(chain_b, CandidatePendingAvailability {
core: CoreIndex::from(1),
receipt: AbridgedCandidateReceipt {
parachain_index: chain_b,
receipt: TestCandidateBuilder {
para_id: chain_b,
head_data: vec![5, 6, 7, 8].into(),
..Default::default()
},
}.build(),
availability_votes: default_availability_votes(),
relay_parent_number: 0,
backed_in_number: 0,
......@@ -1043,12 +1074,12 @@ mod tests {
// unscheduled candidate.
{
let mut candidate = AbridgedCandidateReceipt {
parachain_index: chain_a,
let mut candidate = TestCandidateBuilder {
para_id: chain_a,
relay_parent: System::parent_hash(),
pov_block_hash: Hash::from([1; 32]),
pov_hash: Hash::from([1; 32]),
..Default::default()
};
}.build();
collator_sign_candidate(
Sr25519Keyring::One,
&mut candidate,
......@@ -1071,18 +1102,18 @@ mod tests {
// candidates out of order.
{
let mut candidate_a = AbridgedCandidateReceipt {
parachain_index: chain_a,
let mut candidate_a = TestCandidateBuilder {
para_id: chain_a,
relay_parent: System::parent_hash(),
pov_block_hash: Hash::from([1; 32]),
pov_hash: Hash::from([1; 32]),
..Default::default()
};
let mut candidate_b = AbridgedCandidateReceipt {
parachain_index: chain_b,
}.build();
let mut candidate_b = TestCandidateBuilder {
para_id: chain_b,
relay_parent: System::parent_hash(),
pov_block_hash: Hash::from([2; 32]),
pov_hash: Hash::from([2; 32]),
..Default::default()
};
}.build();
collator_sign_candidate(
Sr25519Keyring::One,
......@@ -1119,12 +1150,12 @@ mod tests {
// candidate not backed.
{
let mut candidate = AbridgedCandidateReceipt {
parachain_index: chain_a,
let mut candidate = TestCandidateBuilder {
para_id: chain_a,
relay_parent: System::parent_hash(),
pov_block_hash: Hash::from([1; 32]),
pov_hash: Hash::from([1; 32]),
..Default::default()
};
}.build();
collator_sign_candidate(
Sr25519Keyring::One,
&mut candidate,
......@@ -1150,12 +1181,12 @@ mod tests {
let wrong_parent_hash = Hash::from([222; 32]);
assert!(System::parent_hash() != wrong_parent_hash);
let mut candidate = AbridgedCandidateReceipt {
parachain_index: chain_a,
let mut candidate = TestCandidateBuilder {
para_id: chain_a,
relay_parent: wrong_parent_hash,
pov_block_hash: Hash::from([1; 32]),
pov_hash: Hash::from([1; 32]),
..Default::default()
};
}.build();
collator_sign_candidate(
Sr25519Keyring::One,
&mut candidate,
......@@ -1178,12 +1209,12 @@ mod tests {
// candidate has wrong collator.
{
let mut candidate = AbridgedCandidateReceipt {
parachain_index: thread_a,
let mut candidate = TestCandidateBuilder {
para_id: thread_a,
relay_parent: System::parent_hash(),
pov_block_hash: Hash::from([1; 32]),
pov_hash: Hash::from([1; 32]),
..Default::default()
};
}.build();
assert!(CollatorId::from(Sr25519Keyring::One.public()) != thread_collator);
collator_sign_candidate(
......@@ -1212,12 +1243,12 @@ mod tests {
// candidate not well-signed by collator.
{
let mut candidate = AbridgedCandidateReceipt {
parachain_index: thread_a,
let mut candidate = TestCandidateBuilder {
para_id: thread_a,
relay_parent: System::parent_hash(),
pov_block_hash: Hash::from([1; 32]),
pov_hash: Hash::from([1; 32]),
..Default::default()
};