Skip to content

Lib: Further reduce dependency list#767

Merged
hydra-yse merged 19 commits into
mainfrom
yse-reduce-deps
Apr 7, 2026
Merged

Lib: Further reduce dependency list#767
hydra-yse merged 19 commits into
mainfrom
yse-reduce-deps

Conversation

@hydra-yse
Copy link
Copy Markdown
Member

@hydra-yse hydra-yse commented Mar 28, 2026

Closes #497.

This PR removes:

  • rayon
  • openssl
  • strum / strum_macros
  • enum_to_enum
  • jwt
  • serde_qs
  • x509-parser -> x509-cert
  • regex -> regex-lite
  • ecies

TO-DOs

  • Test removing openssl dep on older Android environments (Edit: Tested on Android 13)
  • Fix WASM clippy (getrandom)

@hydra-yse hydra-yse self-assigned this Mar 28, 2026
@hydra-yse hydra-yse force-pushed the yse-reduce-deps branch 2 times, most recently from 56ca5e5 to 3e126e5 Compare March 28, 2026 20:23
@hydra-yse hydra-yse marked this pull request as ready for review March 30, 2026 09:00
@hydra-yse hydra-yse force-pushed the yse-reduce-deps branch 3 times, most recently from 57e5b2b to c7d8619 Compare March 31, 2026 15:03
Copy link
Copy Markdown
Collaborator

@JssDWt JssDWt left a comment

Choose a reason for hiding this comment

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

Looking good. I need one more look at the ecies implementation.

Comment thread crates/breez-sdk/lnurl/Cargo.toml
Comment thread Cargo.toml Outdated
Comment thread Makefile Outdated
@roeierez
Copy link
Copy Markdown
Member

roeierez commented Apr 5, 2026

@hydra-yse other than the postgres tls testing and breez temporary fork LGTM. ping again when these are fixed.

hydra-yse and others added 16 commits April 6, 2026 13:07
rayon was declared in [workspace.dependencies] but had zero usages
anywhere in the workspace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
openssl was a vestigial dep from the reqwest → bitreq migration:
commit 802178b changed `openssl-vendored = ["reqwest/native-tls-vendored"]`
to a direct openssl dep, then 9a67d15 removed reqwest but left openssl
behind. It was never called from Rust code — only linked via the
`uniffi` feature chain. rustls already covers all TLS needs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
strum / strum_macros were used solely to derive Display on
BitcoinNetwork in one file. Replace with a five-arm match impl.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
enum_to_enum was used on two enums in graphql/models.rs to generate
From impls across seven source types. Replace with a local macro for
the unit-variant conversions and an explicit impl for SspUserRequest.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jwt was used solely to extract the `exp` claim from the flashnet
access token to compute cache TTL. Replace with: split on '.', decode
the payload segment with base64url (URL_SAFE_NO_PAD), deserialize the
JSON, and extract the `exp` field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
serde_qs was used only in flashnet's get_request_inner to serialize
flat query structs. serde_urlencoded (already a transitive dep via
reqwest) handles repeated keys for Vec fields identically to
serde_qs Unindexed format, which is all this code requires.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
x509-cert (RustCrypto) v0.2.5 was already in the dep tree via
tokio-postgres-rustls. Replacing x509-parser removes 7 exclusive
crates: nom, asn1-rs, asn1-rs-derive, asn1-rs-impl, der-parser,
oid-registry, rusticata-macros.

Also removes the unused rayon reference from xtask/Cargo.toml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This switches to a custom fork of rustls until
rust-bitcoin/corepc#536 is merged
Swaps the heavyweight `regex` crate (which pulls in full Unicode property
tables) for `regex-lite`, which has an identical API but restricts patterns
to ASCII/basic Unicode — sufficient for all ExternalInputParser use cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hydra-yse
Copy link
Copy Markdown
Member Author

hydra-yse commented Apr 6, 2026

Tested postgres with Supabase via breez-cli, and it works! If not enough we can update Postgres support on Glow and we can also test from mobile, but I've already tested other rustls features there those work as well

Copy link
Copy Markdown
Collaborator

@JssDWt JssDWt left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Member

@roeierez roeierez left a comment

Choose a reason for hiding this comment

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

LGTM given the integration tests will pass.

@hydra-yse hydra-yse merged commit 54fd0c1 into main Apr 7, 2026
71 of 74 checks passed
@hydra-yse hydra-yse deleted the yse-reduce-deps branch April 7, 2026 10:47
erdemyerebasmaz pushed a commit that referenced this pull request Apr 7, 2026
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.

Reduce dependencies

3 participants