feat(op-reth): make chainspec reth-codec opt-in#21178
Closed
fakedev9999 wants to merge 1 commit into
Closed
Conversation
reth-optimism-chainspec force-enabled reth-codec on reth-optimism-primitives via its dependency line, unconditionally pulling reth-zstd-compressors → zstd → zstd-sys (native C) into every consumer — even type-only ones. The chainspec crate has no Compact/zstd usage of its own. Gate reth-codec behind an opt-in feature (on by default to preserve behavior) so zkVM/type-only consumers can drop the native zstd C build with default-features = false.
Contributor
|
@claude review once |
Contributor
|
/ci authorize 7aeccf1 |
Contributor
|
@fakedev9999 Please rebase on Context: |
Contributor
|
Superceded by #21483. Thanks for your contribution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the
reth-codecfeature opt-in forreth-optimism-chainspec(on by default to preserve behavior), so type-only consumers can avoid the nativezstd-sysC build.Why
reth-optimism-chainspecforce-enablesreth-codecon itsreth-optimism-primitivesdependency:Because this is in the dependency line (not gated by a feature), it is unconditional: every consumer of
reth-optimism-chainspectransitively pullsreth-optimism-primitives/reth-codec → op-alloy-consensus/reth-codec → reth-zstd-compressors → zstd → zstd-sys(native C).reth-optimism-chainspecitself has noCompact/reth_codec/reth_zstdusage — the feature is only there for downstream convenience. The forced native zstd C build breaksstdtargets without a C cross-compiler — e.g. theriscv64im-succinct-zkvmzkVM target, wherezstd-sysfails (cc: unrecognized argument -mabi=lp64).Change
rust/op-reth/crates/chainspec/Cargo.toml:reth-codecfrom the unconditionalreth-optimism-primitivesdep features (keepserde).reth-codec = ["reth-optimism-primitives/reth-codec"].reth-codectodefault(wasdefault = ["std"]→["std", "reth-codec"]).Backward compatibility
defaultstill enablesreth-codec.default-features = falseto dropreth-codecand thereth-zstd-compressors/zstd/zstd-syschain.reth-optimism-chainspecbuilds the same with default features.Validation
Downstream (succinctlabs/rsp, SP1 zkVM
rsp-client-opELF forriscv64im-succinct-zkvm): with this applied (+default-features = falseon the chainspec edge),zstd-sys/zstd/reth-zstd-compressorsare absent from the compiled feature graph. Default (host) builds are unaffected.