Unverified Commit 94b79d07 authored by Robert Klotzner's avatar Robert Klotzner Committed by GitHub
Browse files

State can be finished due to `Share` message. (#3070)



* State can be finished due to `Share` message.

Therefoe a task can still be running in that state. Removed panic and
changed state name to reflect possibility of `Share` message.

* bump spec versions in kusama, polkadot and westend again III

* properly bump for the upcoming release

Co-authored-by: Andronik Ordian's avatarAndronik Ordian <write@reusable.software>
parent bd83612d
Pipeline #138980 passed with stages
in 25 minutes and 44 seconds
......@@ -554,8 +554,8 @@ enum LargeStatementStatus {
/// We are currently fetching the statement data from a remote peer. We keep a list of other nodes
/// claiming to have that data and will fallback on them.
Fetching(FetchingInfo),
/// Statement data is fetched
Fetched(CommittedCandidateReceipt),
/// Statement data is fetched or we got it locally via `StatementDistributionMessage::Share`.
FetchedOrShared(CommittedCandidateReceipt),
}
/// Info about a fetch in progress.
......@@ -1167,7 +1167,7 @@ async fn retrieve_statement_from_message<'a>(
}
}
}
LargeStatementStatus::Fetched(committed) => {
LargeStatementStatus::FetchedOrShared(committed) => {
match message {
protocol_v1::StatementDistributionMessage::Statement(_, s) => {
// We can now immediately return any statements (should only be
......@@ -1654,7 +1654,7 @@ impl StatementDistribution {
.ok_or(NonFatal::NoSuchHead(relay_parent))?;
let committed = match active_head.waiting_large_statements.get(&candidate_hash) {
Some(LargeStatementStatus::Fetched(committed)) => committed.clone(),
Some(LargeStatementStatus::FetchedOrShared(committed)) => committed.clone(),
_ => {
return Err(
NonFatal::NoSuchFetchedLargeStatement(relay_parent, candidate_hash)
......@@ -1699,8 +1699,9 @@ impl StatementDistribution {
let info = match status {
Some(LargeStatementStatus::Fetching(info)) => info,
Some(LargeStatementStatus::Fetched(_)) => {
panic!("On status fetched, fetching task already succeeded. qed.");
Some(LargeStatementStatus::FetchedOrShared(_)) => {
// We are no longer interested in the data.
return Ok(())
}
None => {
return Err(
......@@ -1711,7 +1712,7 @@ impl StatementDistribution {
active_head.waiting_large_statements.insert(
candidate_hash,
LargeStatementStatus::Fetched(response),
LargeStatementStatus::FetchedOrShared(response),
);
// Cache is now populated, send all messages:
......@@ -1755,8 +1756,14 @@ impl StatementDistribution {
let info = match status {
Some(LargeStatementStatus::Fetching(info)) => info,
Some(LargeStatementStatus::Fetched(_)) =>
panic!("On status fetched, fetching task already succeeded. qed."),
Some(LargeStatementStatus::FetchedOrShared(_)) => {
// This task is going to die soon - no need to send it anything.
tracing::debug!(
target: LOG_TARGET,
"Zombie task wanted more peers."
);
return Ok(())
}
None => {
return Err(
NonFatal::NoSuchLargeStatementStatus(relay_parent, candidate_hash)
......@@ -1845,7 +1852,7 @@ impl StatementDistribution {
.ok_or(NonFatal::NoSuchHead(relay_parent))?;
active_head.waiting_large_statements.insert(
statement.payload().candidate_hash(),
LargeStatementStatus::Fetched(committed.clone())
LargeStatementStatus::FetchedOrShared(committed.clone())
);
}
}
......
......@@ -120,7 +120,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 9020,
spec_version: 9030,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
......
......@@ -95,7 +95,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"),
impl_name: create_runtime_str!("parity-polkadot"),
authoring_version: 0,
spec_version: 9020,
spec_version: 9030,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
......
......@@ -118,7 +118,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westend"),
impl_name: create_runtime_str!("parity-westend"),
authoring_version: 2,
spec_version: 9020,
spec_version: 9030,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment