Repository navigation
Conversation
|
@Ejere Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
…INTERVAL_MS (Telocel-Labs#777) POLL_INTERVAL_MS was removed from the indexer's effective config, and Config::from_env now fails startup if it is set at all, but fly/indexer.toml still set it, crash-looping every Fly deploy. Replace it with POLL_INTERVAL_FLOOR_MS/POLL_INTERVAL_CEILING_MS (5000/5000, reproducing the old fixed cadence), set NETWORK explicitly instead of relying on the testnet default, and add a CI check (scripts/check-fly-env-rejected.sh) that fails if any fly/*.toml sets an env var the indexer's config loader now hard-rejects.
… for per-IP rate limiting (Telocel-Labs#779) Neither Helm nor Fly set TRUSTED_PROXY_ENABLED, so the per-IP limiter keyed every request on the proxy's own address, collapsing all clients behind it into one shared bucket. Behind Helm's LoadBalancer -> nginx -> Go API chain, trusting only the last XFF hop (the prior behaviour) also attributed every request to the load balancer rather than the real client. trustedClientIP now: - uses Fly-Client-IP directly when present (set by Fly's edge, not forgeable by the client) - otherwise walks X-Forwarded-For from the right, skipping hops inside the configured TRUSTED_PROXY_CIDRS, requiring the immediate TCP peer itself be inside one of those CIDRs before trusting XFF at all so a client connecting directly cannot forge a trusted-looking chain - falls back to the prior last-hop-only behaviour when TRUSTED_PROXY_CIDRS is unset, so existing single-proxy-hop deployments are unaffected Wires TRUSTED_PROXY_ENABLED=true + TRUSTED_PROXY_CIDRS (RFC1918 ranges, covering nginx's pod IP on any standard cluster) into the Helm chart, and TRUSTED_PROXY_ENABLED=true (no CIDRs needed) into fly/api.toml. Updates docs/ENVIRONMENT.md, docs/deployment.md, docs/threat-model.md and docs/site/self-hosting/configuration.mdx.
…l-Labs#780) .github/workflows/release.yml pushed the indexer, gRPC API, Go API and migration images to GHCR with no way to verify a given digest actually came from this repository's release workflow. Add, per image: - keyless cosign signing (sigstore/cosign-installer + cosign sign), using the workflow run's own GitHub OIDC identity; no signing key is stored in the repo or in secrets - an SPDX SBOM (anchore/sbom-action) attested onto the image with cosign attest - a SLSA build-provenance attestation via actions/attest-build-provenance, pushed to the registry Document the cosign verify / gh attestation verify commands (and an SBOM inspection one-liner) in docs/deployment.md, with a note on wiring an admission policy against the same identity.
Ejere
force-pushed
the
fix/indexer-retention-poll-interval-rate-limiter-sbom
branch
from
October 26, 2026 05:50
454c0b6 to
57e5e2b
Compare
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.
Summary
Fixes three infra/backend bugs in a single batch: the broken
fly/indexer.tomlconfig that crash-loops every indexer deploy, a per-IP rate limiter that collapses to one global bucket behind Helm/Fly's proxies, and unsigned/unattested release images. The fourth assigned issue (historical ingestion beyond RPC retention) is left out; see "Not included" below.closes #777
closes #779
closes #780
Changes
fly/indexer.tomlsetsPOLL_INTERVAL_MS, which now aborts indexer startup #777 -fly/indexer.tomlsetsPOLL_INTERVAL_MS, which now aborts indexer startup:Config::from_env(crates/indexer/src/config.rs:276-281) hard-fails startup ifPOLL_INTERVAL_MSis set at all, butfly/indexer.tomlstill set it, crash-looping every Fly deploy. Replaced withPOLL_INTERVAL_FLOOR_MS/POLL_INTERVAL_CEILING_MS(both5000, reproducing the old fixed cadence), setNETWORKexplicitly instead of relying on the testnet default, and addedscripts/check-fly-env-rejected.sh(wired into theenv-referenceCI job) which fails if anyfly/*.tomlsets an env var the indexer's config loader rejects. Verified the new check catches the exact regression it's meant to (addedPOLL_INTERVAL_MSback temporarily and confirmed it fails, then reverted).trustedClientIP(services/api/middleware/abuse.go) previously only trusted the last X-Forwarded-For hop unconditionally, and neither Helm nor Fly setTRUSTED_PROXY_ENABLEDat all, so every request was keyed on the proxy's own IP. Added CIDR-aware trusted-proxy logic:Fly-Client-IPis used directly on Fly (unforgeable, set by Fly's edge), and the XFF chain is walked from the right skipping only hops inside a newTRUSTED_PROXY_CIDRSlist, with the immediate TCP peer itself required to be in that CIDR set before XFF is trusted at all (so a client bypassing the proxy can't forge a trusted-looking chain). WiredTRUSTED_PROXY_ENABLED=true+TRUSTED_PROXY_CIDRS(RFC1918 ranges) into the Helm chart'sgoApi.env/trustedProxyCIDRsvalues, andTRUSTED_PROXY_ENABLED=true(no CIDRs needed) intofly/api.toml. Updateddocs/ENVIRONMENT.md,docs/deployment.md,docs/threat-model.md,docs/site/self-hosting/configuration.mdx. Added unit tests covering Fly-Client-IP priority, CIDR-walk, untrusted-peer rejection, and the legacy last-hop-only fallback when no CIDRs are configured..github/workflows/release.ymlbuilt and pushed four images to GHCR with no way to verify a digest came from this repo's release workflow. Added, per image (indexer, gRPC API, Go API, migrate): keyless cosign signing via GitHub OIDC (sigstore/cosign-installer+cosign sign, no stored signing key), an SPDX SBOM (anchore/sbom-action) attested withcosign attest, and a SLSA build-provenance attestation viaactions/attest-build-provenancepushed to the registry. Documented thecosign verify/gh attestation verify/ SBOM-inspection commands indocs/deployment.md, plus a note on wiring an admission policy against the same OIDC identity.Not included
Test plan
go build ./...andgo test ./middleware/...inservices/apipass, including new tests:TestTrustedClientIP_FlyClientIPTakesPriority,TestTrustedClientIP_FlyClientIPIgnoredWhenNotTrusting,TestTrustedClientIP_WalksPastTrustedCIDRs,TestTrustedClientIP_IgnoresXFFWhenPeerNotTrusted,TestTrustedClientIP_TrustsLastHopOnly_NoCIDRsConfigured(renamed from the old last-hop-only test, still passing to confirm the no-CIDRs fallback).bash scripts/check-fly-env-rejected.shpasses against the fixedfly/indexer.toml, and was manually verified to fail whenPOLL_INTERVAL_MSis reintroduced.bash scripts/check-env-reference.shstill passes (newTRUSTED_PROXY_CIDRSvar documented).helm lint helm/tridentpasses;helm template trident helm/tridentconfirmedTRUSTED_PROXY_ENABLED/TRUSTED_PROXY_CIDRSrender correctly onto the go-api Deployment..github/workflows/release.ymlvalidated withactionlint(clean) andpython3 -c "import yaml; yaml.safe_load(...)"(valid YAML); the cosign/SBOM/attestation steps themselves can only be exercised by an actual tag-triggered release run, which this PR doesn't trigger.No Rust source was changed (only
fly/indexer.toml, a new bash script, and docs), so nocargobuild was required for #777. The Go API changes were built and tested directly. I did not have a live Fly/Helm cluster to deploy against, so thefly deploy/helm install"done when" criteria in #777/#779 are verified by config inspection and the automated CI check rather than an end-to-end deploy.