This repository has been 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.6k
Track and accumulate ingress roots in runtime #287
Merged
Merged
Conversation
This file contains 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
rphmeier
added
A0-please_review
Pull request needs code review.
A3-in_progress
Pull request is in progress. No review needed at this stage.
and removed
A0-please_review
Pull request needs code review.
labels
Jun 10, 2019
rphmeier
added
A0-please_review
Pull request needs code review.
and removed
A3-in_progress
Pull request is in progress. No review needed at this stage.
labels
Jun 12, 2019
gavofyork
reviewed
Jun 15, 2019
gavofyork
reviewed
Jun 15, 2019
<Heads<T>>::insert(id, &head.candidate.head_data.0); | ||
|
||
let last_watermark = <Watermarks<T>>::mutate(id, |mark| { | ||
rstd::mem::replace(mark, Some(watermark)) |
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.
why is this not just *mark = Some(watermark)
?
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.
since we want to store the last value of it and assign to last_watermark
gavofyork
approved these changes
Jun 15, 2019
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.
Looks ok to me. More eyes would be better though.
lsaether
pushed a commit
to lsaether/k
that referenced
this pull request
Jul 4, 2019
* runtime: refactor Checkable and BlindCheckable traits * fix impl BlindCheckable for Extrinsic * fix impl Checkable for TestXt * fix impl Checkable for UncheckedExtrinsic * fix tabs * add ::Address to system::Trait since its no longer in Checkable trait * replace tab by space in comment * replace occurences of Checkable::check with ::check_with * tx-pool: replace CheckedIntrinsic type alias since it now would require type param * make more uses of Checkable compile * adapt Executive impl to new Checkable trait * fix that CheckedExtrinsic takes AccountId not Address as first type param * Checkable trait: return error again since it's required in some cases * Checkable: improve docstrings * consistent punctuation and capitalization in docstrings * Ctx -> Context addresses paritytech/polkadot#287 (comment) * reduce trait bounds for impl Checkable for TestXt addresses paritytech/polkadot#287 (comment) * use <UncheckedExtrinsic as Checkable>::Checked addresses paritytech/polkadot#287 (comment) * Revert "add ::Address to system::Trait since its no longer in Checkable trait" This reverts commit 02eb103015b833c995c9f9067aac2542bb7ce5ea. * runtime/executive: properly fix that Address no longer in Checkable * return `Result<Self::Checked, &'static str>` from `Checkable::check`
tomusdrw
pushed a commit
that referenced
this pull request
Mar 26, 2021
* Add header-chain primitive crate * Make MinimalHeaderChain functionaly the same as PeerBlockchain * Use a better doc comment for MinimalHeaderChain * Fix benchmark compilation * Rust Fmt * Remove Substrate based dependencies * Rename MinimalHeaderChain to BaseHeaderChain
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The previous routing implementation in the runtime only tracked the unrouted messages from a single block (i.e. assuming that messages were always routed within one block). This new implementation introduces the concept of a watermark, which is the last block a parachain has routed messages from. Beyond the watermark, message queue roots are accumulated and tracked. Additionally, after this PR messages from unregistered parachains will continue to be routed.
Technically, the only thing that the runtime needs to be responsible for is tracking watermarks so that we can impose rules on watermark raising (see #286). All the actual queue root tracking could be done in an off-chain worker (and should eventually be moved to one), but for the moment it's easier to do the tracking in the runtime.