mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
Update to new gossip system. (#172)
* Integrates new gossip system into Polkadot (#166) * new gossip validation in network * integrate new gossip into service * Fix build * Fix claims module * fix warning * update to latest master again * update runtime
This commit is contained in:
committed by
Bastian Köcher
parent
a918f5b1a0
commit
7e6183f74c
Generated
+289
-365
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,169 @@
|
||||
// Copyright 2019 Parity Technologies (UK) Ltd.
|
||||
// This file is part of Polkadot.
|
||||
|
||||
// Polkadot is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
|
||||
// Polkadot is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Gossip messages and the message validator
|
||||
|
||||
use substrate_network::consensus_gossip::{
|
||||
self as network_gossip, ValidationResult as GossipValidationResult,
|
||||
};
|
||||
use polkadot_validation::SignedStatement;
|
||||
use polkadot_primitives::{Hash, SessionKey};
|
||||
use codec::Decode;
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::RwLock;
|
||||
|
||||
use super::NetworkService;
|
||||
|
||||
/// The engine ID of the polkadot attestation system.
|
||||
pub const POLKADOT_ENGINE_ID: substrate_network::ConsensusEngineId = [b'd', b'o', b't', b'1'];
|
||||
|
||||
/// A gossip message.
|
||||
#[derive(Encode, Decode, Clone)]
|
||||
pub(crate) struct GossipMessage {
|
||||
/// The relay chain parent hash.
|
||||
pub(crate) relay_parent: Hash,
|
||||
/// The signed statement being gossipped.
|
||||
pub(crate) statement: SignedStatement,
|
||||
}
|
||||
|
||||
/// whether a block is known.
|
||||
pub enum Known {
|
||||
/// The block is a known leaf.
|
||||
Leaf,
|
||||
/// The block is known to be old.
|
||||
Old,
|
||||
/// The block is known to be bad.
|
||||
Bad,
|
||||
}
|
||||
|
||||
/// An oracle for known blocks.
|
||||
pub trait KnownOracle: Send + Sync {
|
||||
/// whether a block is known. If it's not, returns `None`.
|
||||
fn is_known(&self, block_hash: &Hash) -> Option<Known>;
|
||||
}
|
||||
|
||||
impl<F> KnownOracle for F where F: Fn(&Hash) -> Option<Known> + Send + Sync {
|
||||
fn is_known(&self, block_hash: &Hash) -> Option<Known> {
|
||||
(self)(block_hash)
|
||||
}
|
||||
}
|
||||
|
||||
/// Register a gossip validator on the network service.
|
||||
///
|
||||
/// This returns a `RegisteredMessageValidator`
|
||||
// NOTE: since RegisteredMessageValidator is meant to be a type-safe proof
|
||||
// that we've actually done the registration, this should be the only way
|
||||
// to construct it outside of tests.
|
||||
pub fn register_validator<O: KnownOracle + 'static>(
|
||||
service: &NetworkService,
|
||||
oracle: O,
|
||||
) -> RegisteredMessageValidator {
|
||||
let validator = Arc::new(MessageValidator {
|
||||
live_session: RwLock::new(HashMap::new()),
|
||||
oracle,
|
||||
});
|
||||
|
||||
let gossip_side = validator.clone();
|
||||
service.with_gossip(|gossip, _| gossip.register_validator(POLKADOT_ENGINE_ID, gossip_side));
|
||||
|
||||
RegisteredMessageValidator { inner: validator as _ }
|
||||
}
|
||||
|
||||
/// A registered message validator.
|
||||
///
|
||||
/// Create this using `register_validator`.
|
||||
#[derive(Clone)]
|
||||
pub struct RegisteredMessageValidator {
|
||||
inner: Arc<MessageValidator<KnownOracle>>,
|
||||
}
|
||||
|
||||
impl RegisteredMessageValidator {
|
||||
#[cfg(test)]
|
||||
pub(crate) fn new_test<O: KnownOracle + 'static>(oracle: O) -> Self {
|
||||
let validator = Arc::new(MessageValidator {
|
||||
live_session: RwLock::new(HashMap::new()),
|
||||
oracle,
|
||||
});
|
||||
|
||||
RegisteredMessageValidator { inner: validator as _ }
|
||||
}
|
||||
|
||||
/// Note a live attestation session. This must be removed later with
|
||||
/// `remove_session`.
|
||||
pub(crate) fn note_session(&self, relay_parent: Hash, validation: MessageValidationData) {
|
||||
self.inner.live_session.write().insert(relay_parent, validation);
|
||||
}
|
||||
|
||||
/// Remove a live attestation session when it is no longer live.
|
||||
pub(crate) fn remove_session(&self, relay_parent: &Hash) {
|
||||
self.inner.live_session.write().remove(relay_parent);
|
||||
}
|
||||
}
|
||||
|
||||
// data needed for validating gossip.
|
||||
pub(crate) struct MessageValidationData {
|
||||
/// The authorities at a block.
|
||||
pub(crate) authorities: Vec<SessionKey>,
|
||||
}
|
||||
|
||||
impl MessageValidationData {
|
||||
fn check_statement(&self, relay_parent: &Hash, statement: &SignedStatement) -> bool {
|
||||
self.authorities.contains(&statement.sender) &&
|
||||
::polkadot_validation::check_statement(
|
||||
&statement.statement,
|
||||
&statement.signature,
|
||||
statement.sender,
|
||||
relay_parent,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// An unregistered message validator. Register this with `register_validator`.
|
||||
pub struct MessageValidator<O: ?Sized> {
|
||||
live_session: RwLock<HashMap<Hash, MessageValidationData>>,
|
||||
oracle: O,
|
||||
}
|
||||
|
||||
impl<O: KnownOracle + ?Sized> network_gossip::Validator<Hash> for MessageValidator<O> {
|
||||
fn validate(&self, mut data: &[u8]) -> GossipValidationResult<Hash> {
|
||||
match GossipMessage::decode(&mut data) {
|
||||
Some(GossipMessage { relay_parent, statement }) => {
|
||||
let live = self.live_session.read();
|
||||
let topic = || ::router::attestation_topic(relay_parent.clone());
|
||||
if let Some(validation) = live.get(&relay_parent) {
|
||||
if validation.check_statement(&relay_parent, &statement) {
|
||||
GossipValidationResult::Valid(topic())
|
||||
} else {
|
||||
GossipValidationResult::Invalid
|
||||
}
|
||||
} else {
|
||||
match self.oracle.is_known(&relay_parent) {
|
||||
None | Some(Known::Leaf) => GossipValidationResult::Future(topic()),
|
||||
Some(Known::Old) => GossipValidationResult::Expired,
|
||||
Some(Known::Bad) => GossipValidationResult::Invalid,
|
||||
}
|
||||
}
|
||||
}
|
||||
None => {
|
||||
debug!(target: "validation", "Error decoding gossip message");
|
||||
GossipValidationResult::Invalid
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ mod collator_pool;
|
||||
mod local_collations;
|
||||
mod router;
|
||||
pub mod validation;
|
||||
pub mod gossip;
|
||||
|
||||
use codec::{Decode, Encode};
|
||||
use futures::sync::oneshot;
|
||||
|
||||
@@ -41,12 +41,14 @@ use std::collections::{hash_map::{Entry, HashMap}, HashSet};
|
||||
use std::{io, mem};
|
||||
use std::sync::Arc;
|
||||
|
||||
use gossip::{RegisteredMessageValidator};
|
||||
use validation::{NetworkService, Knowledge, Executor};
|
||||
|
||||
type IngressPair = (ParaId, Vec<Message>);
|
||||
type IngressPairRef<'a> = (ParaId, &'a [Message]);
|
||||
|
||||
fn attestation_topic(parent_hash: Hash) -> Hash {
|
||||
/// Compute the gossip topic for attestations on the given parent hash.
|
||||
pub(crate) fn attestation_topic(parent_hash: Hash) -> Hash {
|
||||
let mut v = parent_hash.as_ref().to_vec();
|
||||
v.extend(b"attestations");
|
||||
|
||||
@@ -124,6 +126,7 @@ pub struct Router<P, E, N: NetworkService, T> {
|
||||
knowledge: Arc<Mutex<Knowledge>>,
|
||||
fetch_incoming: Arc<Mutex<HashMap<ParaId, IncomingReceiver>>>,
|
||||
deferred_statements: Arc<Mutex<DeferredStatements>>,
|
||||
message_validator: RegisteredMessageValidator,
|
||||
}
|
||||
|
||||
impl<P, E, N: NetworkService, T> Router<P, E, N, T> {
|
||||
@@ -135,6 +138,7 @@ impl<P, E, N: NetworkService, T> Router<P, E, N, T> {
|
||||
parent_hash: Hash,
|
||||
knowledge: Arc<Mutex<Knowledge>>,
|
||||
exit: E,
|
||||
message_validator: RegisteredMessageValidator,
|
||||
) -> Self {
|
||||
Router {
|
||||
table,
|
||||
@@ -147,6 +151,7 @@ impl<P, E, N: NetworkService, T> Router<P, E, N, T> {
|
||||
fetch_incoming: Arc::new(Mutex::new(HashMap::new())),
|
||||
deferred_statements: Arc::new(Mutex::new(DeferredStatements::new())),
|
||||
exit,
|
||||
message_validator,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,6 +174,7 @@ impl<P, E: Clone, N: NetworkService, T: Clone> Clone for Router<P, E, N, T> {
|
||||
fetch_incoming: self.fetch_incoming.clone(),
|
||||
knowledge: self.knowledge.clone(),
|
||||
exit: self.exit.clone(),
|
||||
message_validator: self.message_validator.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,6 +398,7 @@ impl<P, E, N: NetworkService, T> Drop for Router<P, E, N, T> {
|
||||
));
|
||||
}
|
||||
}
|
||||
self.message_validator.remove_session(&parent_hash);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ impl TestContext {
|
||||
fn make_status(status: &Status, roles: Roles) -> FullStatus {
|
||||
FullStatus {
|
||||
version: 1,
|
||||
min_supported_version: 1,
|
||||
roles,
|
||||
best_number: 0,
|
||||
best_hash: Default::default(),
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//! Tests and helpers for validation networking.
|
||||
|
||||
use validation::NetworkService;
|
||||
use substrate_network::{consensus_gossip::ConsensusMessage, Context as NetContext};
|
||||
use substrate_network::Context as NetContext;
|
||||
use substrate_primitives::{Ed25519AuthorityId, NativeOrEncoded};
|
||||
use substrate_keyring::Keyring;
|
||||
use {PolkadotProtocol};
|
||||
@@ -51,21 +51,21 @@ impl Future for NeverExit {
|
||||
}
|
||||
|
||||
struct GossipRouter {
|
||||
incoming_messages: mpsc::UnboundedReceiver<(Hash, ConsensusMessage)>,
|
||||
incoming_streams: mpsc::UnboundedReceiver<(Hash, mpsc::UnboundedSender<ConsensusMessage>)>,
|
||||
outgoing: Vec<(Hash, mpsc::UnboundedSender<ConsensusMessage>)>,
|
||||
messages: Vec<(Hash, ConsensusMessage)>,
|
||||
incoming_messages: mpsc::UnboundedReceiver<(Hash, Vec<u8>)>,
|
||||
incoming_streams: mpsc::UnboundedReceiver<(Hash, mpsc::UnboundedSender<Vec<u8>>)>,
|
||||
outgoing: Vec<(Hash, mpsc::UnboundedSender<Vec<u8>>)>,
|
||||
messages: Vec<(Hash, Vec<u8>)>,
|
||||
}
|
||||
|
||||
impl GossipRouter {
|
||||
fn add_message(&mut self, topic: Hash, message: ConsensusMessage) {
|
||||
fn add_message(&mut self, topic: Hash, message: Vec<u8>) {
|
||||
self.outgoing.retain(|&(ref o_topic, ref sender)| {
|
||||
o_topic != &topic || sender.unbounded_send(message.clone()).is_ok()
|
||||
});
|
||||
self.messages.push((topic, message));
|
||||
}
|
||||
|
||||
fn add_outgoing(&mut self, topic: Hash, sender: mpsc::UnboundedSender<ConsensusMessage>) {
|
||||
fn add_outgoing(&mut self, topic: Hash, sender: mpsc::UnboundedSender<Vec<u8>>) {
|
||||
for message in self.messages.iter()
|
||||
.filter(|&&(ref t, _)| t == &topic)
|
||||
.map(|&(_, ref msg)| msg.clone())
|
||||
@@ -105,8 +105,8 @@ impl Future for GossipRouter {
|
||||
|
||||
#[derive(Clone)]
|
||||
struct GossipHandle {
|
||||
send_message: mpsc::UnboundedSender<(Hash, ConsensusMessage)>,
|
||||
send_listener: mpsc::UnboundedSender<(Hash, mpsc::UnboundedSender<ConsensusMessage>)>,
|
||||
send_message: mpsc::UnboundedSender<(Hash, Vec<u8>)>,
|
||||
send_listener: mpsc::UnboundedSender<(Hash, mpsc::UnboundedSender<Vec<u8>>)>,
|
||||
}
|
||||
|
||||
fn make_gossip() -> (GossipRouter, GossipHandle) {
|
||||
@@ -130,13 +130,13 @@ struct TestNetwork {
|
||||
}
|
||||
|
||||
impl NetworkService for TestNetwork {
|
||||
fn gossip_messages_for(&self, topic: Hash) -> mpsc::UnboundedReceiver<ConsensusMessage> {
|
||||
fn gossip_messages_for(&self, topic: Hash) -> mpsc::UnboundedReceiver<Vec<u8>> {
|
||||
let (tx, rx) = mpsc::unbounded();
|
||||
let _ = self.gossip.send_listener.unbounded_send((topic, tx));
|
||||
rx
|
||||
}
|
||||
|
||||
fn gossip_message(&self, topic: Hash, message: ConsensusMessage) {
|
||||
fn gossip_message(&self, topic: Hash, message: Vec<u8>) {
|
||||
let _ = self.gossip.send_message.unbounded_send((topic, message));
|
||||
}
|
||||
|
||||
@@ -322,9 +322,14 @@ fn build_network(n: usize, executor: TaskExecutor) -> Built {
|
||||
gossip: gossip_handle.clone(),
|
||||
});
|
||||
|
||||
let message_val = crate::gossip::RegisteredMessageValidator::new_test(
|
||||
|_hash: &_| Some(crate::gossip::Known::Leaf),
|
||||
);
|
||||
|
||||
TestValidationNetwork::new(
|
||||
net,
|
||||
NeverExit,
|
||||
message_val,
|
||||
runtime_api.clone(),
|
||||
executor.clone(),
|
||||
)
|
||||
@@ -427,15 +432,22 @@ fn ingress_fetch_works() {
|
||||
let parent_hash = [1; 32].into();
|
||||
|
||||
let (router_a, router_b, router_c) = {
|
||||
let validators: Vec<Hash> = vec![
|
||||
key_a.to_raw_public().into(),
|
||||
key_b.to_raw_public().into(),
|
||||
key_c.to_raw_public().into(),
|
||||
];
|
||||
|
||||
let authorities: Vec<_> = validators.iter().cloned()
|
||||
.map(|h| h.to_fixed_bytes())
|
||||
.map(Ed25519AuthorityId)
|
||||
.collect();
|
||||
|
||||
let mut api_handle = built.api_handle.lock();
|
||||
*api_handle = ApiData {
|
||||
active_parachains: vec![id_a, id_b, id_c],
|
||||
duties: vec![Chain::Parachain(id_a), Chain::Parachain(id_b), Chain::Parachain(id_c)],
|
||||
validators: vec![
|
||||
key_a.to_raw_public().into(),
|
||||
key_b.to_raw_public().into(),
|
||||
key_c.to_raw_public().into(),
|
||||
],
|
||||
validators,
|
||||
ingress,
|
||||
};
|
||||
|
||||
@@ -443,14 +455,17 @@ fn ingress_fetch_works() {
|
||||
built.networks[0].communication_for(
|
||||
make_table(&*api_handle, &key_a, parent_hash),
|
||||
vec![MessagesFrom::from_messages(id_a, messages_from_a)],
|
||||
&authorities,
|
||||
),
|
||||
built.networks[1].communication_for(
|
||||
make_table(&*api_handle, &key_b, parent_hash),
|
||||
vec![MessagesFrom::from_messages(id_b, messages_from_b)],
|
||||
&authorities,
|
||||
),
|
||||
built.networks[2].communication_for(
|
||||
make_table(&*api_handle, &key_c, parent_hash),
|
||||
vec![MessagesFrom::from_messages(id_c, messages_from_c)],
|
||||
&authorities,
|
||||
),
|
||||
)
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
//! each time a validation session begins on a new chain head.
|
||||
|
||||
use sr_primitives::traits::ProvideRuntimeApi;
|
||||
use substrate_network::{consensus_gossip::ConsensusMessage, Context as NetContext};
|
||||
use substrate_network::Context as NetContext;
|
||||
use polkadot_validation::{Network as ParachainNetwork, SharedTable, Collators, Statement, GenericStatement};
|
||||
use polkadot_primitives::{AccountId, Block, Hash, SessionKey};
|
||||
use polkadot_primitives::parachain::{Id as ParaId, Collation, Extrinsic, ParachainHost, BlockData};
|
||||
@@ -38,6 +38,8 @@ use tokio::runtime::TaskExecutor;
|
||||
use parking_lot::Mutex;
|
||||
|
||||
use router::Router;
|
||||
use gossip::{POLKADOT_ENGINE_ID, GossipMessage, RegisteredMessageValidator, MessageValidationData};
|
||||
|
||||
use super::PolkadotProtocol;
|
||||
|
||||
/// An executor suitable for dispatching async consensus tasks.
|
||||
@@ -67,7 +69,7 @@ impl Executor for TaskExecutor {
|
||||
/// Basic functionality that a network has to fulfill.
|
||||
pub trait NetworkService: Send + Sync + 'static {
|
||||
/// Get a stream of gossip messages for a given hash.
|
||||
fn gossip_messages_for(&self, topic: Hash) -> mpsc::UnboundedReceiver<ConsensusMessage>;
|
||||
fn gossip_messages_for(&self, topic: Hash) -> mpsc::UnboundedReceiver<Vec<u8>>;
|
||||
|
||||
/// Gossip a message on given topic.
|
||||
fn gossip_message(&self, topic: Hash, message: Vec<u8>);
|
||||
@@ -81,11 +83,11 @@ pub trait NetworkService: Send + Sync + 'static {
|
||||
}
|
||||
|
||||
impl NetworkService for super::NetworkService {
|
||||
fn gossip_messages_for(&self, topic: Hash) -> mpsc::UnboundedReceiver<ConsensusMessage> {
|
||||
fn gossip_messages_for(&self, topic: Hash) -> mpsc::UnboundedReceiver<Vec<u8>> {
|
||||
let (tx, rx) = std::sync::mpsc::channel();
|
||||
|
||||
self.with_gossip(move |gossip, _| {
|
||||
let inner_rx = gossip.messages_for(topic);
|
||||
let inner_rx = gossip.messages_for(POLKADOT_ENGINE_ID, topic);
|
||||
let _ = tx.send(inner_rx);
|
||||
});
|
||||
|
||||
@@ -96,14 +98,10 @@ impl NetworkService for super::NetworkService {
|
||||
}
|
||||
|
||||
fn gossip_message(&self, topic: Hash, message: Vec<u8>) {
|
||||
self.gossip_consensus_message(topic, message, false);
|
||||
self.gossip_consensus_message(topic, POLKADOT_ENGINE_ID, message);
|
||||
}
|
||||
|
||||
fn drop_gossip(&self, topic: Hash) {
|
||||
self.with_gossip(move |gossip, _| {
|
||||
gossip.collect_garbage_for_topic(topic);
|
||||
})
|
||||
}
|
||||
fn drop_gossip(&self, _topic: Hash) { }
|
||||
|
||||
fn with_spec<F: Send + 'static>(&self, with: F)
|
||||
where F: FnOnce(&mut PolkadotProtocol, &mut NetContext<Block>)
|
||||
@@ -115,8 +113,7 @@ impl NetworkService for super::NetworkService {
|
||||
// task that processes all gossipped consensus messages,
|
||||
// checking signatures
|
||||
struct MessageProcessTask<P, E, N: NetworkService, T> {
|
||||
inner_stream: mpsc::UnboundedReceiver<ConsensusMessage>,
|
||||
parent_hash: Hash,
|
||||
inner_stream: mpsc::UnboundedReceiver<Vec<u8>>,
|
||||
table_router: Router<P, E, N, T>,
|
||||
}
|
||||
|
||||
@@ -127,19 +124,12 @@ impl<P, E, N, T> MessageProcessTask<P, E, N, T> where
|
||||
N: NetworkService,
|
||||
T: Clone + Executor + Send + 'static,
|
||||
{
|
||||
fn process_message(&self, msg: ConsensusMessage) -> Option<Async<()>> {
|
||||
use polkadot_validation::SignedStatement;
|
||||
fn process_message(&self, msg: Vec<u8>) -> Option<Async<()>> {
|
||||
debug!(target: "validation", "Processing consensus statement for live consensus");
|
||||
|
||||
debug!(target: "validation", "Processing validation statement for live session");
|
||||
if let Some(statement) = SignedStatement::decode(&mut msg.as_slice()) {
|
||||
if ::polkadot_validation::check_statement(
|
||||
&statement.statement,
|
||||
&statement.signature,
|
||||
statement.sender,
|
||||
&self.parent_hash
|
||||
) {
|
||||
self.table_router.import_statement(statement);
|
||||
}
|
||||
// statements are already checked by gossip validator.
|
||||
if let Some(message) = GossipMessage::decode(&mut &msg[..]) {
|
||||
self.table_router.import_statement(message.statement);
|
||||
}
|
||||
|
||||
None
|
||||
@@ -175,13 +165,20 @@ pub struct ValidationNetwork<P, E, N, T> {
|
||||
network: Arc<N>,
|
||||
api: Arc<P>,
|
||||
executor: T,
|
||||
message_validator: RegisteredMessageValidator,
|
||||
exit: E,
|
||||
}
|
||||
|
||||
impl<P, E, N, T> ValidationNetwork<P, E, N, T> {
|
||||
/// Create a new validation session networking object.
|
||||
pub fn new(network: Arc<N>, exit: E, api: Arc<P>, executor: T) -> Self {
|
||||
ValidationNetwork { network, exit, api, executor }
|
||||
/// Create a new consensus networking object.
|
||||
pub fn new(
|
||||
network: Arc<N>,
|
||||
exit: E,
|
||||
message_validator: RegisteredMessageValidator,
|
||||
api: Arc<P>,
|
||||
executor: T,
|
||||
) -> Self {
|
||||
ValidationNetwork { network, exit, message_validator, api, executor }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,6 +189,7 @@ impl<P, E: Clone, N, T: Clone> Clone for ValidationNetwork<P, E, N, T> {
|
||||
exit: self.exit.clone(),
|
||||
api: self.api.clone(),
|
||||
executor: self.executor.clone(),
|
||||
message_validator: self.message_validator.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -210,6 +208,7 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
|
||||
&self,
|
||||
table: Arc<SharedTable>,
|
||||
outgoing: polkadot_validation::Outgoing,
|
||||
authorities: &[SessionKey],
|
||||
) -> Self::TableRouter {
|
||||
let parent_hash = table.consensus_parent_hash().clone();
|
||||
|
||||
@@ -224,6 +223,7 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
|
||||
parent_hash,
|
||||
knowledge.clone(),
|
||||
self.exit.clone(),
|
||||
self.message_validator.clone(),
|
||||
);
|
||||
|
||||
table_router.broadcast_egress(outgoing);
|
||||
@@ -234,6 +234,12 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
|
||||
let executor = self.executor.clone();
|
||||
let exit = self.exit.clone();
|
||||
|
||||
// before requesting messages, note live consensus session.
|
||||
self.message_validator.note_session(
|
||||
parent_hash,
|
||||
MessageValidationData { authorities: authorities.to_vec() },
|
||||
);
|
||||
|
||||
// spin up a task in the background that processes all incoming statements
|
||||
// TODO: propagate statements on a timer?
|
||||
let inner_stream = self.network.gossip_messages_for(attestation_topic);
|
||||
@@ -245,7 +251,6 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
|
||||
});
|
||||
let process_task = MessageProcessTask {
|
||||
inner_stream,
|
||||
parent_hash,
|
||||
table_router: table_router_clone,
|
||||
};
|
||||
|
||||
@@ -276,12 +281,14 @@ impl Future for AwaitingCollation {
|
||||
.poll()
|
||||
.map_err(|_| NetworkDown)
|
||||
}
|
||||
if let Ok(futures::Async::Ready(mut inner)) = self.outer.poll() {
|
||||
let poll_result = inner.poll();
|
||||
self.inner = Some(inner);
|
||||
return poll_result.map_err(|_| NetworkDown)
|
||||
match self.outer.poll() {
|
||||
Ok(futures::Async::Ready(inner)) => {
|
||||
self.inner = Some(inner);
|
||||
self.poll()
|
||||
},
|
||||
Ok(futures::Async::NotReady) => Ok(futures::Async::NotReady),
|
||||
Err(_) => Err(NetworkDown)
|
||||
}
|
||||
Ok(futures::Async::NotReady)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,16 +19,20 @@
|
||||
use rstd::prelude::*;
|
||||
use sr_io::{keccak_256, secp256k1_ecdsa_recover};
|
||||
use srml_support::{StorageValue, StorageMap};
|
||||
use srml_support::traits::{Currency, ArithmeticType};
|
||||
use system::ensure_signed;
|
||||
use codec::Encode;
|
||||
#[cfg(feature = "std")]
|
||||
use sr_primitives::traits::Zero;
|
||||
use balances;
|
||||
use system;
|
||||
|
||||
type BalanceOf<T> = <<T as Trait>::Currency as ArithmeticType>::Type;
|
||||
|
||||
/// Configuration trait.
|
||||
pub trait Trait: balances::Trait {
|
||||
pub trait Trait: system::Trait {
|
||||
/// The overarching event type.
|
||||
type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;
|
||||
type Currency: ArithmeticType + Currency<Self::AccountId, Balance=BalanceOf<Self>>;
|
||||
}
|
||||
|
||||
type EthereumAddress = [u8; 20];
|
||||
@@ -58,7 +62,7 @@ impl EcdsaSignature {
|
||||
/// An event in this module.
|
||||
decl_event!(
|
||||
pub enum Event<T> where
|
||||
B = <T as balances::Trait>::Balance,
|
||||
B = BalanceOf<T>,
|
||||
A = <T as system::Trait>::AccountId
|
||||
{
|
||||
/// Someone claimed some DOTs.
|
||||
@@ -73,13 +77,13 @@ decl_storage! {
|
||||
trait Store for Module<T: Trait> as Claims {
|
||||
Claims get(claims) build(|config: &GenesisConfig<T>| {
|
||||
config.claims.iter().map(|(a, b)| (a.clone(), b.clone())).collect::<Vec<_>>()
|
||||
}): map EthereumAddress => Option<T::Balance>;
|
||||
}): map EthereumAddress => Option<BalanceOf<T>>;
|
||||
Total get(total) build(|config: &GenesisConfig<T>| {
|
||||
config.claims.iter().fold(Zero::zero(), |acc: T::Balance, &(_, n)| acc + n)
|
||||
}): T::Balance;
|
||||
config.claims.iter().fold(Zero::zero(), |acc: BalanceOf<T>, &(_, n)| acc + n)
|
||||
}): BalanceOf<T>;
|
||||
}
|
||||
add_extra_genesis {
|
||||
config(claims): Vec<(EthereumAddress, T::Balance)>;
|
||||
config(claims): Vec<(EthereumAddress, BalanceOf<T>)>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,21 +121,21 @@ decl_module! {
|
||||
fn claim(origin, ethereum_signature: EcdsaSignature) {
|
||||
// This is a public call, so we ensure that the origin is some signed account.
|
||||
let sender = ensure_signed(origin)?;
|
||||
|
||||
|
||||
let signer = sender.using_encoded(|data|
|
||||
eth_recover(ðereum_signature, data)
|
||||
).ok_or("Invalid Ethereum signature")?;
|
||||
|
||||
|
||||
let balance_due = <Claims<T>>::take(&signer)
|
||||
.ok_or("Ethereum address has no claim")?;
|
||||
|
||||
|
||||
<Total<T>>::mutate(|t| if *t < balance_due {
|
||||
panic!("Logic error: Pot less than the total of claims!")
|
||||
} else {
|
||||
*t -= balance_due
|
||||
});
|
||||
|
||||
<balances::Module<T>>::increase_free_balance_creating(&sender, balance_due);
|
||||
T::Currency::increase_free_balance_creating(&sender, balance_due);
|
||||
|
||||
// Let's deposit an event to let the outside world know this happened.
|
||||
Self::deposit_event(RawEvent::Claimed(sender, signer, balance_due));
|
||||
@@ -181,11 +185,11 @@ mod tests {
|
||||
type Balance = u64;
|
||||
type OnFreeBalanceZero = ();
|
||||
type OnNewAccount = ();
|
||||
type EnsureAccountLiquid = ();
|
||||
type Event = ();
|
||||
}
|
||||
impl Trait for Test {
|
||||
type Event = ();
|
||||
type Currency = Balances;
|
||||
}
|
||||
type Balances = balances::Module<Test>;
|
||||
type Claims = Module<Test>;
|
||||
|
||||
@@ -62,7 +62,6 @@ extern crate srml_sudo as sudo;
|
||||
extern crate srml_system as system;
|
||||
extern crate srml_timestamp as timestamp;
|
||||
extern crate srml_treasury as treasury;
|
||||
extern crate srml_upgrade_key as upgrade_key;
|
||||
extern crate srml_fees as fees;
|
||||
|
||||
extern crate polkadot_primitives as primitives;
|
||||
@@ -157,7 +156,6 @@ impl balances::Trait for Runtime {
|
||||
type Balance = Balance;
|
||||
type OnFreeBalanceZero = Staking;
|
||||
type OnNewAccount = Indices;
|
||||
type EnsureAccountLiquid = Staking;
|
||||
type Event = Event;
|
||||
}
|
||||
|
||||
@@ -230,10 +228,6 @@ impl grandpa::Trait for Runtime {
|
||||
|
||||
impl parachains::Trait for Runtime {}
|
||||
|
||||
impl upgrade_key::Trait for Runtime {
|
||||
type Event = Event;
|
||||
}
|
||||
|
||||
impl sudo::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Proposal = Call;
|
||||
@@ -241,6 +235,7 @@ impl sudo::Trait for Runtime {
|
||||
|
||||
impl claims::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type Currency = Balances;
|
||||
}
|
||||
|
||||
impl fees::Trait for Runtime {
|
||||
@@ -272,7 +267,6 @@ construct_runtime!(
|
||||
Treasury: treasury,
|
||||
Parachains: parachains::{Module, Call, Storage, Config<T>, Inherent},
|
||||
Sudo: sudo,
|
||||
UpgradeKey: upgrade_key,
|
||||
Claims: claims,
|
||||
Fees: fees::{Module, Storage, Config<T>, Event<T>},
|
||||
}
|
||||
@@ -384,6 +378,12 @@ impl_runtime_apis! {
|
||||
None
|
||||
}
|
||||
|
||||
fn grandpa_forced_change(_digest: &DigestFor<Block>)
|
||||
-> Option<(BlockNumber, ScheduledChange<BlockNumber>)>
|
||||
{
|
||||
None // disable forced changes.
|
||||
}
|
||||
|
||||
fn grandpa_authorities() -> Vec<(SessionKey, u64)> {
|
||||
Grandpa::grandpa_authorities()
|
||||
}
|
||||
|
||||
@@ -528,6 +528,7 @@ mod tests {
|
||||
t.extend(session::GenesisConfig::<Test>{
|
||||
session_length: 1000,
|
||||
validators: authority_keys.iter().map(|k| k.to_raw_public().into()).collect(),
|
||||
keys: vec![],
|
||||
}.build_storage().unwrap().0);
|
||||
t.extend(GenesisConfig::<Test>{
|
||||
parachains: parachains,
|
||||
|
||||
Generated
+122
-108
@@ -50,6 +50,11 @@ name = "bitflags"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "bitmask"
|
||||
version = "0.5.0"
|
||||
source = "git+https://github.com/paritytech/bitmask#c2d8d196e30b018d1385be8357fdca61b978facf"
|
||||
|
||||
[[package]]
|
||||
name = "bitvec"
|
||||
version = "0.8.0"
|
||||
@@ -452,7 +457,7 @@ name = "impl-codec"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -730,18 +735,20 @@ source = "git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7
|
||||
|
||||
[[package]]
|
||||
name = "parity-codec"
|
||||
version = "3.0.0"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "parity-codec-derive"
|
||||
version = "3.0.0"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -811,8 +818,8 @@ name = "polkadot-parachain"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"wasmi 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -822,8 +829,8 @@ dependencies = [
|
||||
name = "polkadot-primitives"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"polkadot-parachain 0.1.0",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -840,8 +847,8 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitvec 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"polkadot-primitives 0.1.0",
|
||||
"rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1273,7 +1280,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
[[package]]
|
||||
name = "sr-api-macros"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1285,12 +1292,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sr-io"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"environmental 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1302,13 +1309,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sr-primitives"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1319,7 +1325,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sr-std"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -1327,11 +1333,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "sr-version"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1341,14 +1346,14 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-aura"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-session 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-staking 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-support 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-system 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1359,11 +1364,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-balances"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1376,11 +1380,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-consensus"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1394,10 +1397,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-council"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1412,11 +1415,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-democracy"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1430,9 +1432,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-executive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1444,11 +1446,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-fees"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1459,16 +1461,32 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "srml-grandpa"
|
||||
name = "srml-finality-tracker"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-support 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-system 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-inherents 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "srml-grandpa"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-finality-tracker 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-session 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-support 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-system 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1479,11 +1497,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-indices"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1498,10 +1516,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-metadata"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1511,11 +1528,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-session"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1529,13 +1546,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-staking"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-consensus 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1548,11 +1565,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-sudo"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1564,12 +1581,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-support"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"bitmask 0.5.0 (git+https://github.com/paritytech/bitmask)",
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"once_cell 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"paste 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1584,7 +1601,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-support-procedural"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1596,7 +1613,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-support-procedural-tools"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1608,7 +1625,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-support-procedural-tools-derive"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1618,11 +1635,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-system"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1636,15 +1652,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-timestamp"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-consensus 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-support 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"srml-system 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-inherents 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1653,11 +1667,10 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-treasury"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1670,9 +1683,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "srml-upgrade-key"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1694,7 +1707,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
[[package]]
|
||||
name = "substrate-client"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1704,8 +1717,7 @@ dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-api-macros 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1717,14 +1729,14 @@ dependencies = [
|
||||
"substrate-keyring 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-state-machine 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-telemetry 0.3.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-telemetry 0.3.1 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-trie 0.4.0 (git+https://github.com/paritytech/substrate)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "substrate-consensus-aura-primitives"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"substrate-client 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
]
|
||||
@@ -1732,14 +1744,14 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-consensus-common"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"crossbeam-channel 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-version 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-inherents 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1750,14 +1762,14 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-executor"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1775,10 +1787,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-finality-grandpa-primitives"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-client 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1788,10 +1799,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-inherents"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"sr-std 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1800,7 +1810,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-keyring"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1810,7 +1820,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-panic-handler"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1819,7 +1829,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-primitives"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1828,8 +1838,7 @@ dependencies = [
|
||||
"hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1847,7 +1856,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-serializer"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1856,13 +1865,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-state-machine"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"substrate-panic-handler 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
"substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)",
|
||||
@@ -1873,12 +1882,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "substrate-telemetry"
|
||||
version = "0.3.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
version = "0.3.1"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.87 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slog-json 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1889,11 +1901,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "substrate-trie"
|
||||
version = "0.4.0"
|
||||
source = "git+https://github.com/paritytech/substrate#18bbe130180989d92b0bcea7952cdf1e58b0d6f4"
|
||||
source = "git+https://github.com/paritytech/substrate#82744fbb6f4d677f2edfe9d88737c237622c97a4"
|
||||
dependencies = [
|
||||
"hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -2291,6 +2303,7 @@ dependencies = [
|
||||
"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6"
|
||||
"checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83"
|
||||
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
|
||||
"checksum bitmask 0.5.0 (git+https://github.com/paritytech/bitmask)" = "<none>"
|
||||
"checksum bitvec 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e37e2176261200377c7cde4c6de020394174df556c356f965e4bc239f5ce1c5a"
|
||||
"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400"
|
||||
"checksum block-buffer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1339a1042f5d9f295737ad4d9a6ab6bf81c84a933dba110b9200cd6d1448b814"
|
||||
@@ -2377,8 +2390,8 @@ dependencies = [
|
||||
"checksum openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)" = "1bb974e77de925ef426b6bc82fce15fd45bdcbeb5728bffcfc7cdeeb7ce1c2d6"
|
||||
"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13"
|
||||
"checksum parity-bytes 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)" = "<none>"
|
||||
"checksum parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88f69984317b736dceac3baa86600fc089856f69b44b07231f39b5648b02bcd4"
|
||||
"checksum parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a58ba33211595f92cc2163ac583961d3dc767e656934146636b05256cc9acd7f"
|
||||
"checksum parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67a4d27831e31e27f1454d6e3d3bb34bcac6bf7ad7032eed0ad0070dc8cf55c1"
|
||||
"checksum parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "864e9f66b58c0b38f0d6b511b6576afa2b678ae801b64220553bced57ac12df9"
|
||||
"checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc"
|
||||
"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337"
|
||||
"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9"
|
||||
@@ -2443,6 +2456,7 @@ dependencies = [
|
||||
"checksum srml-democracy 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum srml-executive 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum srml-fees 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum srml-finality-tracker 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum srml-grandpa 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum srml-indices 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum srml-metadata 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
@@ -2470,7 +2484,7 @@ dependencies = [
|
||||
"checksum substrate-primitives 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum substrate-serializer 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum substrate-state-machine 0.1.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum substrate-telemetry 0.3.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum substrate-telemetry 0.3.1 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum substrate-trie 0.4.0 (git+https://github.com/paritytech/substrate)" = "<none>"
|
||||
"checksum subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "702662512f3ddeb74a64ce2fbbf3707ee1b6bb663d28bb054e0779bbc720d926"
|
||||
"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9"
|
||||
|
||||
BIN
Binary file not shown.
Binary file not shown.
@@ -27,3 +27,4 @@ substrate-service = { git = "https://github.com/paritytech/substrate" }
|
||||
substrate-telemetry = { git = "https://github.com/paritytech/substrate" }
|
||||
substrate-inherents = { git = "https://github.com/paritytech/substrate" }
|
||||
substrate-transaction-pool = { git = "https://github.com/paritytech/substrate" }
|
||||
substrate-keystore = { git = "https://github.com/paritytech/substrate" }
|
||||
@@ -16,13 +16,16 @@
|
||||
|
||||
//! Polkadot chain configurations.
|
||||
|
||||
use primitives::{H256, Ed25519AuthorityId as AuthorityId, ed25519};
|
||||
use primitives::{Ed25519AuthorityId as AuthorityId, ed25519};
|
||||
use polkadot_primitives::AccountId;
|
||||
use polkadot_runtime::{
|
||||
GenesisConfig, ConsensusConfig, CouncilSeatsConfig, DemocracyConfig, TreasuryConfig,
|
||||
SessionConfig, StakingConfig, TimestampConfig, BalancesConfig, Perbill,
|
||||
CouncilVotingConfig, GrandpaConfig, UpgradeKeyConfig, SudoConfig, IndicesConfig,
|
||||
CouncilVotingConfig, GrandpaConfig, SudoConfig, IndicesConfig,
|
||||
ClaimsConfig, FeesConfig, Permill
|
||||
};
|
||||
use telemetry::TelemetryEndpoints;
|
||||
use keystore::pad_seed;
|
||||
|
||||
const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
|
||||
const DEFAULT_PROTOCOL_ID: &str = "dot";
|
||||
@@ -35,12 +38,23 @@ pub fn poc_3_testnet_config() -> Result<ChainSpec, String> {
|
||||
}
|
||||
|
||||
fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
let initial_authorities = vec![
|
||||
hex!["4bd3620064cda1f4cf405bf9ab565c9bad69446034c48884ffc5363a5286b145"].into(),
|
||||
hex!["3a92077b16fbb87972be7ebaf1b7e70f5b4fac9636c136936a28d0fb494d1ed4"].into(),
|
||||
hex!["ca8feb6f870330cdaea24e49c2f850b66729340cab164aea86c0a782ddecf57a"].into(),
|
||||
hex!["dcb83e46917c3c0ca35b9a18a32ba6d3912b6d50ab2bd382341d2e4fd2e6946f"].into(),
|
||||
];
|
||||
let initial_authorities: Vec<(AccountId, AccountId, AuthorityId)> = vec![(
|
||||
hex!["863ab9379a9b78fe28368d794094bd576ce0c18536012605da7fc76e4f331faf"].into(), // 5F6hicQ1rnmQKy9q6yX9BUaBtQsfBLxAhrozQ8LrKxnPuBP7
|
||||
hex!["6d090ef6cde4dc1df057e8ce928a156b5793b461dc35eabbb8a17ee4bd41a576"].into(), // 5EXfmUBE1Vs13jz4tbApSRJqT3sEQsMWNQmHWeknc4Gy9CuU
|
||||
hex!["fba60a57436218519abf2dde5b5cadf02771c33833a27527ac4808c0690cfe72"].into(), // 5HkfCaoiFt41WSqEby4fkgRrXtxwfB9G8q8pPuoxDrsqGmFm
|
||||
),(
|
||||
hex!["46cf99718ddcf7868a1c7073862f6b821a58ac1ee57655b6a78b29559cf6fa9b"].into(), // 5DfYswB6NLVyvft5ggt6NJuX13X4VQjXqxuhha8C79ntPra9
|
||||
hex!["c4d4dae0d95c3c012322709e12f20ce154b9e04c23c75dce3fe63cd907c2f4a0"].into(), // 5GWnURnpMXqk5Yzfr8AJBE6fNM3AKmWikFMFvia8A7hGBPUT
|
||||
hex!["337c9a3f05221973d94995c9e9448c582e2ff3382c64f624318acc5164525244"].into(), // 5DEDKARKMZsecqU2s2onmg7ZxQDsZSYKTvxxHKMBMCU2UiCB
|
||||
),(
|
||||
hex!["6d14eced242492088e6ab054e6da3300b435de1fbab57e79103071cdc1dfff94"].into(), // 5EXjHw7GK6GEJjT7b9kGAPzQdCbrmjt27TYwVB1igN5uai3Y
|
||||
hex!["971da4fe7d20cd83c05186d699e3a0756b1772bc7c16309c71bab36dac0909e8"].into(), // 5FUqtohZwTyhY12GNxSb2ExhGtrEGB7B8nLv29mevbPep5zk
|
||||
hex!["79e9fd0469f6563bea8e2019c27c5c53a685675221ea4c7715c3f9fca75c6aa8"].into(), // 5EpZAFPsyuMEVKfdB1VtG6b2E11XS6T5ch646zq13xfmbsgS
|
||||
),(
|
||||
hex!["e2f736077b2a1522339f7a0dc90468ba2223c5f98fe82a0283138a3e48463f02"].into(), // 5HCJ7gu6kH5mYyp4DVDPGDmJf4Zf5zJgW5Swi3dizi8qq8vm
|
||||
hex!["91627d4b51c11c1b8b6d54dbe727219e4eccbea6a86599ebe25a316e8ba3bf15"].into(), // 5FML4K5Vz45nKvndwmnAGwv6CTKvacEK2Nr6UbGf2zJYxuwd
|
||||
hex!["08d9e438d2ccc88b66115e2e2f07b0cbdcf912e0f147124b39024735e6b58057"].into(), // 5CGJy52caRtJUjEnCK7gj7jYvBTfpffPqP443g4aM2GZt5ns
|
||||
)];
|
||||
let endowed_accounts = vec![
|
||||
hex!["f295940fa750df68a686fcf4abd4111c8a9c5a5a5a83c4c8639c451a94a7adfd"].into(),
|
||||
];
|
||||
@@ -52,30 +66,39 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
const MINUTES: u64 = 60 / SECS_PER_BLOCK;
|
||||
const HOURS: u64 = MINUTES * 60;
|
||||
const DAYS: u64 = HOURS * 24;
|
||||
|
||||
const ENDOWMENT: u128 = 10_000_000 * DOLLARS;
|
||||
const STASH: u128 = 100 * DOLLARS;
|
||||
|
||||
GenesisConfig {
|
||||
consensus: Some(ConsensusConfig {
|
||||
// TODO: Change after Substrate 1252 is fixed (https://github.com/paritytech/substrate/issues/1252)
|
||||
code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm").to_vec(),
|
||||
authorities: initial_authorities.clone(),
|
||||
authorities: initial_authorities.iter().map(|x| x.2.clone()).collect(),
|
||||
}),
|
||||
system: None,
|
||||
indices: Some(IndicesConfig {
|
||||
ids: endowed_accounts.clone(),
|
||||
}),
|
||||
balances: Some(BalancesConfig {
|
||||
balances: endowed_accounts.iter().map(|&k| (k, 10_000_000 * DOLLARS)).collect(),
|
||||
balances: endowed_accounts.iter()
|
||||
.map(|&k| (k, ENDOWMENT))
|
||||
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
|
||||
.collect(),
|
||||
existential_deposit: 1 * DOLLARS,
|
||||
transfer_fee: 1 * CENTS,
|
||||
creation_fee: 1 * CENTS,
|
||||
vesting: vec![],
|
||||
}),
|
||||
indices: Some(IndicesConfig {
|
||||
ids: endowed_accounts.iter().cloned()
|
||||
.chain(initial_authorities.iter().map(|x| x.0.clone()))
|
||||
.collect::<Vec<_>>(),
|
||||
}),
|
||||
session: Some(SessionConfig {
|
||||
validators: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
validators: initial_authorities.iter().map(|x| x.1.into()).collect(),
|
||||
session_length: 5 * MINUTES,
|
||||
keys: initial_authorities.iter().map(|x| (x.1.clone(), x.2.clone())).collect::<Vec<_>>(),
|
||||
}),
|
||||
staking: Some(StakingConfig {
|
||||
current_era: 0,
|
||||
intentions: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
offline_slash: Perbill::from_billionths(1_000_000),
|
||||
session_reward: Perbill::from_billionths(2_065),
|
||||
current_offline_slash: 0,
|
||||
@@ -85,7 +108,8 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
bonding_duration: 60 * MINUTES,
|
||||
offline_slash_grace: 4,
|
||||
minimum_validator_count: 4,
|
||||
invulnerables: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
stakers: initial_authorities.iter().map(|x| (x.0.into(), x.1.into(), STASH)).collect(),
|
||||
invulnerables: initial_authorities.iter().map(|x| x.1.into()).collect(),
|
||||
}),
|
||||
democracy: Some(DemocracyConfig {
|
||||
launch_period: 10 * MINUTES, // 1 day per public referendum
|
||||
@@ -120,23 +144,20 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
|
||||
spend_period: 1 * DAYS,
|
||||
burn: Permill::from_percent(50),
|
||||
}),
|
||||
parachains: Some(Default::default()),
|
||||
upgrade_key: Some(UpgradeKeyConfig {
|
||||
key: endowed_accounts[0],
|
||||
}),
|
||||
sudo: Some(SudoConfig {
|
||||
key: endowed_accounts[0],
|
||||
key: endowed_accounts[0].clone(),
|
||||
}),
|
||||
grandpa: Some(GrandpaConfig {
|
||||
authorities: initial_authorities.clone().into_iter().map(|k| (k, 1)).collect(),
|
||||
}),
|
||||
claims: Some(ClaimsConfig {
|
||||
claims: vec![],
|
||||
authorities: initial_authorities.iter().map(|x| (x.2.clone(), 1)).collect(),
|
||||
}),
|
||||
fees: Some(FeesConfig {
|
||||
transaction_base_fee: 1 * CENTS,
|
||||
transaction_byte_fee: 10 * MILLICENTS,
|
||||
}),
|
||||
parachains: Some(Default::default()),
|
||||
claims: Some(ClaimsConfig {
|
||||
claims: vec![],
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,26 +169,57 @@ pub fn staging_testnet_config() -> ChainSpec {
|
||||
"staging_testnet",
|
||||
staging_testnet_config_genesis,
|
||||
boot_nodes,
|
||||
Some(STAGING_TELEMETRY_URL.into()),
|
||||
Some(TelemetryEndpoints::new(vec![(STAGING_TELEMETRY_URL.to_string(), 0)])),
|
||||
Some(DEFAULT_PROTOCOL_ID),
|
||||
None,
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
fn testnet_genesis(initial_authorities: Vec<AuthorityId>, upgrade_key: H256) -> GenesisConfig {
|
||||
let endowed_accounts = vec![
|
||||
ed25519::Pair::from_seed(b"Alice ").public().0.into(),
|
||||
ed25519::Pair::from_seed(b"Bob ").public().0.into(),
|
||||
ed25519::Pair::from_seed(b"Charlie ").public().0.into(),
|
||||
ed25519::Pair::from_seed(b"Dave ").public().0.into(),
|
||||
ed25519::Pair::from_seed(b"Eve ").public().0.into(),
|
||||
ed25519::Pair::from_seed(b"Ferdie ").public().0.into(),
|
||||
];
|
||||
/// Helper function to generate AuthorityID from seed
|
||||
pub fn get_account_id_from_seed(seed: &str) -> AccountId {
|
||||
let padded_seed = pad_seed(seed);
|
||||
// NOTE from ed25519 impl:
|
||||
// prefer pkcs#8 unless security doesn't matter -- this is used primarily for tests.
|
||||
ed25519::Pair::from_seed(&padded_seed).public().0.into()
|
||||
}
|
||||
|
||||
/// Helper function to generate stash, controller and session key from seed
|
||||
pub fn get_authority_keys_from_seed(seed: &str) -> (AccountId, AccountId, AuthorityId) {
|
||||
let padded_seed = pad_seed(seed);
|
||||
// NOTE from ed25519 impl:
|
||||
// prefer pkcs#8 unless security doesn't matter -- this is used primarily for tests.
|
||||
(
|
||||
get_account_id_from_seed(&format!("{}-stash", seed)),
|
||||
get_account_id_from_seed(seed),
|
||||
ed25519::Pair::from_seed(&padded_seed).public().0.into()
|
||||
)
|
||||
}
|
||||
|
||||
/// Helper function to create GenesisConfig for testing
|
||||
pub fn testnet_genesis(
|
||||
initial_authorities: Vec<(AccountId, AccountId, AuthorityId)>,
|
||||
root_key: AccountId,
|
||||
endowed_accounts: Option<Vec<AccountId>>,
|
||||
) -> GenesisConfig {
|
||||
let endowed_accounts: Vec<AccountId> = endowed_accounts.unwrap_or_else(|| {
|
||||
vec![
|
||||
get_account_id_from_seed("Alice"),
|
||||
get_account_id_from_seed("Bob"),
|
||||
get_account_id_from_seed("Charlie"),
|
||||
get_account_id_from_seed("Dave"),
|
||||
get_account_id_from_seed("Eve"),
|
||||
get_account_id_from_seed("Ferdie"),
|
||||
]
|
||||
});
|
||||
|
||||
const STASH: u128 = 1 << 20;
|
||||
const ENDOWMENT: u128 = 1 << 20;
|
||||
|
||||
GenesisConfig {
|
||||
consensus: Some(ConsensusConfig {
|
||||
code: include_bytes!("../../runtime/wasm/target/wasm32-unknown-unknown/release/polkadot_runtime.compact.wasm").to_vec(),
|
||||
authorities: initial_authorities.clone(),
|
||||
authorities: initial_authorities.iter().map(|x| x.2.clone()).collect(),
|
||||
}),
|
||||
system: None,
|
||||
indices: Some(IndicesConfig {
|
||||
@@ -177,16 +229,16 @@ fn testnet_genesis(initial_authorities: Vec<AuthorityId>, upgrade_key: H256) ->
|
||||
existential_deposit: 500,
|
||||
transfer_fee: 0,
|
||||
creation_fee: 0,
|
||||
balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60))).collect(),
|
||||
balances: endowed_accounts.iter().map(|&k| (k.into(), ENDOWMENT)).collect(),
|
||||
vesting: vec![],
|
||||
}),
|
||||
session: Some(SessionConfig {
|
||||
validators: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
validators: initial_authorities.iter().map(|x| x.1.into()).collect(),
|
||||
session_length: 10,
|
||||
keys: initial_authorities.iter().map(|x| (x.1.clone(), x.2.clone())).collect::<Vec<_>>(),
|
||||
}),
|
||||
staking: Some(StakingConfig {
|
||||
current_era: 0,
|
||||
intentions: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
minimum_validator_count: 1,
|
||||
validator_count: 2,
|
||||
sessions_per_era: 5,
|
||||
@@ -196,20 +248,20 @@ fn testnet_genesis(initial_authorities: Vec<AuthorityId>, upgrade_key: H256) ->
|
||||
current_offline_slash: 0,
|
||||
current_session_reward: 0,
|
||||
offline_slash_grace: 0,
|
||||
invulnerables: initial_authorities.iter().cloned().map(Into::into).collect(),
|
||||
stakers: initial_authorities.iter().map(|x| (x.0.into(), x.1.into(), STASH)).collect(),
|
||||
invulnerables: initial_authorities.iter().map(|x| x.1.into()).collect(),
|
||||
}),
|
||||
democracy: Some(DemocracyConfig {
|
||||
launch_period: 9,
|
||||
voting_period: 18,
|
||||
minimum_deposit: 10,
|
||||
public_delay: 10 * 60,
|
||||
public_delay: 0,
|
||||
max_lock_periods: 6,
|
||||
}),
|
||||
grandpa: Some(GrandpaConfig {
|
||||
authorities: initial_authorities.clone().into_iter().map(|k| (k, 1)).collect(),
|
||||
}),
|
||||
council_seats: Some(CouncilSeatsConfig {
|
||||
active_council: endowed_accounts.iter().filter(|a| initial_authorities.iter().find(|&b| a[..] == b.0).is_none()).map(|a| (a.clone(), 1000000)).collect(),
|
||||
active_council: endowed_accounts.iter()
|
||||
.filter(|&endowed| initial_authorities.iter().find(|&(_, controller, _)| controller == endowed).is_none())
|
||||
.map(|a| (a.clone().into(), 1000000)).collect(),
|
||||
candidacy_bond: 10,
|
||||
voter_bond: 2,
|
||||
present_slash_per_voter: 1,
|
||||
@@ -227,68 +279,58 @@ fn testnet_genesis(initial_authorities: Vec<AuthorityId>, upgrade_key: H256) ->
|
||||
}),
|
||||
parachains: Some(Default::default()),
|
||||
timestamp: Some(TimestampConfig {
|
||||
period: 2, // 2*2=4 second block time.
|
||||
period: 2, // 2*2=4 second block time.
|
||||
}),
|
||||
treasury: Some(Default::default()),
|
||||
upgrade_key: Some(UpgradeKeyConfig {
|
||||
key: upgrade_key,
|
||||
treasury: Some(TreasuryConfig {
|
||||
proposal_bond: Permill::from_percent(5),
|
||||
proposal_bond_minimum: 1_000_000,
|
||||
spend_period: 12 * 60 * 24,
|
||||
burn: Permill::from_percent(50),
|
||||
}),
|
||||
sudo: Some(SudoConfig {
|
||||
key: upgrade_key,
|
||||
key: root_key,
|
||||
}),
|
||||
claims: Some(ClaimsConfig {
|
||||
claims: vec![],
|
||||
}),
|
||||
grandpa: Some(GrandpaConfig {
|
||||
authorities: initial_authorities.iter().map(|x| (x.2.clone(), 1)).collect(),
|
||||
}),
|
||||
fees: Some(FeesConfig {
|
||||
transaction_base_fee: 1,
|
||||
transaction_byte_fee: 0,
|
||||
})
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fn development_config_genesis() -> GenesisConfig {
|
||||
testnet_genesis(
|
||||
vec![
|
||||
ed25519::Pair::from_seed(b"Alice ").public().into(),
|
||||
get_authority_keys_from_seed("Alice"),
|
||||
],
|
||||
ed25519::Pair::from_seed(b"Alice ").public().0.into()
|
||||
get_account_id_from_seed("Alice").into(),
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
/// Development config (single validator Alice)
|
||||
pub fn development_config() -> ChainSpec {
|
||||
ChainSpec::from_genesis(
|
||||
"Development",
|
||||
"development",
|
||||
development_config_genesis,
|
||||
vec![],
|
||||
None,
|
||||
Some(DEFAULT_PROTOCOL_ID),
|
||||
None,
|
||||
None,
|
||||
)
|
||||
ChainSpec::from_genesis("Development", "dev", development_config_genesis, vec![], None, Some(DEFAULT_PROTOCOL_ID), None, None)
|
||||
}
|
||||
|
||||
fn local_testnet_genesis() -> GenesisConfig {
|
||||
testnet_genesis(
|
||||
vec![
|
||||
ed25519::Pair::from_seed(b"Alice ").public().into(),
|
||||
ed25519::Pair::from_seed(b"Bob ").public().into(),
|
||||
get_authority_keys_from_seed("Alice"),
|
||||
get_authority_keys_from_seed("Bob"),
|
||||
],
|
||||
ed25519::Pair::from_seed(b"Alice ").public().0.into()
|
||||
get_account_id_from_seed("Alice").into(),
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
/// Local testnet config (multivalidator Alice + Bob)
|
||||
pub fn local_testnet_config() -> ChainSpec {
|
||||
ChainSpec::from_genesis(
|
||||
"Local Testnet",
|
||||
"local_testnet",
|
||||
local_testnet_genesis,
|
||||
vec![],
|
||||
None,
|
||||
Some(DEFAULT_PROTOCOL_ID),
|
||||
None,
|
||||
None,
|
||||
)
|
||||
ChainSpec::from_genesis("Local Testnet", "local_testnet", local_testnet_genesis, vec![], None, Some(DEFAULT_PROTOCOL_ID), None, None)
|
||||
}
|
||||
|
||||
@@ -27,11 +27,13 @@ extern crate polkadot_network;
|
||||
extern crate sr_primitives;
|
||||
extern crate substrate_primitives as primitives;
|
||||
extern crate substrate_client as client;
|
||||
extern crate substrate_keystore as keystore;
|
||||
#[macro_use]
|
||||
extern crate substrate_service as service;
|
||||
extern crate substrate_consensus_aura as aura;
|
||||
extern crate substrate_finality_grandpa as grandpa;
|
||||
extern crate substrate_transaction_pool as transaction_pool;
|
||||
extern crate substrate_telemetry as telemetry;
|
||||
extern crate tokio;
|
||||
extern crate substrate_inherents as inherents;
|
||||
|
||||
@@ -44,8 +46,9 @@ pub mod chain_spec;
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use polkadot_primitives::{parachain, AccountId, Block};
|
||||
use polkadot_primitives::{parachain, AccountId, Block, Hash, BlockId};
|
||||
use polkadot_runtime::{GenesisConfig, RuntimeApi};
|
||||
use polkadot_network::gossip::{self as network_gossip, Known};
|
||||
use primitives::ed25519;
|
||||
use tokio::runtime::TaskExecutor;
|
||||
use service::{FactoryFullConfiguration, FullBackend, LightBackend, FullExecutor, LightExecutor};
|
||||
@@ -187,6 +190,7 @@ construct_service_factory! {
|
||||
},
|
||||
link_half,
|
||||
grandpa::NetworkBridge::new(service.network()),
|
||||
service.config.custom.inherent_data_providers.clone(),
|
||||
service.on_exit(),
|
||||
)?;
|
||||
|
||||
@@ -212,11 +216,33 @@ construct_service_factory! {
|
||||
};
|
||||
|
||||
let client = service.client();
|
||||
let known_oracle = client.clone();
|
||||
|
||||
let gossip_validator = network_gossip::register_validator(
|
||||
&*service.network(),
|
||||
move |block_hash: &Hash| {
|
||||
use client::{BlockStatus, ChainHead};
|
||||
|
||||
match known_oracle.block_status(&BlockId::hash(*block_hash)) {
|
||||
Err(_) | Ok(BlockStatus::Unknown) | Ok(BlockStatus::Queued) => None,
|
||||
Ok(BlockStatus::KnownBad) => Some(Known::Bad),
|
||||
Ok(BlockStatus::InChain) => match known_oracle.leaves() {
|
||||
Err(_) => None,
|
||||
Ok(leaves) => if leaves.contains(block_hash) {
|
||||
Some(Known::Leaf)
|
||||
} else {
|
||||
Some(Known::Old)
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// collator connections and validation network both fulfilled by this
|
||||
let validation_network = ValidationNetwork::new(
|
||||
service.network(),
|
||||
service.on_exit(),
|
||||
gossip_validator,
|
||||
service.client(),
|
||||
executor.clone(),
|
||||
);
|
||||
|
||||
@@ -176,6 +176,7 @@ pub trait Network {
|
||||
&self,
|
||||
table: Arc<SharedTable>,
|
||||
outgoing: Outgoing,
|
||||
authorities: &[SessionKey],
|
||||
) -> Self::TableRouter;
|
||||
}
|
||||
|
||||
@@ -347,6 +348,7 @@ impl<C, N, P> ParachainValidation<C, N, P> where
|
||||
let router = self.network.communication_for(
|
||||
table.clone(),
|
||||
outgoing,
|
||||
authorities,
|
||||
);
|
||||
|
||||
let drop_signal = match local_duty.validation {
|
||||
|
||||
Reference in New Issue
Block a user