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

Ibft to uniquely ID messages by their hash #730

Merged
merged 4 commits into from
Feb 1, 2019

Conversation

rain-on
Copy link
Contributor

@rain-on rain-on commented Jan 31, 2019

Ibft was re-gossiping previously sent messages due to using 'hashcode' which, for anonymous MessageData objects never matched.

This has been updated to use Hash instead.

@rain-on rain-on requested a review from jframe January 31, 2019 05:38
Copy link
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

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

Is there a test we can add to the unit test so we can be sure that the uniqueness check does not depend on the MessageData class? Perhaps just use an anonymous class of MessageData without any hashCode implementation.


@Test
public void anonymousMessageDataClassesContainingTheSameDataAreConsideredIdentical() {
final MessageData arbitraryMessage_1 =
Copy link
Contributor

Choose a reason for hiding this comment

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

a function that creates the arbitrary message using the anonymous class would make this test more readable

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.

@rain-on rain-on merged commit 3fe23bb into PegaSysEng:master Feb 1, 2019
@rain-on rain-on deleted the unique_hash branch February 1, 2019 01:43
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