-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add unit test for multihash panic in multiformats/multihash #1409
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1409 +/- ##
==========================================
- Coverage 70.89% 69.35% -1.54%
==========================================
Files 47 56 +9
Lines 4356 4977 +621
==========================================
+ Hits 3088 3452 +364
- Misses 1268 1525 +257
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Cargo.lock
Outdated
@@ -859,7 +909,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" | |||
dependencies = [ | |||
"core2", | |||
"multihash 0.18.0", | |||
"multihash 0.18.1", |
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.
This is the crate version that fixes the panic.
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.
I suggest bumping the dependency in Cargo.toml
as well.
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.
if it is an indirect dependency we should be careful with updating the lock file
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.
This will technically work, but it might be nice to submit a PR to https://github.com/multiformats/rust-cid/blob/master/Cargo.toml to bump the actual dependency there.
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.
Then we could bump our cid
dependency in Cargo.toml
.
Meanwhile, approving--but maybe file a chore to follow up once the cid
crate bumps the underlying dependency.
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.
if it is an indirect dependency we should be careful with updating the lock file
Yeah, the Cargo.lock
file reflects the changes from executing cargo update
, I did not edit the file directly.
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.
@saraswatpuneet , it's not a manual update of the lock file; I think Cargo updated the indirect dependency based on the rules, now that multihash has published a version with the fix. But my previous comments stand--we should encourage the cid
crate to update their dependency, and then update ours explicitly.
8c68ea2
to
dfea657
Compare
Goal
The goal of this PR is to add a unit test in the messages pallet to detect a panic on some types of bad cids.
multihash
v0.18.1 fixes an issue with callingunwrap()
on certain types of errors in ano-std
environment.multihash
is included by thecid
crate used for IPFS messages.[
Cargo.lock
was updated by another PR before this was merged, so v0.18.1 is already there]Closes #1233
Further updates in progress #1417
multiformats/rust-cid#135