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
54 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
51ce190
Merge remote-tracking branch 'origin/master' into prgn-real-overseer
coriolinus Oct 28, 2020
5791bb4
Merge branch 'prgn-real-overseer' of github.com:paritytech/polkadot i…
coriolinus Oct 28, 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
20 changes: 19 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion cli/src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use browser_utils::{
Client,
browser_configuration, set_console_error_panic_hook, init_console_log,
};
use std::str::FromStr;

/// Starts the client.
#[wasm_bindgen]
Expand Down
1 change: 1 addition & 0 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ pub fn run() -> Result<()> {
_ => service::build_full(
config,
authority_discovery_disabled,
service::IsCollator::No,
grandpa_pause,
).map(|full| full.task_manager),
}
Expand Down
2 changes: 2 additions & 0 deletions node/core/av-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ polkadot-node-subsystem-util = { path = "../../subsystem-util" }
polkadot-overseer = { path = "../../overseer" }
polkadot-primitives = { path = "../../../primitives" }

sc-service = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comes from a4642e1 which fixes this CI failure.


[dev-dependencies]
env_logger = "0.7.1"
assert_matches = "1.3.0"
Expand Down
43 changes: 31 additions & 12 deletions node/core/av-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,23 @@ pub struct Config {
pub path: PathBuf,
}

impl std::convert::TryFrom<sc_service::config::DatabaseConfig> for Config {
type Error = &'static str;

fn try_from(config: sc_service::config::DatabaseConfig) -> Result<Self, Self::Error> {
let path = config.path().ok_or("custom databases are not supported")?;

Ok(Self {
// substrate cache size is improper here; just use the default
cache_size: None,
// DB path is a sub-directory of substrate db path to give two properties:
// 1: column numbers don't conflict with substrate
// 2: commands like purge-chain work without further changes
path: path.join("parachains").join("av-store"),
})
}
}

impl AvailabilityStoreSubsystem {
/// Create a new `AvailabilityStoreSubsystem` with a given config on disk.
pub fn new_on_disk(config: Config, metrics: Metrics) -> io::Result<Self> {
Expand Down Expand Up @@ -449,7 +466,6 @@ async fn run<Context>(mut subsystem: AvailabilityStoreSubsystem, mut ctx: Contex
where
Context: SubsystemContext<Message=AvailabilityStoreMessage>,
{
let ctx = &mut ctx;
loop {
// Every time the following two methods are called a read from DB is performed.
// But given that these are very small values which are essentially a newtype
Expand All @@ -470,16 +486,19 @@ where
ActiveLeavesUpdate { activated, .. })
)) => {
for activated in activated.into_iter() {
process_block_activated(ctx, &subsystem.inner, activated).await?;
process_block_activated(&mut ctx, &subsystem.inner, activated).await?;
}
}
Ok(FromOverseer::Signal(OverseerSignal::BlockFinalized(hash))) => {
process_block_finalized(&subsystem, ctx, &subsystem.inner, hash).await?;
process_block_finalized(&subsystem, &mut ctx, &subsystem.inner, hash).await?;
}
Ok(FromOverseer::Communication { msg }) => {
process_message(&mut subsystem, ctx, msg).await?;
process_message(&mut subsystem, &mut ctx, msg).await?;
}
Err(_) => break,
Err(e) => {
log::error!("AvailabilityStoreSubsystem err: {:#?}", e);
break
},
}
}
pov_pruning_time = pov_pruning_time => {
Expand Down Expand Up @@ -945,15 +964,15 @@ fn query_inner<D: Decode>(db: &Arc<dyn KeyValueDB>, column: u32, key: &[u8]) ->
}

impl<Context> Subsystem<Context> for AvailabilityStoreSubsystem
where
Context: SubsystemContext<Message=AvailabilityStoreMessage>,
where
Context: SubsystemContext<Message = AvailabilityStoreMessage>,
{
fn start(self, ctx: Context) -> SpawnedSubsystem {
let future = Box::pin(async move {
if let Err(e) = run(self, ctx).await {
log::error!(target: LOG_TARGET, "Subsystem exited with an error {:?}", e);
}
});
let future = run(self, ctx)
.map(|r| if let Err(e) = r {
log::error!(target: "availabilitystore", "Subsystem exited with an error {:?}", e);
})
.boxed();

SpawnedSubsystem {
name: "availability-store-subsystem",
Expand Down
8 changes: 4 additions & 4 deletions node/core/candidate-selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ impl metrics::Metrics for Metrics {
seconds: prometheus::register(
prometheus::CounterVec::new(
prometheus::Opts::new(
"candidate_selection_invalid_selections_total",
"Number of Candidate Selection subsystem seconding selections which proved to be invalid.",
"candidate_selection_seconds_total",
"Number of Candidate Selection subsystem seconding events.",
),
&["succeeded", "failed"],
&["success"],
)?,
registry,
)?,
Expand All @@ -433,7 +433,7 @@ impl metrics::Metrics for Metrics {
"candidate_selection_invalid_selections_total",
"Number of Candidate Selection subsystem seconding selections which proved to be invalid.",
),
&["succeeded", "failed"],
&["success"],
)?,
registry,
)?,
Expand Down
4 changes: 2 additions & 2 deletions node/core/candidate-validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Metrics {
metrics.validation_requests.with_label_values(&["invalid"]).inc();
},
Err(_) => {
metrics.validation_requests.with_label_values(&["failed"]).inc();
metrics.validation_requests.with_label_values(&["validation failure"]).inc();
},
}
}
Expand All @@ -98,7 +98,7 @@ impl metrics::Metrics for Metrics {
"parachain_validation_requests_total",
"Number of validation requests served.",
),
&["valid", "invalid", "failed"],
&["validity"],
)?,
registry,
)?,
Expand Down
20 changes: 13 additions & 7 deletions node/core/chain-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,19 @@ use polkadot_node_subsystem_util::{
};
use polkadot_primitives::v1::{Block, BlockId};
use sp_blockchain::HeaderBackend;
use std::sync::Arc;

