-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
.verify_backed_candidate(parent_hash, candidate_idx, backed_candidate) | ||
.is_err() | ||
// | ||
// NOTE: this is the only place where we check the relay-parent. |
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.
This is true in my branch but not here
@rphmeier is there a particular reason we are discarding all other candidates too just rather than discarding the one with an invalid parachain? We could as well just |
We have 2 places with use of In inclusion, it has always been the case to not silently ignore invalid backed candidates, and this PR simply continues that behavior. The logic of From my reading of this PR, the usage in filtering is as a predicate in
The I hope this is helpful / sane. |
@@ -725,7 +726,7 @@ impl<T: Config> Pallet<T> { | |||
// That way we avoid possible duplicate checks while assuring all | |||
// backed candidates fine to pass on. | |||
check_ctx | |||
.verify_backed_candidate(parent_hash, candidate_idx, backed_candidate) | |||
.verify_backed_candidate(parent_hash, parent_storage_root, candidate_idx, backed_candidate) |
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 don't think this is correct, we'd want to filter out all of them, not only the outer error. Missing a para chain header is also a good enough reason to drop the candidate iiuc
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'm having a hard time connecting your comment to the code here. Can you explain in more detail?
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.
We are now only considering the outer error of the nested result, I'd argue that an error of the inner result type is also a good enough reason to discard the backed candidate iiuc. This can be deferred to a follow up PR, since as you correctly stated, behavior does not change compared to current master
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'd argue that an error of the inner result type is also a good enough reason to discard the backed candidate iiuc
Ok, fair. We should probably discard all backed candidates when encountering this error. It means something is seriously wrong and governance will probably need to step in. The on-chain logic is to ignore all the candidates anyway for the same reasons.
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 assume we can change that in the next release/new PR.
I agree that |
* master: Fix incomplete sorting. (#4795) Companion for better way to resolve `Phase::Emergency` via governance #10663 (#4757) Refactor and fix usage of `get_session_index()` and `get_session_info_by_index()` (#4735) `relay chain selection` and `dispute-coordinator` fixes and improvements (#4752) Fix tests (#4787) log concluded disputes (#4785) availability-distribution: look for leaf ancestors within the same session (#4596) Companion for Use proper bounded vector type for nominations #10601 (#4709) Fix release profile (#4778) [ci] remove publish-s3-release (#4779) Companion for substrate#10632 (#4689) [ci] pipeline chores (#4775) New changelog scripts (#4491)
…4801) * Move PersistedValidationData check into * Address feedback * Remove incorrect comment * Update runtime/parachains/src/inclusion/mod.rs * fmt * Add logging Co-authored-by: Robert Habermeier <[email protected]> Co-authored-by: Andronik <[email protected]>
* Update deps * Fix release profile (#4778) * Add codeden-units=1 ref #4311 * opt-level to 3 * Fix opt-level * Refactor apt-level into the release profile fix #4780 * wrong if-case - backport of #4798 into v0.9.16 (#4800) * fixup * fmt * fix tests * Rk fix sorting 0.9.16 (#4806) * Fix incomplete sorting. * fmt. * Better test. * Update runtime/parachains/src/disputes.rs Co-authored-by: Bastian Köcher <[email protected]> * cargo fmt Co-authored-by: Bastian Köcher <[email protected]> * Refactor check validation outputs - Backport of #4727 into v0.9.16 (#4801) * Move PersistedValidationData check into * Address feedback * Remove incorrect comment * Update runtime/parachains/src/inclusion/mod.rs * fmt * Add logging Co-authored-by: Robert Habermeier <[email protected]> Co-authored-by: Andronik <[email protected]> Co-authored-by: Bernhard Schuster <[email protected]> Co-authored-by: Robert Klotzner <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Lldenaurois <[email protected]> Co-authored-by: Robert Habermeier <[email protected]> Co-authored-by: Andronik <[email protected]>
A particular check that ensures the
backed_candidate
's persisted validation hash matches the expected hash (fetched via the util functionfn make_persisted_validation_data
) was not included thefn verify_backed_candidate
function and was present higher in the call-stack instead.However, this logic needs to be called in the
fn create_inherent_inner
function but was incorrectly ommitted from this inner function. In order to reconcile this discrepancy we must move the persisted validation hash verification into thefn verify_backed_candidate
function, which ensures this logic is called in bothfn process_candidates
andfn create_inherent_inner
as desired.