-
Notifications
You must be signed in to change notification settings - Fork 337
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
Allow full node to verify author inherent #192
Allow full node to verify author inherent #192
Conversation
println!("{:?}", call); | ||
} | ||
// This if let should always be true. This is the only call that the inehrent could make. | ||
if let Self::Call::set_author(claimed_author) = call { |
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.
I don't understand why it is needed to set the author in the check.
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.
I'm pattern matching call
, the parameter that was passed into the function, against the variants of the Self::Call
enum. set_author
is not actually a function and I'm not calling it. It is a variant of the Self::Call
enum. This is hard to read because typically enum variants are written in ThisCaseStandard
. But the Call
enum is an exception because of how the FRAME macros work.
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.
That might be worthy of a comment, although that's probably true of a lot of other cases...
Co-authored-by: Amar Singh <[email protected]>
What does it do?
Changes the inherent checking logic for the author inherent. It was previously "checking" the inherent as if the verifying node had made the inherent. It now checks the actual inherent that the actual author included.
What important points reviewers should know?
Docs for the
ProvideInherent
trait: https://crates.parity.io/sp_inherents/trait.ProvideInherent.html These docs are not great, and I've made an attempt to improve them in paritytech/substrate#7941What alternative implementations were considered?
We considered not checking the inherent at all, but this would remove most of the usefulness of the stake pallet.
What value does it bring to the blockchain users?
It is possible to run full nodes.
Checklist