Skip to content

refactor: use Chain type for FilBeam retriever config#573

Merged
hugomrdias merged 5 commits into
hugomrdias/paymentsfrom
refactor-filbeam-retriever
Feb 2, 2026
Merged

refactor: use Chain type for FilBeam retriever config#573
hugomrdias merged 5 commits into
hugomrdias/paymentsfrom
refactor-filbeam-retriever

Conversation

@bajtos
Copy link
Copy Markdown
Collaborator

@bajtos bajtos commented Jan 27, 2026

Replace FilecoinNetworkType with Chain from synapse-core in FilBeamRetriever, reading the retrieval domain from chain configuration instead of hardcoding network-to-domain mapping.

Refs:

Replace FilecoinNetworkType with Chain from synapse-core in
FilBeamRetriever, reading the retrieval domain from chain
configuration instead of hardcoding network-to-domain mapping.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Jan 27, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 27, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
synapse-dev 6cf8b3e Commit Preview URL

Branch Preview URL
Jan 28 2026, 04:36 PM

@bajtos bajtos moved this from 📌 Triage to 🔎 Awaiting review in FOC Jan 27, 2026
@bajtos
Copy link
Copy Markdown
Collaborator Author

bajtos commented Jan 27, 2026

@rvagg re: #570 (comment)

a better port number might be advisable because I think we include it in the default retrieval path

Would you like me to change the devnet FilBeam domain in this PR? What value do you suggest?

@bajtos
Copy link
Copy Markdown
Collaborator Author

bajtos commented Jan 27, 2026

Re-posting another relevant comment:

How do you feel about using filbeam.localhost:8080 for devnet? It won't work out of the box, but it's possible to configure your machine to make that hostname work, plus the hostname is IMO descriptive enough to make it clear what's going on when somebody tries FilBeam retrievals for devnet pieces.

@bajtos
Copy link
Copy Markdown
Collaborator Author

bajtos commented Jan 27, 2026

There is one more caveat that I realised just now: We are always using HTTPS protocol for FilBeam retrievals. That's fine for mainnet and calibration testnet, but probably too difficult to set up for local devnet 🤔

@rvagg
Copy link
Copy Markdown
Collaborator

rvagg commented Jan 28, 2026

And here's my concern about port 8080, we always wrap the FilBeam retriever an attempt it on local retrievals: pieceRetriever = new FilBeamRetriever(baseRetriever, network) so that's always going to be hitting 8080 which could contain anything and may be running something that's not going to fail-fast like we want it to which could screw up testing in surprising ways.
Hence, my preference for using a more random port number if you have to hardwire something at all. I think we have the option of leaving it undefined for devnet and then doing a skip in FilBeamRetriever when we find we don't have a defined endpoint. Then if there's ever a use in devnet where we're testing this then the onus is on the developer to supply a chain with that defined. I think that can work with this chain structure?

@rjan90 rjan90 added this to the M4.0: mainnet staged milestone Jan 28, 2026
@bajtos
Copy link
Copy Markdown
Collaborator Author

bajtos commented Jan 28, 2026

Hence, my preference for using a more random port number if you have to hardwire something at all. I think we have the option of leaving it undefined for devnet and then doing a skip in FilBeamRetriever when we find we don't have a defined endpoint. Then if there's ever a use in devnet where we're testing this then the onus is on the developer to supply a chain with that defined. I think that can work with this chain structure?

Yes, I think that's the best option! I'll also log a warning when we fall back to direct retrievals.

bajtos and others added 2 commits January 28, 2026 16:57
Set chain.filbeam to null for devnet and update all code that accesses
it to gracefully handle the missing config. When CDN retrieval is
requested but not available, log a warning with chain ID and name,
then fall back to direct retrieval via the storage provider.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos
Copy link
Copy Markdown
Collaborator Author

bajtos commented Jan 28, 2026

In 7d1438a, I reworked chain.filbeam to null for devnet, and modified code reading chain.filbeam to fall back to direct retrieval from the SP with and log a warning to the console.

This PR is ready for final review and merging as far as I am concerned.

I think that the CI failure is inherited from #569 which is the target of my PR. Fixing the CI checks in #569 is out of the scope of this pull request.

@rvagg @hugomrdias LGTY now?

Copy link
Copy Markdown
Collaborator

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, up to Hugo how it lands though cause it's on to his branch

@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Jan 30, 2026
@hugomrdias hugomrdias merged commit f182413 into hugomrdias/payments Feb 2, 2026
12 checks passed
@hugomrdias hugomrdias deleted the refactor-filbeam-retriever branch February 2, 2026 15:59
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants