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

chore(deps): upgrade fvm and cid #5015

Merged
merged 17 commits into from
Nov 28, 2024
Merged

chore(deps): upgrade fvm and cid #5015

merged 17 commits into from
Nov 28, 2024

Conversation

hanabi1224
Copy link
Contributor

@hanabi1224 hanabi1224 commented Nov 28, 2024

Summary of changes

(Based on #5013)

Changes introduced in this pull request:

  • upgrade fvm and cid

Reference issue to close (if applicable)

Closes #5014

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

@hanabi1224 hanabi1224 changed the title Hm/upgrade fvm chore(deps): upgrade fvm and cid Nov 28, 2024
@@ -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))
Copy link
Contributor Author

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.

@hanabi1224 hanabi1224 marked this pull request as ready for review November 28, 2024 10:10
@hanabi1224 hanabi1224 requested a review from a team as a code owner November 28, 2024 10:10
@hanabi1224 hanabi1224 requested review from lemmih and elmattic and removed request for a team November 28, 2024 10:10

#[derive(Clone, Copy, Debug, Eq, MultihashDigest, PartialEq)]
#[mh(alloc_size = 64)]
pub enum MultihashCodeLegacy {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

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

Copy link
Contributor Author

@hanabi1224 hanabi1224 Nov 28, 2024

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(())
    }

Copy link
Contributor

@ruseinov ruseinov left a 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
Copy link
Contributor Author

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'] }
Copy link
Contributor

@elmattic elmattic Nov 28, 2024

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please re-approve @elmattic

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, done.

Cargo.toml Outdated Show resolved Hide resolved
@hanabi1224 hanabi1224 added this pull request to the merge queue Nov 28, 2024
Merged via the queue into main with commit 3d6ea59 Nov 28, 2024
34 checks passed
@hanabi1224 hanabi1224 deleted the hm/upgrade-fvm branch November 28, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade fvm and cid
3 participants