mirror of
https://github.com/logos-co/logos-evm-net-proxy.git
synced 2026-08-27 04:11:13 +00:00
main
The previous commit broke CI on main here, and the mechanism is worth recording.
Measured, by asking each cache for the path that failed in keystore-module
(the same class of path fails in every Rust-building repo):
logos-co.cachix.org 200 <- present
cache.nix.logos.co/public 404
cache.nix.logos.co/ci 404
cache.nixos.org 404
The failing path is a fixed-output fetch of a crates.io tarball
(crate-alloy-eip7928-0.3.4.tar.gz). With Cachix in the substituters CI never
performed that fetch -- it downloaded the finished path. Dropping Cachix
therefore did not merely cost cache hits: it made CI attempt the fetch for the
first time, and it fails there in ~7 minutes, taking cargo-vendor-dir and the
whole module with it.
The crate itself is healthy: that URL returns 20373 bytes hashing to
407510740da5..., exactly the expected outputHash. So this is not a yanked crate
or a stale hash -- it is an untested assumption ("CI can fetch from crates.io")
that Cachix had been hiding.
Cachix therefore stays as a READ-ONLY substituter until Attic has the paths. It
is credential-free (the cache is public) and nothing publishes to it any more:
pushes go to Attic, public on main and ci elsewhere. Drop these two lines once
Attic is seeded -- and expect that first uncached build to exercise the fetch
path for real.
The Attic side is confirmed working in the failing runs themselves: they
substituted python3-env and doctest from cache.nix.logos.co/public, and the push
step correctly skipped, since these repos have no public-cache environment yet.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
logos-net-proxy
The single, fail-closed constructor of HTTP clients for the Logos wallet modules
(eth_rpc_module, token_list_module). It is the one chokepoint through which every
outbound request is built, so the wallet's privacy posture — never send in the clear
when a proxy is required — is enforced in one auditable place and is ready for Tor.
API
pub struct ProxyConfig { pub proxy: Option<String>, pub proxy_required: bool, pub timeout_secs: u64 }
pub enum ProxyError { ProxyRequiredButUnset, ProxyUnusable(String), Build(String) }
/// The ONLY place a reqwest client is constructed in the wallet networking modules.
pub fn build_client(cfg: &ProxyConfig) -> Result<reqwest::blocking::Client, ProxyError>;
Rules enforced by build_client:
proxy_required == trueand no usable proxy ⇒Err(ProxyRequiredButUnset)— it never falls back to a clear-net client.- A proxy URL must use a supported scheme:
socks5h(preferred — DNS resolves through the proxy, the right choice for Tor),socks5,http, orhttps. - With no proxy set and none required, ambient environment proxies are disabled so the clear-net path is explicit and deterministic.
Consumers depend on this crate and have no other way to obtain a client; each asserts via
a unit test that reqwest::Client::builder appears only here.
Build / test
cargo test
Uses reqwest with rustls-tls (pure-Rust TLS) + socks. Built with rustls rather than
native-tls to keep the link closure free of system OpenSSL.
Description
Fail-closed proxyable HTTP client chokepoint for the Logos EVM wallet (Tor-ready).
264 KiB
Languages
Rust
72.3%
Nix
14.2%
Shell
13.5%