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

Allow IBFT Round to be created using PreparedCert #429

Merged
merged 6 commits into from
Dec 17, 2018

Conversation

rain-on
Copy link
Contributor

@rain-on rain-on commented Dec 17, 2018

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).

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());
Copy link
Contributor

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()

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.

@@ -51,4 +55,28 @@ public static Block createSealedBlock(

return new Block(sealedHeader, block.getBody());
}

public static Optional<PreparedCertificate> findLatestPreparedCertificate(
Copy link
Contributor

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

Copy link
Contributor Author

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.

@rain-on rain-on merged commit 5425a92 into PegaSysEng:master Dec 17, 2018
@rain-on rain-on deleted the ibft_round_from_new branch January 16, 2019 21:36
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.

3 participants