Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Conversation

@acud
Copy link
Contributor

@acud acud commented Nov 1, 2019

This PR fixes a bug in stream package where a slice representing the wanted hashes on a 0 wanted hashes message was appended to, instead of setting the slice elements which were preallocated. This resulted in the first len(msg.Hashes) to be zero address hashes, and the second len(msg.Hashes) to be the actual hashes.
In turn, in localstore.Set this caused an error (since the zero address chunk returned an error because it does not exist) and the rest of the hashes were not set, since the error handling in Set bails directly on the first error, instead of continuing to set the rest of the chunk addresses in the variadic function parameters.

We should probably consider our error handling on if we bail immediately on error on these kind of operations. Maybe a potential partial set in this case would have prevented the problem (while masking the bug).

@acud acud added the bug label Nov 1, 2019
@acud acud added this to the 0.5.3 milestone Nov 1, 2019
@acud acud requested review from janos and zelig November 1, 2019 17:06
@acud acud self-assigned this Nov 1, 2019
@acud acud force-pushed the fix-stream-quirk branch from bee895e to 015cd58 Compare November 1, 2019 17:08
@acud acud added the stream label Nov 1, 2019
Copy link
Member

@janos janos left a comment

Choose a reason for hiding this comment

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

This is an amazing find and a huge bug. Thank you @acud.

@zelig zelig merged commit e89acee into master Nov 4, 2019
@acud acud deleted the fix-stream-quirk branch November 4, 2019 07:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants