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

New round validation #353

Merged
merged 4 commits into from
Dec 8, 2018
Merged

Conversation

rain-on
Copy link
Contributor

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

This adds a class which is able to determine if a received IBFT New Round message is valid.

new RoundChangeCertificate(Collections.emptyList()),
proposerMessageFactory.createSignedProposalPayload(roundIdentifier, proposedBlock));

assertThat(validator.validateNewRoundMessage(msg)).isFalse();
Copy link
Contributor

@saltiniroberto saltiniroberto Dec 5, 2018

Choose a reason for hiding this comment

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

This test would succeed even if the message is signed by the proposer.
This is because no RoundChange message is included in the NewRound message.
The same applies to other tests below.

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.

return false;
}

for (final SignedData<RoundChangePayload> roundChangeMsg :
Copy link
Contributor

Choose a reason for hiding this comment

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

Using stream().allMatch could simplify this


public class TestHelpers {

public static ConsensusRoundIdentifier createFrom(
Copy link
Contributor

Choose a reason for hiding this comment

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

From the class name or method it isn't clear what it's doing, perhaps rename method to createRoundIdentifier?

@rain-on rain-on merged commit 51ffe8a into PegaSysEng:master Dec 8, 2018
@rain-on rain-on deleted the new_round_validation 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.

4 participants