use futures::prelude::*;

/// The Chain API Subsystem implementation.
pub struct ChainApiSubsystem<Client> {
client: Client,
client: Arc<Client>,
metrics: Metrics,
}

impl<Client> ChainApiSubsystem<Client> {
/// Create a new Chain API subsystem with the given client.
pub fn new(client: Client, metrics: Metrics) -> Self {
pub fn new(client: Arc<Client>, metrics: Metrics) -> Self {
ChainApiSubsystem {
client,
metrics,
Expand Down Expand Up @@ -126,8 +127,13 @@ where
// fewer than `k` ancestors are available
Ok(None) => None,
Ok(Some(header)) => {
hash = header.parent_hash;
Some(Ok(hash))
// stop at the genesis header.
if header.number == 1 {
None
} else {
hash = header.parent_hash;
Some(Ok(hash))
}
}
}
});
Expand Down Expand Up @@ -171,7 +177,7 @@ impl metrics::Metrics for Metrics {
"parachain_chain_api_requests_total",
"Number of Chain API requests served.",
),
&["succeeded", "failed"],
&["success"],
)?,
registry,
)?,
Expand Down Expand Up @@ -300,11 +306,11 @@ mod tests {
}

fn test_harness(
test: impl FnOnce(TestClient, TestSubsystemContextHandle<ChainApiMessage>)
test: impl FnOnce(Arc<TestClient>, TestSubsystemContextHandle<ChainApiMessage>)
-> BoxFuture<'static, ()>,
) {
let (ctx, ctx_handle) = make_subsystem_context(TaskExecutor::new());
let client = TestClient::default();
let client = Arc::new(TestClient::default());

let subsystem = ChainApiSubsystem::new(client.clone(), Metrics(None));
let chain_api_task = run(ctx, subsystem).map(|x| x.unwrap());
Expand Down
11 changes: 6 additions & 5 deletions node/core/proposer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ where
let (sender, receiver) = futures::channel::oneshot::channel();

overseer.wait_for_activation(parent_header_hash, sender).await?;
receiver.await.map_err(Error::ClosedChannelFromProvisioner)??;
receiver.await.map_err(|_| Error::ClosedChannelAwaitingActivation)??;

let (sender, receiver) = futures::channel::oneshot::channel();
// strictly speaking, we don't _have_ to .await this send_msg before opening the
Expand All @@ -156,7 +156,7 @@ where
ProvisionerMessage::RequestInherentData(parent_header_hash, sender),
)).await?;

receiver.await.map_err(Error::ClosedChannelFromProvisioner)
receiver.await.map_err(|_| Error::ClosedChannelAwaitingInherentData)
}
.boxed()
.fuse();
Expand Down Expand Up @@ -236,7 +236,8 @@ pub enum Error {
Blockchain(sp_blockchain::Error),
Inherent(sp_inherents::Error),
Timeout,
ClosedChannelFromProvisioner(futures::channel::oneshot::Canceled),
ClosedChannelAwaitingActivation,
ClosedChannelAwaitingInherentData,
Subsystem(SubsystemError)
}

Expand Down Expand Up @@ -271,7 +272,8 @@ impl fmt::Display for Error {
Self::Blockchain(err) => write!(f, "blockchain error: {}", err),
Self::Inherent(err) => write!(f, "inherent error: {:?}", err),
Self::Timeout => write!(f, "timeout: provisioner did not return inherent data after {:?}", PROPOSE_TIMEOUT),
Self::ClosedChannelFromProvisioner(err) => write!(f, "provisioner closed inherent data channel before sending: {}", err),
Self::ClosedChannelAwaitingActivation => write!(f, "closed channel from overseer when awaiting activation"),
Self::ClosedChannelAwaitingInherentData => write!(f, "closed channel from provisioner when awaiting inherent data"),
Self::Subsystem(err) => write!(f, "subsystem error: {:?}", err),
}
}
Expand All @@ -282,7 +284,6 @@ impl std::error::Error for Error {
match self {
Self::Consensus(err) => Some(err),
Self::Blockchain(err) => Some(err),
Self::ClosedChannelFromProvisioner(err) => Some(err),
Self::Subsystem(err) => Some(err),
_ => None
}
Expand Down
4 changes: 2 additions & 2 deletions node/core/provisioner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ impl Metrics {
fn on_inherent_data_request(&self, response: Result<(), ()>) {
if let Some(metrics) = &self.0 {
match response {
Ok(()) => metrics.inherent_data_requests.with_label_values(&["succeded"]).inc(),
Ok(()) => metrics.inherent_data_requests.with_label_values(&["succeeded"]).inc(),
Err(()) => metrics.inherent_data_requests.with_label_values(&["failed"]).inc(),
}
}
Expand All @@ -498,7 +498,7 @@ impl metrics::Metrics for Metrics {
"parachain_inherent_data_requests_total",
"Number of InherentData requests served by provisioner.",
),
&["succeeded", "failed"],
&["success"],
)?,
registry,
)?,
Expand Down
Loading