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(cel-shed/p2p): bootstrapper probe tool #3780

Merged
merged 11 commits into from
Oct 2, 2024

Conversation

smuu
Copy link
Member

@smuu smuu commented Sep 27, 2024

Based on @Wondertan PR: #3511

This PR introduces a new connect-bootstrappers command to the cel-shed tool. The command allows users to connect to bootstrappers of a specified network. It includes options to handle connection failures by returning errors if at least one or all bootstrappers are unreachable.

This will be used by the @celestiaorg/devops team to create alerts if no Bootstrapper is reachable.

Closes #3511

@github-actions github-actions bot added the external Issues created by non node team members label Sep 27, 2024
@smuu smuu added area:p2p kind:feat Attached to feature PRs labels Sep 27, 2024
@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 2.43902% with 80 lines in your changes missing coverage. Please review.

Project coverage is 46.46%. Comparing base (2469e7a) to head (ef7428c).
Report is 320 commits behind head on main.

Files with missing lines Patch % Lines
cmd/cel-shed/p2p.go 0.00% 78 Missing ⚠️
nodebuilder/p2p/network.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3780      +/-   ##
==========================================
+ Coverage   44.83%   46.46%   +1.62%     
==========================================
  Files         265      314      +49     
  Lines       14620    18093    +3473     
==========================================
+ Hits         6555     8407    +1852     
- Misses       7313     8669    +1356     
- Partials      752     1017     +265     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Wondertan
Wondertan previously approved these changes Sep 27, 2024
Copy link
Member

@Wondertan Wondertan left a comment

Choose a reason for hiding this comment

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

Thank you for cleaning up and improving that PR!

  • Linter seems to complain
  • Did you test new flags work as expected?

@smuu
Copy link
Member Author

smuu commented Sep 27, 2024

Thank you for cleaning up and improving that PR!

* Linter seems to complain

* Did you test new flags work as expected?

I tried the arguments manually with these scenarios.

  • All Bootstrappers are reachable
  • All Bootstrappers are not reachable
  • At least one Bootstrapper is reachable

Do you see a way to write tests for these?

Signed-off-by: Smuu <[email protected]>
cmd/cel-shed/p2p.go Outdated Show resolved Hide resolved
cmd/cel-shed/p2p.go Show resolved Hide resolved
cmd/cel-shed/p2p.go Outdated Show resolved Hide resolved
cmd/cel-shed/p2p.go Outdated Show resolved Hide resolved
@Wondertan
Copy link
Member

Do you see a way to write tests for these?

We don't write tests for cel-shed usually. In some way it's bad, but on the bright side it saves a lot of time, like in this case writing a proper test is not straightforward. Usually, manual testing is enough here and that's why I am checking.

Wondertan
Wondertan previously approved these changes Sep 30, 2024
walldiss
walldiss previously approved these changes Sep 30, 2024
auto-merge was automatically disabled October 1, 2024 07:00

Head branch was pushed to by a user without write access

@smuu smuu dismissed stale reviews from Wondertan and walldiss via f7b5d3b October 1, 2024 07:00
@smuu smuu requested review from Wondertan and walldiss October 1, 2024 07:09
@smuu
Copy link
Member Author

smuu commented Oct 1, 2024

When running this in a container I get bash: /bin/cel-shed: cannot execute binary file: Exec format error. But I can run the celestia command in the container. cel-key fails for the same reason.

Any ideas what is going on here?

bootstrapper-probe-celestia-node-0:~$ celestia

            ____      __          __  _
          / ____/__  / /__  _____/ /_(_)___ _
         / /   / _ \/ / _ \/ ___/ __/ / __  /
        / /___/  __/ /  __(__  ) /_/ / /_/ /
        \____/\___/_/\___/____/\__/_/\__,_/

Usage:
  celestia [command]

Available Commands:
  blob        Allows to interact with the Blob Service via JSON-RPC
  bridge      Manage your Bridge node
  completion  Generate the autocompletion script for the specified shell
  das         Allows to interact with the Daser via JSON-RPC
  docgen      docgen generates the openrpc documentation for all Celestia Node packages
  full        Manage your Full node
  header      Allows interaction with the Header Module via JSON-RPC
  light       Manage your Light node
  node        Allows administrating running node.
  p2p         Allows interaction with the P2P Module via JSON-RPC
  share       Allows interaction with the Share Module via JSON-RPC
  state       Allows interaction with the State Module via JSON-RPC
  version     Show information about the current binary build

Flags:
  -h, --help   help for celestia

Additional help topics:
  celestia            

Use "celestia [command] --help" for more information about a command.
bootstrapper-probe-celestia-node-0:~$ cel-shed
bash: /bin/cel-shed: cannot execute binary file: Exec format error
bootstrapper-probe-celestia-node-0:~$ cel-key
bash: /bin/cel-key: cannot execute binary file: Exec format error

Fixed due to @tty47

Wondertan
Wondertan previously approved these changes Oct 1, 2024
MSevey
MSevey previously approved these changes Oct 1, 2024
cmd/cel-shed/p2p.go Outdated Show resolved Hide resolved
@smuu smuu dismissed stale reviews from MSevey and Wondertan via 61ac49b October 2, 2024 08:25
cristaloleg
cristaloleg previously approved these changes Oct 2, 2024
Wondertan
Wondertan previously approved these changes Oct 2, 2024
@renaynay renaynay enabled auto-merge (squash) October 2, 2024 13:04
renaynay
renaynay previously approved these changes Oct 2, 2024
Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

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

utack

Dockerfile Outdated Show resolved Hide resolved
auto-merge was automatically disabled October 2, 2024 13:09

Head branch was pushed to by a user without write access

@smuu smuu dismissed stale reviews from renaynay, Wondertan, and cristaloleg via 6eeb8a9 October 2, 2024 13:09
Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

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

utack

@renaynay renaynay enabled auto-merge (squash) October 2, 2024 13:19
@renaynay renaynay merged commit d4e0fc8 into celestiaorg:main Oct 2, 2024
21 checks passed
@smuu smuu deleted the smuu/bootstrapper-connect-tool branch October 2, 2024 14:03
renaynay pushed a commit to renaynay/celestia-node that referenced this pull request Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:p2p external Issues created by non node team members kind:feat Attached to feature PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants