-
Notifications
You must be signed in to change notification settings - Fork 160
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
chore(deps): upgrade fvm
and cid
#5015
Conversation
5cd818b
to
c226275
Compare
c226275
to
4b63e63
Compare
@@ -42,7 +41,8 @@ pub async fn download_ipfs_file_trustlessly( | |||
{ | |||
let mut reader = reader(url.as_str()).await?.compat(); | |||
let mut writer = futures::io::BufWriter::new(async_fs::File::create(&tmp).await?); | |||
rs_car_ipfs::single_file::read_single_file_seek(&mut reader, &mut writer, Some(cid)) | |||
let cid_v10 = crate::utils::cid::cid_11_to_10(cid); | |||
rs_car_ipfs::single_file::read_single_file_seek(&mut reader, &mut writer, Some(&cid_v10)) |
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.
cid_0_10
is needed until dapplion/rs-car#13 is merged and released.
04adf55
to
b22289e
Compare
src/utils/multihash.rs
Outdated
|
||
#[derive(Clone, Copy, Debug, Eq, MultihashDigest, PartialEq)] | ||
#[mh(alloc_size = 64)] | ||
pub enum MultihashCodeLegacy { |
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.
Wow, that's quite a change on their part.
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.
Yeah, Identity hasher has been deprecated
https://github.com/multiformats/rust-multihash/blob/master/CHANGELOG.md#-breaking-changes
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.
Do we then need all of this code, or should we instead introduce a helper method to wrap this: https://github.com/multiformats/rust-multihash/blob/master/examples/identity.rs
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.
We do need the code. e.g. in CarBlock::validate
, the code could be 0(identity) or others
pub fn validate(&self) -> anyhow::Result<()> {
let actual = {
let code = MultihashCode::try_from(self.cid.hash().code())?;
Cid::new_v1(self.cid.codec(), code.digest(&self.data))
};
anyhow::ensure!(
actual == self.cid,
"CID/Block mismatch for block {}, actual: {actual}",
self.cid
);
Ok(())
}
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.
looks good
@@ -73,7 +73,6 @@ ignore = [ | |||
# Unmaintained crates that fvm2 requires, and will not change for | |||
# compatability/consensus reasons - see | |||
# https://github.com/filecoin-project/ref-fvm/issues/1843 | |||
"RUSTSEC-2020-0168", # mach is unmaintained | |||
"RUSTSEC-2022-0061", # parity-wasm is deprecated | |||
"RUSTSEC-2024-0370", # proc-macro-error is unmaintained |
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.
RUSTSEC-2024-0370
will be fixed once we deprecate [email protected]
Cargo.toml
Outdated
@@ -94,7 +95,7 @@ humantime = "2" | |||
indexmap = { version = "2", features = ["serde"] } | |||
indicatif = { version = "0.17", features = ["tokio"] } | |||
integer-encoding = "4.0" | |||
ipld-core = { version = "0.4", features = ["serde", "arb"] } | |||
ipld-core = { version = "0.4", features = ['arb', 'serde'] } |
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.
any reasons to use single quotes here?
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.
Reverted.
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.
Please re-approve @elmattic
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.
Sorry, done.
Summary of changes
(Based on #5013)
Changes introduced in this pull request:
fvm
andcid
Reference issue to close (if applicable)
Closes #5014
Other information and links
Change checklist