Skip to content

gateway(legacy): port /get fetch pool to gateway.DefaultGateways; bump v0.18.1 - #74

Merged
noslav merged 1 commit into
dedicated-gatewayfrom
port-legacy-gateway
May 22, 2026
Merged

gateway(legacy): port /get fetch pool to gateway.DefaultGateways; bump v0.18.1#74
noslav merged 1 commit into
dedicated-gatewayfrom
port-legacy-gateway

Conversation

@noslav

@noslav noslav commented May 22, 2026

Copy link
Copy Markdown
Member

Summary

Stacks on top of #73. #73 swapped the new-path gateway pool from w3s.link to ipfs.filebase.io in internal/gateway/handler.go, but the deprecated /get endpoint kept its own hardcoded gateway list in internal/pinner/ipfs-node/legacy.go:

IPFS_HTTP_GATEWAYS = []string{
    "https://w3s.link/ipfs/%s",
    "https://dweb.link/ipfs/%s",
    "https://ipfs.io/ipfs/%s",
}

So consumers still on /get (today: refiner, until very recently bsp-agent) were silently routed through w3s.link and saw it in the logs:

ewm-das  WARN  Deprecated endpoint accessed: /get
ewm-das  DEBUG ipfs-node/legacy.go:76  trying out https://w3s.link/ipfs/bafy...

This PR derives 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 list now reads (post-#73):

https://ipfs.filebase.io/ipfs/%s
https://trustless-gateway.link/ipfs/%s
https://dweb.link/ipfs/%s
https://ipfs.io/ipfs/%s

Design notes

  • Source of truth. gateway.DefaultGateways is 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.
  • Format suffix. The legacy fetcher uses fmt.Sprintf to inject the CID, so each base URL is suffixed with /ipfs/%s at init (strings.TrimRight(g, "/") + "/ipfs/%s"). The new path uses url.Parse + path.Join and doesn't need the suffix.
  • DEDICATED_GATEWAY intentionally not honoured here. The legacy endpoint is deprecated. Consumers should migrate to /api/v1/get to 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.
  • No semantic change to the legacy fetcher. It still returns raw IPFS bytes (vs the new path's DAS-decode + reconstruct). Only the gateway list changes.

Version bump

common/constants.go is also bumped: Version = "v0.18.1" (was "v0.1.0", a stale fallback). The Makefile injects git describe --tags via ldflags at 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

🤖 Generated with Claude Code

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>
@noslav
noslav merged commit 672f850 into dedicated-gateway May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant