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

Commit 2c8a404

Browse files
andresilvagavofyork
andcommitted
v0.6: merge master branch (#497)
* add authority discovery module (#444) * grandpa: set justification period to 512 blocks (#445) * lock (#446) * Kusama CC2 spec (#449) * update readme for cc2 (#453) * docs: add security policy (#450) * docs: add security policy * Update SECURITY.md Co-Authored-By: joe petrowski <[email protected]> * Enable `substrate-session` `std` feature and remove unused traits (#456) * update (#457) * Update latest substrate master (#462) * update substrate to latest polkadot-master * fix test runtime * Fix compilation in wasm (#465) Also fix the weird file structure by making `wasm_executor.rs` -> `wasm_executor/mod.rs`. * Make `ParachainContext` take self as mutable (#458) This replicates changes to `Environment`/`Proposer` that are used internally at Cumulus. * wasm_executor: fix wasm signature checker (#471) Signed-off-by: yjhmelody <[email protected]> * Changes for substrate#3699 (#466) * change upstream and branch * Fix build * remove doc renamings * Fix tests * . * Revert changing fork and branch * Update Cargo.toml * Update parachains.rs * update branch name in Cargo.lock (#473) * Introduce Parathreads (runtime) (#341) * Rest of parathread draft implementation, parachain permissioning. * Update Substrate * Update Substrate again * Integrate weight/fee stuff. * Council * Build fixes * More fixes * Minor additions * fix some small errors * Revert "fix some small errors" This reverts commit 4fb52c8. * Merge fix. * do_swap -> on_swap * Update depdendency to polkadot-master * Fix more merge problems * Some patching of errors * Fix storage closure * Actually fix storage. It builds! * Tests run... but not successfully. * Add `run_to_block` to get parachains active to start * More `run_to_block` * Fix build * Queue up changes to threads * Move registration test * Fix regsiter/deregister test * Retry queue. * Minor refactor * Refactor to avoid heavy storage items * Make tests pass * remove para on deregister, add events * Remove println * Fix register/deregister parathread test * fix merge * Parathread can be activated test * Test auction * Add `Debtors` storage item I considered putting the debtor information in `ParaInfo`, but it did not make sense to me since this information only applies to parathreads, not `paras` in general. * remove comment code * Some new tests * Fixes for removing threads when scheduled. Tests. * Test progression of threads. * Test that reschedule queuing works properly. * Make test slightly more interesting * whitespace * Swap works properly. * Update locks * Build * Rename can_swap * Add test for funds to be correctly returned after a swap Swap does not seem to have logic which correctly swaps the debtor account to the new parathread. * Make tests consistant * Add check that `PendingSwap` is cleaned up * Update runtime/src/parachains.rs Co-Authored-By: Robert Habermeier <[email protected]> * Update runtime/src/registrar.rs Co-Authored-By: Robert Habermeier <[email protected]> * Some fixes/suggestions from review * Docs * Apply suggestions from code review Co-Authored-By: Robert Habermeier <[email protected]> Co-Authored-By: Shawn Tabrizi <[email protected]> * Update network/src/gossip.rs Co-Authored-By: Robert Habermeier <[email protected]> * Rename OnSwap * Add missing `]` * Rejig ordering semantics, making everything a bit slower but correct. * Some Fixes to Parathread Compile (#470) * Some Fixes * Fix queue_upward_messages * Change back to const * Build fixes * Fix tests * Update to latest Substrate master (#472) * Update to latest Substrate master * Fix * Fix compilation * fix var name for post_upward_message (#474) Signed-off-by: yjhmelody <[email protected]> * change versioning and tagging of releases (#476) * change versioning and tagging of releases * Make `ParaId` constructible from a const context (#483) * Pass `client` and `task_executor` to `BuildParachainContext` (#484) * Pass `client` and `task_executor` to `BuildParachainContext` * Update `Cargo.lock` * integrate minor weight/fee changes (#482) * Update cargo files * Make it build again. * Fix build * revert cargo file * New lockfile * Bump. * Update to latest Substrate master (#486) * Fixes required for Cumulus (#485) * Collator node need to register all gossip validators as well * Make sure that parachain authorities are only written once at genesis * Fix test * fix dockerfile build - upgrade image base from ubuntu 16 to 18 (#423) * Only register one gossip validator for full nodes (#487) * ci: fix publishing of ci builds (#488) * Support `account_nextIndex` RPC. (#460) * Use node-rpc extensions to support account_nextIndex. * Remove todo. * Update lock. * Use new srml_system_rpc crate. * Update to substrate=master * Update lockfile. * Update to polkadot-master. * Apply suggestions from code review Co-Authored-By: Bastian Köcher <[email protected]> * Update to latest substrate master (#491) * update to latest substrate master * Fix compilation * Switch elections to Phragmen, enable them in PoA (#492) * Switch elections to Phragmen, enable them in PoA * Remove superfluous code. * Build fixes * Update to substrate master * Build fixes * Add warning * Disable authority discovery for now * Remove commented code * Fix warning * service: cleanup task spawning (#495) * Update to latest substrate polkadot-master (#496) * update to latest substrate polkadot-master * Bump to 0.6.3 * service: don't use the grandpa observer (#494) (#498) * service: don't use the grandpa observer * service: remove unnecessary boxing * service: fix indentation * service: remove unnecessary on_exit tasks spawned with `spawn_task`/`spawn_essential_task` are already guarded by `on_exit`. * Update service/src/lib.rs Co-Authored-By: Gavin Wood <[email protected]>
1 parent a467bb2 commit 2c8a404

Some content is hidden

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

41 files changed

+2393
-612
lines changed

Cargo.lock

+164-139
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ path = "src/main.rs"
44

55
[package]
66
name = "polkadot"
7-
version = "0.6.2"
7+
version = "0.6.3"
88
authors = ["Parity Technologies <[email protected]>"]
99
build = "build.rs"
1010
edition = "2018"

README.adoc

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ In 2017 we split our implementation of "Polkadot" from its platform-level compon
1212

1313
We are actively building both Substrate and Polkadot, but things will be a little odd for a while. If you see "substrate" and are wondering why you need it for Polkadot, now you know.
1414

15-
To connect on the "Kusama" canary network, you will want the `v0.5` code which is in this **Polkadot** repo. To play on the ("Alexander") testnet, you'll want the PoC-4 code instead. Note that PoC-3 uses the Alexander testnet, but will not be able to sync to the latest block.
15+
To connect on the "Kusama" canary network, you will want the `v0.6` code, which is in this **Polkadot** repo. To play on the ("Alexander") testnet, you'll want the PoC-4 code instead. Note that PoC-3 uses the Alexander testnet, but will not be able to sync to the latest block.
1616

17-
* **Kusama** is in this link:https://github.com/paritytech/polkadot/tree/v0.5[**Polkadot**] repo branch `v0.5`.
17+
* **Kusama** is in this link:https://github.com/paritytech/polkadot/tree/v0.6[**Polkadot**] repo branch `v0.6`.
1818

1919
* **Polkadot PoC-4 "Alexander"** is in this link:https://github.com/paritytech/polkadot/tree/v0.4[**Polkadot**] repo branch `v0.4`.
2020

@@ -48,7 +48,7 @@ rustup update
4848
Build Kusama by cloning this repository and running the following commands from the root directory of the repo:
4949

5050
```bash
51-
git checkout v0.5
51+
git checkout v0.6
5252
./scripts/init.sh
5353
cargo build --release
5454
```
@@ -59,6 +59,8 @@ Connect to the global Kusama canary network by default by running:
5959
./target/release/polkadot
6060
```
6161

62+
You can see your node on link:https://telemetry.polkadot.io/#list/Kusama%20CC2[telemetry].
63+
6264
=== Install PoC-4 on "Alexander" Testnet
6365

6466
Build Polkadot PoC-4 by cloning this repository and running the following commands from the root directory of the repo:

SECURITY.md

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Security Policy
2+
3+
Parity Technologies is committed to resolving security vulnerabilities in our software quickly and carefully. We take the necessary steps to minimize risk, provide timely information, and deliver vulnerability fixes and mitigations required to address security issues.
4+
5+
## Reporting a Vulnerability
6+
7+
Security vulnerabilities in Parity software should be reported by email to [email protected]. If you think your report might be eligible for the Parity Bug Bounty Program, your email should be sent to [email protected].
8+
9+
Your report should include the following:
10+
11+
- your name
12+
- description of the vulnerability
13+
- attack scenario (if any)
14+
- components
15+
- reproduction
16+
- other details
17+
18+
Try to include as much information in your report as you can, including a description of the vulnerability, its potential impact, and steps for reproducing it. Be sure to use a descriptive subject line.
19+
20+
You'll receive a response to your email within two business days indicating the next steps in handling your report. We encourage finders to use encrypted communication channels to protect the confidentiality of vulnerability reports. You can encrypt your report using our public key. This key is [on MIT's key server](https://pgp.mit.edu/pks/lookup?op=get&search=0x5D0F03018D07DE73) server and reproduced below.
21+
22+
After the initial reply to your report, our team will endeavor to keep you informed of the progress being made towards a fix. These updates will be sent at least every five business days.
23+
24+
Thank you for taking the time to responsibly disclose any vulnerabilities you find.
25+
26+
## Responsible Investigation and Reporting
27+
28+
Responsible investigation and reporting includes, but isn't limited to, the following:
29+
30+
- Don't violate the privacy of other users, destroy data, etc.
31+
- Don’t defraud or harm Parity Technologies Ltd or its users during your research; you should make a good faith effort to not interrupt or degrade our services.
32+
- Don't target our physical security measures, or attempt to use social engineering, spam, distributed denial of service (DDOS) attacks, etc.
33+
- Initially report the bug only to us and not to anyone else.
34+
- Give us a reasonable amount of time to fix the bug before disclosing it to anyone else, and give us adequate written warning before disclosing it to anyone else.
35+
- In general, please investigate and report bugs in a way that makes a reasonable, good faith effort not to be disruptive or harmful to us or our users. Otherwise your actions might be interpreted as an attack rather than an effort to be helpful.
36+
37+
## Bug Bounty Program
38+
39+
Our Bug Bounty Program allows us to recognise and reward members of the Parity community for helping us find and address significant bugs, in accordance with the terms of the Parity Bug Bounty Program. A detailed description on eligibility, rewards, legal information and terms & conditions for contributors can be found on [our website](https://paritytech.io/bug-bounty.html).
40+
41+
42+
43+
44+
45+
46+
## Plaintext PGP Key
47+
48+
```
49+
-----BEGIN PGP PUBLIC KEY BLOCK-----
50+
51+
mQINBF0vHwQBEADKui4qAo4bzdzRhMm+uhUpYGf8jjjmET3zJ8kKQIpp6JTsV+HJ
52+
6m1We0QYeMRXoOYH1xVHBf2zNCuHS0nSQdUCQA7SHWsPB05STa2hvlR7fSdQnCCp
53+
gnLOJWXvvedlRDIAhvqI6cwLdUlXgVSKEwrwmrpiBhh4NxI3qX+LyIa+Ovkchu2S
54+
d/YCnE4GqojSGRfJYiGwe2N+sF7OfaoKhQuTrtdDExHrMU4cWnTXW2wyxTr4xkj9
55+
jS2WeLVZWflvkDHT8JD9N6jNxBVEF/Qvjk83zI0kCOzkhek8x+YUgfLq3/rHOYbX
56+
3pW21ccHYPacHjHWvKE+xRebjeEhJ4KxKHfCVjQcxybwDBqDka1AniZt4CQ7UORf
57+
MU/ue2oSZ9nNg0uMdb/0AbQPZ04OlMcYPAPWzFL08nVPox9wT9uqlL6JtcOeC90h
58+
oOeDmfgwmjMmdwWTRgt9qQjcbgXzVvuAzIGbzj1X3MdLspWdHs/d2+US4nji1TkN
59+
oYIW7vE+xkd3aB+NZunIlm9Rwd/0mSgDg+DaNa5KceOLhq0/qKgcXC/RRU29I8II
60+
tusRoR/oesGJGYTjh4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euDYTbVWu
92+
+ZtHQef+pRteki3wvNLJK+kC1y3BtHqDJS9Lqx0s8SCiVozlC+fZfC9hCtU7bXJK
93+
0UJZ4qjSvj6whzfaNgOZAqJpmwgOnd8W/3YJk1DwUeX98FcU38MR23SOkx2EDdDE
94+
77Kdu62vTs/tLmOTuyKBvYPaHaYulYjQTxurG+o8vhHtaL87ARvuq+83dj+nO5z3
95+
5O9vkcVJYWjOEnJe7ZvCTxeLJehpCmHIbyUuDx5P24MWVbyXOxIlxNxTqlub5GlW
96+
rQF6Qsa/0k9TRk7Htbct6fAA0/VahJS0g096MrTH8AxBXDNE8lIoNeGikVlaxK9Z
97+
S+aannlWYIJymZ4FygIPPaRlzhAoXBuJd8OaR5giC7dS1xquxKOiQEXTGsLeGFaI
98+
BZYiIhW7GG4ozvKDqyNm4eg=
99+
=yKcB
100+
-----END PGP PUBLIC KEY BLOCK-----
101+
```

availability-store/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "polkadot-availability-store"
33
description = "Persistent database for parachain data"
4-
version = "0.6.2"
4+
version = "0.6.3"
55
authors = ["Parity Technologies <[email protected]>"]
66
edition = "2018"
77

cli/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "polkadot-cli"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
authors = ["Parity Technologies <[email protected]>"]
55
description = "Polkadot node implementation in Rust."
66
edition = "2018"

collator/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
22
name = "polkadot-collator"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
authors = ["Parity Technologies <[email protected]>"]
55
description = "Collator node implementation"
66
edition = "2018"
77

88
[dependencies]
99
futures = "0.1.17"
10-
futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] }
10+
futures03 = { package = "futures-preview", version = "0.3.0-alpha.18", features = ["compat"] }
1111
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
1212
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
1313
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }

collator/src/lib.rs

+50-19
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@ use std::time::Duration;
5151

5252
use futures::{future, Stream, Future, IntoFuture};
5353
use futures03::{TryStreamExt as _, StreamExt as _};
54-
use log::{info, warn};
54+
use log::{warn, error};
5555
use client::BlockchainEvents;
56-
use primitives::Pair;
56+
use primitives::{Pair, Blake2Hasher};
5757
use polkadot_primitives::{
5858
BlockId, Hash, Block,
5959
parachain::{
60-
self, BlockData, DutyRoster, HeadData, ConsolidatedIngress, Message, Id as ParaId, OutgoingMessages,
61-
PoVBlock, Status as ParachainStatus, ValidatorId, CollatorPair,
60+
self, BlockData, DutyRoster, HeadData, ConsolidatedIngress, Message, Id as ParaId,
61+
OutgoingMessages, PoVBlock, Status as ParachainStatus, ValidatorId, CollatorPair,
6262
}
6363
};
6464
use polkadot_cli::{
65-
Worker, IntoExit, ProvideRuntimeApi, TaskExecutor, AbstractService,
66-
CustomConfiguration, ParachainHost,
65+
Worker, IntoExit, ProvideRuntimeApi, AbstractService, CustomConfiguration, ParachainHost,
6766
};
6867
use polkadot_network::validation::{LeafWorkParams, ValidationNetwork};
6968
use polkadot_network::{PolkadotNetworkService, PolkadotProtocol};
69+
use polkadot_runtime::RuntimeApi;
7070
use tokio::timer::Timeout;
7171

72-
pub use polkadot_cli::VersionInfo;
72+
pub use polkadot_cli::{VersionInfo, TaskExecutor};
7373
pub use polkadot_network::validation::Incoming;
7474
pub use polkadot_validation::SignedStatement;
7575
pub use polkadot_primitives::parachain::CollatorId;
@@ -128,13 +128,24 @@ impl<R: fmt::Display> fmt::Display for Error<R> {
128128
}
129129
}
130130

131+
/// The Polkadot client type.
132+
pub type PolkadotClient<B, E> = client::Client<B, E, Block, RuntimeApi>;
133+
131134
/// Something that can build a `ParachainContext`.
132135
pub trait BuildParachainContext {
133136
/// The parachain context produced by the `build` function.
134137
type ParachainContext: self::ParachainContext;
135138

136139
/// Build the `ParachainContext`.
137-
fn build(self, network: Arc<dyn Network>) -> Result<Self::ParachainContext, ()>;
140+
fn build<B, E>(
141+
self,
142+
client: Arc<PolkadotClient<B, E>>,
143+
task_executor: TaskExecutor,
144+
network: Arc<dyn Network>,
145+
) -> Result<Self::ParachainContext, ()>
146+
where
147+
B: client::backend::Backend<Block, Blake2Hasher> + 'static,
148+
E: client::CallExecutor<Block, Blake2Hasher> + Clone + Send + Sync + 'static;
138149
}
139150

140151
/// Parachain context needed for collation.
@@ -147,7 +158,7 @@ pub trait ParachainContext: Clone {
147158
/// Produce a candidate, given the relay parent hash, the latest ingress queue information
148159
/// and the last parachain head.
149160
fn produce_candidate<I: IntoIterator<Item=(ParaId, Message)>>(
150-
&self,
161+
&mut self,
151162
relay_parent: Hash,
152163
status: ParachainStatus,
153164
ingress: I,
@@ -174,7 +185,7 @@ pub fn collate<'a, R, P>(
174185
local_id: ParaId,
175186
parachain_status: ParachainStatus,
176187
relay_context: R,
177-
para_context: P,
188+
mut para_context: P,
178189
key: Arc<CollatorPair>,
179190
)
180191
-> impl Future<Item=(parachain::Collation, OutgoingMessages), Error=Error<R::Error>> + 'a
@@ -289,10 +300,18 @@ impl<P, E> Worker for CollationNode<P, E> where
289300
}
290301

291302
fn work<S, SC, B, CE>(self, service: &S, task_executor: TaskExecutor) -> Self::Work
292-
where S: AbstractService<Block = polkadot_service::Block, RuntimeApi = polkadot_service::RuntimeApi, Backend = B, SelectChain = SC, NetworkSpecialization = PolkadotProtocol, CallExecutor = CE>,
293-
SC: polkadot_service::SelectChain<polkadot_service::Block> + 'static,
294-
B: polkadot_service::Backend<polkadot_service::Block, polkadot_service::Blake2Hasher> + 'static,
295-
CE: polkadot_service::CallExecutor<polkadot_service::Block, polkadot_service::Blake2Hasher> + Clone + Send + Sync + 'static
303+
where
304+
S: AbstractService<
305+
Block = Block,
306+
RuntimeApi = RuntimeApi,
307+
Backend = B,
308+
SelectChain = SC,
309+
NetworkSpecialization = PolkadotProtocol,
310+
CallExecutor = CE,
311+
>,
312+
SC: polkadot_service::SelectChain<Block> + 'static,
313+
B: client::backend::Backend<Block, Blake2Hasher> + 'static,
314+
CE: client::CallExecutor<Block, Blake2Hasher> + Clone + Send + Sync + 'static
296315
{
297316
let CollationNode { build_parachain_context, exit, para_id, key } = self;
298317
let client = service.client();
@@ -301,7 +320,7 @@ impl<P, E> Worker for CollationNode<P, E> where
301320
let select_chain = if let Some(select_chain) = service.select_chain() {
302321
select_chain
303322
} else {
304-
info!("The node cannot work because it can't select chain.");
323+
error!("The node cannot work because it can't select chain.");
305324
return Box::new(future::err(()));
306325
};
307326

@@ -334,13 +353,25 @@ impl<P, E> Worker for CollationNode<P, E> where
334353
exit.clone(),
335354
message_validator,
336355
client.clone(),
337-
task_executor,
356+
task_executor.clone(),
338357
));
339358

340-
let parachain_context = build_parachain_context.build(validation_network.clone()).unwrap();
359+
let parachain_context = match build_parachain_context.build(
360+
client.clone(),
361+
task_executor,
362+
validation_network.clone(),
363+
) {
364+
Ok(ctx) => ctx,
365+
Err(()) => {
366+
error!("Could not build the parachain context!");
367+
return Box::new(future::err(()))
368+
}
369+
};
370+
341371
let inner_exit = exit.clone();
342372
let work = client.import_notification_stream()
343-
.map(|v| Ok::<_, ()>(v)).compat()
373+
.map(|v| Ok::<_, ()>(v))
374+
.compat()
344375
.for_each(move |notification| {
345376
macro_rules! try_fr {
346377
($e:expr) => {
@@ -489,7 +520,7 @@ mod tests {
489520
type ProduceCandidate = Result<(BlockData, HeadData, OutgoingMessages), InvalidHead>;
490521

491522
fn produce_candidate<I: IntoIterator<Item=(ParaId, Message)>>(
492-
&self,
523+
&mut self,
493524
_relay_parent: Hash,
494525
_status: ParachainStatus,
495526
ingress: I,

docker/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM phusion/baseimage:0.10.2 as builder
1+
FROM phusion/baseimage:0.11 as builder
22
LABEL maintainer "[email protected]"
33
LABEL description="This is the build stage for Polkadot. Here we create the binary."
44

@@ -17,7 +17,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
1717

1818
# ===== SECOND STAGE ======
1919

20-
FROM phusion/baseimage:0.10.2
20+
FROM phusion/baseimage:0.11
2121
LABEL maintainer "[email protected]"
2222
LABEL description="This is the 2nd stage: a very small image where we copy the Polkadot binary."
2323
ARG PROFILE=release

erasure-coding/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "polkadot-erasure-coding"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
authors = ["Parity Technologies <[email protected]>"]
55
edition = "2018"
66

executor/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "polkadot-executor"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
authors = ["Parity Technologies <[email protected]>"]
55
description = "Polkadot node implementation in Rust."
66
edition = "2018"

network/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "polkadot-network"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
authors = ["Parity Technologies <[email protected]>"]
55
description = "Polkadot-specific networking protocol"
66
edition = "2018"

network/src/gossip.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ impl<F, P> ChainContext for (F, P) where
265265
let leaf_id = BlockId::Hash(leaf);
266266
let active_parachains = api.active_parachains(&leaf_id)?;
267267

268-
for para_id in active_parachains {
268+
// TODO: https://github.com/paritytech/polkadot/issues/467
269+
for (para_id, _) in active_parachains {
269270
if let Some(ingress) = api.ingress(&leaf_id, para_id, None)? {
270271
for (_height, _from, queue_root) in ingress.iter() {
271272
with_queue_root(queue_root);

network/src/tests/validation.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use polkadot_primitives::{Block, BlockNumber, Hash, Header, BlockId};
3030
use polkadot_primitives::parachain::{
3131
Id as ParaId, Chain, DutyRoster, ParachainHost, TargetedMessage,
3232
ValidatorId, StructuredUnroutedIngress, BlockIngressRoots, Status,
33-
FeeSchedule, HeadData,
33+
FeeSchedule, HeadData, Retriable, CollatorId
3434
};
3535
use parking_lot::Mutex;
3636
use substrate_client::error::Result as ClientResult;
@@ -177,7 +177,7 @@ impl NetworkService for TestNetwork {
177177
struct ApiData {
178178
validators: Vec<ValidatorId>,
179179
duties: Vec<Chain>,
180-
active_parachains: Vec<ParaId>,
180+
active_parachains: Vec<(ParaId, Option<(CollatorId, Retriable)>)>,
181181
ingress: HashMap<ParaId, StructuredUnroutedIngress>,
182182
}
183183

@@ -279,7 +279,7 @@ impl ParachainHost<Block> for RuntimeApi {
279279
_: ExecutionContext,
280280
_: Option<()>,
281281
_: Vec<u8>,
282-
) -> ClientResult<NativeOrEncoded<Vec<ParaId>>> {
282+
) -> ClientResult<NativeOrEncoded<Vec<(ParaId, Option<(CollatorId, Retriable)>)>>> {
283283
Ok(NativeOrEncoded::Native(self.data.lock().active_parachains.clone()))
284284
}
285285

0 commit comments

Comments
 (0)