Conversation
…on using nil check
gammazero
added a commit
to ipfs/kubo
that referenced
this pull request
Apr 29, 2025
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
gammazero
added a commit
to ipfs/kubo
that referenced
this pull request
Apr 30, 2025
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
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.
No description provided.