1. 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
  2. 19 Aug, 2020 1 commit
  3. 10 Jun, 2020 10 commits
  4. 08 Jun, 2020 1 commit
  5. 03 Jun, 2020 7 commits
  6. 02 Jun, 2020 1 commit
    • dirkmc's avatar
      Total wants gauge (#402) · 88373cd4
      dirkmc authored
      * feat: total wants gauge
      
      * fix: in gauges count wants regardless of which peers they're sent to
      
      * fix: want block gauge calculation
      
      * refactor: simplify peermanagerwants
      88373cd4
  7. 21 May, 2020 2 commits
  8. 20 May, 2020 1 commit
  9. 19 May, 2020 2 commits
  10. 07 May, 2020 2 commits
  11. 04 May, 2020 1 commit
  12. 02 May, 2020 4 commits
  13. 01 May, 2020 3 commits
  14. 30 Apr, 2020 3 commits
  15. 29 Apr, 2020 1 commit