Skip to content

Commit

Permalink
Merge branch 'master' into girazoki-new-tools-for-developers
Browse files Browse the repository at this point in the history
  • Loading branch information
girazoki authored Sep 2, 2024
2 parents 29846b8 + e189687 commit e8b291b
Show file tree
Hide file tree
Showing 10 changed files with 1,130 additions and 461 deletions.
4 changes: 4 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 @@ -339,6 +339,7 @@ futures-timer = "3.0.1"
hex = { version = "0.4.3", default-features = false }
jsonrpsee = { version = "0.23", features = [ "server" ] }
num-traits = "0.2.8"
orchestra = { version = "0.4.0", default-features = false }
parking_lot = "0.12.1"
paste = "1.0.14"
rand = { version = "0.8.5", default-features = false, features = [ "std_rng" ] }
Expand Down
7 changes: 5 additions & 2 deletions client/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ substrate-prometheus-endpoint = { workspace = true }
# Own
dp-consensus = { workspace = true, features = [ "std" ] }
pallet-registrar-runtime-api = { workspace = true, features = [ "std" ] }
pallet-xcm-core-buyer-runtime-api = { workspace = true }
pallet-xcm-core-buyer-runtime-api = { workspace = true, features = [ "std" ] }
tp-traits = { workspace = true }
tp-xcm-core-buyer = { workspace = true, features = [ "std" ] }

Expand Down Expand Up @@ -74,16 +74,19 @@ parity-scale-codec = { workspace = true, features = [ "derive" ] }
tokio = { workspace = true }
tokio-util = { workspace = true, features = [ "rt" ] }
tracing = { workspace = true }

[dev-dependencies]
cumulus-test-relay-sproof-builder = { workspace = true }
futures-timer = { workspace = true }
orchestra = { workspace = true, features = [ "futures_channel" ] }
parking_lot = { workspace = true }
polkadot-core-primitives = { workspace = true }
polkadot-node-subsystem-test-helpers = { workspace = true }
polkadot-node-subsystem-util = { workspace = true }
polkadot-parachain-primitives = { workspace = true }
sc-block-builder = { workspace = true }
sc-keystore = { workspace = true }
sc-network-test = { workspace = true }
sp-keyring = { workspace = true }
sp-tracing = { workspace = true }
substrate-test-runtime-client = { workspace = true }
tempfile = { workspace = true }
8 changes: 6 additions & 2 deletions client/consensus/src/collators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ where
&self,
relay_parent: PHash,
validation_data: &PersistedValidationData,
parent_hash: Block::Hash,
parent_hash: <Block as BlockT>::Hash,
_timestamp: impl Into<Option<Timestamp>>,
) -> Result<(ParachainInherentData, InherentData), Box<dyn Error + Send + Sync + 'static>> {
let paras_inherent_data = ParachainInherentDataProvider::create_at(
Expand Down Expand Up @@ -161,7 +161,11 @@ where
proposal_duration: Duration,
max_pov_size: usize,
) -> Result<
Option<(Collation, ParachainBlockData<Block>, Block::Hash)>,
Option<(
Collation,
ParachainBlockData<Block>,
<Block as BlockT>::Hash,
)>,
Box<dyn Error + Send + 'static>,
> {
let mut digest = additional_pre_digest.into().unwrap_or_default();
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/src/collators/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ pub async fn run<Block, P, BI, CIDP, Client, RClient, SO, Proposer, CS, GOH>(
// Essentially checks that the latest head we are trying to build
// is the one included in the relay
async fn can_build_upon_included<Block: BlockT, RClient>(
parent_hash: Block::Hash,
parent_hash: <Block as BlockT>::Hash,
relay_client: &RClient,
para_id: ParaId,
relay_parent: PHash,
Expand Down
7 changes: 3 additions & 4 deletions client/consensus/src/collators/lookahead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ use {
async_backing_primitives::UnincludedSegmentApi,
cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface,
cumulus_client_consensus_common::{
self as consensus_common, load_abridged_host_configuration, ParachainBlockImportMarker,
ParentSearchParams,
self as consensus_common, load_abridged_host_configuration, ParentSearchParams,
},
cumulus_client_consensus_proposer::ProposerInterface,
cumulus_primitives_core::{
Expand Down Expand Up @@ -404,7 +403,7 @@ where
+ 'static
+ Clone,
CIDP::InherentDataProviders: Send + InherentDataProviderExt,
BI: BlockImport<Block> + ParachainBlockImportMarker + Send + Sync + 'static,
BI: BlockImport<Block> + Send + Sync + 'static,
SO: SyncOracle + Send + Sync + Clone + 'static,
Proposer: ProposerInterface<Block> + Send + Sync + 'static,
CS: CollatorServiceInterface<Block> + Send + Sync + 'static,
Expand Down Expand Up @@ -780,7 +779,7 @@ async fn can_build_upon<Block: BlockT, Client, P>(
slot: Slot,
aux_data: OrchestratorAuraWorkerAuxData<P>,
parent_header: Block::Header,
included_block: Block::Hash,
included_block: <Block as BlockT>::Hash,
force_authoring: bool,
client: &Client,
keystore: &KeystorePtr,
Expand Down
4 changes: 2 additions & 2 deletions client/consensus/src/consensus_orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub trait RetrieveAuthoritiesFromOrchestrator<Block: BlockT, ExtraArgs, A>: Send
/// Create the inherent data providers at the given `parent` block using the given `extra_args`.
async fn retrieve_authorities_from_orchestrator(
&self,
parent: Block::Hash,
parent: <Block as BlockT>::Hash,
extra_args: ExtraArgs,
) -> Result<A, Box<dyn std::error::Error + Send + Sync>>;
}
Expand All @@ -48,7 +48,7 @@ where
{
async fn retrieve_authorities_from_orchestrator(
&self,
parent: Block::Hash,
parent: <Block as BlockT>::Hash,
extra_args: ExtraArgs,
) -> Result<A, Box<dyn std::error::Error + Send + Sync>> {
(*self)(parent, extra_args).await
Expand Down
2 changes: 2 additions & 0 deletions client/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ pub mod collators;
mod consensus_orchestrator;
mod manual_seal;

#[cfg(test)]
mod mocks;
#[cfg(test)]
mod tests;

Expand Down
Loading

0 comments on commit e8b291b

Please sign in to comment.