Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Allow Attached rules to be flagged 'light' #580

Merged
merged 3 commits into from
Jan 16, 2019
Merged

Conversation

rain-on
Copy link
Contributor

@rain-on rain-on commented Jan 16, 2019

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.

@rain-on rain-on requested review from ajsutton and CjHare January 16, 2019 03:06
Copy link
Contributor

@ajsutton ajsutton left a 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;
});
Copy link
Contributor

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.

Copy link
Contributor Author

@rain-on rain-on Jan 16, 2019

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 {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@rain-on rain-on merged commit d1f5383 into PegaSysEng:master Jan 16, 2019
@rain-on rain-on deleted the light branch January 16, 2019 21:34
iikirilov pushed a commit to vinistevam/pantheon that referenced this pull request Jan 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants