-
Notifications
You must be signed in to change notification settings - Fork 130
Allow Attached rules to be flagged 'light' #580
Conversation
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.
Suggestion made but I could live with it either way.
rule -> { | ||
final boolean result = rule.validate(header, parent, protocolContext); | ||
return result; | ||
}); |
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 result
variable appears to be redundant here.
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.
done - returned to original
*/ | ||
package tech.pegasys.pantheon.ethereum.mainnet; | ||
|
||
public interface BlockHeaderValidationRule { |
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 think I'd bother introducing this extra interface. Just add includeInLightValidation
to AttachedBlockHeaderValidationRule
. It's somewhat confusing that a BlockHeaderValidationRule
doesn't actually give you any way to validate a block header.
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.
done.
At the moment, only a Detached rule can be deemed "light". Going forwards with IBFT, being able to create "light" validation rules will support validating a proposed block on reception, while then importing said block with a full feature set of the same rules.