-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dot/parachain): implement validate candidate from exhaustive #4036
feat(dot/parachain): implement validate candidate from exhaustive #4036
Conversation
1b3436e
to
911740f
Compare
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.
the function returns the wrong struct.
We don't need to Encode or decode I have already commented above on how to use this struct.
Let's schedule a meeting and work on this together if you are confused. |
I've removed the usage VDT for this type (and renamed it back to ValidationResult) |
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.
epic! 🎉
It seems you have missed implementing this. |
Good point, I've implemented this now. |
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.
How do you plan to handle these errors?
You have returned all the errors, but Rust doesn't consider them all errors. Two are considered errors, and others are reasons for invalidity.
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.
Great work Ed!
The |
If we are not checking that the error is an actual error or reason for invalidity, it's not the correct implementation. Context: @kishansagathiya How should we handle errors here? |
@edwardmack So, currently (I am including this PR), eventhough we have Reason for Invalidity (
I would think that ValidateBlock (
Let's make sure that ValidateBlock is implemented as expected. Let's have a decent number of tests for it. And differentiate between ReasonForInvalidity and errors occurred in executing ValidateBlock or any other internal error. Have created an issue to track this task |
Changes
This PR introduces code for candidate validation subsystem to validate candidates when all data validation data is provided. As described in Implementation Plan this PR implements:
performBasicChecks
to confirm parameters are present and checks collator signature.Create tests to check for candidate validation exceptions based on possible errors generated by validate block function and reviewing code from polkadot test code
Tests
go test github.com/ChainSafe/gossamer/dot/parachain/candidate-validation -v
Issues
closes: #3547 and #3995