fix(auth): bound SimplifiedFetchTransport reqwest client + disable idle pool - #5
Merged
Merged
Conversation
Additive, behavior-compatible counterpart to `encrypt`: same AES-256-GCM, same 32-byte-IV convention, same `IV(32) || ciphertext || authTag(16)` layout as @bsv/sdk (TS) and go-sdk — the ONLY difference is the caller supplies the IV instead of it being random. Output is byte-identical to what `encrypt` (or any conformant SDK) would produce for the same IV, and decrypts under every SDK's `decrypt`. The canonical `encrypt`/`decrypt` are byte-for-byte unchanged. Enables deterministic cross-impl ciphertext byte-lock (MPC-Spec §06.16 / bsv-mpc#23): the IV is otherwise the only nondeterminism. Documented test-only (GCM IV reuse is catastrophic; production uses random-IV `encrypt`). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…le pool Egress-NAT'd hosts (Cloudflare Containers) silently drop idle keep-alive sockets; reqwest's default pool reused a half-dead connection and the next BRC-104 General POST (/sendMessage) hung indefinitely (Client::new sets no timeout). Add request + connect timeouts and pool_max_idle_per_host(0) so a dropped keep-alive forces a fresh connection instead of a hang. Fixes the deployed bsv-mpc cosigner reshare-over-relay stall (#58). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pre-existing on main: cargo doc -Dwarnings failed on an unresolved `[encrypt]` intra-doc link (now `[encrypt](Self::encrypt)`) and rustfmt flagged the file. Unblocks CI on this branch; unrelated to the transport fix.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SimplifiedFetchTransport::newbuiltreqwest::Client::new()— no timeout, no connect-timeout, default keep-alive pool. On an egress-NAT'd host (e.g. a Cloudflare Container) the NAT silently drops the idle pooled socket; reqwest then reuses a half-dead connection and the next BRC-104 General POST (/sendMessage) hangs indefinitely (nothing breaks the hang).This wedged the deployed bsv-mpc cosigner's reshare-over-relay round-1 ship. Fix: build the client with
timeout(30s)+connect_timeout(10s)+pool_max_idle_per_host(0)so a dropped keep-alive forces a fresh connection instead of a hang.Validated:
cargo build/clippy --features auth,httpclean; the downstream bsv-mpc #40 recovery gate passed on mainnet with this pinned (TXID f8b51458…).