Parachain improvements (#1905)

* Parachain improvements

- Set the parachains configuration in Rococo genesis
- Don't stop the overseer when a subsystem job is stopped
- Several small code changes

* Remove unused functionality

* Return error from the runtime instead of printing it

* Apply suggestions from code review

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* Update primitives/src/v1.rs

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* Update primitives/src/v1.rs

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>

* Fix test

* Revert "Update primitives/src/v1.rs"

This reverts commit 11fce2785acd1de481ca57815b8e18400f09fd52.

* Revert "Update primitives/src/v1.rs"

This reverts commit d6439fed4f954360c89fb1e12b73954902c76a41.

* Revert "Return error from the runtime instead of printing it"

This reverts commit cb4b5c0830ac516a6d54b2c24197e9354f2b98cb.

* Revert "Fix test"

This reverts commit 0c5fa1b5566d4cd3c55a55d485e707165ce7a59e.

* Update runtime/parachains/src/runtime_api_impl/v1.rs

Co-authored-by: Sergei Shulepov <sergei@parity.io>

Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Sergei Shulepov <sergei@parity.io>
This commit is contained in:
Bastian Köcher
2020-11-03 12:22:38 +01:00
committed by GitHub
parent 45c9aefd27
commit 002e1141a8
14 changed files with 122 additions and 175 deletions
+2 -2
View File
@@ -288,7 +288,7 @@ impl CandidateBackingJob {
ToJob::CandidateBacking(msg) => {
self.process_msg(msg).await?;
}
_ => break,
ToJob::Stop => break,
}
}
@@ -838,7 +838,7 @@ impl util::JobTrait for CandidateBackingJob {
let (assignment, required_collator) = match assignment {
None => return Ok(()), // no need to work.
Some((a, r)) => (a, r),
Some(r) => r,
};
let job = CandidateBackingJob {
@@ -323,10 +323,7 @@ async fn candidate_is_valid(
pov: Arc<PoV>,
sender: mpsc::Sender<FromJob>,
) -> bool {
std::matches!(
candidate_is_valid_inner(candidate_descriptor, pov, sender).await,
Ok(true)
)
candidate_is_valid_inner(candidate_descriptor, pov, sender).await.unwrap_or(false)
}
// find out whether a candidate is valid or not, with a worse interface
@@ -342,7 +339,7 @@ async fn candidate_is_valid_inner(
CandidateValidationMessage::ValidateFromChainState(candidate_descriptor, pov, tx),
))
.await?;
Ok(std::matches!(
Ok(matches!(
rx.await,
Ok(Ok(ValidationResult::Valid(_, _)))
))
@@ -294,11 +294,11 @@ async fn find_assumed_validation_data(
for assumption in ASSUMPTIONS {
let outcome = check_assumption_validation_data(ctx, descriptor, *assumption).await?;
let () = match outcome {
match outcome {
AssumptionCheckOutcome::Matches(_, _) => return Ok(outcome),
AssumptionCheckOutcome::BadRequest => return Ok(outcome),
AssumptionCheckOutcome::DoesNotMatch => continue,
};
}
}
Ok(AssumptionCheckOutcome::DoesNotMatch)