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

Comments

Runtime API for checking validation outputs#1842

Merged
rphmeier merged 8 commits intomasterfrom
ser-validate-outputs-runtime-api
Oct 24, 2020
Merged

Runtime API for checking validation outputs#1842
rphmeier merged 8 commits intomasterfrom
ser-validate-outputs-runtime-api

Conversation

@pepyakin
Copy link
Contributor

@pepyakin pepyakin commented Oct 23, 2020

Closes #1594

This PR features structured commits. Please see each commit individually.

The difference between this PR and is that I had to promote the struct ValidationOutputs to top-level primitives.

This is because CandidateCommitments host not only the validation outputs, but also erasure_root. Getting erasure root happens in the backing subsystem, (i.e. later) and I don't think it's a good idea to move it earlier. Moreover, the runtime API in question should check the acceptance criteria and erasure_root is not required for that. ValidationOutputs is the best thing we have so far that. Unfortunately, it lives in node primitives. So I just promoted it to top-level primitives.
As a potential refactoring we could express CandidateCommitments in terms of ValidationOutputs.

I used fully-qualified names instead of imports deliberately to minimize conflicts. Before merging I prefer to switch over to imports.

Split off from #1679

Add `CheckValidationOutputs` runtime api and also change the
candidate-validation stuff
i.e. move it from node specific primitives to global v1 primitives. This
will be needed when we share it later in the runtime inclusion module
factor out the common code to share it during the block inclusion and
for the forthcoming CheckValidationOutputs runtime api.

Also note that the acceptance criteria was updated to incorporate checks
that exist now in candidate-validation
apart from that refactor, update docs and tidy a bit
@github-actions github-actions bot added the A0-please_review Pull request needs code review. label Oct 23, 2020
@pepyakin pepyakin changed the title ser validate outputs runtime api Runtime API for checking validation outputs Oct 23, 2020
@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. labels Oct 23, 2020
@drahnr drahnr self-requested a review October 23, 2020 15:56
This is to fix a test that performs an upgrade.
AssumptionCheckOutcome::DoesNotMatch => {},
AssumptionCheckOutcome::BadRequest => return Ok(Err(ValidationFailed("Bad request".into()))),
OccupiedCoreAssumption::TimedOut,
// TODO: Why don't we check `Free`? The guide assumes there are only two possible assumptions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Included and TimedOut on a free core are both no-ops, so any candidate which assumes the core is free would already pass one of those. Adding the third check is a no-op.

Free is kind of an odd one out because there are very few situations where you actually want to check to see that a core is fully free. Off the top of my head, I can't think of any.

fn persisted_validation_data(para_id: Id, assumption: OccupiedCoreAssumption)
-> Option<PersistedValidationData<N>>;

// TODO: Adding a Runtime API should be backwards compatible... right?
Copy link
Contributor

@rphmeier rphmeier Oct 23, 2020

Choose a reason for hiding this comment

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

Yeah, it is fine. We don't need to worry about backcompat until we've deployed on Kusama, probably. This TODO needs resolving before merge

);
}

// TODO: messaging acceptance criteria rules will go here.
Copy link
Contributor

Choose a reason for hiding this comment

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

needs resolving

Copy link
Contributor

@rphmeier rphmeier left a comment

Choose a reason for hiding this comment

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

A couple stray TODOs but looks good!

@pepyakin
Copy link
Contributor Author

pepyakin commented Oct 23, 2020

Those aren't stray actually : ) I placed two of them to source the comments on review. So they fulfilled their purpose and now can go.

Then last one is actually a marker (so I will have less fun time rebasing / resolving conflicts) and is supposed to be resolved by within #1679. Now I realized that I can put a PR number there to be inline with our TODO guidelines. I can remove it as well, it's not critical

Another thing I realized is that I probably need to bump the runtime spec versions.

@rphmeier
Copy link
Contributor

Ok, I know I need to review #1679 :) happy to leave those TODOs be until then

@rphmeier rphmeier merged commit 4a17a2b into master Oct 24, 2020
@rphmeier rphmeier deleted the ser-validate-outputs-runtime-api branch October 24, 2020 06:48
@pepyakin pepyakin mentioned this pull request Oct 26, 2020
2 tasks
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. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce a Runtime API for checking results against TransientValidationData

3 participants