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

Ibft2: Replace NewRound with extended Proposal #872

Merged
merged 25 commits into from
Feb 20, 2019

Conversation

rain-on
Copy link
Contributor

@rain-on rain-on commented Feb 15, 2019

The NewRound message has been removed, and the Proposal has been extended to include the RoundChangeCertificate (for non-0 rounds).

This has required updates to:

  • StateMachine, such that a new round can be started on reception of a valid Proposal (with included RoundChangeCertificate)
  • Message Validators - such that the new structure of a Proposal message can be validated in accordance with the RoundChangeCertificate

Unit and integration tests have been summarily updated.

Copy link
Contributor

@CjHare CjHare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

return false;
}
} else {
if (!roundChangeCertificate.isPresent()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be nice if this block was split out into function for validating the future proposal

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.

@@ -149,19 +148,17 @@ public void whenSufficientRoundChangeMessagesAreReceivedForNewRoundLocalNodeCrea
final RoundChange rc3 = peers.getNonProposing(2).injectRoundChange(targetRound, empty());
final RoundChange rc4 = peers.getProposer().injectRoundChange(targetRound, empty());

final NewRound expectedNewRound =
localNodeMessageFactory.createNewRound(
final Proposal expectedNewRound =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this should be renamed to expectedProposal

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 (plus lots of others).

@@ -55,7 +73,15 @@ public static Proposal decode(final BytesValue data) {
final SignedData<ProposalPayload> payload = SignedData.readSignedProposalPayloadFrom(rlpIn);
final Block proposedBlock =
Block.readFrom(rlpIn, IbftBlockHashing::calculateDataHashForCommittedSeal);

RoundChangeCertificate roundChangeCertificate = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit nasty, be nicer if reading the round change certificate was split out into a seperate function then you could quite easily return Optional without the need for the variable initialiser.

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.

ajsutton and others added 20 commits February 19, 2019 10:11
* PAN-2270: Rename password hash command

* Fixing test

* PR review
…ing (PegaSysEng#876)

* Reduce logging for invalid peer discovery packets. The message is enough to locate the source of the rejection.

* Reduce ECIESHandshaker logging to trace since it documents a normal flow through the handshake process.
* o

* add test

* clean up

* scaffolding

* update

* update

* comments

* add test

* update

* update ii

* format

* update ii

* fix

* verifyBroadcastBlockInvocation

* test

* update

* update to difficulty calculation

* remove BlockBroadcasterTest from this pr

* update

* update

* update II
Copy link
Contributor

@saltiniroberto saltiniroberto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good from a protocol correctness perspective.

@rain-on rain-on merged commit f73b4e8 into PegaSysEng:master Feb 20, 2019
@rain-on rain-on deleted the proposal_rcc branch February 20, 2019 05:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet