Skip to content
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

feat: require bbr by default #3774

Merged
merged 6 commits into from
Aug 22, 2024
Merged

feat: require bbr by default #3774

merged 6 commits into from
Aug 22, 2024

Conversation

evan-forbes
Copy link
Member

@evan-forbes evan-forbes commented Aug 9, 2024

Overview

This PR adds a requirement to use bbr by default. This requirement can be bypassed by using a flag. Warnings are returned when installing, and there is a makefile command that will configure the system to use bbr.

~~~ Note for Reviewers ~~~

Most of this PR is copying over the start command from the sdk. Alternatively, we could simply modify the sdk. That would not require copy past forking, but the trend has been that every change that we make to the sdk eventually gets moved here, so I figured we should just skip to doing that. This also gives us finer grained control in the future. I'm definitely not tied to this approach, and if we'd rather change our fork, then I'm happy go do that instead.

closes #3745

@evan-forbes evan-forbes added backport:v1.x PR will be backported automatically to the v1.x branch upon merging WS: Big Blonks 🔭 Improving consensus critical gossiping protocols backport:v2.x PR will be backported automatically to the v2.x branch upon merging labels Aug 9, 2024
@evan-forbes evan-forbes self-assigned this Aug 9, 2024
@evan-forbes evan-forbes requested a review from a team as a code owner August 9, 2024 20:08
@evan-forbes evan-forbes requested review from cmwaters and ninabarbakadze and removed request for a team August 9, 2024 20:08
Copy link
Contributor

coderabbitai bot commented Aug 9, 2024

Walkthrough

Walkthrough

The recent changes enhance the celestia-appd application by integrating BBR checks into the installation process, improving documentation for enabling BBR, and introducing a new command for starting the application node with extensive configuration options. These modifications streamline user setup and optimize network performance, ensuring a more robust experience when managing the application.

Changes

Files Change Summary
Makefile, README.md Added BBR checks in installation; improved documentation for enabling BBR in the Linux kernel.
cmd/celestia-appd/cmd/*.go Refactored command registration in root.go; added CLI functionality for starting the node in start.go.
scripts/single-node.sh Introduced --force-no-bbr argument for local node deployment, simplifying setup by bypassing BBR requirements.

Assessment against linked issues

Objective Addressed Explanation
By default, stop the node unless using BBR (Issue #3745) The implementation of the mechanism is unclear.
Add a flag that bypasses the above mechanism (Issue #3745)

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7892a41 and e28f3ab.

Files selected for processing (2)
  • README.md (1 hunks)
  • scripts/single-node.sh (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • README.md
  • scripts/single-node.sh

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@celestia-bot celestia-bot requested a review from a team August 9, 2024 20:08
Comment on lines +112 to +115
err := checkBBR(cmd)
if err != nil {
return err
}
Copy link
Member Author

@evan-forbes evan-forbes Aug 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

besides adding imports and not exporting a few functions that previously were, this is the only change to the copy paste forked code 🙃

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Outside diff range, codebase verification and nitpick comments (2)
cmd/celestia-appd/cmd/start.go (2)

3-4: Clarify the rationale for copying and forking code.

The note mentions that the file was copied and forked from the SDK. Ensure this decision is documented clearly, and consider the long-term maintainability.

- // NOTE: This file was copy paste forked from the sdk in order to modify the
+ // NOTE: This file was copied and forked from the SDK to modify the

55-55: Document the new flag FlagForceNoBBR.

The FlagForceNoBBR allows bypassing the BBR requirement. Ensure this is well-documented for users who might need to disable the BBR check.

+ // This flag allows users to bypass the BBR requirement if necessary.

README.md Outdated Show resolved Hide resolved
cmd/celestia-appd/cmd/start.go Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
rootulp
rootulp previously approved these changes Aug 10, 2024
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will need a corresponding PR to https://github.com/celestiaorg/docs to instruct users to enable BBR or provide the --force-no-bbr flag.

This is a breaking change with respect to how user's interact with the binary. It's fine to include in v3.x but we should consider whether we want to backport to v1.x or v2.x.

scripts/single-node.sh Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
)
}

// checkBBR checks is bbr is configured to be used as a congestion control algo.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// checkBBR checks is bbr is configured to be used as a congestion control algo.
// checkBBR checks if BBR is configured to be used as a congestion control algorithm.

// The BBR congestion control algorithm does not appear to be enabled in this
// system's kernel. This is important for the p2p stack to be performant.
//
// to enable bbr call:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// to enable bbr call:
// To enable BBR call:

Co-authored-by: Rootul P <rootulp@gmail.com>
@cmwaters
Copy link
Contributor

I think this should just be in V3. We could do a patch release for v2 but it will require extra communication to tell node operators of the change and hopefully v3 will shortly be out

Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck

FYI: I think a lot of the start/stop cli logic will get refactored when we use the new upgrade tooling that Rootul is working on

@celestia-bot celestia-bot requested review from a team and staheri14 and removed request for a team August 14, 2024 15:44
@evan-forbes evan-forbes removed backport:v1.x PR will be backported automatically to the v1.x branch upon merging backport:v2.x PR will be backported automatically to the v2.x branch upon merging labels Aug 14, 2024
@rootulp rootulp mentioned this pull request Aug 22, 2024
@cmwaters cmwaters merged commit b948c08 into main Aug 22, 2024
32 checks passed
@cmwaters cmwaters deleted the evan/default-to-bbr branch August 22, 2024 16:45
cmwaters pushed a commit that referenced this pull request Aug 22, 2024
This PR adds a requirement to use bbr by default. This requirement can
be bypassed by using a flag. Warnings are returned when installing, and
there is a makefile command that will configure the system to use bbr.

Most of this PR is copying over the start command from the sdk.
Alternatively, we could simply modify the sdk. That would not require
copy past forking, but the trend has been that every change that we make
to the sdk eventually gets moved here, so I figured we should just skip
to doing that. This also gives us finer grained control in the future.
I'm definitely not tied to this approach, and if we'd rather change our
fork, then I'm happy go do that instead.

closes #3745

---------

Co-authored-by: Rootul P <rootulp@gmail.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
rootulp added a commit to rootulp/celestia-app that referenced this pull request Sep 9, 2024
rootulp added a commit to rootulp/celestia-app that referenced this pull request Sep 9, 2024
@@ -102,7 +102,8 @@ startCelestiaApp() {
--api.enable \
--grpc.enable \
--grpc-web.enable \
--v2-upgrade-height 3
--v2-upgrade-height 3 \
--force-no-bbr // no need to require BBR usage on a local node
Copy link

@qezz qezz Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's not a valid bash syntax the actual behavior is not what's expected here

I assume it was meant to be a comment, so, # for comments

// figure out how to enable bbr for your system.
//
// While this node will get worse performance using something other than bbr,
// If you need to bypass this block use the "--force-no-bbr true" flag.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depending on the parser, --x true can give different results, i.e. it will probably be parsed as --x and true as a positional argument

if you want to keep explicit value for it, then it should be --force-no-bbr=true, if it's supported by the args parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WS: Big Blonks 🔭 Improving consensus critical gossiping protocols
Projects
None yet
Development

Successfully merging this pull request may close these issues.

By default, stop the node unless using bbr
4 participants