Skip to content

Commit

Permalink
[CodeHealth] Drop proc-macro-error from filecoin-cxx (#26427)
Browse files Browse the repository at this point in the history
* [CodeHealth] Drop `proc-macro-error` from `filecoin-cxx`

This PR updates all crates around `multihash` to use the latest
`multihash` version that does not depend anymore on `proc-macro-error`.
This crate is being removed as it is getting flagged in security audits
for being unmaintained, and it also relies on unstable rustc features.

* [rust] `gnrt` crate changes for `multihash` v.0.19

This commit includes all the mechanical changes done by `gnrt`.
  • Loading branch information
cdesouza-chromium authored and emerick committed Dec 2, 2024
1 parent 0a7648c commit 02dfffa
Show file tree
Hide file tree
Showing 1,321 changed files with 122,687 additions and 29,468 deletions.
8 changes: 4 additions & 4 deletions components/filecoin/rs/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ rust_static_library("rust_lib") {
deps = [
"//brave/third_party/rust/blake2b_simd/v1:lib",
"//brave/third_party/rust/bls_signatures/v0_12:lib",
"//brave/third_party/rust/cid/v0_10:lib",
"//brave/third_party/rust/cid/v0_11:lib",
"//brave/third_party/rust/forest_bigint/v0_1:lib",
"//brave/third_party/rust/fvm_ipld_encoding/v0_4:lib",
"//brave/third_party/rust/fvm_shared/v3:lib",
"//brave/third_party/rust/fvm_ipld_encoding/v0_5:lib",
"//brave/third_party/rust/fvm_shared/v4:lib",
"//brave/third_party/rust/libsecp256k1/v0_7:lib",
"//brave/third_party/rust/multihash/v0_18:lib",
"//brave/third_party/rust/multihash_codetable/v0_1:lib",
"//brave/third_party/rust/thiserror/v1:lib",
"//third_party/rust/base64/v0_13:lib",
"//third_party/rust/serde/v1:lib",
Expand Down
8 changes: 4 additions & 4 deletions components/filecoin/rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ license = "MPL-2.0"
base64 = "0.13.0"
bls-signatures = { version = "0.12", default-features = false, features = ["pairing"] }
cxx = "1"
fvm_shared = { version = "3.10.0" }
fvm_shared = { version = "4.5.1" }
libsecp256k1 = "0.7"
num_bigint_chainsafe = { package = "forest_bigint", version = "0.1.2"}
serde = { version = "^1.0.117", features = ["derive"] }
serde_json = "^1.0.59"
thiserror = "^1.0.30"
blake2b_simd = "1"
cid = { version = "0.10", default-features = false }
multihash = { version = "0.18.0", default-features = false, features = [ "multihash-impl", "blake2b"] }
fvm_ipld_encoding = "0.4"
cid = { version = "^0.11.1", default-features = false }
multihash-codetable = { version = "0.1.4", default-features = false }
fvm_ipld_encoding = "0.5.1"

[lib]
name = "filecoin_cxx"
Expand Down
6 changes: 3 additions & 3 deletions components/filecoin/rs/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ use crate::message::MessageAPI;
use blake2b_simd::Params;
use bls_signatures::Serialize;
use core::{array::TryFromSliceError, num::ParseIntError};
use fvm_ipld_encoding::to_vec;
use fvm_ipld_encoding::DAG_CBOR;
use fvm_shared::address::set_current_network;
use fvm_ipld_encoding::to_vec;
use fvm_shared::address::Network;
use fvm_shared::address::set_current_network;
use fvm_shared::crypto::signature::Signature;
use fvm_shared::message::Message as UnsignedMessage;
use libsecp256k1::util::{SECRET_KEY_SIZE, SIGNATURE_SIZE};
use multihash::{Code, MultihashDigest};
use multihash_codetable::{Code, MultihashDigest};
use thiserror::Error;

pub struct PrivateKey(pub [u8; SECRET_KEY_SIZE]);
Expand Down
7 changes: 4 additions & 3 deletions patches/tools-crates-gnrt-lib-readme.rs.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/tools/crates/gnrt/lib/readme.rs b/tools/crates/gnrt/lib/readme.rs
index 1c7e5fc10fb9b0a8ebc6b3b65431e9a65ece20e9..29928d1201d545ccbe6ba2201095dc0c05c3a79e 100644
index 1c7e5fc10fb9b0a8ebc6b3b65431e9a65ece20e9..c330f3a3589ead0ccd81f5efeb4f5ce8b219c605 100644
--- a/tools/crates/gnrt/lib/readme.rs
+++ b/tools/crates/gnrt/lib/readme.rs
@@ -150,7 +150,7 @@ pub fn readme_file_from_package<'a>(
Expand All @@ -16,18 +16,19 @@ index 1c7e5fc10fb9b0a8ebc6b3b65431e9a65ece20e9..29928d1201d545ccbe6ba2201095dc0c
// Allowed licenses, in the format they are specified in Cargo.toml files from
// crates.io, and the format to write to README.chromium.
-static ALLOWED_LICENSES: [(&str, &str); 21] = [
+static ALLOWED_LICENSES: [(&str, &str); 25] = [
+static ALLOWED_LICENSES: [(&str, &str); 26] = [
// ("Cargo.toml string", "License for README.chromium")
("Apache-2.0", "Apache 2.0"),
("MIT OR Apache-2.0", "Apache 2.0"),
@@ -235,6 +235,10 @@ static ALLOWED_LICENSES: [(&str, &str); 21] = [
@@ -235,6 +235,11 @@ static ALLOWED_LICENSES: [(&str, &str); 21] = [
),
("Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", "Apache 2.0"),
("BSD-2-Clause OR Apache-2.0 OR MIT", "Apache 2.0"),
+ ("CC0-1.0 OR MIT-0 OR Apache-2.0", "Apache 2.0"),
+ ("MIT OR Apache-2.0 OR BSD-1-Clause", "Apache 2.0"),
+ ("BSD-2-Clause", "BSD 2-Clause"),
+ ("MPL-2.0", "Mozilla Public License 2.0"),
+ ("CC0-1.0 OR Apache-2.0", "Apache 2.0"),
];

static EXPECTED_LICENSE_FILE: [(&str, &str); 21] = [
Loading

0 comments on commit 02dfffa

Please sign in to comment.