Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/someguy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.10.0
Choose a base ref
...
head repository: ipfs/someguy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.11.0
Choose a head ref
  • 8 commits
  • 21 files changed
  • 3 contributors

Commits on Sep 22, 2025

  1. update dependencies (#122)

    gammazero authored Sep 22, 2025
    Configuration menu
    Copy the full SHA
    95b801a View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2025

  1. fix(ci): race conditions in tests (#119)

    * fix: race condition in TestFindProviders
    
    the test was incorrectly using require.Eventually on already-read results.
    also, parallelRouter doesn't deduplicate, so peers[0] can appear twice
    (once with addresses from mr1, once without from mr2). fixed by searching
    for the record with addresses before verifying filtration.
    
    * fix: deadlock in manyIter.Close()
    
    manyIter.Close() would deadlock when goroutines were blocked
    on unbuffered channel sends. fixed with synchronous drain that
    matches http streaming semantics from routing v1 spec:
    - idempotent close (safe to call multiple times)
    - drain channel to unblock senders (expected for early termination)
    - proper cleanup of child iterators
    
    also added missing defer it.Close() in tests.
    
    * fix: deadlock in cacheFallbackIter
    
    dispatchFindPeer goroutines blocked forever trying to send to
    unbuffered channel when iterator closed early.
    
    fixed with buffered channel + non-blocking sends that drop
    results if nobody is reading (acceptable for background lookups).
    also added context cancellation in Close() to stop goroutines.
    
    * fix: add missing iterator Close() calls in tests
    
    added defer it.Close() to all test iterators to prevent
    resource leaks that could cause intermittent hangs.
    
    * fix: infinite recursion in cacheFallbackIter.Next()
    
    replaced recursion with loop to avoid stack overflow.
    maintains original logic: after dispatching lookup for
    peer without addresses, continues trying source iterator
    or waiting for lookup results.
    
    also fixed deadlock when ongoingLookups reaches 0 between
    check and channel read by using periodic timeout.
    
    * refactor: simplify cacheFallbackIter.Next()
    
    - removed unnecessary handleRecord closure
    - cache ongoingLookups value to avoid race in logging
    - use defer timer.Stop() for proper cleanup
    
    * fix: resource leak and double-close issues
    
    - fix iterator leak in dispatchFindPeer by adding defer Close()
    - remove redundant goroutine in manyIter.Close() that could
      cause double-close panic. the channel is already closed by
      the goroutine in newManyIter.
    lidel authored Sep 23, 2025
    Configuration menu
    Copy the full SHA
    d67d18e View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2025

  1. update dependencies (#125)

    * update dependencies
    * update changelog
    gammazero authored Oct 31, 2025
    Configuration menu
    Copy the full SHA
    b6f0a05 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2025

  1. upgrade to boxo v0.35.2 (#126)

    * upgrade to boxo v0.35.2
    
    - upgrade to go-libp2p v0.45.0
    - upgrade to go-log/v2 v2.9.0
    gammazero authored Nov 12, 2025
    Configuration menu
    Copy the full SHA
    d89ef3d View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2025

  1. feat: autoconf support (#123)

    * Use autoconf to configure settings
    
    * autoconf bootstrap peers
    * autoconf delegated routing endpoints
    * no delegated endpoint filtering
    * add autoconftest
    * set delegated routing endpoint using environ var
    * fix autoconf disabled error message
    * git ignore .autoconf-cache
    * update README and changelog for autoconf
    * fix(autoconf): add fallback configuration
      - ensures autoconf client uses mainnet fallback config when server is unreachable or cache is empty
    * fix(autoconf): use autoconf.FallbackBootstrapPeers for fallback
      - replaces dht.GetDefaultBootstrapPeerAddrInfos with autoconf.FallbackBootstrapPeers to align with kubo's approach
    * docs: fix typo in README
    * refactor(autoconf): implement path-based routing for delegated endpoints
      - set all three endpoint types (provider, peer, IPNS) to default to 'auto'
      - expand and validate endpoint URLs per flag to support custom configurations
      - accept both base URLs (https://example.com) and full URLs with routing paths
      - strip routing paths after validation to get base URLs for HTTP client
      - validate path matches flag type, error on mismatches with helpful messages
      - update stdout to show routing paths explicitly (/routing/v1/providers)
      - add spec references to Routing V1 and IPFS Mainnet in docs
      - simplify documentation following godoc style
    
    This ensures endpoints only receive requests they support (e.g., cid.contact
    only gets provider requests, not peers or IPNS).
    
    * refactor(autoconf): deduplicate HTTP clients per base URL
    
    when the same base URL appears in multiple endpoint configs
    (provider/peer/ipns), create only ONE HTTP client instead of
    three separate clients with duplicate connection pools
    
    this was not an issue with cid.contact as it only supported /providers,
    but is necessary to future-proof if autoconf provides more routing systems
    in the future
    
    implementation:
    - client_delegated_routing.go: new file for delegated routing client logic
    - collectEndpoints: deduplicates URLs and aggregates capabilities
    - createDelegatedHTTPRouters: creates one client per unique base URL
      and registers metrics once for all delegated HTTP clients
    - combineRouters: simplified to combine routers without client creation
    - clientRouter: moved from server_routers.go to co-locate with client creation
    
    same client instance is reused across routing types when base URL matches,
    significantly reducing memory and connection overhead
    
    * chore: improve test coverage and documentation
      - add file-level godoc to autoconf.go
      - fix parameter shadowing in createAutoConfClient
      - add validation for empty strings in collectEndpoints
      - add tests for collectEndpoints deduplication logic
      - add trailing slash normalization tests
    
    * refactor: improve HTTP client creation and file organization
      - inline autoconfDisabledError (single use function)
      - add newDelegatedRoutingClient helper for consistent HTTP client creation
      - use helper in both server and CLI code to ensure consistent options
      - rename client_delegated_routing.go to server_delegated_routing.go
      - add file-level documentation explaining server-side delegated routing
    gammazero authored Nov 19, 2025
    Configuration menu
    Copy the full SHA
    ec76365 View commit details
    Browse the repository at this point in the history
  2. feat: add "getclosestpeers" support (IPIP-476) (#124)

    * Add "getclosestpeers" support.
    
    * fix: wire dht router and support bundledDHT in GetClosestPeers
    
    GetClosestPeers endpoint was returning empty results or errors:
    
    1. composableRouter.dht field was nil - the server never created a dht
       router, so GetClosestPeers always returned empty. Fixed by calling
       getCombinedRouting to create dhtRouters and passing it to the handler.
    
    2. libp2pRouter type switch didn't handle bundledDHT (the default when
       SOMEGUY_DHT=accelerated), causing "cannot call GetClosestPeers on DHT
       implementation" error. Fixed by adding bundledDHT case that delegates
       to the active DHT (fullRT or standard).
    
    3. dual.DHT case failed entirely when LAN lookup errored, even if WAN
       succeeded. Fixed to log LAN errors but continue with WAN results.
    
    * test: add GetClosestPeers endpoint tests
    
    - add 10 test cases for GET /routing/v1/dht/closest/peers/{key}
    - verify 20 peers returned with unique addresses (127.0.0.1-127.0.0.20)
    - test JSON and NDJSON response formats
    - test empty results, ErrNotFound, and invalid key handling
    - test different key formats (CID, PeerID as CID)
    - test Accept header handling (default, wildcard)
    - verify response headers (Cache-Control, Content-Type, Vary, Last-Modified)
    - add makePeerRecords helper to generate test fixtures
    
    * fix: getclosestpeers improvements from review
    
    - use cid.Parse instead of cid.Decode for consistency with other CLI commands
    - remove TODO comment in cachedRouter.GetClosestPeers
    - clarify UsageText to specify DHT-closest peers
    - add private address filtering in sanitizeRouter.GetClosestPeers
    
    * fix: add cached addrs to GetClosestPeers results
    
    add missing addrs to GetClosestPeers to ensure light clients do not
    have to do extra lookups after addrs expired in regular libp2p peerbook.
    
    - add addrQueryOriginClosestPeers constant for metrics tracking
    - make queryOrigin configurable in cacheFallbackIter
    - create applyPeerRecordCaching helper to abstract type conversions
    - update GetClosestPeers to apply caching via helper
    - add tests for cache hit and FindPeers fallback scenarios
    
    * fix: only use WAN DHT in GetClosestPeers
    
    LAN DHT contains private network peers that should not be exposed
    via public HTTP Routing API. This fix ensures only WAN DHT results
    are returned to external clients.
    
    * fix: support legacy peer IDs in getclosestpeers CLI
    
    - add parseKey() helper that accepts CIDs and legacy peer ID formats
    - change default endpoint for CLI commands to delegated-ipfs.dev
    - keep cid.contact as default for daemon mode
    
    * docs: add changelog entry for GetClosestPeers
    
    - document new /routing/v1/peers/closest/{key} endpoint (IPIP-476)
    
    * Use updated boxo branch
    
    * GetClosestPeers: align router's implementation with Kubo. Review Feedback.
    
    * Rebase
    
    * remove unused vars
    
    * remove outdated changelog entry
    
    ---------
    
    Co-authored-by: Marcin Rataj <lidel@lidel.org>
    Co-authored-by: gammazero <11790789+gammazero@users.noreply.github.com>
    3 people authored Nov 19, 2025
    Configuration menu
    Copy the full SHA
    43188dd View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2025

  1. fix: wire dht router to composableRouter and return error when DHT di…

    …sabled (#127)
    
    fixes two issues with the GetClosestPeers endpoint:
    
    1. endpoint returned HTTP 200 with empty results instead of actual DHT peers
    2. when DHT disabled, returned HTTP 200 with empty results instead of error
    
    root cause:
    during rebase of PR #124 (commit 0dad3f7) when integrating with autoconf
    refactor (PR #123 / ec76365), the dhtRouters initialization was accidentally
    omitted from server.go. the autoconf PR renamed getCombinedRouting to
    combineRouters and changed its signature, but the rebase failed to preserve
    the dhtRouters creation line that existed in commit 42bd221.
    
    changes:
    - server.go:201-208: add explicit dhtRouters creation with caching and
      sanitization, similar to original 42bd221 implementation
    - server.go:232: wire dhtRouters to composableRouter.dht field
    - server.go:338: update combineRouters signature to accept host.Host
      parameter needed for GetClosestPeers peerstore lookups
    - server_routers.go:73-77: return routing.ErrNotSupported instead of empty
      iterator when DHT is nil, resulting in HTTP 500 instead of misleading
      HTTP 200
    - server_test.go:16,20,24: update combineRouters test calls with new signature
    - server_dht_test.go:355-379: add test verifying HTTP 500 when DHT disabled
    lidel authored Nov 20, 2025
    Configuration menu
    Copy the full SHA
    72b34fb View commit details
    Browse the repository at this point in the history
  2. chore: v0.11.0 release (#128)

    - bump version to v0.11.0
    - update CHANGELOG with IPIP-476 support, autoconf, and bug fixes
    - add unreleased section for future changes
    lidel authored Nov 20, 2025
    Configuration menu
    Copy the full SHA
    bcedcb2 View commit details
    Browse the repository at this point in the history
Loading
⌂ 换网址