Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Share code between Verifier and executor wrapper #14

Open
JoshOrndorff opened this issue Nov 3, 2021 · 0 comments
Open

Share code between Verifier and executor wrapper #14

JoshOrndorff opened this issue Nov 3, 2021 · 0 comments

Comments

@JoshOrndorff
Copy link
Contributor

The verifier is used to check block signatures when importing blocks in a normal node. It lives in nimbus-consensus/src/lib/import_queue.rs

The executor wrapper is used to check block signatures when validating a parachain block as a validator entirely in wasm. It lives in pallets/author-inherent/src/exec.rs.

While the context is different, the job of these two pieces of code is nearly identical. Therefore we should share code between them to the extent reasonable.

JoshOrndorff added a commit that referenced this issue Nov 3, 2021
See #14 about de-duplicating this code
JoshOrndorff added a commit that referenced this issue Dec 8, 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]>
tgmichel pushed a commit that referenced this issue 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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant