Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
c4c6738
start working on building the real overseer
coriolinus Oct 8, 2020
a334432
fill in AllSubsystems internal constructors
coriolinus Oct 9, 2020
db98360
Merge remote-tracking branch 'origin/master' into prgn-real-overseer
coriolinus Oct 9, 2020
b8c9463
replace fn make_metrics with Metrics::attempt_to_register
coriolinus Oct 9, 2020
e769207
update to account for #1740
coriolinus Oct 9, 2020
98204d5
remove Metrics::register, rename Metrics::attempt_to_register
coriolinus Oct 9, 2020
b847b85
Merge remote-tracking branch 'origin/master' into prgn-real-overseer
coriolinus Oct 9, 2020
40850ac
Merge remote-tracking branch 'origin/master' into prgn-real-overseer
coriolinus Oct 13, 2020
36eaa46
add 'static bounds to real_overseer type params
coriolinus Oct 13, 2020
7334016
pass authority_discovery and network_service to real_overseer
coriolinus Oct 13, 2020
5ea441e
select a proper database configuration for the availability store db
coriolinus Oct 13, 2020
0720f5d
use subdirectory for av-store database path
coriolinus Oct 14, 2020
8185a55
apply Basti's patch which avoids needing to parameterize everything o…
coriolinus Oct 15, 2020
801063d
simplify path extraction
ordian Oct 15, 2020
99a61f9
get all tests to compile
coriolinus Oct 15, 2020
79abc50
Fix Prometheus double-registry error
coriolinus Oct 19, 2020
ff63eb2
authorities must have authority discovery, but not necessarily overse…
coriolinus Oct 19, 2020
1b13b29
fix broken SpawnedSubsystem impls
coriolinus Oct 20, 2020
16ce6cb
use prometheus properly
coriolinus Oct 20, 2020
3a0d1a6
get av-store subsystem to actually run properly and not die on first …
coriolinus Oct 21, 2020
ec91b9b
Merge remote-tracking branch 'origin/master' into prgn-real-overseer
coriolinus Oct 21, 2020
1b52a0e
typo fix: incomming -> incoming
coriolinus Oct 21, 2020
c6e78be
don't disable authority discovery in test nodes
coriolinus Oct 21, 2020
f369874
Merge remote-tracking branch 'origin/master' into prgn-real-overseer
bkchr Oct 21, 2020
dba976f
Fix rococo-v1 missing session keys
bkchr Oct 21, 2020
a4642e1
Update node/core/av-store/Cargo.toml
montekki Oct 23, 2020
239c182
try dummying out av-store on non-full-nodes
coriolinus Oct 23, 2020
96ae179
overseer and subsystems are required only for full nodes
coriolinus Oct 23, 2020
f3fd10f
Reduce the amount of warnings on browser target
montekki Oct 23, 2020
ee23259
Fix two more warnings
montekki Oct 23, 2020
98aa01d
InclusionInherent should actually have an Inherent module on rococo
montekki Oct 23, 2020
ba768b4
Ancestry: don't return genesis' parent hash
Oct 24, 2020
57418fb
Update Cargo.lock
montekki Oct 24, 2020
a395acb
Merge remote-tracking branch 'origin/master' into prgn-real-overseer
coriolinus Oct 26, 2020
b953b01
fix broken test
coriolinus Oct 26, 2020
25ec0be
update test script: specify chainspec as script argument
coriolinus Oct 26, 2020
2449358
Apply suggestions from code review
coriolinus Oct 26, 2020
ffc37f2
Update node/service/src/lib.rs
coriolinus Oct 26, 2020
6ee3d7b
Merge branch 'paritytech/master' into real-overseer
mxinden Oct 26, 2020
919d530
node/service/src/lib: Return error via ? operator
mxinden Oct 26, 2020
af37ece
Merge remote-tracking branch 'mxinden/real-overseer' into prgn-real-o…
coriolinus Oct 26, 2020
244e980
Merge remote-tracking branch 'origin/master' into prgn-real-overseer
coriolinus Oct 27, 2020
cd97445
post-merge blues
coriolinus Oct 27, 2020
d1d4163
add is_collator flag
coriolinus Oct 27, 2020
283f426
prevent occasional av-store test panic
coriolinus Oct 27, 2020
2ddc5ee
simplify fix; expand application
coriolinus Oct 27, 2020
2bf2980
run authority_discovery in Role::Discover when collating
coriolinus Oct 27, 2020
ac0a90f
distinguish between proposer closed channel errors
coriolinus Oct 27, 2020
566fd21
add IsCollator enum, remove is_collator CLI flag
coriolinus Oct 27, 2020
0f4a86e
improve formatting
coriolinus Oct 27, 2020
558844d
remove nop loop
coriolinus Oct 27, 2020
d16f502
Fix some stuff
bkchr Oct 27, 2020
306203e
Adds test parachain adder collator
bkchr Oct 27, 2020
fda928e
Add sudo to Rococo, change session length to 30 seconds and some rena…
bkchr Oct 28, 2020
4a3f9b0
Merge remote-tracking branch 'origin/master' into bkchr-adder-collator
bkchr Oct 28, 2020
89e5b6c
Update to the latest changes on master
pepyakin Oct 28, 2020
83d408c
Some fixes
bkchr Oct 28, 2020
adb6e6d
Merge remote-tracking branch 'origin/ser-fix-runtime-api-mock-in-test…
bkchr Oct 28, 2020
c4156b1
Fix compilation
bkchr Oct 28, 2020
6643180
Update parachain/test-parachains/adder/collator/src/lib.rs
bkchr Oct 28, 2020
2b34c73
Review comments
bkchr Oct 28, 2020
6d39a0e
Downgrade transaction version
bkchr Oct 28, 2020
45e3457
Merge branch 'master' into bkchr-adder-collator
ordian Oct 28, 2020
6638ca3
Merge remote-tracking branch 'origin/master' into bkchr-adder-collator
bkchr Oct 28, 2020
e3bc174
Merge remote-tracking branch 'origin/master' into bkchr-adder-collator
bkchr Oct 28, 2020
4162a10
Fixes
bkchr Oct 28, 2020
8b83c04
MOARE
bkchr Oct 28, 2020
a7adf68
Register notification protocols
bkchr Oct 28, 2020
e1fc037
utils: remove unused error
ordian Oct 9, 2020
9e03da1
av-store: more resilient to some errors
ordian Oct 30, 2020
8dc1163
address review nits
ordian Oct 30, 2020
b44e963
address more review nits
ordian Oct 30, 2020
67d3788
Merge remote-tracking branch 'origin/master' into bkchr-adder-collator
bkchr Oct 30, 2020
ead42a1
Merge remote-tracking branch 'origin/ao-more-resilient-subsystems-av-…
bkchr Oct 30, 2020
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
300 changes: 160 additions & 140 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ members = [
"runtime/parachains",
"runtime/polkadot",
"runtime/kusama",
"runtime/rococo-v1",
"runtime/rococo",
"runtime/westend",
"runtime/test-runtime",
"statement-table",
Expand Down Expand Up @@ -69,6 +69,7 @@ members = [
"node/test/service",
"parachain/test-parachains",
"parachain/test-parachains/adder",
"parachain/test-parachains/adder/collator",
]

[badges]
Expand Down
52 changes: 39 additions & 13 deletions node/core/av-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,37 @@ mod columns {

#[derive(Debug, Error)]
enum Error {
#[error(transparent)]
RuntimeAPI(#[from] RuntimeApiError),
#[error(transparent)]
ChainAPI(#[from] ChainApiError),
#[error(transparent)]
Erasure(#[from] erasure::Error),
#[error(transparent)]
Io(#[from] io::Error),
#[error(transparent)]
Oneshot(#[from] oneshot::Canceled),
ChainApiChannelIsClosed(#[from] oneshot::Canceled),
#[error(transparent)]
Subsystem(#[from] SubsystemError),
#[error(transparent)]
Time(#[from] SystemTimeError),
}

/// Class of errors which we should handle more gracefully.
/// An occurrence of this error should not bring down the subsystem.
#[derive(Debug, Error)]
enum NonFatalError {
/// A Runtime API error occurred.
#[error(transparent)]
RuntimeApi(#[from] RuntimeApiError),

/// The receiver's end of the channel is closed.
#[error(transparent)]
Oneshot(#[from] oneshot::Canceled),

/// Overseer channel's buffer is full.
#[error(transparent)]
OverseerOutOfCapacity(#[from] SubsystemError),
}

/// A wrapper type for delays.
#[derive(Debug, Decode, Encode, Eq)]
enum PruningDelay {
Expand Down Expand Up @@ -582,7 +597,13 @@ async fn process_block_activated<Context>(
where
Context: SubsystemContext<Message=AvailabilityStoreMessage>
{
let events = request_candidate_events(ctx, hash).await?;
let events = match request_candidate_events(ctx, hash).await {
Ok(events) => events,
Err(err) => {
log::debug!(target: LOG_TARGET, "requesting candidate events failed due to {}", err);
return Ok(());
}
};

log::trace!(target: LOG_TARGET, "block activated {}", hash);
let mut included = HashSet::new();
Expand Down Expand Up @@ -626,7 +647,7 @@ where
async fn request_candidate_events<Context>(
ctx: &mut Context,
hash: Hash,
) -> Result<Vec<CandidateEvent>, Error>
) -> Result<Vec<CandidateEvent>, NonFatalError>
where
Context: SubsystemContext<Message=AvailabilityStoreMessage>
{
Expand All @@ -651,44 +672,49 @@ where
Context: SubsystemContext<Message=AvailabilityStoreMessage>
{
use AvailabilityStoreMessage::*;

fn log_send_error(request: &'static str) {
log::debug!(target: LOG_TARGET, "error sending a response to {}", request);
}

match msg {
QueryAvailableData(hash, tx) => {
tx.send(available_data(&subsystem.inner, &hash).map(|d| d.data))
.map_err(|_| oneshot::Canceled)?;
.unwrap_or_else(|_| log_send_error("QueryAvailableData"));
}
QueryDataAvailability(hash, tx) => {
tx.send(available_data(&subsystem.inner, &hash).is_some())
.map_err(|_| oneshot::Canceled)?;
.unwrap_or_else(|_| log_send_error("QueryDataAvailability"));
}
QueryChunk(hash, id, tx) => {
tx.send(get_chunk(subsystem, &hash, id)?)
.map_err(|_| oneshot::Canceled)?;
.unwrap_or_else(|_| log_send_error("QueryChunk"));
}
QueryChunkAvailability(hash, id, tx) => {
tx.send(get_chunk(subsystem, &hash, id)?.is_some())
.map_err(|_| oneshot::Canceled)?;
.unwrap_or_else(|_| log_send_error("QueryChunkAvailability"));
}
StoreChunk { candidate_hash, relay_parent, validator_index, chunk, tx } => {
// Current block number is relay_parent block number + 1.
let block_number = get_block_number(ctx, relay_parent).await? + 1;
match store_chunk(subsystem, &candidate_hash, validator_index, chunk, block_number) {
Err(e) => {
tx.send(Err(())).map_err(|_| oneshot::Canceled)?;
tx.send(Err(())).unwrap_or_else(|_| log_send_error("StoreChunk (Err)"));
return Err(e);
}
Ok(()) => {
tx.send(Ok(())).map_err(|_| oneshot::Canceled)?;
tx.send(Ok(())).unwrap_or_else(|_| log_send_error("StoreChunk (Ok)"));
}
}
}
StoreAvailableData(hash, id, n_validators, av_data, tx) => {
match store_available_data(subsystem, &hash, id, n_validators, av_data) {
Err(e) => {
tx.send(Err(())).map_err(|_| oneshot::Canceled)?;
tx.send(Err(())).unwrap_or_else(|_| log_send_error("StoreAvailableData (Err)"));
return Err(e);
}
Ok(()) => {
tx.send(Ok(())).map_err(|_| oneshot::Canceled)?;
tx.send(Ok(())).unwrap_or_else(|_| log_send_error("StoreAvailableData (Ok)"));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions node/network/collator-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ impl CollatorProtocolSubsystem {
Context: SubsystemContext<Message = CollatorProtocolMessage>,
{
match self.protocol_side {
ProtocolSide::Validator(metrics) => validator_side::run(
ProtocolSide::Validator(metrics) => validator_side::run(
ctx,
REQUEST_TIMEOUT,
metrics,
).await,
ProtocolSide::Collator(id, metrics) => collator_side::run(
ProtocolSide::Collator(id, metrics) => collator_side::run(
ctx,
id,
metrics,
Expand Down
2 changes: 1 addition & 1 deletion node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ polkadot-node-subsystem-util = { path = "../subsystem-util" }
polkadot-runtime = { path = "../../runtime/polkadot" }
kusama-runtime = { path = "../../runtime/kusama" }
westend-runtime = { path = "../../runtime/westend" }
rococo-runtime = { package = "rococo-v1-runtime", path = "../../runtime/rococo-v1" }
rococo-runtime = { path = "../../runtime/rococo" }

# Polkadot Subsystems
polkadot-availability-bitfield-distribution = { path = "../network/bitfield-distribution", optional = true }
Expand Down
6 changes: 5 additions & 1 deletion node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,9 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime::
keys: vec![],
}),
pallet_staking: Some(Default::default()),
pallet_sudo: Some(rococo_runtime::SudoConfig {
key: endowed_accounts[0].clone(),
}),
}
}

Expand Down Expand Up @@ -1176,7 +1179,7 @@ pub fn westend_testnet_genesis(
pub fn rococo_testnet_genesis(
wasm_binary: &[u8],
initial_authorities: Vec<(AccountId, AccountId, BabeId, GrandpaId, ImOnlineId, ValidatorId, AuthorityDiscoveryId)>,
_root_key: AccountId,
root_key: AccountId,
endowed_accounts: Option<Vec<AccountId>>,
) -> rococo_runtime::GenesisConfig {
let endowed_accounts: Vec<AccountId> = endowed_accounts.unwrap_or_else(testnet_accounts);
Expand Down Expand Up @@ -1208,6 +1211,7 @@ pub fn rococo_testnet_genesis(
keys: vec![],
}),
pallet_staking: Some(Default::default()),
pallet_sudo: Some(rococo_runtime::SudoConfig { key: root_key }),
}
}

Expand Down
2 changes: 2 additions & 0 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ pub fn new_full<RuntimeApi, Executor>(

let (shared_voter_state, finality_proof_provider) = rpc_setup;

config.network.notifications_protocols.extend(polkadot_network_bridge::notifications_protocol_info());

let (network, network_status_sinks, system_rpc_tx, network_starter) =
service::build_network(service::BuildNetworkParams {
config: &config,
Expand Down
5 changes: 1 addition & 4 deletions node/subsystem-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#![warn(missing_docs)]

use polkadot_node_subsystem::{
errors::{ChainApiError, RuntimeApiError},
errors::RuntimeApiError,
messages::{AllMessages, RuntimeApiMessage, RuntimeApiRequest, RuntimeApiSender},
FromOverseer, SpawnedSubsystem, Subsystem, SubsystemContext, SubsystemError, SubsystemResult,
};
Expand Down Expand Up @@ -99,9 +99,6 @@ pub enum Error {
/// A subsystem error
#[error(transparent)]
Subsystem(#[from] SubsystemError),
/// An error in the Chain API.
#[error(transparent)]
ChainApi(#[from] ChainApiError),
/// An error in the Runtime API.
#[error(transparent)]
RuntimeApi(#[from] RuntimeApiError),
Expand Down
3 changes: 1 addition & 2 deletions parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-wasm-interface = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
polkadot-core-primitives = { path = "../core-primitives", default-features = false }
derive_more = { version = "0.99.11" }

# all optional crates.
thiserror = { version = "1.0.21", optional = true }
derive_more = { version = "0.99.11", optional = true }
serde = { version = "1.0.102", default-features = false, features = [ "derive" ], optional = true }
sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
Expand All @@ -36,7 +36,6 @@ wasm-api = []
std = [
"codec/std",
"thiserror",
"derive_more",
"serde/std",
"sp-std/std",
"sp-runtime/std",
Expand Down
18 changes: 3 additions & 15 deletions parachain/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,19 @@ use polkadot_core_primitives::Hash;
pub use polkadot_core_primitives::BlockNumber as RelayChainBlockNumber;

/// Parachain head data included in the chain.
#[derive(PartialEq, Eq, Clone, PartialOrd, Ord, Encode, Decode, RuntimeDebug)]
#[derive(PartialEq, Eq, Clone, PartialOrd, Ord, Encode, Decode, RuntimeDebug, derive_more::From)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Default, Hash))]
pub struct HeadData(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec<u8>);

impl From<Vec<u8>> for HeadData {
fn from(head: Vec<u8>) -> Self {
HeadData(head)
}
}

/// Parachain validation code.
#[derive(Default, PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)]
#[derive(Default, PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, derive_more::From)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Hash))]
pub struct ValidationCode(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec<u8>);

impl From<Vec<u8>> for ValidationCode {
fn from(code: Vec<u8>) -> Self {
ValidationCode(code)
}
}

/// Parachain block data.
///
/// Contains everything required to validate para-block, may contain block and witness data.
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
#[derive(PartialEq, Eq, Clone, Encode, Decode, derive_more::From)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
pub struct BlockData(#[cfg_attr(feature = "std", serde(with="bytes"))] pub Vec<u8>);

Expand Down
29 changes: 29 additions & 0 deletions parachain/test-parachains/adder/collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "test-parachain-adder-collator"
version = "0.7.26"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator for the adder test parachain"
edition = "2018"

[[bin]]
name = "adder-collator"
path = "src/main.rs"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] }
futures = "0.3.4"
log = "0.4.8"
structopt = "0.3.8"

test-parachain-adder = { path = ".." }
polkadot-primitives = { path = "../../../../primitives" }
polkadot-cli = { path = "../../../../cli" }
polkadot-service = { path = "../../../../node/service" }
polkadot-node-primitives = { path = "../../../../node/primitives" }
polkadot-node-subsystem = { path = "../../../../node/subsystem" }

sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }

[dev-dependencies]
polkadot-parachain = { path = "../../.." }
Loading