-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
Ibft is required to validate a block upon reception, but not import it until a later time. As such, IBFT will require validation and importing to be separated. The validator has been exposed as part of the ProtocolSpecification.
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.
LGTM, just a few quite minor nits.
|
||
public interface BlockValidator<C> { | ||
|
||
class BlockValidationOutputs { |
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.
As mentioned on #565 before it got chopped up, this is maybe more BlockProcessingOutputs
?
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.
if (!result.isSuccessful()) { | ||
return false; | ||
} | ||
outputs.ifPresent(o -> persistState(o, block, context)); |
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.
It would be great to avoid using single letter variable names. Always takes me ages to work out what the heck o
actually is.
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.
BlockHeaderValidator<T> blockHeaderValidator, | ||
BlockBodyValidator<T> blockBodyValidator, | ||
BlockProcessor blockProcessor); | ||
} | ||
|
||
public interface BlockImporterBuilder<T> { | ||
BlockImporter<T> apply(BlockValidator<T> blockValidator); |
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.
nit: How come all the existing interfaces got an extra blank line added and the new one didn't? (I like the no blank line version not that it really matters)
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.
(no idea) Attempted to maintain consistency with existing code (i.e no new lines).
Ibft is required to validate a block upon reception, but not import it until a later time. As such, IBFT will require validation and importing to be separated. The validator has been exposed as part of the ProtocolSpecification.
Ibft is required to validate a block upon reception, but not import
it until a later time.
As such, IBFT will require validation and importing to be separated.
The validator has been exposed as part of the ProtocolSpecification.