feat(config): ability to disable Bitswap fully or just server#10793
Closed
feat(config): ability to disable Bitswap fully or just server#10793
Conversation
Original PR: #10782 This pull request introduces changes to the Bitswap configuration and functionality, including the addition of new configuration options, modifications to the Bitswap server/client behavior, and the inclusion of new tests to verify these changes. * Added a new `BitswapConfig` struct in `config/bitswap.go` to hold Bitswap configuration options, including `Enabled` and `ServerEnabled` flags. * Updated the `Config` struct in `config/config.go` to include the new `BitswapConfig` field. * Modified the `Bitswap` function in `core/node/bitswap.go` to respect the `ServerEnabled` flag, using an empty blockstore when the server is disabled to prevent serving blocks to other peers. * Updated the `OnlineExchange` function to return a no-op exchange when Bitswap is disabled. * Added a `noopExchange` struct to handle cases where Bitswap is disabled, ensuring no blocks are served or retrieved. * Introduced a new test file `test/cli/bitswap_config_test.go` with multiple test cases to verify the behavior of Bitswap configuration, including scenarios where the server is enabled, disabled, or Bitswap is completely disabled. - Closes #10717 - Depends on ipfs/boxo#912
729e23f to
e5e7cf1
Compare
Member
|
nit: I'll be reverting the squash on the commits here or amend and add We want to keep credit for the original author from #10782 and we usually do squash only when PR is merged, keeping commits on PR in original form, that way all commit authors are credited via If that is too much work, we can also add |
Member
|
since we've switched |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.