Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ShortHash with MD5 in order to avoid hash collisions in Mempool tests #1779

Closed
nfrisby opened this issue Mar 10, 2020 · 0 comments · Fixed by #1780
Closed

Replace ShortHash with MD5 in order to avoid hash collisions in Mempool tests #1779

nfrisby opened this issue Mar 10, 2020 · 0 comments · Fixed by #1780
Assignees
Labels
consensus issues related to ouroboros-consensus testing
Milestone

Comments

@nfrisby
Copy link
Contributor

nfrisby commented Mar 10, 2020

We have observed a ShortHash collision in the ouroboros-consensus:test:test-consensus:Test.Consensus.Mempool module. It uses ShortHash. That implementation appears to have the same compute time as MD5, but a quarter of the bits (it just takes a prefix of the MD5).

Instead of writing the tests to anticipate the occasional collision and thereby save the debugging time whenever it happens, we're just going to switch to MD5, under the assumption that it won't collide in these tests during the project's lifetime.

Thomas summarized the change as follows.

sed -i s/ShortHash/MD5/g ouroboros-consensus/ouroboros-consensus-mock/src/Ouroboros/Consensus/Mock/Ledger/UTxO.hs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consensus issues related to ouroboros-consensus testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants