gateway(legacy): port /get fetch pool to gateway.DefaultGateways; bump v0.18.1 - #74
Merged
Merged
Conversation
PR #73 swapped the new-path gateway pool from w3s.link to ipfs.filebase.io, but the deprecated /get endpoint kept its own hardcoded IPFS_HTTP_GATEWAYS list in internal/pinner/ipfs-node/legacy.go — so consumers still on /get were silently routed through w3s.link and saw it in the logs. Derive IPFS_HTTP_GATEWAYS from gateway.DefaultGateways at package init so the legacy fetcher uses the same single source of truth as the /api/v1/get handler. The legacy fetcher injects the CID via fmt.Sprintf, so each base URL is suffixed with "/ipfs/%s". DEDICATED_GATEWAY is intentionally NOT honoured by the legacy path — that's a deliberate nudge for consumers to migrate to /api/v1/get, which also gets the parallel-fetch worker pool. Also bump common.Version to v0.18.1 so a fallback build (one that skips the Makefile's `git describe`-via-ldflags injection) reports a post-#73 version. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Stacks on top of #73. #73 swapped the new-path gateway pool from
w3s.linktoipfs.filebase.ioininternal/gateway/handler.go, but the deprecated/getendpoint kept its own hardcoded gateway list ininternal/pinner/ipfs-node/legacy.go:So consumers still on
/get(today:refiner, until very recentlybsp-agent) were silently routed throughw3s.linkand saw it in the logs:This PR derives
IPFS_HTTP_GATEWAYSfromgateway.DefaultGatewaysat package init, so the legacy fetcher uses the same single source of truth as the/api/v1/gethandler. The list now reads (post-#73):Design notes
gateway.DefaultGatewaysis now the single place to update the pool. Future tweaks flow through both endpoint families automatically and the legacy path can never drift back to a retired gateway.fmt.Sprintfto inject the CID, so each base URL is suffixed with/ipfs/%sat init (strings.TrimRight(g, "/") + "/ipfs/%s"). The new path usesurl.Parse + path.Joinand doesn't need the suffix./api/v1/getto pick up dedicated-gateway support and the new path's parallel-fetch worker pool. Keeping the legacy path "as good as new" would weaken the migration incentive.Version bump
common/constants.gois also bumped:Version = "v0.18.1"(was"v0.1.0", a stale fallback). The Makefile injectsgit describe --tagsvialdflagsat build-time so this constant is only used when the binary is built without the Makefile path — but the fallback should still report a sensible post-#73 version.Test plan
ewm-das:latestfrom this branch.covalenthq/refinerPR #292 CI against the rebuilt image with/getstill mapped — confirm now3s.linkline in theewm-daslogs./get?cid=<known-good-cid>against the rebuilt image directly — confirm it routes throughipfs.filebase.iofirst and returns the same bytes the old gateway list did.🤖 Generated with Claude Code