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

Minimal parachains part 2: Parachain statement and data routing #173

Merged
merged 131 commits into from
Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
36055db
dynamic inclusion threshold calculator
rphmeier Apr 4, 2018
8634fcd
collators interface
rphmeier Apr 4, 2018
28bf531
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 4, 2018
90ed3a1
collation helpers
rphmeier Apr 5, 2018
b3e654a
initial proposal-creation future
rphmeier Apr 5, 2018
2c17d00
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 5, 2018
83879eb
create proposer when asked to propose
rphmeier Apr 5, 2018
04bf517
remove local_availability duty
rphmeier Apr 6, 2018
6559366
statement table tracks includable parachain count
rphmeier Apr 6, 2018
9bf4b2a
beginnings of timing future
rphmeier Apr 6, 2018
79ea48a
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 7, 2018
f1d7634
finish proposal logic
rphmeier Apr 7, 2018
908bcab
remove stray println
rphmeier Apr 7, 2018
74b7ded
extract shared table to separate module
rphmeier Apr 7, 2018
81508cf
change ordering
rphmeier Apr 9, 2018
d7cb48a
includability tracking
rphmeier Apr 9, 2018
616503d
fix doc
rphmeier Apr 9, 2018
7e049b3
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 9, 2018
ca6fbcb
initial changes to parachains module
rphmeier Apr 10, 2018
a8b0fc1
initialise dummy block before API calls
rphmeier Apr 10, 2018
f2297b8
give polkadot control over round proposer based on random seed
rphmeier Apr 10, 2018
f6fa97f
propose only after enough candidates
rphmeier Apr 10, 2018
6380239
flesh out parachains module a bit more
rphmeier Apr 11, 2018
00624c8
set_heads
rphmeier Apr 11, 2018
7cff6b7
actually introduce set_heads to runtime
rphmeier Apr 11, 2018
7e5d5ce
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 11, 2018
47095e5
update block_builder to accept parachains
rphmeier Apr 11, 2018
08a040c
split block validity errors from real errors in evaluation
rphmeier Apr 11, 2018
57b523a
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 12, 2018
0653de9
update WASM runtimes
rphmeier Apr 12, 2018
3ba45d5
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 13, 2018
6e73e55
polkadot-api methods for parachains additions
rphmeier Apr 13, 2018
acfdc27
delay evaluation until candidates are ready
rphmeier Apr 13, 2018
7bcf8e5
comments
rphmeier Apr 13, 2018
e63431b
fix dynamic inclusion with zero initial
rphmeier Apr 13, 2018
787ffeb
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 16, 2018
1f5faa3
test for includability tracker
rphmeier Apr 16, 2018
213cfab
wasm validation of parachain candidates
rphmeier Apr 17, 2018
eeebde3
move primitives to primitives crate
rphmeier Apr 17, 2018
d01531f
remove runtime-std dependency from codec
rphmeier Apr 17, 2018
1a84478
adjust doc
rphmeier Apr 17, 2018
c18ed9a
polkadot-parachain-primitives
rphmeier Apr 17, 2018
51c6063
kill legacy polkadot-validator crate
rphmeier Apr 17, 2018
90fe0ff
basic-add test chain
rphmeier Apr 17, 2018
fc5ff45
test for basic_add parachain
rphmeier Apr 17, 2018
0cce813
move to test-chains dir
rphmeier Apr 17, 2018
fb6f12d
use wasm-build
rphmeier Apr 17, 2018
5ba8dd3
new wasm directory layout
rphmeier Apr 17, 2018
f404eb8
reorganize a bit more
rphmeier Apr 18, 2018
39aad59
Fix for rh-minimal-parachain (#141)
pepyakin Apr 18, 2018
b5b2629
more basic_add tests
rphmeier Apr 18, 2018
3cd7c2c
validate parachain WASM
rphmeier Apr 18, 2018
da5d1a9
Merge branch 'master' into rh-minimal-parachain
rphmeier Apr 18, 2018
716f104
produce statements on receiving statements
rphmeier Apr 30, 2018
516c0c1
tests for reactive statement production
rphmeier May 1, 2018
11a2e2b
fix build
rphmeier May 1, 2018
e0acc9c
add OOM lang item to runtime-io
rphmeier May 1, 2018
0857ffa
use dynamic_inclusion when evaluating as well
rphmeier May 1, 2018
12ea3b3
Merge branch 'master' into rh-minimal-parachain
rphmeier May 2, 2018
8e38484
Merge branch 'master' into rh-minimal-parachain
rphmeier May 2, 2018
3f35959
fix update_includable_count
rphmeier May 4, 2018
3e88415
remove dead code
rphmeier May 5, 2018
157b0ca
grumbles
rphmeier May 6, 2018
0d17f97
actually defer round_proposer logic
rphmeier May 7, 2018
a8581ac
Merge branch 'master' into rh-minimal-parachain
rphmeier May 8, 2018
c658d29
update wasm
rphmeier May 8, 2018
ed05e14
address a few more grumbles
rphmeier May 8, 2018
75004e1
Merge branch 'master' into rh-minimal-parachain
rphmeier May 15, 2018
77c6df7
Merge branch 'master' into rh-minimal-parachain
rphmeier May 17, 2018
59f7f48
schedule collation work as soon as BFT is started
rphmeier May 18, 2018
6814287
impl future in collator
rphmeier May 18, 2018
a3c0ad0
fix comment
rphmeier May 22, 2018
3ee8b93
governance proposals for adding and removing parachains
rphmeier May 22, 2018
e31d39d
bump protocol version
rphmeier May 22, 2018
02906b5
tear out polkadot-specific pieces of substrate-network
rphmeier May 22, 2018
c7882aa
extract out polkadot-specific stuff from substrate-network
rphmeier May 22, 2018
00cdc05
begin polkadot network subsystem
rphmeier May 23, 2018
5c0c13b
Merge branch 'master' into rh-minimal-parachain
rphmeier May 23, 2018
e6e6b5a
grumbles
rphmeier May 23, 2018
251a93c
update WASM checkins
rphmeier May 23, 2018
1c7adce
Merge branch 'rh-minimal-parachain' into rh-co-finalization
rphmeier May 23, 2018
a8463d6
parse status from polkadot peer
rphmeier May 23, 2018
9a3301f
Merge branch 'master' into rh-minimal-parachain
rphmeier May 23, 2018
51d66ce
allow invoke of network specialization
rphmeier May 23, 2018
14caa84
begin statement router implementation
rphmeier May 24, 2018
78f7428
remove dependency on tokio-timer
rphmeier May 24, 2018
c04aeef
Merge branch 'master' into rh-minimal-parachain
rphmeier May 24, 2018
3c9086e
Merge branch 'rh-minimal-parachain' into rh-co-finalization
rphmeier May 24, 2018
f769e86
fix sanity check and have proposer factory create communication streams
rphmeier May 24, 2018
9dc67ba
pull out statement routing from consensus library
rphmeier May 24, 2018
5da52c1
fix comments
rphmeier May 25, 2018
cad6e4a
Merge branch 'master' into rh-co-finalization
rphmeier Jun 7, 2018
35ce714
adjust typedefs
rphmeier Jun 7, 2018
e4948eb
extract consensus_gossip out of main network protocol handler
rphmeier Jun 11, 2018
667dc2b
port substrate-bft to new tokio
rphmeier Jun 12, 2018
1fd63ff
port polkadot-consensus to new tokio
rphmeier Jun 12, 2018
94bb78e
fix typo
rphmeier Jun 12, 2018
62aa5cc
start message processing task
rphmeier Jun 15, 2018
05fa59c
initial consensus network implementation
rphmeier Jun 18, 2018
2bb829d
remove known tracking from statement-table crate
rphmeier Jun 18, 2018
fae50a0
extract router into separate module
rphmeier Jun 18, 2018
5fdc50a
defer statements until later
rphmeier Jun 18, 2018
6c4d269
double signature is invalid
rphmeier Jun 19, 2018
0a2abce
propagating statements
rphmeier Jun 19, 2018
a6219ab
grumbles
rphmeier Jun 21, 2018
4fed499
Merge branch 'master' into rh-co-finalization
rphmeier Jun 21, 2018
b500731
request block data
rphmeier Jun 22, 2018
5d74bab
fix compilation
rphmeier Jun 25, 2018
919da45
embed new consensus network into service
rphmeier Jun 25, 2018
810308a
port demo CLI to tokio
rphmeier Jun 25, 2018
e778fe0
Merge remote-tracking branch 'upstream/master' into rh-co-finalization
rphmeier Jun 25, 2018
e9274f3
all test crates compile
rphmeier Jun 25, 2018
edadf3a
some tests for fetching block data
rphmeier Jun 26, 2018
b156b00
whitespace
rphmeier Jun 26, 2018
76b33a9
Merge remote-tracking branch 'upstream/master' into rh-co-finalization
rphmeier Jun 26, 2018
2b58efd
adjusting some tokio stuff
rphmeier Jun 27, 2018
61c21b3
update exit-future
rphmeier Jul 2, 2018
7dbc99c
remove overly noisy warning
rphmeier Jul 2, 2018
7499ca3
Merge branch 'master' into rh-co-finalization
rphmeier Jul 2, 2018
7210585
clean up collation work a bit
rphmeier Jul 3, 2018
51470c1
address review grumbles
rphmeier Jul 3, 2018
a2c2009
fix lock order in protocol handler
rphmeier Jul 3, 2018
b80e311
Merge branch 'master' into rh-co-finalization
rphmeier Jul 3, 2018
139195d
rebuild wasm artifacts
rphmeier Jul 3, 2018
20b0c8f
Merge branch 'master' into rh-co-finalization
rphmeier Jul 4, 2018
16ab684
tag AuthorityId::from_slice for std only
rphmeier Jul 4, 2018
03d5637
Merge branch 'master' into rh-co-finalization
rphmeier Jul 5, 2018
9a4889e
address formatting grumbles
rphmeier Jul 5, 2018
34ee739
Merge branch 'master' into rh-co-finalization
rphmeier Jul 6, 2018
618535d
rename event_loop to executor
rphmeier Jul 6, 2018
98bac98
some more docs for polkadot-network crate
rphmeier Jul 6, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 47 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ members = [
"polkadot/collator",
"polkadot/consensus",
"polkadot/executor",
"polkadot/parachain",
"polkadot/network",
"polkadot/primitives",
"polkadot/runtime",
"polkadot/service",
"polkadot/statement-table",
"polkadot/transaction-pool",
"polkadot/service",

"substrate/bft",
"substrate/client",
"substrate/client/db",
Expand Down
2 changes: 1 addition & 1 deletion demo/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ futures = "0.1.17"
error-chain = "0.12"
hex-literal = "0.1"
log = "0.3"
tokio-core = "0.1.12"
tokio = "0.1.7"
triehash = "0.1"
substrate-client = { path = "../../substrate/client" }
substrate-codec = { path = "../../substrate/codec" }
Expand Down
11 changes: 6 additions & 5 deletions demo/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extern crate ctrlc;
extern crate ed25519;
extern crate env_logger;
extern crate futures;
extern crate tokio_core;
extern crate tokio;
extern crate triehash;
extern crate substrate_client as client;
extern crate substrate_codec as codec;
Expand Down Expand Up @@ -53,6 +53,7 @@ use demo_runtime::{Block, BlockId, UncheckedExtrinsic, GenesisConfig,
ConsensusConfig, CouncilConfig, DemocracyConfig, SessionConfig, StakingConfig,
TimestampConfig};
use futures::{Future, Sink, Stream};
use tokio::runtime::Runtime;

struct DummyPool;
impl extrinsic_pool::api::ExtrinsicPool<UncheckedExtrinsic, BlockId, Hash> for DummyPool {
Expand Down Expand Up @@ -155,11 +156,10 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
};

let client = Arc::new(client::new_in_mem::<_, Block, _>(executor, genesis_config)?);
let mut core = ::tokio_core::reactor::Core::new().expect("Unable to spawn event loop.");

let mut runtime = Runtime::new()?;
let _rpc_servers = {
let handler = || {
let chain = rpc::apis::chain::Chain::new(client.clone(), core.remote());
let chain = rpc::apis::chain::Chain::new(client.clone(), runtime.executor());
let author = rpc::apis::author::Author::new(client.clone(), Arc::new(DummyPool));
rpc::rpc_handler::<Block, _, _, _, _>(client.clone(), chain, author, DummySystem)
};
Expand All @@ -178,7 +178,8 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
ctrlc::CtrlC::set_handler(move || {
exit_send.clone().send(()).wait().expect("Error sending exit notification");
});
core.run(exit.into_future()).expect("Error running informant event loop");

runtime.block_on(exit.into_future()).expect("Error running informant event loop");
return Ok(())
}

Expand Down
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion polkadot/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ lazy_static = "1.0"
triehash = "0.1"
ed25519 = { path = "../../substrate/ed25519" }
app_dirs = "1.2"
tokio-core = "0.1.12"
tokio = "0.1.7"
futures = "0.1.17"
ctrlc = { git = "https://github.com/paritytech/rust-ctrlc.git" }
fdlimit = "0.1"
parking_lot = "0.4"
serde_json = "1.0"
serde = "1.0"
exit-future = "0.1"
substrate-client = { path = "../../substrate/client" }
substrate-codec = { path = "../../substrate/codec" }
substrate-network = { path = "../../substrate/network" }
Expand Down
16 changes: 8 additions & 8 deletions polkadot/cli/src/informant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
//! Console informant. Prints sync progress and block events. Runs on the calling thread.

use std::time::{Duration, Instant};
use futures::stream::Stream;
use futures::{Future, Stream};
use service::{Service, Components};
use tokio_core::reactor;
use tokio::runtime::TaskExecutor;
use tokio::timer::Interval;
use network::{SyncState, SyncProvider};
use polkadot_primitives::Block;
use state_machine;
Expand All @@ -28,13 +29,12 @@ use client::{self, BlockchainEvents};
const TIMER_INTERVAL_MS: u64 = 5000;

/// Spawn informant on the event loop
pub fn start<C>(service: &Service<C>, handle: reactor::Handle)
pub fn start<C>(service: &Service<C>, exit: ::exit_future::Exit, handle: TaskExecutor)
where
C: Components,
client::error::Error: From<<<<C as Components>::Backend as client::backend::Backend<Block>>::State as state_machine::Backend>::Error>,
{
let interval = reactor::Interval::new_at(Instant::now(), Duration::from_millis(TIMER_INTERVAL_MS), &handle)
.expect("Error creating informant timer");
let interval = Interval::new(Instant::now(), Duration::from_millis(TIMER_INTERVAL_MS));

let network = service.network();
let client = service.client();
Expand Down Expand Up @@ -73,8 +73,8 @@ pub fn start<C>(service: &Service<C>, handle: reactor::Handle)
telemetry!("txpool.import"; "mem_usage" => status.mem_usage, "count" => status.transaction_count, "sender" => status.senders);
Ok(())
});
handle.spawn(display_notifications);
handle.spawn(display_block_import);
handle.spawn(display_txpool_import);

let informant_work = display_notifications.join3(display_block_import, display_txpool_import);
handle.spawn(exit.until(informant_work).map(|_| ()));
}

Loading