Skip to content
Snippets Groups Projects
Unverified Commit a673c2ec authored by Hector Sanjuan's avatar Hector Sanjuan Committed by GitHub
Browse files

fix: Provide according to Reprovider.Strategy (#10886)

* Provide according to strategy

Updates boxo to a version with the changes from https://github.com/ipfs/boxo/pull/976

, which decentralize the providing responsibilities (from a central providing.Exchange to blockstore, pinner, mfs).

The changes consist in initializing the Pinner, MFS and the blockstore with the provider.System, which is created first.

Since the provider.System is created first, the reproviding KeyChanFunc is set
later when we can create it once we have the Pinner, MFS and the blockstore.

Some additional work applies to the Add() workflow. Normally, blocks would get provided at the Blockstore or the Pinner, but when adding blocks AND a "pinned" strategy is used, the blockstore does not provide, and the
pinner does not traverse the DAG (and thus doesn't provide either), so we need to provide directly from the Adder. This is resolved by wrapping the DAGService in a "providingDAGService" which provides every added block, when using the "pinned" strategy.

`ipfs --offline add` when the ONLINE daemon is running will now announce blocks per the chosen strategy, where before it did not announce them. This is documented in the changelog. A couple of releases ago, adding with `ipfs --offline add` was faster, but this is no longer the case so we are not incurring in any penalties by sticking to the fact that the daemon is online and has a providing strategy that we follow.

Co-authored-by: default avatargammazero <11790789+gammazero@users.noreply.github.com>
Co-authored-by: default avatarMarcin Rataj <lidel@lidel.org>
parent cfbc6484
Branches
Tags
No related merge requests found
Showing
with 438 additions and 200 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment