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

Commit

Permalink
v0.6: merge master branch (#497)
Browse files Browse the repository at this point in the history
* 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 <25483142+joepetrowski@users.noreply.github.com>

* 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 <465402634@qq.com>

* 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 <rphmeier@gmail.com>

* Update runtime/src/registrar.rs

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* Some fixes/suggestions from review

* Docs

* Apply suggestions from code review

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>
Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update network/src/gossip.rs

Co-Authored-By: Robert Habermeier <rphmeier@gmail.com>

* 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 <465402634@qq.com>

* 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 <bkchr@users.noreply.github.com>

* 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 <gavin@parity.io>
  • Loading branch information
andresilva and gavofyork committed Oct 25, 2019
1 parent a467bb2 commit 2c8a404
Show file tree
Hide file tree
Showing 41 changed files with 2,393 additions and 612 deletions.
303 changes: 164 additions & 139 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ path = "src/main.rs"

[package]
name = "polkadot"
version = "0.6.2"
version = "0.6.3"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
edition = "2018"
Expand Down
8 changes: 5 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ In 2017 we split our implementation of "Polkadot" from its platform-level compon

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.

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.
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.

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

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

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

```bash
git checkout v0.5
git checkout v0.6
./scripts/init.sh
cargo build --release
```
Expand All @@ -59,6 +59,8 @@ Connect to the global Kusama canary network by default by running:
./target/release/polkadot
```

You can see your node on link:https://telemetry.polkadot.io/#list/Kusama%20CC2[telemetry].

=== Install PoC-4 on "Alexander" Testnet

Build Polkadot PoC-4 by cloning this repository and running the following commands from the root directory of the repo:
Expand Down
101 changes: 101 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Security Policy

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.

## Reporting a Vulnerability

Security vulnerabilities in Parity software should be reported by email to security@parity.io. If you think your report might be eligible for the Parity Bug Bounty Program, your email should be sent to bugbounty@parity.io.

Your report should include the following:

- your name
- description of the vulnerability
- attack scenario (if any)
- components
- reproduction
- other details

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.

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.

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.

Thank you for taking the time to responsibly disclose any vulnerabilities you find.

## Responsible Investigation and Reporting

Responsible investigation and reporting includes, but isn't limited to, the following:

- Don't violate the privacy of other users, destroy data, etc.
- 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.
- Don't target our physical security measures, or attempt to use social engineering, spam, distributed denial of service (DDOS) attacks, etc.
- Initially report the bug only to us and not to anyone else.
- 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.
- 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.

## Bug Bounty Program

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).






## Plaintext PGP Key

```
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF0vHwQBEADKui4qAo4bzdzRhMm+uhUpYGf8jjjmET3zJ8kKQIpp6JTsV+HJ
6m1We0QYeMRXoOYH1xVHBf2zNCuHS0nSQdUCQA7SHWsPB05STa2hvlR7fSdQnCCp
gnLOJWXvvedlRDIAhvqI6cwLdUlXgVSKEwrwmrpiBhh4NxI3qX+LyIa+Ovkchu2S
d/YCnE4GqojSGRfJYiGwe2N+sF7OfaoKhQuTrtdDExHrMU4cWnTXW2wyxTr4xkj9
jS2WeLVZWflvkDHT8JD9N6jNxBVEF/Qvjk83zI0kCOzkhek8x+YUgfLq3/rHOYbX
3pW21ccHYPacHjHWvKE+xRebjeEhJ4KxKHfCVjQcxybwDBqDka1AniZt4CQ7UORf
MU/ue2oSZ9nNg0uMdb/0AbQPZ04OlMcYPAPWzFL08nVPox9wT9uqlL6JtcOeC90h
oOeDmfgwmjMmdwWTRgt9qQjcbgXzVvuAzIGbzj1X3MdLspWdHs/d2+US4nji1TkN
oYIW7vE+xkd3aB+NZunIlm9Rwd/0mS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qx0s8SCiVozlC+fZfC9hCtU7bXJK
0UJZ4qjSvj6whzfaNgOZAqJpmwgOnd8W/3YJk1DwUeX98FcU38MR23SOkx2EDdDE
77Kdu62vTs/tLmOTuyKBvYPaHaYulYjQTxurG+o8vhHtaL87ARvuq+83dj+nO5z3
5O9vkcVJYWjOEnJe7ZvCTxeLJehpCmHIbyUuDx5P24MWVbyXOxIlxNxTqlub5GlW
rQF6Qsa/0k9TRk7Htbct6fAA0/VahJS0g096MrTH8AxBXDNE8lIoNeGikVlaxK9Z
S+aannlWYIJymZ4FygIPPaRlzhAoXBuJd8OaR5giC7dS1xquxKOiQEXTGsLeGFaI
BZYiIhW7GG4ozvKDqyNm4eg=
=yKcB
-----END PGP PUBLIC KEY BLOCK-----
```
2 changes: 1 addition & 1 deletion availability-store/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "polkadot-availability-store"
description = "Persistent database for parachain data"
version = "0.6.2"
version = "0.6.3"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-cli"
version = "0.6.2"
version = "0.6.3"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust."
edition = "2018"
Expand Down
4 changes: 2 additions & 2 deletions collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "polkadot-collator"
version = "0.6.2"
version = "0.6.3"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation"
edition = "2018"

[dependencies]
futures = "0.1.17"
futures03 = { package = "futures-preview", version = "0.3.0-alpha.19", features = ["compat"] }
futures03 = { package = "futures-preview", version = "0.3.0-alpha.18", features = ["compat"] }
client = { package = "substrate-client", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
primitives = { package = "substrate-primitives", git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
substrate-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
Expand Down
69 changes: 50 additions & 19 deletions collator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ use std::time::Duration;

use futures::{future, Stream, Future, IntoFuture};
use futures03::{TryStreamExt as _, StreamExt as _};
use log::{info, warn};
use log::{warn, error};
use client::BlockchainEvents;
use primitives::Pair;
use primitives::{Pair, Blake2Hasher};
use polkadot_primitives::{
BlockId, Hash, Block,
parachain::{
self, BlockData, DutyRoster, HeadData, ConsolidatedIngress, Message, Id as ParaId, OutgoingMessages,
PoVBlock, Status as ParachainStatus, ValidatorId, CollatorPair,
self, BlockData, DutyRoster, HeadData, ConsolidatedIngress, Message, Id as ParaId,
OutgoingMessages, PoVBlock, Status as ParachainStatus, ValidatorId, CollatorPair,
}
};
use polkadot_cli::{
Worker, IntoExit, ProvideRuntimeApi, TaskExecutor, AbstractService,
CustomConfiguration, ParachainHost,
Worker, IntoExit, ProvideRuntimeApi, AbstractService, CustomConfiguration, ParachainHost,
};
use polkadot_network::validation::{LeafWorkParams, ValidationNetwork};
use polkadot_network::{PolkadotNetworkService, PolkadotProtocol};
use polkadot_runtime::RuntimeApi;
use tokio::timer::Timeout;

pub use polkadot_cli::VersionInfo;
pub use polkadot_cli::{VersionInfo, TaskExecutor};
pub use polkadot_network::validation::Incoming;
pub use polkadot_validation::SignedStatement;
pub use polkadot_primitives::parachain::CollatorId;
Expand Down Expand Up @@ -128,13 +128,24 @@ impl<R: fmt::Display> fmt::Display for Error<R> {
}
}

/// The Polkadot client type.
pub type PolkadotClient<B, E> = client::Client<B, E, Block, RuntimeApi>;

/// Something that can build a `ParachainContext`.
pub trait BuildParachainContext {
/// The parachain context produced by the `build` function.
type ParachainContext: self::ParachainContext;

/// Build the `ParachainContext`.
fn build(self, network: Arc<dyn Network>) -> Result<Self::ParachainContext, ()>;
fn build<B, E>(
self,
client: Arc<PolkadotClient<B, E>>,
task_executor: TaskExecutor,
network: Arc<dyn Network>,
) -> Result<Self::ParachainContext, ()>
where
B: client::backend::Backend<Block, Blake2Hasher> + 'static,
E: client::CallExecutor<Block, Blake2Hasher> + Clone + Send + Sync + 'static;
}

/// Parachain context needed for collation.
Expand All @@ -147,7 +158,7 @@ pub trait ParachainContext: Clone {
/// Produce a candidate, given the relay parent hash, the latest ingress queue information
/// and the last parachain head.
fn produce_candidate<I: IntoIterator<Item=(ParaId, Message)>>(
&self,
&mut self,
relay_parent: Hash,
status: ParachainStatus,
ingress: I,
Expand All @@ -174,7 +185,7 @@ pub fn collate<'a, R, P>(
local_id: ParaId,
parachain_status: ParachainStatus,
relay_context: R,
para_context: P,
mut para_context: P,
key: Arc<CollatorPair>,
)
-> impl Future<Item=(parachain::Collation, OutgoingMessages), Error=Error<R::Error>> + 'a
Expand Down Expand Up @@ -289,10 +300,18 @@ impl<P, E> Worker for CollationNode<P, E> where
}

fn work<S, SC, B, CE>(self, service: &S, task_executor: TaskExecutor) -> Self::Work
where S: AbstractService<Block = polkadot_service::Block, RuntimeApi = polkadot_service::RuntimeApi, Backend = B, SelectChain = SC, NetworkSpecialization = PolkadotProtocol, CallExecutor = CE>,
SC: polkadot_service::SelectChain<polkadot_service::Block> + 'static,
B: polkadot_service::Backend<polkadot_service::Block, polkadot_service::Blake2Hasher> + 'static,
CE: polkadot_service::CallExecutor<polkadot_service::Block, polkadot_service::Blake2Hasher> + Clone + Send + Sync + 'static
where
S: AbstractService<
Block = Block,
RuntimeApi = RuntimeApi,
Backend = B,
SelectChain = SC,
NetworkSpecialization = PolkadotProtocol,
CallExecutor = CE,
>,
SC: polkadot_service::SelectChain<Block> + 'static,
B: client::backend::Backend<Block, Blake2Hasher> + 'static,
CE: client::CallExecutor<Block, Blake2Hasher> + Clone + Send + Sync + 'static
{
let CollationNode { build_parachain_context, exit, para_id, key } = self;
let client = service.client();
Expand All @@ -301,7 +320,7 @@ impl<P, E> Worker for CollationNode<P, E> where
let select_chain = if let Some(select_chain) = service.select_chain() {
select_chain
} else {
info!("The node cannot work because it can't select chain.");
error!("The node cannot work because it can't select chain.");
return Box::new(future::err(()));
};

Expand Down Expand Up @@ -334,13 +353,25 @@ impl<P, E> Worker for CollationNode<P, E> where
exit.clone(),
message_validator,
client.clone(),
task_executor,
task_executor.clone(),
));

let parachain_context = build_parachain_context.build(validation_network.clone()).unwrap();
let parachain_context = match build_parachain_context.build(
client.clone(),
task_executor,
validation_network.clone(),
) {
Ok(ctx) => ctx,
Err(()) => {
error!("Could not build the parachain context!");
return Box::new(future::err(()))
}
};

let inner_exit = exit.clone();
let work = client.import_notification_stream()
.map(|v| Ok::<_, ()>(v)).compat()
.map(|v| Ok::<_, ()>(v))
.compat()
.for_each(move |notification| {
macro_rules! try_fr {
($e:expr) => {
Expand Down Expand Up @@ -489,7 +520,7 @@ mod tests {
type ProduceCandidate = Result<(BlockData, HeadData, OutgoingMessages), InvalidHead>;

fn produce_candidate<I: IntoIterator<Item=(ParaId, Message)>>(
&self,
&mut self,
_relay_parent: Hash,
_status: ParachainStatus,
ingress: I,
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM phusion/baseimage:0.10.2 as builder
FROM phusion/baseimage:0.11 as builder
LABEL maintainer "chevdor@gmail.com"
LABEL description="This is the build stage for Polkadot. Here we create the binary."

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

# ===== SECOND STAGE ======

FROM phusion/baseimage:0.10.2
FROM phusion/baseimage:0.11
LABEL maintainer "chevdor@gmail.com"
LABEL description="This is the 2nd stage: a very small image where we copy the Polkadot binary."
ARG PROFILE=release
Expand Down
2 changes: 1 addition & 1 deletion erasure-coding/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-erasure-coding"
version = "0.6.2"
version = "0.6.3"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-executor"
version = "0.6.2"
version = "0.6.3"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust."
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion network/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-network"
version = "0.6.2"
version = "0.6.3"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
Expand Down
3 changes: 2 additions & 1 deletion network/src/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ impl<F, P> ChainContext for (F, P) where
let leaf_id = BlockId::Hash(leaf);
let active_parachains = api.active_parachains(&leaf_id)?;

for para_id in active_parachains {
// TODO: https://github.com/paritytech/polkadot/issues/467
for (para_id, _) in active_parachains {
if let Some(ingress) = api.ingress(&leaf_id, para_id, None)? {
for (_height, _from, queue_root) in ingress.iter() {
with_queue_root(queue_root);
Expand Down
6 changes: 3 additions & 3 deletions network/src/tests/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use polkadot_primitives::{Block, BlockNumber, Hash, Header, BlockId};
use polkadot_primitives::parachain::{
Id as ParaId, Chain, DutyRoster, ParachainHost, TargetedMessage,
ValidatorId, StructuredUnroutedIngress, BlockIngressRoots, Status,
FeeSchedule, HeadData,
FeeSchedule, HeadData, Retriable, CollatorId
};
use parking_lot::Mutex;
use substrate_client::error::Result as ClientResult;
Expand Down Expand Up @@ -177,7 +177,7 @@ impl NetworkService for TestNetwork {
struct ApiData {
validators: Vec<ValidatorId>,
duties: Vec<Chain>,
active_parachains: Vec<ParaId>,
active_parachains: Vec<(ParaId, Option<(CollatorId, Retriable)>)>,
ingress: HashMap<ParaId, StructuredUnroutedIngress>,
}

Expand Down Expand Up @@ -279,7 +279,7 @@ impl ParachainHost<Block> for RuntimeApi {
_: ExecutionContext,
_: Option<()>,
_: Vec<u8>,
) -> ClientResult<NativeOrEncoded<Vec<ParaId>>> {
) -> ClientResult<NativeOrEncoded<Vec<(ParaId, Option<(CollatorId, Retriable)>)>>> {
Ok(NativeOrEncoded::Native(self.data.lock().active_parachains.clone()))
}

Expand Down
Loading

0 comments on commit 2c8a404

Please sign in to comment.