-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bitswap/server: allow overriding peer ledger with WithPeerLedger #607
Conversation
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #607 +/- ##
==========================================
- Coverage 59.88% 59.69% -0.20%
==========================================
Files 238 238
Lines 29868 29883 +15
==========================================
- Hits 17887 17839 -48
- Misses 10375 10425 +50
- Partials 1606 1619 +13
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel strongly how we name it, but
- feels like we could go away with adding just one option for this
- rainbow should use explicit
noopPeerLedger
that has all methods implemented as noop. this will be less prone to breakage / bugs during refactors.
details inline
@lidel I refactored to only have one new option ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, follows what we already had for WithScoreLedger
and does not introduce anything new.
Digression on future work:
We are still figuring out what appropriate settings for rainbow are, but once we do, it will be useful for others. If we want to add a higher abstraction similar to what @aschmahmann suggested (WithRequestResponseOnly
), I feel it needs to be more generic, e.g.: WithProfile("minimal-request-response")
because it would adjust multiple settings, and work similar to Kubo profiles.
Introduces
WithPeerLedger
, which allows to override the default peer ledger with anything else you want.