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(reth): bin/reth missing help msg of segment #10873

Merged
merged 5 commits into from
Sep 13, 2024

Conversation

9547
Copy link
Contributor

@9547 9547 commented Sep 13, 2024

As found in #10856 (comment)

when building reth without --workspace, the output of the binary doesn't have the help message of SEGMENT:

$ ./target/release/reth db get static-file --help | head
Gets the content of a static file segment for the given key

Usage: reth-debug-without-segment db get static-file [OPTIONS] <SEGMENT> <KEY>

Arguments:
  <SEGMENT>


  <KEY>
          The key to get content for

but when building with --workspace, ref

- run: cargo build --bin reth --workspace --features ethereum
env:
RUSTFLAGS: -D warnings
- run: ./book/cli/update.sh target/debug/reth
- name: Check book changes
run: git diff --exit-code

then it contains the segment info:

$ ./target/release/reth db get static-file --help | head
Gets the content of a static file segment for the given key

Usage: reth db get static-file [OPTIONS] <SEGMENT> <KEY>

Arguments:
  <SEGMENT>
          Possible values:
          - headers:      Static File segment responsible for the `CanonicalHeaders`, `Headers`, `HeaderTerminalDifficulties` tables
          - transactions: Static File segment responsible for the `Transactions` table
          - receipts:     Static File segment responsible for the `Receipts` table

Then found the define of StaticFileSegment has an cfg_attr

#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
/// Segment of the data that can be moved to static files.
pub enum StaticFileSegment {
.

So I think we need to implictly import the reth_static_file_types crate

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
@9547
Copy link
Contributor Author

9547 commented Sep 13, 2024

@mattsse ptal

bin/reth/Cargo.toml Outdated Show resolved Hide resolved
@onbjerg onbjerg added C-bug An unexpected or incorrect behavior A-cli Related to the reth CLI labels Sep 13, 2024
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

yeah let's move this to commands, otherwise everyone that pulls this in needs to enable it as well.

This reverts commit 21292dd.

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
This reverts commit 1251ae0.

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
@mattsse mattsse added this pull request to the merge queue Sep 13, 2024
Merged via the queue into paradigmxyz:main with commit df701a0 Sep 13, 2024
34 checks passed
@9547 9547 deleted the cmd-missing-segment branch September 14, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Related to the reth CLI C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants