-
Notifications
You must be signed in to change notification settings - Fork 130
Allow IBFT Round to be created using PreparedCert #429
Conversation
When the local node is to be the proposer for a new round (due to round change), the new Ibft Round is to be created using the latest received PreparedCertificate, and a NewRound message multicast to all validators. It should be noted, the block in the NewRound Proposal must be modified from that received in the PreparedCertificate such that it contains the executing round number.
final RoundChangePayload payload = roundChangeMsg.getPayload(); | ||
if (payload.getPreparedCertificate().isPresent()) { | ||
if (!result.isPresent()) { | ||
result = Optional.of(payload.getPreparedCertificate().get()); |
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 could be just result = payload.getPreparedCertificate()
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.
@@ -51,4 +55,28 @@ public static Block createSealedBlock( | |||
|
|||
return new Block(sealedHeader, block.getBody()); | |||
} | |||
|
|||
public static Optional<PreparedCertificate> findLatestPreparedCertificate( |
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.
doesn't look there is a test for this
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.
Was previously fully tested as part of NewRoundMessageValidator (but was then moved out here) - have created additional tests based of the previously existing tests.
When the local node is to be the proposer for a new round
(due to round change), the new Ibft Round is to be created using the
latest received PreparedCertificate, and a NewRound message multicast
to all validators.
It should be noted, the block in the NewRound Proposal must be
modified from that received in the PreparedCertificate such that it
contains the executing round number (all other fields remain unchanged).