Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

pvf-precheck: PVF pre-checker subsystem #4643

Merged
merged 1 commit into from
Jan 7, 2022

Conversation

pepyakin
Copy link
Contributor

@pepyakin pepyakin commented Dec 30, 2021

Closes #4610

This commit implements the last major piece of #3211: the subsystem that
tracks PVFs that require voting, issues pre-check requests to
candidate-validation and makes sure that the votes are submitted to the
chain.

TODO:

  • Run once more with polkadot-launch

I am skipping the cumulus check since this is not related.

skip check-dependent-cumulus

@pepyakin
Copy link
Contributor Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Dec 30, 2021
@pepyakin pepyakin added B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. labels Dec 30, 2021
@pepyakin pepyakin requested review from chevdor and a team as code owners December 30, 2021 18:17
@pepyakin pepyakin requested a review from drahnr January 3, 2022 15:22
Copy link
Contributor

@drahnr drahnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overseer integration looks good, I'll take another pass on the actual impl.

node/core/pvf-checker/src/interest_view.rs Show resolved Hide resolved
node/core/pvf-checker/src/lib.rs Outdated Show resolved Hide resolved
node/overseer/src/lib.rs Show resolved Hide resolved
node/overseer/src/dummy.rs Show resolved Hide resolved
node/overseer/src/dummy.rs Show resolved Hide resolved
const NUM_SUBSYSTEMS_MESSAGED: usize = NUM_SUBSYSTEMS - 3;
const NUM_SUBSYSTEMS: usize = 21;
// -4 for BitfieldSigning, GossipSupport, AvailabilityDistribution and PvfCheckerSubsystem.
const NUM_SUBSYSTEMS_MESSAGED: usize = NUM_SUBSYSTEMS - 4;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

scripts/gitlab/lingua.dic Outdated Show resolved Hide resolved
node/subsystem-types/src/messages.rs Outdated Show resolved Hide resolved
@pepyakin pepyakin force-pushed the pep-pvf-subsystem branch 3 times, most recently from fc7e458 to 645c825 Compare January 4, 2022 14:54
@pepyakin
Copy link
Contributor Author

pepyakin commented Jan 5, 2022

I've managed to verify that the thing works as a whole, but only if we change the weight for

#[pallet::weight(Weight::MAX)]
pub fn include_pvf_check_statement(
origin: OriginFor<T>,
stmt: PvfCheckStatement,
signature: ValidatorSignature,
) -> DispatchResult {

to something manageable.

@pepyakin pepyakin added B1-releasenotes and removed B0-silent Changes should not be mentioned in any release notes labels Jan 5, 2022
impl PvfData {
/// Initialize a new `PvfData` which is awaiting for the initial judgement.
fn pending(origin: Hash) -> Self {
// Preallocate the hashset with 5 items. This is the anticipated maximum leafs we can
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaves

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh i wonder why spell check did not go off )

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a dev comment and they are currently not checked by CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

node/core/pvf-checker/src/interest_view.rs Show resolved Hide resolved
} else {
// Pre-checking request dropped before replying. That can happen in case the
// overseer is shutting down. Our part of shutdown will be handled by the
// overseer conclude signal.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add some debug log, so if this happens for some other reason it will be easier to see what's going on.

// Abstain.
//
// Returning here will leave the PVF in the view dangling. Since it is there, no new
// pre-checking request will be sent.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some log message?

}

#[test]
fn activation_of_descedant_leaves_pvfs_in_view() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

@eskimor
Copy link
Member

eskimor commented Jan 7, 2022

Really nice! Especially the test suite - reads like a book!

This commit implements the last major piece of #3211: the subsystem that
tracks PVFs that require voting, issues pre-check requests to
candidate-validation and makes sure that the votes are submitted to the
chain.
@eskimor
Copy link
Member

eskimor commented Jan 7, 2022

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot paritytech-processbot bot merged commit 22e5c04 into master Jan 7, 2022
@paritytech-processbot paritytech-processbot bot deleted the pep-pvf-subsystem branch January 7, 2022 18:10
@eskimor eskimor added D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. and removed D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit. labels Jan 11, 2022
@jakoblell jakoblell added D1-audited 👍 PR contains changes to critical logic that has been properly reviewed and externally audited. and removed D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Jan 18, 2022
Wizdave97 pushed a commit to ComposableFi/polkadot that referenced this pull request Feb 3, 2022
This commit implements the last major piece of paritytech#3211: the subsystem that
tracks PVFs that require voting, issues pre-check requests to
candidate-validation and makes sure that the votes are submitted to the
chain.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D1-audited 👍 PR contains changes to critical logic that has been properly reviewed and externally audited.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pvf-precheck: the subsystem
5 participants