-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: opt-in http retrieval client #10772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @hsanjuan, yes, this looks right (small asks in the inline comments)
In terms of testing, yes, we need something, but it should be enough if we have a basic end-to-end regression test in test/cli
that attempts to ipfs cat
a CID that is provided only over HTTP.
Some pointers: it should be possible to mock (override) cid.contact
responses by setting IPFS_HTTP_ROUTERS
in env used by test to a local mock HTTP server that handles /routing/v1/providers/cid
and returns static JSON with a single provider. The provider would have multiaddr pointing at the same mock server, handling /ipfs/cid
path and returning the block bytes.
This introduces the http-retrieval capability as an experimental feature. It can be enabled in the configuration `Experimental.HTTPRetrieval.Enabled = true`. Documentation and changelog to be added later.
allows self-signed certificates in tests
makes is easier to track which specific rainbow build/release is responsible for requests. we need this, because Kubo and Rainbow may use the same boxo, but initialize client with slightly different config Ref. ipfs/kubo#10772
this spawns two http services on localhost: 1. HTTP router that returns HTTP provider when /routing/v1/providers/cid i queried 2. HTTP provider that returns a block when /ipfs/cid is queried 3. Configures Kubo to use (1) instead of cid.contact this seems to work (running test with DEBUG=true shows (1) was queried for the test CID and returned multiaddr of (2), but Kubo never requested test CID block from (2) – needs investigation
Pushed config improvements, and end-to-end test (a6db7af) suggested in #10772 (review). E2E test in
Version from a6db7af seems to partially work (running Needs further investigation. |
makes is easier to track which specific rainbow build/release is responsible for requests. we need this, because Kubo and Rainbow may use the same boxo, but initialize client with slightly different config Ref. ipfs/kubo#10772
we artificallly crippled every delegated routing endpoint because of cid.contact being limited to one endpoint
make it easy to override the hardcoded implicit HTTP routeur URL without having to set the entire custom Router.Routers and Router.Methods (http_retrieval_client_test.go still needs to be fixed in future commit)
Resolved the merge conflicts. I have been busy with other required work for version 0.35 (#10760) and haven't had enough time to finish debugging why the E2E tests are failing, but did quick ad-hoc test and the E2E seems to fail with non-localhost HTTP/2 URL as well. Writing down quick checkpoint so its easier to resume next week (or someone else can look, if spare time): Running
which is odd – delegated routing request seems to work, but no action is taken on the result (?) and |
replaces Bitswap.Enabled with Bitswap.Libp2pEnabled adds tests that confirm it is possible to disable libp2p bitswap fully and only keep http in client mode also, removes the need for passing empty blockstore in client-only mode
Turns out we had providerQueryManager not wired correctly after resolving conflicts with #10717. Refactored in fac1314. It is now possible to fully disable bitswap over libp2p (only have HTTP retrieval client) and remove Will take a look with fresh eyes tomorrow again, but likely good enough for RC1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm.
- Added docs and release notes.
- renamed
Bitswap.Enabled
toBitswap.Libp2pEnabled
- E2E tests for
HTTPRouting.Enabled
andBitswap.*
Merging, we will test this on staging and include in 0.35.0-rc1 (#10760)
This introduces the http-retrieval capability as an experimental feature.
It can be enabled in the configuration
HTTPRetrieval.Enabled = true
.Documentation and changelog to be added later.