-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
102e65d
to
48aa056
Compare
msg.getUnsignedMessageData().getPreparedCertificate().get(); | ||
|
||
if (!messageValidator.addPreprepareMessage(certificate.getIbftPrePrepareMessage())) { | ||
LOG.info("Invalid Round Change message, embedded Preprepare message failed validation."); |
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.
Remove space in RoundChange like other messages
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.
for (final IbftSignedMessageData<IbftUnsignedPrepareMessageData> prepareMsg : | ||
certificate.getIbftPrepareMessages()) { | ||
if (!messageValidator.validatePrepareMessage(prepareMsg)) { | ||
LOG.info("Invalid RoundChange message, embedded prepare message failed validation."); |
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.
capitalise Prepare
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.
e0d9f38
to
e465d6f
Compare
6bb4358
to
21ff411
Compare
RoundChangeValidator has been added which is responsible for validating the content of a RoundChange message by using the underlying MessageValidator capabilities.
21ff411
to
0c160b3
Compare
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.
One major issue in the validation checks
} | ||
|
||
if (prepareCertRound.getRoundNumber() > currentRound.getRoundNumber()) { | ||
LOG.info("Invalid RoundChange message, PreprepareCertificate is not for a past round."); |
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 correct check is
pepareCertRound.getRoundNumber() < RounChnageMesage.getRoundChangeIdentifier().getRoundIdentifier()
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.
} | ||
|
||
@Test | ||
public void roundChangeWithPreprepareFromAFutureRoundFails() { |
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.
This test may need to be revisited after addressing my other comments
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.
Updated to state preprepare must be earlier than roundchange target.
4681f7d
to
a0dc32b
Compare
Validates round change messages through the use of the underlying MessageValidator class.