-
Notifications
You must be signed in to change notification settings - Fork 130
Separate round change reception from RoundChangeCertificate #754
Conversation
IBFT2.1 requires that message content be separated, thus concepts at the message level must not leak into the business logic - eg RoundChangeCertificate should not be created by the RoundChangeManager - rather an intermediate type is to be inserted.
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 still not a fan of passing Optional<>
as a method parameter
@@ -49,4 +52,33 @@ public Address getProposerOfBlock(final BlockHeader header) { | |||
final IbftExtraData ibftExtraData = IbftExtraData.decode(header.getExtraData()); | |||
return ibftExtraData.getValidators(); | |||
} | |||
|
|||
public int roundOfBlock(final BlockHeader 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.
Is this used, maybe it was added for later code?
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.
removed.
} | ||
|
||
public static Block replaceRoundInBlock( | ||
final Block block, final int round, final BlockHashFunction blockHashFunction) { |
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.
blockHashFunction isn't used
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.
.map(roundChange -> roundChange.getSignedPayload()) | ||
.collect(Collectors.toList()); | ||
|
||
final Optional<PreparedCertificate> latestdPreparedCertificate = |
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: typo in latestdPreparedCertificate
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.
IBFT2.1 requires that message content be separated, thus concepts
at the message level must not leak into the business logic - eg
RoundChangeCertificate should not be created by the
RoundChangeManager - rather an intermediate type is to be inserted.