Added
routing/http/server
: added built-in Prometheus instrumentation to http delegated/routing/v1/
endpoints, with custom buckets for response size and duration to match real world data observed at thedelegated-ipfs.dev
instance. #718 #724routing/http/server
: added configurable routing timeout (DefaultRoutingTimeout
being 30s) to prevent indefinite hangs during content/peer routing. Set custom duration viaWithRoutingTimeout
. #720routing/http/server
: exposes Prometheus metrics onprometheus.DefaultRegisterer
and a custom one can be provided viaWithPrometheusRegistry
#722gateway
:NewCacheBlockStore
andNewCarBackend
will useprometheus.DefaultRegisterer
when a custom one is not specified viaWithPrometheusRegistry
#722filestore
: added opt-inWithMMapReader
option toFileManager
to enable memory-mapped file reads #665bitswap/routing
ProviderQueryManager
does not require callingStartup
separate fromNew
. #741bitswap/routing
ProviderQueryManager does not use liftcycle context.
Changed
bitswap
,routing
,exchange
(#641):-
✨ Bitswap is no longer in charge of providing blocks to the newtork: providing functionality is now handled by a
exchange/providing.Exchange
, meant to be used withprovider.System
so that all provides follow the same rules (multiple parts of the code where handling provides) before. -
🛠
bitswap/client/internal/providerquerymanager
has been moved torouting/providerquerymanager
where it belongs. In order to keep compatibility, Bitswap now receives arouting.ContentDiscovery
parameter which implementsFindProvidersAsync(...)
and uses it to create aproviderquerymanager
with the default settings as before. Custom settings can be used by using a customproviderquerymanager
to manually wrap aContentDiscovery
object and pass that in asContentDiscovery
on initialization while settingbitswap.WithDefaultProviderQueryManager(false)
(to avoid re-wrapping it again). -
The renovated
providedQueryManager
will trigger lookups until it manages to connect toMaxProviders
. Before it would lookup at mostMaxInProcessRequests*MaxProviders
and connection failures may have limited the actual number of providers found. -
🛠 We have aligned our routing-related interfaces with the libp2p
routing
ones, including in thereprovider.System
. -
In order to obtain exactly the same behaviour as before (i.e. particularly ensuring that new blocks are still provided), what was done like:
bswapnet := network.NewFromIpfsHost(host, contentRouter) bswap := bitswap.New(p.ctx, bswapnet, blockstore) bserv = blockservice.New(blockstore, bswap)
-
becomes:
// Create network: no contentRouter anymore bswapnet := network.NewFromIpfsHost(host) // Create Bitswap: a new "discovery" parameter, usually the "contentRouter" // which does both discovery and providing. bswap := bitswap.New(p.ctx, bswapnet, discovery, blockstore) // A provider system that handles concurrent provides etc. "contentProvider" // is usually the "contentRouter" which does both discovery and providing. // "contentProvider" could be used directly without wrapping, but it is recommended // to do so to provide more efficiently. provider := provider.New(datastore, provider.Online(contentProvider) // A wrapped providing exchange using the previous exchange and the provider. exch := providing.New(bswap, provider) // Finally the blockservice bserv := blockservice.New(blockstore, exch) ...
-
The above is only necessary if content routing is needed. Otherwise:
// Create network: no contentRouter anymore bswapnet := network.NewFromIpfsHost(host) // Create Bitswap: a new "discovery" parameter set to nil (disable content discovery) bswap := bitswap.New(p.ctx, bswapnet, nil, blockstore) // Finally the blockservice bserv := blockservice.New(blockstore, exch)
-
routing/http/client
: creating delegated routing client withNew
now defaults to querying delegated routing server withDefaultProtocolFilter
(IPIP-484) #689bitswap/client
: Wait at lease one broadcast interval before resending wants to a peer. Check for peers to rebroadcast to more often than one broadcast interval.- No longer using
github.com/jbenet/goprocess
to avoid requiring in dependents. #710 pinning/remote/client
: Refactor remote pinningLs
to take results channel instead of returning one. The previousLs
behavior is implemented by the GoLs function, which creates the channels, starts the goroutine that calls Ls, and returns the channels to the caller #738- updated to go-libp2p to v0.37.2
Fixed
- Do not erroneously update the state of sent wants when a send a peer disconnected and the send did not happen. #452
Full Changelog: v0.24.3...v0.25.0
This release was brought to you by the Shipyard team.