-
Notifications
You must be signed in to change notification settings - Fork 923
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
fix(ipld/plugin): verify that data written to namespaceHasher has legit size #964
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make a quick unit test for this?
@renaynay, I can make a test that would just test the hasher itself, but FWIW it does not bring any value. To actually test this, we need somehow simulate that over bitswap we rcv a wrong size msg, which is a big PITA |
ff8d8c0
to
fd5a174
Compare
Tests were failing due to a typo. Fixed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you file an issue to add such a test so we don't forget at least?
fd5a174
to
df25f4a
Compare
An issue to test this out: #981 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
df25f4a
to
7f191a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last nit but is optional
7f191a4
to
79bdd33
Compare
My understanding of the bug right now is that the bitswap msg that was rcvd from the network had the wrong size of inner nodes hashes, and instead of erroring out, our IPLD plugin panics. It's not clear what could cause the wrong msg size under normal conditions, but it's clear that we have to fix it by checking if the sizes of msgs are correct.
Closes #952 and closes celestiaorg/celestia-core#780