1. 22 Aug, 2021 1 commit
  2. 03 Sep, 2020 1 commit
    • Paul Wolneykien's avatar
      Added `WithScoreLedger` Bitswap option (#430) · fd213932
      Paul Wolneykien authored
      * Separate decision engine ledger on two parts: score and the wantlist
      
      This is the first step to make external decision logic (tagging
      peers with score values) possible.
      
      The wantlist still resides in the original `ledger` struct while
      sent/received byte accounting and scores are extracted to the new
      `scoreledger` struct managed by the original `scoreWorker()` logic.
      The accounting is integrated into the `Engine` via `ScoreLedger`
      interface making it possible to replace the original `scoreWorker()`
      with some other logic. The interface, however, doesn't allow a
      score logic to directly touch peer tags: the logic may decide about
      score values while tagging itself is still under control of Engine.
      
      Note: with this commit it's yet not possible to replace the original
      score logic because there is no public methods for that.
      
      * Added "WithScoreLedger" Bitswap option
      
      New `WithScoreLedger(decision.ScoreLedger)` option in the `bitswap`
      package is the way to connect a custom `ScoreLedger` implementation
      to the decision engine. The `Engine` now has the corresponding
      `UseScoreLedger(ScoreLedger)` method.
      
      The `ScoreLedger` and `ScorePeerFunc` types are exposed from the
      internal `decision` package to the public one.
      
      Because its options are processed by the `Bitswap` after construction
      of its parts but before starting of the engine, the default
      `scoreLedger` initialization is moved from `newEngine()` to
      `StartWorkers()`.
      
      New `TestWithScoreLedger` test is added. The test checks for start and
      stop of the testing score ledger implementation that is specified via
      `WithScoreLedger` option.
      
      * Combine score ledger start with initialization of the score function
      
      Having a separate `Init(ScoreFunc)` method seems redundant (thx
      @dirkmc for pointing about that). As a bonus, the two-step ledger
      starting process is now enclosed in the `startScoreLedger()` function.
      
      * Let's call Stop() to stop a ScoreLedger
      
      The `Close()` method was there to stop the ledger. Let call it
      `Stop()` now.
      
      * Get return of the blank Receipt out of conditional block
      
      Explicitly form it as the final resort.
      Co-authored-by: default avatarPaul Wolneykien <manowar@altlinux.org>
      fd213932
  3. 15 Apr, 2020 1 commit
  4. 17 Mar, 2020 1 commit
  5. 30 Jan, 2020 2 commits
    • Steven Allen's avatar
      feat: move internals to an internal package · bbf65296
      Steven Allen authored
      This makes reading the docs much easier as it's clear what's "private" and
      what's not.
      
      fixes #238
      bbf65296
    • dirkmc's avatar
      feat: bitswap protocol extensions · b3a47bcf
      dirkmc authored
      This commit extends the bitswap protocol with two additional wantlist properties:
      
      * WANT_HAVE/HAVE: Instead of asking for a block, a node can specify that they
        want to know if any peers "have" the block.
      * WANT_HAVE_NOT/HAVE_NOT: Instead of waiting for a timeout, a node can explicitly
        request to be told immediately if their peers don't currently have the given
        block.
      
      Additionally, nodes now tell their peers how much data they have queued to send
      them when sending messages. This allows peers to better distribute requests,
      keeping all peers busy but not overloaded.
      
      Changes in this PR are described in: https://github.com/ipfs/go-bitswap/issues/186
      b3a47bcf
  6. 07 Sep, 2019 1 commit
    • Steven Allen's avatar
      engine: tag peers based on usefulness · 9d580a65
      Steven Allen authored
      This patch tracks two usefulness metrics: short-term usefulness and long-term
      usefulness. Short-term usefulness is sampled frequently and highly weights new
      observations. Long-term usefulness is sampled less frequently and highly weights
      on long-term trends.
      
      In practice, we do this by keeping two EWMAs. If we see an interaction within
      the sampling period, we record the score, otherwise, we record a 0. The
      short-term one has a high alpha and is sampled every shortTerm period. The
      long-term one has a low alpha and is sampled every longTermRatio*shortTerm
      period.
      
      To calculate the final score, we sum the short-term and long-term scores then
      adjust it ±25% based on our debt ratio. Peers that have historically been more
      useful to us than we are to them get the highest score.
      9d580a65
  7. 31 May, 2019 1 commit
  8. 10 May, 2019 1 commit
  9. 20 Feb, 2019 1 commit
  10. 12 Sep, 2018 1 commit
  11. 27 Jul, 2018 1 commit
  12. 16 Jul, 2018 1 commit
  13. 27 Jun, 2018 1 commit
    • Steven Allen's avatar
      gx update · b468efbc
      Steven Allen authored
      Updates:
      
      * go-kad-dht: Query performance improvements, DHT client fixes, validates
        records on *local* put.
      * go-libp2p-swarm/go-libp2p-transport: Timeout improvements.
      * go-multiaddr-net: Exposes useful Conn methods (CloseWrite, CloseRead, etc.)
      * go-log: fixes possible panic when enabling/disabling events.
      * go-multiaddr: fixes possible panic when stringifying malformed multiaddrs,
        adds support for consuming /p2p/ multiaddrs.
      
      fixes #5113
      unblocks #4895
      
      License: MIT
      Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
      b468efbc
  14. 09 Jun, 2018 1 commit
  15. 01 Jun, 2018 1 commit
  16. 30 Mar, 2018 1 commit
  17. 01 Feb, 2018 1 commit
  18. 24 Jan, 2018 1 commit
  19. 14 Dec, 2017 1 commit
  20. 02 Sep, 2017 1 commit
  21. 12 Jul, 2017 1 commit
  22. 04 Jul, 2017 1 commit
  23. 29 Jun, 2017 1 commit
  24. 01 Jun, 2017 1 commit
  25. 20 May, 2017 1 commit
  26. 20 Apr, 2017 1 commit
  27. 06 Mar, 2017 1 commit
  28. 12 Feb, 2017 1 commit
  29. 29 Nov, 2016 1 commit
  30. 16 Nov, 2016 1 commit
  31. 25 Oct, 2016 1 commit
  32. 10 Oct, 2016 1 commit
    • Jeromy's avatar
      bitswap: protocol extension to handle cids · 591491b1
      Jeromy authored
      This change adds the /ipfs/bitswap/1.1.0 protocol. The new protocol
      adds a 'payload' field to the protobuf message and deprecates the
      existing 'blocks' field. The 'payload' field is an array of pairs of cid
      prefixes and block data. The cid prefixes are used to ensure the correct
      codecs and hash functions are used to handle the block on the receiving
      end.
      
      License: MIT
      Signed-off-by: default avatarJeromy <why@ipfs.io>
      591491b1
  33. 08 Oct, 2016 1 commit
  34. 06 Oct, 2016 1 commit
  35. 10 Sep, 2016 1 commit
  36. 09 Sep, 2016 1 commit
  37. 04 Sep, 2016 1 commit
  38. 26 Aug, 2016 1 commit
  39. 05 Aug, 2016 1 commit