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

Ibft RoundState #392

Merged
merged 2 commits into from
Dec 11, 2018
Merged

Ibft RoundState #392

merged 2 commits into from
Dec 11, 2018

Conversation

rain-on
Copy link
Contributor

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

The IBFT RoundState is responsible for determining if sufficient
valid messages have been received to deem the node "Prepared" or
"Committed".

}

public void addCommitSeal(final SignedData<CommitPayload> commitPayload) {
if (!proposalMessage.isPresent()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

simplify to (!proposalMessage.isPresent() || validator.validateCommmitMessage(commitPayload))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Less lines of code - but potentially harder read - where do other reviewers fall?

}

@Test
public void singleVlidatorIsPreparedWithJustProposal() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Vlidator

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.

}

public void addPreparedPeer(final SignedData<PreparePayload> prepareMsg) {
if (!proposalMessage.isPresent()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to below comment. This is simpler as (!proposalMessage.isPresent()) || (validator.validatePrepareMessage(prepareMsg))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The suggested change relies on the || operator precedence, in that the validator will fail the commit message if the proposal is not available.
Would prefer to be explicit rather than implicit.

Appreciate the actual functionality is identical.

tmohay added 2 commits December 11, 2018 12:12
The IBFT RoundState is responsible for determining if sufficient
valid messages have been received to deem the node "Prepared" or
"Committed".
@rain-on rain-on merged commit 853799d into PegaSysEng:master Dec 11, 2018
@rain-on rain-on deleted the round_state 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