chore(deps): bump @effectstream pins 0.103.1 → 0.104.3 (trustProxy fix for preprod) - #76
Merged
Merged
Conversation
…Proxy fix The kernel's `main` line (Node 1 / ledger-v8) pinned every @effectstream package at 0.103.1. That runtime builds Fastify with no `trustProxy`, so behind preprod's nginx every client collapses into one `request.ip` and a single shared rate-limit bucket: one browser tab (or the solver console's poller) locks everyone else out with 429 RATE_LIMITED. 0.104.3 was published today from effectstream `midnight-1` (dist-tag `midnight-1`) and carries the runtime fix from effectstream #925/#926: `EFFECTSTREAM_TRUST_PROXY` parsed into Fastify's `trustProxy`, so `request.ip` becomes the real client again and the limiter counts per client. Verified against the published tarballs rather than assumed: 0.103.1 src/api/http-server.ts:171 fastify({ routerOptions: { maxParamLength: 300 } }) <- no trustProxy 0.104.3 src/api/http-server.ts:197-199 const serverOptions: FastifyServerOptions = { ..., trustProxy: parseTrustProxy(ENV.EFFECTSTREAM_TRUST_PROXY), } 0.104.3 @effectstream/utils src/config.ts:210 EFFECTSTREAM_TRUST_PROXY This is the `main`-line counterpart of the `ledger-v9` bump to 0.200.6 (PR #75); together they put the fix on both lines. It is the last step before the preprod kernel image can be rebuilt and the two-IP check run. Scope: 17 distinct @effectstream packages, 31 dependency lines across 11 of the 14 package.json files -- wallets, celestia, midnight-contracts, orchestrator, batcher-sdk, utils, runtime, db, config, sm, concise, coroutine, event-client, log, npm-midnight-indexer, npm-midnight-node, npm-midnight-proof-server. All 17 confirmed present on npm at 0.104.3 before editing. @effectstream/mip-zswap-offer@0.3.0 is untouched. Lockfile, asserted rather than eyeballed: - ledger-v9 entries: 0; ledger-v8 entries: 26, unchanged. This line stays on Node 1 / ledger-v8 and does not drift toward Node 2. - @effectstream/*@0.103: 0 (no `0.103` substring survives anywhere); @effectstream/*@0.200: 0. - 20 @effectstream names now at 0.104.3 (the 17 direct plus transitive crypto, event-server, sync) over 51 occurrences -- exactly the 51 occurrences 0.103.1 had. - The resolved @midnight-ntwrk/* (17 entries) and @midnightntwrk/* (13 entries) sets are byte-identical before and after: ledger-v8 8.1.0, onchain-runtime-v3 3.0.0, compact-runtime 0.16.0, midnight-js 4.1.1, wallet-sdk facade 4.1.0 / dust 4.2.0 / shielded 3.0.2 / unshielded 3.1.0 / capabilities 3.3.1 / hd 3.0.3 / abstractions 2.1.0 / address-format 3.1.2. No wallet-sdk drift. One third-party transitive move, fully attributed: diffing all 20 packages' published `dependencies` at 0.103.1 vs 0.104.3 leaves exactly two non-@effectstream range changes -- @effectstream/celestia moved @xhmikosr/bin-wrapper ^5.0.0 -> ^13.2.0, and @effectstream/sm added @noble/hashes ^2.2.0 (already resolved at 2.2.0, no lockfile change). The bin-wrapper major accounts for the rest of the lockfile diff: the Celestia binary downloader tree (@xhmikosr/downloader 9 -> 15.2.0, decompress 5 -> 10.2.2, got 11 -> 13, file-type 12 -> 20, tar-stream 1 -> 3, arch 2 -> 3 and their sub-trees). Upstream's own bump, confined to the Celestia binary download path. Unlike the 0.200.6 bump on ledger-v9, ntp-time-sync stays at 0.5.0 here, so the deliberate pin guard in solver-offerfiles-real-ntp-responder.test.ts needed no change. Gates, in a space-free copy (the workspace path contains a space): bun install --frozen-lockfile on a fresh copy pass, lockfile unchanged bun run typecheck 0 diagnostics in all three gates; out-of-gate 23/24/23, identical to the 24150bb baseline bun run check:pgtypes pass, tree stays clean CI unit set (10 ci.yml paths) 1465 pass / 0 fail / 14180 expect, 111 files check:compact-runtime does not exist on this line (ledger-v9 only).
acedward
marked this pull request as ready for review
September 11, 2026 12:12
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.
Bumps every
@effectstream/*pin on themainline (Node 1 / ledger-v8) from0.103.1to0.104.3, so this line picks up the runtimetrustProxyfix. This is themain-line counterpart of #75 (ledger-v9→0.200.6); together they put the fix on both lines. Last step before the preprod kernel image can be rebuilt and the two-IP check run (SC-001).Project
00043-rate-limit-shared-bucket, phase P6b. Follows #73 (kernel default 600/min, merged) and effectstream #925 / #926 (the runtime change and itsmidnight-1port).Why
@effectstream/runtime@0.103.1creates Fastify with notrustProxy, so behind preprod's nginx every client collapses into a singlerequest.ipand therefore a single rate-limit bucket. One browser tab — or the solver console's poller — exhausts the budget and locks everyone else out with429 RATE_LIMITED.0.104.3(published today from effectstreammidnight-1, npm dist-tagmidnight-1) carries the fix.Verified against the published tarballs, not assumed:
0.103.1src/api/http-server.ts:171fastify({ routerOptions: { maxParamLength: 300 } })— notrustProxyat all0.104.3src/api/http-server.ts:197-199const serverOptions: FastifyServerOptions = { …, trustProxy: parseTrustProxy(ENV.EFFECTSTREAM_TRUST_PROXY) }, withparseTrustProxyexported at:680.104.3@effectstream/utilssrc/config.ts:210EFFECTSTREAM_TRUST_PROXYconfig entryScope
17 distinct packages, 31 dependency lines, 11 of the 14
package.jsonfiles. All 17 confirmed present on npm at0.104.3before any edit (npm view @effectstream/<name>@0.104.3 version).wallets,celestia,midnight-contracts,orchestrator,batcher-sdk,utils,runtime,db,config,sm,concise,coroutine,event-client,log,npm-midnight-indexer,npm-midnight-node,npm-midnight-proof-server.@effectstream/mip-zswap-offer@0.3.0is untouched (9 lines).Lockfile assertions
Asserted mechanically, not eyeballed:
ledger-v9entries inbun.lockledger-v8entries@effectstream/*@0.1030.103substring survives anywhere in the lockfile)@effectstream/*@0.200@effectstream/*@0.104.3crypto,event-server,sync) over 51 occurrences — exactly the 510.103.1occurrences the base lockfile hadNo wallet-SDK drift. The resolved
@midnight-ntwrk/*(17 entries) and@midnightntwrk/*(13 entries) sets are byte-identical before and after:ledger-v8@8.1.0,onchain-runtime-v3@3.0.0,compact-runtime@0.16.0,midnight-js-*@4.1.1,wallet-sdk-facade@4.1.0,dust-wallet@4.2.0,shielded@3.0.2,unshielded-wallet@3.1.0,capabilities@3.3.1,hd@3.0.3,abstractions@2.1.0,address-format@3.1.2. No Node-2 pin appears.One third-party transitive move, fully attributed. Diffing all 20 packages' published
dependenciesat0.103.1vs0.104.3(with@effectstreamentries filtered and keys sorted) leaves exactly two non-@effectstreamrange changes:@effectstream/celestiamoved@xhmikosr/bin-wrapper^5.0.0→^13.2.0, and@effectstream/smadded@noble/hashes^2.2.0(already resolved at2.2.0, no lockfile change). The bin-wrapper major accounts for the rest of the lockfile diff — the Celestia binary downloader tree (@xhmikosr/downloader9 → 15.2.0,decompress5 → 10.2.2,got11 → 13,file-type12 → 20,tar-stream1 → 3,arch2 → 3 and their sub-trees). Upstream's own bump, confined to the Celestia binary download path.Unlike the
0.200.6bump onledger-v9(#75),ntp-time-syncstays at 0.5.0 here, so the deliberate pin guard insolver-offerfiles-real-ntp-responder.test.ts:502needed no change.Gates
Run in a space-free copy — the workspace path contains a space, which breaks Bun child-spawn tests.
bun install --frozen-lockfileon a fresh copybun.lockunchangedbun run typecheck(backend + solver + price-feed)24150bbbaseline measured head-to-headbun run check:pgtypesbun run check:compact-runtimeledger-v9only)ci.ymlpaths)*.test.tsfiles those paths contain, so nothing was skippedsolver-offerfiles-real-image-secret-scan(known host-flaky)trade-data.test.ts"Connection terminated" (known flake)Not a breaking change for this repo
No source or config file changes — dependency pins and the lockfile only. The behaviour change lives in the runtime and was flagged on effectstream #925 / #926:
EFFECTSTREAM_TRUST_PROXYdefaults totrue(trust every hop), which is what makesrequest.ipthe real client behind a proxy. A deployment that exposes the runtime with no proxy in front should setEFFECTSTREAM_TRUST_PROXY=false, otherwise a client can spoofX-Forwarded-Forand dodge the limiter. Every known deployment fronts the runtime with nginx or Caddy.Owner recipe — preprod redeploy and the two-IP check (SC-001)
Not done in this PR; it needs host access. After this merges:
@effectstream/runtime@0.104.3. Use a uniqueIMAGE_TAGfor the build.preprod.api-zswap.zkdojo.commust contain:intents-uiblock already sets it; the API block was not in the workspace and has to be checked on the host.)EFFECTSTREAM_TRUST_PROXYunset on preprod — thetruedefault is what is wanted behind nginx.429. Confirm the body is{"statusCode":429,"error":"RATE_LIMITED","reason":…}and check the headers:curl -sD - -o /dev/null https://preprod.api-zswap.zkdojo.com/v1/market/pairs | grep -i x-ratelimitx-ratelimit-limitshould read 600 (the feat(api): raise the default per-IP rate limit to 600/min #73 default;deploy/sets an explicit 6000 if that env is in play).curl -sD - -o /dev/null https://preprod.api-zswap.zkdojo.com/v1/market/pairs | grep -i x-ratelimit200with its ownx-ratelimit-remaining, close to the full budget rather than 0 — proving the two IPs now have independent counters. Fail:429, or aremainingthat continues IP A's count — which means step 2's header is still missing.Use
/v1/market/pairsor any counted route;/v1/health*and the docs routes are exempt from the limiter and will not move the counter.CI
All four jobs green on the runner (ubuntu-latest, pinned Bun 1.3.3) — run 34596197114: Unit tests (bun test, PGlite) 2m16s, Backend typecheck 31s, Solver typecheck 31s, Typecheck docs playground 26s.
e2eskipped (workflow_dispatch-only).One open question for the reviewer
The one thing this bump changes that no gate on this line covers:
@effectstream/celestia@0.104.3moved@xhmikosr/bin-wrapper^5.0.0→^13.2.0, and that is the component which lazily downloadscelestia-appd/celestiainto the package'svendor/dir. The CI unit set never downloads a binary, and the only job that would (e2e) is manual and needs live chain infra — so this PR is green while the swapped code path stays unexercised.scripts/patch-macos-celestia.ts(thepredev/preteststep) is also coupled to that path, since it patches the Mach-O binaries bin-wrapper leaves invendor/.Mitigating evidence:
@effectstream/celestia'sindex.jsis byte-identical at0.103.1and0.104.3— the samenew BinWrapper().src(…).dest(dest).use(…)calls, the same pinned binaries (celestia-appd 6.4.10,celestia-node 0.28.4) from the same source (effectstream/binariesrelease0.3.120). Only the downloader implementation underneath changed.Suggested cheap check before merging, on Linux: delete
node_modules/@effectstream/celestia/vendorand force a.use()(e.g.bunx @effectstream/celestia start-node --help), confirming both binaries land and report their versions. If that is inconvenient, the preprod rebuild in step 1 above should be watched for a Celestia fetch failure rather than assumed routine. Recorded as Q6 in the project's questions file.