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

fix: show bbr error message on celestia-appd start #3851

Merged
merged 4 commits into from
Sep 11, 2024

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Sep 9, 2024

Closes #3845

Before

$ celestia-appd start
Error: exit status 1

After

$ celestia-appd start

The BBR (Bottleneck Bandwidth and Round-trip propagation time) congestion control algorithm is not enabled in this system's kernel.
BBR is important for the performance of the p2p stack.

To enable BBR:
sudo modprobe tcp_bbr
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
sudo sysctl -p

Then verify BBR is enabled:
sysctl net.ipv4.tcp_congestion_control

This node will get worse p2p performance using a different congestion control algorithm.
If you need to bypass this check use the --force-no-bbr flag.
Error: failed to execute 'sysctl net.ipv4.tcp_congestion_control' exit status 1

@rootulp rootulp self-assigned this Sep 9, 2024
@rootulp rootulp marked this pull request as ready for review September 9, 2024 11:54
@rootulp rootulp requested a review from a team as a code owner September 9, 2024 11:54
@rootulp rootulp requested review from cmwaters and rach-id and removed request for a team September 9, 2024 11:54
Copy link
Contributor

coderabbitai bot commented Sep 9, 2024

Walkthrough

Walkthrough

The pull request introduces changes to the Makefile, README.md, and several scripts and command files to simplify the installation process of the celestia-appd binary. It removes specific targets related to BBR (Bottleneck Bandwidth and Round-trip propagation time) configuration and updates command handling in the application. These modifications aim to streamline the build and installation process while also altering user guidance in the documentation.

Changes

File Change Summary
Makefile Simplified install target; removed check-bbr and enable-bbr targets.
README.md Removed instructions for enabling BBR in the "Usage" section.
cmd/celestia-appd/cmd/root.go Replaced addCommands with server.AddCommands in initRootCommand function.
scripts/single-node.sh Removed --force-no-bbr option from the startup command for the Celestia application.
cmd/celestia-appd/cmd/start.go Improved error handling and comments in the checkBBR function.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CelestiaApp
    participant Server

    User->>CelestiaApp: Start application
    CelestiaApp->>Server: Initialize commands
    Server-->>CelestiaApp: Commands ready
    CelestiaApp-->>User: Application started
Loading

Assessment against linked issues

Objective Addressed Explanation
Identify why main can't start (Issue #3845) The PR does not address the startup issue directly.
Fix the startup issue (Issue #3845) The PR does not provide a fix for the identified problem.
Add a unit test to prevent future breaks (Issue #3845) No unit tests were added in this PR.

Possibly related issues

Tip

Announcements
  • The review status is no longer posted as a separate comment when there are no actionable or nitpick comments. In such cases, the review status is included in the walkthrough comment.
  • We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord.
  • Possibly related PRs: Walkthrough comment now includes a list of potentially related PRs to help you recall past context. Please share any feedback in the discussion post on our Discord.
  • Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs in the walkthrough comment. You can also provide custom labeling instructions in the UI or configuration file.
  • Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7385ba1 and 6b5676d.

Files selected for processing (1)
  • cmd/celestia-appd/cmd/start.go (3 hunks)
Additional comments not posted (1)
cmd/celestia-appd/cmd/start.go (1)

Line range hint 568-609: LGTM! The checkBBR function changes are approved.

The changes to the checkBBR function significantly improve the user experience by providing clear instructions on how to enable BBR and what to do if BBR is not enabled. The error handling has been improved to provide more context when the sysctl command fails or when BBR is not enabled.

The function also uses the --force-no-bbr flag to bypass the BBR check, which is useful for systems that don't support BBR.

To verify that the --force-no-bbr flag bypasses the BBR check, run the following script:

Verification successful

The --force-no-bbr flag is correctly implemented to bypass the BBR check.

The FlagForceNoBBR is defined and used appropriately in the codebase. It is added as a boolean flag to the command and is checked in the checkBBR function to bypass the BBR check when set. This confirms that the flag functions as intended.

  • cmd/celestia-appd/cmd/start.go:54: Definition of FlagForceNoBBR.
  • cmd/celestia-appd/cmd/start.go:160: Addition of the flag to the command.
  • cmd/celestia-appd/cmd/start.go:589: Usage of the flag in the checkBBR function.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the `--force-no-bbr` flag bypasses the BBR check.

# Test case 1: Run the command without the `--force-no-bbr` flag. 
# Expect: The command should fail with an error message indicating that BBR is not enabled.
go run ./cmd/celestia-appd start

# Test case 2: Run the command with the `--force-no-bbr` flag.
# Expect: The command should succeed without any error messages.
go run ./cmd/celestia-appd start --force-no-bbr

Length of output: 225


Script:

#!/bin/bash
# Search for the definition and usage of `FlagForceNoBBR` in the codebase.
ast-grep --lang go --pattern 'FlagForceNoBBR'

Length of output: 328


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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@rootulp rootulp requested review from evan-forbes and ninabarbakadze and removed request for rach-id September 9, 2024 11:54
evan-forbes
evan-forbes previously approved these changes Sep 9, 2024
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

do we know why this is breaking start? if its a small issue, would it just be easier to fix that instead of revert, then re-introduce this code?

@rootulp
Copy link
Collaborator Author

rootulp commented Sep 9, 2024

idk yet

@rootulp
Copy link
Collaborator Author

rootulp commented Sep 9, 2024

I know now

$ celestia-appd start
Error: error while invoking 'sysctl net.ipv4.tcp_congestion_control' exit status 1

we should propagate this error and ideally give users an indication that they should run with the flag to skip BBR check.

@rootulp rootulp marked this pull request as draft September 9, 2024 13:41
@rootulp rootulp changed the title revert: require bbr by default (#3774) fix: show bbr error message on celestia-appd start Sep 9, 2024
@rootulp rootulp marked this pull request as ready for review September 9, 2024 13:45
@rootulp rootulp enabled auto-merge (squash) September 9, 2024 13:46
staheri14
staheri14 previously approved these changes Sep 9, 2024
evan-forbes
evan-forbes previously approved these changes Sep 9, 2024
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

👍

@rootulp
Copy link
Collaborator Author

rootulp commented Sep 10, 2024

I want to fix golangci-lint before merging this.

@rootulp rootulp marked this pull request as draft September 10, 2024 09:34
auto-merge was automatically disabled September 10, 2024 09:34

Pull request was converted to draft

@rootulp rootulp merged commit 226ad61 into celestiaorg:main Sep 11, 2024
34 checks passed
@rootulp rootulp deleted the rp/fix-celestia-appd-start branch September 11, 2024 07:41
@coderabbitai coderabbitai bot mentioned this pull request Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

celestia-appd start is broken on main
5 participants