This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Update guide candidate validation module #1264
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8e809af
first pass updating candidate validation module in the guide
coriolinus 41b5ec2
expand candidate validation functionality section
coriolinus 6ea7b2c
Merge remote-tracking branch 'origin/master' into prgn-candidate-vali…
coriolinus ac6fabe
add candidate fetch; validation requires PoV to be provided
coriolinus 0c404e7
remove candidate fetch
coriolinus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,12 +2,22 @@ | |
|
|
||
| This subsystem is responsible for handling candidate validation requests. It is a simple request/response server. | ||
|
|
||
| A variety of subsystems want to know if a parachain block candidate is valid. None of them care about the detailed mechanics of how a candidate gets validated, just the results. This subsystem handles those details. | ||
|
|
||
| ## Protocol | ||
|
|
||
| Input: | ||
| Input: [`CandidateValidationMessage`](../../type-definitions.html#validation-request-type) | ||
|
|
||
| - [`CandidateValidationMessage`](../../type-definitions.html#validation-request-type) | ||
| Output: [`Statement`](../../type-definitions.html#statement-type) via the provided `Sender<Statement>`. | ||
|
|
||
| ## Functionality | ||
|
|
||
| Given a candidate, its validation code, and its PoV, determine whether the candidate is valid. There are a few different situations this code will be called in, and this will lead to variance in where the parameters originate. Determining the parameters is beyond the scope of this subsystem. | ||
| Given the hashes of a relay parent and a parachain candidate block, and either its PoV or the information with which to retrieve the PoV from the network, spawn a short-lived async job to determine whether the candidate is valid. | ||
|
|
||
| Each job follows this process: | ||
|
|
||
| - Get the full candidate from the current relay chain state | ||
| - Check the candidate's proof | ||
| > TODO: that's extremely hand-wavey. What does that actually entail? | ||
| - Generate either `Statement::Valid` or `Statement::Invalid`. Note that this never generates `Statement::Seconded`; Candidate Backing is the only subsystem which upgrades valid to seconded. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer to return |
||
| - Return the statement on the provided channel. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old line said:
I find this vastly superior to a system where the validation subsystem is responsible for fetching the PoV. The caller will know best where to get the PoV.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know what "determining the parameters" meant, in the old line.
If the caller is responsible for fetching the PoV, then what is this subsystem supposed to do when it receives a
CandidateValidationMessage::ValidatewithPoVOrigin::Network? If it's the caller's responsibility, then we don't needPoVOriginat all; we can just make the PoV one ofValidate's fields.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is what I'd advocate for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I can make that change.