add trustless IPFS gateway, use patched rclone, remove bitswap#646
Conversation
fe93173 to
adfce2b
Compare
51b8666 to
a8d4dd4
Compare
remove the dead bitswap protocol and add an /ipfs/ endpoint implementing the trustless gateway spec via boxo/gateway. StorageBlockStore pools rclone handlers per storage and holds open a streaming file reader to serve sequential block reads efficiently -- DAG nodes return from the DB without storage I/O, and leaf blocks from the same file share a single held-open rclone stream. supports dag-scope=all/entity/block, path resolution, entity-bytes, format=car and format=raw. stale source files detected at read time are mapped to HTTP 409 via boxo's error status mechanism.
replace github.com/rclone/rclone with parkan/rclone@singularity-v1.68.0 which adds sync.Map + singleflight caching for /metadata/ API calls in the internetarchive backend. reduces per-item metadata hits from N (one per file) to 1. temporary measure until metadata caching is upstreamed to rclone.
- remove uptobox backend (dropped upstream) - fix fs.Duration type change in config overrides - handle []string option defaults in ToCLIFlag type switch
ca2e329 to
c55bddf
Compare
|
I found 3 issues worth addressing in this PR:
|
|
I think (1) landed on the wrong PR (concerning export_keys.go), maybe some stale state on your end? should have been addressed in #650 concerns (2) and (3) are valid in specific concurrent traffic cases, mostly materializing as a throughput bottleneck across serialized reads (3) and (much less likely to happen) same-file reads with different expectations in (2); acknowledge both but don't think they strictly block the baseline functionality here |
|
ok actually yes it's possible to inherit a cancelled context which is quite bad, working on a fix |
|
ok, context ownership has been shifted to the blockstore from the request; this should decouple cross-request concerns |
|
no idea why the CI got stuck on this, trying to manually run |
Code reviewFound 3 issues worth flagging (none are blockers, but all affect the gateway path):
singularity/store/storage_blockstore.go Lines 73 to 76 in 3198937
singularity/store/storage_blockstore.go Lines 70 to 125 in 3198937
singularity/store/storage_blockstore.go Lines 191 to 195 in 3198937 None of these block the baseline gateway functionality, but (1) is a crash risk worth guarding against. 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
0cb65cd to
a9a1c74
Compare
a9a1c74 to
2a404a6
Compare
|
nil guard and blockstore close added mutex discussed above, accept for POC re: closing rclone Fs, |
anjor
left a comment
There was a problem hiding this comment.
All three review items addressed — nil guard, blockstore close, and mutex accepted for POC. LGTM.
remove the dead bitswap protocol and add an /ipfs/ endpoint implementing the trustless gateway spec via boxo/gateway
StorageBlockStore pools rclone handlers per storage and holds open a streaming file reader to serve sequential block reads efficiently -- DAG nodes return from the DB without storage I/O, and leaf blocks from the same file share a single held-open rclone stream
supports dag-scope=all/entity/block, path resolution, entity-bytes, format=car and format=raw. stale source files detected at read time are mapped to HTTP 409 via boxo's error status mechanism