Skip to content

op-reth: remove unsupported --minimal option (breaking change) - #22109

Draft
claude[bot] wants to merge 4 commits into
claude/op-reth-cli-snapshot-testfrom
claude/op-reth-remove-minimal
Draft

op-reth: remove unsupported --minimal option (breaking change)#22109
claude[bot] wants to merge 4 commits into
claude/op-reth-cli-snapshot-testfrom
claude/op-reth-remove-minimal

Conversation

@claude

@claude claude Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Requested by Josh Klopfenstein · Slack thread

Stacked on #22108 (base = claude/op-reth-cli-snapshot-test, so CI here includes the CLI surface snapshot test). Retarget to develop after #22108 merges.

Before

op-reth accepted the upstream reth flag

--minimal

which enables maximum pruning, including pruning block bodies to a fixed 10,064-block window. op-node reads the L1-info deposit transaction from historical block bodies during derivation, so a node running with it eventually fails EL sync with

l2 block is missing L1 info deposit tx

The docs told operators not to use the flag, but nothing enforced that.

After (breaking change)

op-reth now rejects the flag. A node started with it exits immediately with an error (BLOCKS placeholders shown in angle brackets in the real output):

error: --minimal is not supported by op-reth and has been removed.

It prunes block bodies to a fixed 10,064-block window, which breaks op-node derivation
(op-node reads the L1-info deposit transaction from historical block bodies).

For a pruned (non-archive) node, use the supported pruning recipe instead:
  --prune.minimum-distance BLOCKS
  --prune.receipts.distance BLOCKS
  --prune.account-history.distance BLOCKS
  --prune.storage-history.distance BLOCKS
Do NOT prune block bodies.

See https://docs.optimism.io/node-operators/guides/management/archive-node#pruning-op-reth

The flag is also hidden from all op-reth help output.

Operator impact: any node previously running with the flag will now exit at startup with the message above. Such datadirs were already in an unsupported state (bodies pruned) and need a resync to a supported configuration regardless — the hard error surfaces that instead of letting the node keep running toward a derivation failure.

How

The flag lives in upstream reth arg structs that op-reth reuses, so it cannot be removed at the type level. The in-tree cli crate instead gets a small deny-list in rust/op-reth/crates/cli/src/lib.rs: a DENIED_ARGS const of (subcommand, argument id, error message) entries, currently containing the single entry (node, minimal, MINIMAL_REMOVED_HELP). Future entries from the #21687 audit are one-line additions. The list is applied in two places:

  • Parse time: the clap command is built with denied args hidden, and after parsing, any denied arg that was passed on the command line produces the hard error above (clap still accepts hidden args, hence the post-parse check). All shared parse entrypoints route through this — parse_args, try_parse_args_from, and the new parse_with_denied_args now used by the op-reth binary — so denial is the default behavior of the shared crate, not an opt-in call sites must remember.
  • Run time backstop: CliApp::run rejects a parsed node command with the flag set. This covers binaries that construct their clap command directly instead of using the shared parse methods — specifically the vendored op-rbuilder, whose launcher parses itself but runs through CliApp::run. op-rbuilder therefore also refuses to start with the flag, though its own help output still lists it (its vendored code builds the command from CommandFactory directly and is slated for deprecation, so it was left untouched).

Unit tests cover the parse-time rejection (error kind and message), that the flag is absent from rendered node help, and that the adjacent pruning flags still parse. The CLI surface snapshot from #22108 now renders the flag with a [hidden] marker, documenting the deny decision, and the snapshot-regen note in rust/UPDATING-RETH.md tells future reth bumpers that deny-listed flags must stay rejected.

The bin crate no longer uses clap directly after switching entrypoints, so its clap dependency edge is dropped (workspace lockfile entry updated by hand; clap itself stays in the graph).

Docs

Minimal prose updates to say op-reth rejects the flag at startup instead of do-not-use: archive-node.mdx, execution-clients.mdx, network-architecture.mdx.

The generated CLI reference page docs/public-docs/node-operators/op-reth/cli/op-reth/node.mdx was deliberately left untouched: it is generated from the compiled binary help output, there is no in-repo generator that runs without building op-reth, and the page is already stale relative to the current reth pin (e.g. it shows the old --full help text mentioning MINIMUM_PRUNING_DISTANCE where the pinned source now says MINIMUM_UNWIND_SAFE_DISTANCE, and it predates several engine/rollup flags). It needs a proper regen by someone who can build the binary; when that happens the --minimal entry disappears automatically.

Refs #21687

claude and others added 4 commits July 29, 2026 16:59
--minimal configures maximum pruning, including pruning block bodies to
a fixed 10,064-block window. op-node reads the L1-info deposit
transaction from historical block bodies during derivation, so a
--minimal datadir breaks EL sync (l2 block is missing L1 info deposit
tx). The docs have long said not to use it; now the binary enforces it.

The flag lives in upstream reth arg structs that op-reth reuses, so it
cannot be removed at the type level. Instead the in-tree cli crate
grows a small deny-list (DENIED_ARGS) of (subcommand, arg id, error)
entries: denied args are hidden from all help output and rejected
after parsing with an error that points operators at the supported
pruning recipe and docs page. The shared parse entrypoints
(parse_args, try_parse_args_from, and the new parse_with_denied_args
used by the op-reth binary) all route through the deny-list, and
CliApp::run carries a backstop check so binaries that build their clap
command directly (the vendored op-rbuilder) reject --minimal at
startup too.

Nodes previously started with --minimal now exit at startup with the
guidance message; their datadirs were already unsupported and need a
resync regardless.

The CLI surface snapshot is updated to render --minimal with a
[hidden] marker, documenting the deny decision. The bin crate no
longer uses clap directly, so the dependency edge is dropped.

Refs #21687

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017oDUppqTaWNyAbxV99uMMY
Co-authored-by: Josh Klopfenstein <joshklop@oplabs.co>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
rust-docs runs rustdoc with -D warnings, which rejects public docs
linking to the private DENIED_ARGS const. Use plain code spans instead.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Josh Klopfenstein <joshklop@oplabs.co>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
… with CI

clap's mut_subcommand/mut_arg move the modified subcommand and argument to
the end of help output, which pushed the node subcommand to the bottom of
op-reth --help. Rebuild the command with the order-preserving
mut_subcommands/mut_args instead.

Replace the offline-built CLI snapshot with the CI-generated one (rust-tests
build 5392860), reordered to match the fixed command construction.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Josh Klopfenstein <joshklop@oplabs.co>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Josh Klopfenstein <joshklop@oplabs.co>
Co-authored-by: Sebastian Stammler <seb@oplabs.co>
@claude
claude Bot force-pushed the claude/op-reth-remove-minimal branch from fc20575 to b05b7b8 Compare July 30, 2026 08:59
@claude
claude Bot force-pushed the claude/op-reth-cli-snapshot-test branch from 6c7c483 to bf234d1 Compare July 30, 2026 09:00
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.

1 participant