This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Support pre-runtime digest and instant seal #15
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
Should probably still add tests to pallet author inherent. |
JoshOrndorff
changed the title
Optional pre-runtime digest support and instant seal
Support pre-runtime digest and instant seal
Nov 19, 2021
JoshOrndorff
commented
Nov 19, 2021
girazoki
approved these changes
Nov 30, 2021
librelois
suggested changes
Dec 2, 2021
Hell Yeah CI!
librelois
suggested changes
Dec 7, 2021
Co-authored-by: girazoki <[email protected]> Co-authored-by: Éloïs <[email protected]>
librelois
approved these changes
Dec 7, 2021
tgmichel
pushed a commit
that referenced
this pull request
Dec 16, 2021
* checkpoint. Gonna try switching to preruntime digest first * pallet allows preruntime digests and validates at end of block * remove incorrect comment * factor slot prediction into helper function, start sketching manual seal consensus data provider * better message for future self * preruntime digest interface * `create_digest` compiles * service compiles * whoe service checks * allow running from cli * actually install our new manual seal consensus data provider * Handle no-key scenario * Preruntime digest an no memoizing author account * remove wrong comment. Better to follow aura * prune commented inherent-related code * Hack in fake signature in manual seal. * unused import * verifier supports both digest types * duplicate code from verifier to executor wrapper See #14 about de-duplicating this code * author inherent no longer required * sign blocks in manual seal !! * Hack import queue so it works in instant seal although it is now broken in parachain mode. * prune some debugging logs * NimbusBlockImport with optional parachain rules * we can use std on the client-side * remove unnecessary generic * indentation and comment * use constant instead of hard-coded nmbs * code style: map instead of if let * assume relay chain slot beacon in manual seal for now * Actually checkvalidity and send notification when using preruntime digest * Typos from code review Co-authored-by: Amar Singh <[email protected]> Co-authored-by: girazoki <[email protected]> * Proper index Co-authored-by: Amar Singh <[email protected]> * Switch consensus worker from inherent to preruntime digest. Was it really that easy!? * map from author id to account id in FindAuthor * more toward parachain consensus worker * Update nimbus-consensus/src/import_queue.rs * inherent is a no-op * Revert "more toward parachain consensus worker" This reverts commit 807e72b. * validators don't need backward compatability * Fix incorrect merge conflict resolution. Still detect NimbusApi * Add copyright to manual seal file. Hell Yeah CI! * Typo found by @girazoki * stray space * Single author in dev spec so that `run-instant-seal --dev` works with one node * warnings * Apply suggestions from code review Co-authored-by: girazoki <[email protected]> Co-authored-by: Éloïs <[email protected]> * better weight in `on_initialize` * thoughts about the legacy author inherent * sketch kick-off inherent in pallet * fees * Update the inherent extrinsics Co-authored-by: Amar Singh <[email protected]> Co-authored-by: girazoki <[email protected]> Co-authored-by: Éloïs <[email protected]> (cherry picked from commit d610b68) # Conflicts: # Cargo.lock # nimbus-consensus/Cargo.toml # nimbus-consensus/src/lib.rs # pallets/author-inherent/src/lib.rs # parachain-template/node/Cargo.toml
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.
This PR updates the runtime, authoring, and block-import components of nimbus to support authorship information coming from from a pre-runtime digest, as opposed to the author inherent as it had previously. Authoring, and block import continue to support the old author inherent to facilitate a smooth migration of live networks. These are the first steps in switching entirely to the preruntime digest which means this PR solves #2 and works toward #23.
This PR adds the
NimbusBlockImport
, which, at the moment, is nearly a copy paste of cumulus'sParachainBlockImport
except that the parachain import rules can be optionally disabled. This also provides an obvious place to include actual nimbus-specific import logic should it ever become necessary.Instant seal
This PR also adds an instant seal feature to the example node which has all the normal advantages of instant seal (easy to quickly experiment). The instant seal worker also uses the pre-runtime digests. In order to add the manual seal worker, some of the slot prediction and header sealing logic had to be factored out of the parachain consensus worker into re-usable helper functions. This also paves the way for #3 .
To try the instant seal feature:
Migration
This PR makes breaking changes to the runtime's assumptions about authorship. To ensure a smooth upgrade of live chains, it is recommended that you proceed as follows:
Note that the block import logic will always retain support for blocks authored with the author inherent to ensure that new nodes can sync old chains from genesis.