From 142f98f682a895dd8d11036ea201f539b1aafd35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Tr=C4=85d?= Date: Tue, 15 Oct 2024 14:37:15 +0200 Subject: [PATCH] Bump sqlx (#791) --- Cargo.lock | 87 ++++++++++++++++++++++++--------------- Cargo.toml | 6 ++- src/database/types.rs | 17 +++++--- supply-chain/config.toml | 42 +++++++++---------- supply-chain/imports.lock | 59 ++++++++++++++++++++------ 5 files changed, 135 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 67011c53..30f1ed72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1610,6 +1610,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "config" version = "0.13.4" @@ -2711,9 +2720,14 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.3" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] [[package]] name = "eyre" @@ -3168,9 +3182,9 @@ dependencies = [ [[package]] name = "hashlink" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" dependencies = [ "hashbrown 0.14.5", ] @@ -3180,9 +3194,6 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -dependencies = [ - "unicode-segmentation", -] [[package]] name = "heck" @@ -3805,9 +3816,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.27.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" dependencies = [ "cc", "pkg-config", @@ -4553,6 +4564,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + [[package]] name = "parking_lot" version = "0.12.3" @@ -5475,8 +5492,7 @@ dependencies = [ [[package]] name = "ruint" version = "1.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +source = "git+https://github.com/Dzejkop/uint?rev=9a1a6019c519e9cd76add2494190d21fc5f574f9#9a1a6019c519e9cd76add2494190d21fc5f574f9" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", @@ -5485,6 +5501,7 @@ dependencies = [ "bytes", "fastrlp", "num-bigint", + "num-integer", "num-traits", "parity-scale-codec", "primitive-types", @@ -5502,8 +5519,7 @@ dependencies = [ [[package]] name = "ruint-macro" version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +source = "git+https://github.com/Dzejkop/uint?rev=9a1a6019c519e9cd76add2494190d21fc5f574f9#9a1a6019c519e9cd76add2494190d21fc5f574f9" [[package]] name = "rust-ini" @@ -6188,6 +6204,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "socket2" @@ -6250,9 +6269,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" +checksum = "93334716a037193fac19df402f8571269c84a00852f6a7066b5d2616dcd64d3e" dependencies = [ "sqlx-core", "sqlx-macros", @@ -6263,11 +6282,10 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" +checksum = "d4d8060b456358185f7d50c55d9b5066ad956956fddec42ee2e8567134a8936e" dependencies = [ - "ahash 0.8.11", "atoi", "byteorder", "bytes", @@ -6281,6 +6299,7 @@ dependencies = [ "futures-intrusive", "futures-io", "futures-util", + "hashbrown 0.14.5", "hashlink", "hex", "indexmap 2.6.0", @@ -6304,26 +6323,26 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" +checksum = "cac0692bcc9de3b073e8d747391827297e075c7710ff6276d9f7a1f3d58c6657" dependencies = [ "proc-macro2", "quote", "sqlx-core", "sqlx-macros-core", - "syn 1.0.109", + "syn 2.0.79", ] [[package]] name = "sqlx-macros-core" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" +checksum = "1804e8a7c7865599c9c79be146dc8a9fd8cc86935fa641d3ea58e5f0688abaa5" dependencies = [ "dotenvy", "either", - "heck 0.4.1", + "heck 0.5.0", "hex", "once_cell", "proc-macro2", @@ -6335,7 +6354,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 1.0.109", + "syn 2.0.79", "tempfile", "tokio", "url", @@ -6343,12 +6362,12 @@ dependencies = [ [[package]] name = "sqlx-mysql" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" +checksum = "64bb4714269afa44aef2755150a0fc19d756fb580a67db8885608cf02f47d06a" dependencies = [ "atoi", - "base64 0.21.7", + "base64 0.22.1", "bitflags 2.6.0", "byteorder", "bytes", @@ -6386,12 +6405,12 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" +checksum = "6fa91a732d854c5d7726349bb4bb879bb9478993ceb764247660aee25f67c2f8" dependencies = [ "atoi", - "base64 0.21.7", + "base64 0.22.1", "bitflags 2.6.0", "byteorder", "chrono", @@ -6425,9 +6444,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.7.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" +checksum = "d5b2cf34a45953bfd3daaf3db0f7a7878ab9b7a6b91b422d24a7a9e4c857b680" dependencies = [ "atoi", "chrono", @@ -6441,10 +6460,10 @@ dependencies = [ "log", "percent-encoding", "serde", + "serde_urlencoded", "sqlx-core", "tracing", "url", - "urlencoding", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b62911d0..de571943 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ semaphore = { git = "https://github.com/worldcoin/semaphore-rs", rev = "251e908d ] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -sqlx = { version = "0.7", features = [ +sqlx = { version = "0.8.2", features = [ "runtime-tokio-native-tls", "any", "postgres", @@ -98,6 +98,10 @@ testcontainers-modules = { version = "0.3.7", features = ["postgres"] } tracing-subscriber = "0.3.11" tracing-test = "0.2" +[patch.crates-io] +# Necessary until https://github.com/recmo/uint/pull/400 is merged and released +ruint = { git = "https://github.com/Dzejkop/uint", rev = "9a1a6019c519e9cd76add2494190d21fc5f574f9" } + [profile.release] panic = "abort" overflow-checks = true diff --git a/src/database/types.rs b/src/database/types.rs index fae96891..c53d6b93 100644 --- a/src/database/types.rs +++ b/src/database/types.rs @@ -1,10 +1,9 @@ use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; -use sqlx::database::{HasArguments, HasValueRef}; use sqlx::encode::IsNull; use sqlx::error::BoxDynError; use sqlx::prelude::FromRow; -use sqlx::{Decode, Encode, Postgres, Type}; +use sqlx::{Database, Decode, Encode, Postgres, Type}; use crate::identity_tree::{Hash, UnprocessedStatus}; use crate::prover::identity::Identity; @@ -92,7 +91,10 @@ pub struct BatchEntryData { pub struct Commitments(pub Vec); impl Encode<'_, Postgres> for Commitments { - fn encode_by_ref(&self, buf: &mut >::ArgumentBuffer) -> IsNull { + fn encode_by_ref( + &self, + buf: &mut ::ArgumentBuffer<'_>, + ) -> Result { let commitments = &self .0 .iter() @@ -104,7 +106,7 @@ impl Encode<'_, Postgres> for Commitments { } impl Decode<'_, Postgres> for Commitments { - fn decode(value: >::ValueRef) -> Result { + fn decode(value: ::ValueRef<'_>) -> Result { let value = as Decode>::decode(value)?; let res = value.iter().map(|&v| Hash::from_be_bytes(v)).collect(); @@ -133,7 +135,10 @@ impl From> for Commitments { pub struct LeafIndexes(pub Vec); impl Encode<'_, Postgres> for LeafIndexes { - fn encode_by_ref(&self, buf: &mut >::ArgumentBuffer) -> IsNull { + fn encode_by_ref( + &self, + buf: &mut ::ArgumentBuffer<'_>, + ) -> Result { let commitments = &self .0 .iter() @@ -145,7 +150,7 @@ impl Encode<'_, Postgres> for LeafIndexes { } impl Decode<'_, Postgres> for LeafIndexes { - fn decode(value: >::ValueRef) -> Result { + fn decode(value: ::ValueRef<'_>) -> Result { let value = as Decode>::decode(value)?; let res = value.iter().map(|&v| v as usize).collect(); diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 5585fddf..c5a95c95 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -317,10 +317,6 @@ criteria = "safe-to-deploy" version = "0.6.12" criteria = "safe-to-deploy" -[[exemptions.bytemuck]] -version = "1.19.0" -criteria = "safe-to-deploy" - [[exemptions.bytes]] version = "1.7.1" criteria = "safe-to-deploy" @@ -405,6 +401,10 @@ criteria = "safe-to-deploy" version = "4.6.7" criteria = "safe-to-deploy" +[[exemptions.concurrent-queue]] +version = "2.5.0" +criteria = "safe-to-deploy" + [[exemptions.config]] version = "0.13.4" criteria = "safe-to-deploy" @@ -654,7 +654,7 @@ version = "2.0.14" criteria = "safe-to-deploy" [[exemptions.event-listener]] -version = "2.5.3" +version = "5.3.1" criteria = "safe-to-deploy" [[exemptions.eyre]] @@ -786,7 +786,7 @@ version = "1.0.1" criteria = "safe-to-deploy" [[exemptions.hashlink]] -version = "0.8.4" +version = "0.7.0" criteria = "safe-to-deploy" [[exemptions.hermit-abi]] @@ -934,7 +934,7 @@ version = "0.0.1" criteria = "safe-to-deploy" [[exemptions.libsqlite3-sys]] -version = "0.25.2" +version = "0.30.1" criteria = "safe-to-deploy" [[exemptions.linux-raw-sys]] @@ -1129,6 +1129,10 @@ criteria = "safe-to-deploy" version = "3.6.12" criteria = "safe-to-deploy" +[[exemptions.parking]] +version = "2.2.1" +criteria = "safe-to-deploy" + [[exemptions.parking_lot]] version = "0.12.2" criteria = "safe-to-deploy" @@ -1385,14 +1389,6 @@ criteria = "safe-to-deploy" version = "0.9.6" criteria = "safe-to-deploy" -[[exemptions.ruint]] -version = "1.12.3" -criteria = "safe-to-deploy" - -[[exemptions.ruint-macro]] -version = "1.2.1" -criteria = "safe-to-deploy" - [[exemptions.rust-ini]] version = "0.18.0" criteria = "safe-to-deploy" @@ -1590,31 +1586,31 @@ version = "0.2.6" criteria = "safe-to-deploy" [[exemptions.sqlx]] -version = "0.7.4" +version = "0.8.2" criteria = "safe-to-deploy" [[exemptions.sqlx-core]] -version = "0.7.4" +version = "0.8.2" criteria = "safe-to-deploy" [[exemptions.sqlx-macros]] -version = "0.7.4" +version = "0.8.2" criteria = "safe-to-deploy" [[exemptions.sqlx-macros-core]] -version = "0.7.4" +version = "0.8.2" criteria = "safe-to-deploy" [[exemptions.sqlx-mysql]] -version = "0.7.4" +version = "0.8.2" criteria = "safe-to-deploy" [[exemptions.sqlx-postgres]] -version = "0.7.4" +version = "0.8.2" criteria = "safe-to-deploy" [[exemptions.sqlx-sqlite]] -version = "0.7.4" +version = "0.8.2" criteria = "safe-to-deploy" [[exemptions.stable_deref_trait]] @@ -1839,7 +1835,7 @@ criteria = "safe-to-deploy" [[exemptions.unicode-segmentation]] version = "1.12.0" -criteria = "safe-to-deploy" +criteria = "safe-to-run" [[exemptions.unicode-width]] version = "0.1.14" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index d18bbeba..105e38ae 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -1381,6 +1381,40 @@ Additional review comments can be found at https://crrev.com/c/4723145/31 """ aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" +[[audits.google.audits.bytemuck]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +version = "1.16.3" +notes = """ +Review notes from the original audit (of 1.14.3) may be found in +https://crrev.com/c/5362675. Note that this audit has initially missed UB risk +that was fixed in 1.16.2 - see https://github.com/Lokathor/bytemuck/pull/258. +Because of this, the original audit has been edited to certify version `1.16.3` +instead (see also https://crrev.com/c/5771867). +""" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +delta = "1.16.3 -> 1.17.1" +notes = "Unsafe review comments can be found in https://crrev.com/c/5813463" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Adrian Taylor " +criteria = "safe-to-deploy" +delta = "1.17.1 -> 1.18.0" +notes = "No code changes - just altering feature flag arrangements" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bytemuck]] +who = "Adrian Taylor " +criteria = "safe-to-deploy" +delta = "1.18.0 -> 1.19.0" +notes = "No code changes - just comment changes and adding the track_caller attribute." +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + [[audits.google.audits.byteorder]] who = "danakj " criteria = "safe-to-deploy" @@ -2378,28 +2412,29 @@ version = "0.12.3" notes = "This version is used in rust's libstd, so effectively we're already trusting it" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.hex]] -who = "Simon Friedberger " +[[audits.mozilla.audits.hashlink]] +who = "Mike Hommey " criteria = "safe-to-deploy" -version = "0.4.3" +delta = "0.7.0 -> 0.8.1" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.idna]] -who = "Valentin Gosu " +[[audits.mozilla.audits.hashlink]] +who = "Mark Hammond " criteria = "safe-to-deploy" -delta = "0.4.0 -> 0.5.0" +delta = "0.8.1 -> 0.9.1" +notes = "New CursorMut struct and other relatively straight-forward changes." aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.libsqlite3-sys]] -who = "Ben Dean-Kawamura " +[[audits.mozilla.audits.hex]] +who = "Simon Friedberger " criteria = "safe-to-deploy" -delta = "0.25.2 -> 0.26.0" +version = "0.4.3" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.libsqlite3-sys]] -who = "Mark Hammond " +[[audits.mozilla.audits.idna]] +who = "Valentin Gosu " criteria = "safe-to-deploy" -delta = "0.26.0 -> 0.27.0" +delta = "0.4.0 -> 0.5.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" [[audits.mozilla.audits.linked-hash-map]]