Skip to content

Commit 63958c4

Browse files
SajjonAlexander Cyongithub-actions[bot]sandreims0me0ne-unkn0wn
authored
move released primitives and APIs out of staging (#9443)
Solves #9400 No logic change, only moves types from `polkadot/primitives/src/vstaging` into `polkadot/primitives/src/v9` (renamed from `v8` to `v9`). --------- Co-authored-by: Alexander Cyon <[email protected]> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrei Sandu <[email protected]> Co-authored-by: Dmitry Sinyavin <[email protected]> Co-authored-by: s0me0ne-unkn0wn <[email protected]>
1 parent 75173f8 commit 63958c4

File tree

153 files changed

+2541
-3389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+2541
-3389
lines changed

Cargo.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cumulus/client/consensus/aura/src/collators/lookahead.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use polkadot_node_primitives::SubmitCollationParams;
4444
use polkadot_node_subsystem::messages::CollationGenerationMessage;
4545
use polkadot_overseer::Handle as OverseerHandle;
4646
use polkadot_primitives::{
47-
vstaging::DEFAULT_CLAIM_QUEUE_OFFSET, CollatorPair, Id as ParaId, OccupiedCoreAssumption,
47+
CollatorPair, Id as ParaId, OccupiedCoreAssumption, DEFAULT_CLAIM_QUEUE_OFFSET,
4848
};
4949

5050
use crate::{collator as collator_util, export_pov_to_path};

cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ mod tests {
523523
use async_trait::async_trait;
524524
use cumulus_relay_chain_interface::*;
525525
use futures::Stream;
526-
use polkadot_primitives::vstaging::{CandidateEvent, CommittedCandidateReceiptV2};
526+
use polkadot_primitives::{CandidateEvent, CommittedCandidateReceiptV2};
527527
use sp_version::RuntimeVersion;
528528
use std::{
529529
collections::{BTreeMap, HashMap, VecDeque},

cumulus/client/consensus/aura/src/collators/slot_based/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ use cumulus_primitives_core::{
8080
use cumulus_relay_chain_interface::RelayChainInterface;
8181
use futures::FutureExt;
8282
use polkadot_primitives::{
83-
vstaging::DEFAULT_CLAIM_QUEUE_OFFSET, CollatorPair, CoreIndex, Hash as RelayHash, Id as ParaId,
84-
ValidationCodeHash,
83+
CollatorPair, CoreIndex, Hash as RelayHash, Id as ParaId, ValidationCodeHash,
84+
DEFAULT_CLAIM_QUEUE_OFFSET,
8585
};
8686
use sc_client_api::{backend::AuxStore, BlockBackend, BlockOf, UsageProvider};
8787
use sc_consensus::BlockImport;

cumulus/client/consensus/common/src/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use async_trait::async_trait;
2121
use codec::Encode;
2222
use cumulus_client_pov_recovery::RecoveryKind;
2323
use cumulus_primitives_core::{
24-
relay_chain::{vstaging::CoreState, BlockId, BlockNumber},
24+
relay_chain::{BlockId, BlockNumber, CoreState},
2525
CumulusDigestItem, InboundDownwardMessage, InboundHrmpMessage,
2626
};
2727
use cumulus_relay_chain_interface::{
@@ -35,7 +35,7 @@ use cumulus_test_client::{
3535
use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
3636
use futures::{channel::mpsc, executor::block_on, select, FutureExt, Stream, StreamExt};
3737
use futures_timer::Delay;
38-
use polkadot_primitives::{vstaging::CandidateEvent, HeadData};
38+
use polkadot_primitives::{CandidateEvent, HeadData};
3939
use sc_client_api::{Backend as _, UsageProvider};
4040
use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy};
4141
use sp_blockchain::Backend as BlockchainBackend;

cumulus/client/network/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ polkadot-node-primitives = { workspace = true, default-features = true }
3535
polkadot-node-subsystem = { workspace = true, default-features = true }
3636
polkadot-parachain-primitives = { workspace = true, default-features = true }
3737
polkadot-primitives = { workspace = true, default-features = true }
38+
polkadot-primitives-test-helpers = { workspace = true, default-features = true }
3839

3940
# Cumulus
4041
cumulus-relay-chain-interface = { workspace = true, default-features = true }

cumulus/client/network/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ use polkadot_node_primitives::{CollationSecondedSignal, Statement};
3333
use polkadot_node_subsystem::messages::RuntimeApiRequest;
3434
use polkadot_parachain_primitives::primitives::HeadData;
3535
use polkadot_primitives::{
36-
vstaging::CandidateReceiptV2 as CandidateReceipt, CompactStatement, Hash as PHash,
37-
Id as ParaId, OccupiedCoreAssumption, SigningContext, UncheckedSigned,
36+
CandidateReceiptV2 as CandidateReceipt, CompactStatement, Hash as PHash, Id as ParaId,
37+
OccupiedCoreAssumption, SigningContext, UncheckedSigned,
3838
};
3939

4040
use codec::{Decode, DecodeAll, Encode};

cumulus/client/network/src/tests.rs

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ use futures::{executor::block_on, poll, task::Poll, FutureExt, Stream, StreamExt
2727
use parking_lot::Mutex;
2828
use polkadot_node_primitives::{SignedFullStatement, Statement};
2929
use polkadot_primitives::{
30-
vstaging::{CandidateEvent, CommittedCandidateReceiptV2, CoreState},
31-
BlockNumber, CandidateCommitments, CandidateDescriptor, CollatorPair,
32-
CommittedCandidateReceipt, Hash as PHash, HeadData, InboundDownwardMessage, InboundHrmpMessage,
33-
OccupiedCoreAssumption, PersistedValidationData, SessionIndex, SigningContext,
34-
ValidationCodeHash, ValidatorId,
30+
BlockNumber, CandidateCommitments, CandidateDescriptorV2, CandidateEvent, CollatorPair,
31+
CommittedCandidateReceiptV2, CoreState, Hash as PHash, HeadData, InboundDownwardMessage,
32+
InboundHrmpMessage, OccupiedCoreAssumption, PersistedValidationData, SessionIndex,
33+
SigningContext, ValidationCodeHash, ValidatorId,
3534
};
35+
use polkadot_primitives_test_helpers::{CandidateDescriptor, CommittedCandidateReceipt};
3636
use polkadot_test_client::{
3737
Client as PClient, ClientBlockImportExt, DefaultTestClientBuilderExt, FullBackend as PBackend,
3838
InitPolkadotBlockBuilder, TestClientBuilder, TestClientBuilderExt,
@@ -62,22 +62,19 @@ fn check_error(error: crate::BoxedError, check_error: impl Fn(&BlockAnnounceErro
6262
}
6363
}
6464

65-
fn dummy_candidate() -> CommittedCandidateReceipt {
66-
CommittedCandidateReceipt {
67-
descriptor: CandidateDescriptor {
68-
para_head: polkadot_parachain_primitives::primitives::HeadData(
69-
default_header().encode(),
70-
)
71-
.hash(),
72-
para_id: 0u32.into(),
73-
relay_parent: PHash::random(),
74-
collator: CollatorPair::generate().0.public(),
75-
persisted_validation_data_hash: PHash::random(),
76-
pov_hash: PHash::random(),
77-
erasure_root: PHash::random(),
78-
signature: sp_core::sr25519::Signature::default().into(),
79-
validation_code_hash: ValidationCodeHash::from(PHash::random()),
80-
},
65+
fn dummy_candidate() -> CommittedCandidateReceiptV2 {
66+
CommittedCandidateReceiptV2 {
67+
descriptor: CandidateDescriptorV2::new(
68+
0u32.into(),
69+
PHash::random(),
70+
0.into(),
71+
1,
72+
PHash::random(),
73+
PHash::random(),
74+
PHash::random(),
75+
polkadot_parachain_primitives::primitives::HeadData(default_header().encode()).hash(),
76+
ValidationCodeHash::from(PHash::random()),
77+
),
8178
commitments: CandidateCommitments {
8279
upward_messages: Default::default(),
8380
horizontal_messages: Default::default(),
@@ -176,7 +173,7 @@ impl RelayChainInterface for DummyRelayChainInterface {
176173
}
177174

178175
if self.data.lock().has_pending_availability {
179-
Ok(Some(dummy_candidate().into()))
176+
Ok(Some(dummy_candidate()))
180177
} else {
181178
Ok(None)
182179
}
@@ -194,7 +191,7 @@ impl RelayChainInterface for DummyRelayChainInterface {
194191
}
195192

196193
if self.data.lock().has_pending_availability {
197-
Ok(vec![dummy_candidate().into()])
194+
Ok(vec![dummy_candidate()])
198195
} else {
199196
Ok(vec![])
200197
}

cumulus/client/pov-recovery/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,8 @@ use polkadot_node_primitives::{PoV, POV_BOMB_LIMIT};
5656
use polkadot_node_subsystem::messages::AvailabilityRecoveryMessage;
5757
use polkadot_overseer::Handle as OverseerHandle;
5858
use polkadot_primitives::{
59-
vstaging::{
60-
CandidateReceiptV2 as CandidateReceipt,
61-
CommittedCandidateReceiptV2 as CommittedCandidateReceipt,
62-
},
63-
Id as ParaId, SessionIndex,
59+
CandidateReceiptV2 as CandidateReceipt,
60+
CommittedCandidateReceiptV2 as CommittedCandidateReceipt, Id as ParaId, SessionIndex,
6461
};
6562

6663
use cumulus_primitives_core::ParachainBlockData;

cumulus/client/pov-recovery/src/tests.rs

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,20 @@ use super::*;
1919
use assert_matches::assert_matches;
2020
use codec::{Decode, Encode};
2121
use cumulus_primitives_core::relay_chain::{
22-
vstaging::CoreState, BlockId, CandidateCommitments, CandidateDescriptor, CoreIndex,
22+
BlockId, CandidateCommitments, CandidateDescriptorV2, CoreIndex, CoreState,
2323
};
2424
use cumulus_relay_chain_interface::{
2525
InboundDownwardMessage, InboundHrmpMessage, OccupiedCoreAssumption, PHash, PHeader,
2626
PersistedValidationData, RelayChainResult, StorageValue, ValidationCodeHash, ValidatorId,
2727
};
28-
use cumulus_test_client::{
29-
runtime::{Block, Header},
30-
Sr25519Keyring,
31-
};
28+
use cumulus_test_client::runtime::{Block, Header};
3229
use futures::{channel::mpsc, SinkExt, Stream};
3330
use polkadot_node_primitives::AvailableData;
3431
use polkadot_node_subsystem::{
3532
messages::{AvailabilityRecoveryMessage, RuntimeApiRequest},
3633
RecoveryError, TimeoutExt,
3734
};
38-
use polkadot_primitives::vstaging::CandidateEvent;
35+
use polkadot_primitives::CandidateEvent;
3936
use rstest::rstest;
4037
use sc_client_api::{
4138
BlockImportNotification, ClientInfo, CompactProof, FinalityNotification, FinalityNotifications,
@@ -520,7 +517,6 @@ impl RelayChainInterface for Relaychain {
520517
}
521518

522519
fn make_candidate_chain(candidate_number_range: Range<u32>) -> Vec<CommittedCandidateReceipt> {
523-
let collator = Sr25519Keyring::Ferdie;
524520
let mut latest_parent_hash = GENESIS_HASH;
525521
let mut candidates = vec![];
526522

@@ -536,18 +532,17 @@ fn make_candidate_chain(candidate_number_range: Range<u32>) -> Vec<CommittedCand
536532
latest_parent_hash = head_data.hash();
537533

538534
candidates.push(CommittedCandidateReceipt {
539-
descriptor: CandidateDescriptor {
540-
para_id: ParaId::from(1000),
541-
relay_parent: PHash::zero(),
542-
collator: collator.public().into(),
543-
persisted_validation_data_hash: PHash::zero(),
544-
pov_hash: PHash::zero(),
545-
erasure_root: PHash::zero(),
546-
signature: collator.sign(&[0u8; 132]).into(),
547-
para_head: PHash::zero(),
548-
validation_code_hash: PHash::zero().into(),
549-
}
550-
.into(),
535+
descriptor: CandidateDescriptorV2::new(
536+
ParaId::from(1000),
537+
PHash::zero(),
538+
CoreIndex(0),
539+
0,
540+
PHash::zero(),
541+
PHash::zero(),
542+
PHash::zero(),
543+
PHash::zero(),
544+
PHash::zero().into(),
545+
),
551546
commitments: CandidateCommitments {
552547
head_data: head_data.encode().into(),
553548
upward_messages: vec![].try_into().expect("empty vec fits within bounds"),

0 commit comments

Comments
 (0)