Skip to content

Commit

Permalink
Patch tokio to vendored version (#34240)
Browse files Browse the repository at this point in the history
* Patch tokio to vendored version

* Fix typo

(cherry picked from commit aaa48ec)

# Conflicts:
#	Cargo.toml
  • Loading branch information
CriesofCarrots authored and mergify[bot] committed Dec 13, 2023
1 parent 0b6a172 commit ac609ca
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 94 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ tempfile = "3.8.0"
test-case = "3.2.1"
thiserror = "1.0.49"
tiny-bip39 = "0.8.2"
# Update solana-tokio patch below when updating this version
tokio = "1.29.1"
tokio-serde = "0.8"
tokio-stream = "0.1.14"
Expand Down Expand Up @@ -445,3 +446,96 @@ crossbeam-epoch = { git = "https://github.com/solana-labs/crossbeam", rev = "fd2
# overrides in sync.
solana-program = { path = "sdk/program" }
solana-zk-token-sdk = { path = "zk-token-sdk" }
<<<<<<< HEAD
=======
#
# === zeroize versioning issues ===
#
# A number of packages used explicit upper bound on the `zeroize` package, such
# as `>=1, <1.4`. The problem is that cargo still does not duplicate `zeroize`
# if a newer version is available and requested by another package and just
# fails the whole dependency resolution process.
#
# This is described in
#
# https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#multiple-requirements
#
# So we have to patch `zeroize` dependency specifications in the projects that
# introduce these constraints. They have already removed these constraints in
# newer versions, but we have not updated yet. As we update, we need to remove
# these patch requests.
#
# When our dependencies are upgraded, we can remove these patches. Before that
# we might need to maintain these patches in sync with our full dependency tree.

# Our dependency tree has `aes-gcm-siv` v0.10.3 and the `zeroize` restriction
# was removed in the next commit just after the release. So it seems safe to
# patch to this commit.
#
# `aes-gcm-siv` v0.10.3 release:
#
# https://github.com/RustCrypto/AEADs/releases/tag/aes-gcm-siv-v0.10.3
#
# Corresponds to commit
#
# https://github.com/RustCrypto/AEADs/commit/6f16f4577a1fc839a2346cf8c5531c85a44bf5c0
#
# Comparison with `6105d7a5591aefa646a95d12b5e8d3f55a9214ef` pinned here:
#
# https://github.com/RustCrypto/AEADs/compare/aes-gcm-siv-v0.10.3..6105d7a5591aefa646a95d12b5e8d3f55a9214ef
#
[patch.crates-io.aes-gcm-siv]
git = "https://github.com/RustCrypto/AEADs"
rev = "6105d7a5591aefa646a95d12b5e8d3f55a9214ef"

# Our dependency tree has `curve25519-dalek` v3.2.1. They have removed the
# constraint in the next major release. The commit that removes the `zeroize`
# constraint was added to multiple release branches, but not to the 3.2 branch.
#
# `curve25519-dalek` maintainers are saying they do not want to invest any more
# time in the 3.2 release:
#
# https://github.com/dalek-cryptography/curve25519-dalek/issues/452#issuecomment-1749809428
#
# So we have to fork and create our own release, based on v3.2.1, with the
# commit that removed `zeroize` constraint on the `main` branch cherry-picked on
# top.
#
# `curve25519-dalek` v3.2.1 release:
#
# https://github.com/dalek-cryptography/curve25519-dalek/releases/tag/3.2.1
#
# Corresponds to commit
#
# https://github.com/dalek-cryptography/curve25519-dalek/commit/29e5c29b0e5c6821e4586af58b0d0891dd2ec639
#
# Comparison with `b500cdc2a920cd5bff9e2dd974d7b97349d61464`:
#
# https://github.com/dalek-cryptography/curve25519-dalek/compare/3.2.1...solana-labs:curve25519-dalek:b500cdc2a920cd5bff9e2dd974d7b97349d61464
#
# Or, using the branch name instead of the hash:
#
# https://github.com/dalek-cryptography/curve25519-dalek/compare/3.2.1...solana-labs:curve25519-dalek:3.2.1-unpin-zeroize
#
[patch.crates-io.curve25519-dalek]
git = "https://github.com/solana-labs/curve25519-dalek.git"
rev = "b500cdc2a920cd5bff9e2dd974d7b97349d61464"

# Solana RPC nodes experience stalls when running with `tokio` containing this
# commit:
# https://github.com/tokio-rs/tokio/commit/4eed411519783ef6f58cbf74f886f91142b5cfa6
#
# Tokio maintainers believe performance degradation is due to application bugs:
# https://github.com/tokio-rs/tokio/issues/4873#issuecomment-1198277677
#
# This may indeed be true of the code in this monorepo, but we haven't yet
# identified the bug or a way to fix. As a stopgap, this patches `tokio` to the
# tagged version specified above with commit `4eed411` reverted.
#
# Comparison:
# https://github.com/tokio-rs/tokio/compare/tokio-1.29.1...solana-labs:solana-tokio:tokio-1.29.1-revert-4eed411
#
[patch.crates-io.tokio]
git = "https://github.com/solana-labs/solana-tokio.git"
rev = "7cf47705faacf7bf0e43e4131a5377b3291fce21"
>>>>>>> aaa48ec8db (Patch tokio to vendored version (#34240))

0 comments on commit ac609ca

Please sign in to comment.