Skip to content
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

Use ipnisync with libp2phttp #1638

Merged
merged 27 commits into from
Sep 26, 2023
Merged

Use ipnisync with libp2phttp #1638

merged 27 commits into from
Sep 26, 2023

Conversation

gammazero
Copy link
Collaborator

@gammazero gammazero commented Aug 21, 2023

Overview

IPNI has a new capability to perform advertisement sync using HTTP over libp2p. This replaces the current data-transfer/graphsync based mechanism, and does not require any change in configuration.

For boost providers serving advertisements using plain HTTP, their current configurations will continue serving plain HTTP as well as HTTP over libp2p. Serving advertisements over libp2p can be disabled if needed.

Technical design

New capabilities within the ipni publisher, contained in the go-libipni/dagsync and index-provider/engine packages, serve advertisements using the boost libp2p stream host. A new protocol ID for HTTP is registered and libp2p stream host directs requests for this protocol to use the ipni publisher as a handler for incoming requests. The requests are handled as HTTP requests and the ipni publisher handles these requests the same way that it handles HTTP requests delivered by a plain HTTP server.

This allows an existing boost provider to serve the new http-based ipni protocol over libp2p without making any changes to its existing configuration, which previously used data-transfer/graphsync to publish advertisements. Since communication is done using the existing libp2p host, there is no need to make any infrastructure changes such as exposing HTTP endpoints or configuring a proxy. The same addresses that were sent in announcement messages to announce new advertisements will continue to work with the new libp2phttp ipni protocol.

UI changes required

No UI changes are needed, unless necessary to give access to new configuration options. The new configuration options are documented in the documentation update.

Implementation

The only new implementation is a dependency update and a modification to fix an existing unit test.

Testing plan

The current tests are run using the default configuration, which serves advertisements using HTTP over libp2p.

Remaining Tasks

  • Update to release versions of dependencies
  • Test in production

@gammazero gammazero marked this pull request as ready for review August 23, 2023 16:00
@gammazero gammazero marked this pull request as draft September 1, 2023 11:36
@gammazero gammazero marked this pull request as ready for review September 9, 2023 00:25
@LexLuthr
Copy link
Collaborator

@gammazero A few questions about dependencies:

  1. Do we need to upgrade the Go version? Lotus latest is still dependent on v1.19 and I would like to Boost on the same version as Lotus.
  2. Can we update Lotus dependency to point to v1.23.4-rc1 instead of master? I am not sure how reliable is Lotus master dependency.
  3. Any specific reason to bump Ubuntu to 22? I am asking as there was a thread in Slack about things not working smoothly on 22. I can follow up with the TSE team on that side to confirm if there are any known issues.
  4. We will need to upgrade the FFI based on point 2.

@gammazero
Copy link
Collaborator Author

@LexLuthr

  1. Various dependencies such as libp2p require that the go version is upgraded, at least to v1.20. I do not think it is reasonable to ask that all these dependencies downgrade their go version, so it will be necessary for boost to upgrade.
  2. Yes, [email protected] appears to be compatible. I will make that change to this PR.
  3. It needed to at least be upgraded to a more current version of Ubuntu 20 to use the current tagging in CircleCI. CircleCI has made Ubuntu 22 their "standard" linux image so that seemed like the best choice.
  4. I have upgraded the FFI in this PR (see submodule link) as was needed to work with the newer lotus.

@LexLuthr
Copy link
Collaborator

@gammazero Let me know once changes are done to downgrade Lotus dependency. After that, we can test in filcollins.

@gammazero
Copy link
Collaborator Author

@LexLuthr Is [email protected] the correct version? See commit 28644a0 above my previous comment.

@LexLuthr
Copy link
Collaborator

@gammazero Apologies! I completely missed that commit. I will start the deployment and testing on filcollins.

@LexLuthr
Copy link
Collaborator

LexLuthr commented Sep 26, 2023

I am merging this PR in a temporary branch. The reason for this approach:

  1. Allows anyone to push commits to this change
  2. Would allow me to test with multiple version of Lotus in parallel

@LexLuthr LexLuthr changed the base branch from main to ipnisync September 26, 2023 08:28
@LexLuthr LexLuthr merged commit 38d7088 into filecoin-project:ipnisync Sep 26, 2023
1 check passed
@LexLuthr LexLuthr mentioned this pull request Oct 3, 2023
3 tasks
LexLuthr added a commit that referenced this pull request Oct 3, 2023
* Use ipnisync with libp2phttp (#1638)

* Use ipnisync with libp2phttp

* Add config to fall back to legacy data-transfer sync

* Update config doc

* Need to sync entries chain

* Fix expected error text in test case

* Fix lint warning

* Update comment

* Fork mplex since libp2p no longer supports it

* gostream relocated, deps updated

* update circle CI config to use latest version of go

* update libp2p

* Do not import car/v2 from boxo

* Update index-provider config

* Update to latest index-provider

* Update lotus, filecoin-ffi submodule, and lotus API parameter

* doc gen

* Update circle-ci image versions

* Fix itest

* cbor-gen

* Update circieci lid-docker-compose image

* Fix circieci image

* update circleci docker version

* update devnet golang docker image

* Upgrade devnet docker to ubuntu 22.04

* Update go-car

* Use lotus version [email protected]

- Update ipni dependencies

* rebase and mod tidy

* add defaults, streamline go version

* Update node/config/types.go

Co-authored-by: dirkmc <[email protected]>

* update UI

* fix variable names

* remove mplex lib and mux from bitswap

* mod tidy

---------

Co-authored-by: Andrew Gillis <[email protected]>
Co-authored-by: dirkmc <[email protected]>
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.

3 participants