Skip to content

chore: remove revm/portable from default feature set#159

Merged
Fraser999 merged 1 commit into
mainfrom
fraser/disable-revm-portable
May 25, 2026
Merged

chore: remove revm/portable from default feature set#159
Fraser999 merged 1 commit into
mainfrom
fraser/disable-revm-portable

Conversation

@Fraser999
Copy link
Copy Markdown
Contributor

@Fraser999 Fraser999 commented May 22, 2026

[Claude Code]

Summary

Remove revm/portable from trevm's default features. Bump to 0.34.3.

The portable feature only affects blst and c-kzg: it forces blst's BLS12-381 Fp arithmetic onto a generic code path instead of the hand-tuned ADX/BMI2 assembly. It does not affect secp256k1 (ecrecover), and on aarch64 it is a no-op entirely (__BLST_PORTABLE__ is only read by the x86_64 branch of blst's assembly.S).

In return for keeping portable on by default, trevm-using binaries paid:

  • Slower BLS12-381 (EIP-2537) and KZG point eval (EIP-4844) precompiles on the rollup EVM. Rarely-called in practice, so small impact.
  • More importantly, slower KZG commitment + EIP-7594 cell-proof generation in any blob-submitting binary. Because Cargo unifies features per (crate, version), enabling revm/c-kzg + revm/blst + revm/portable in trevm's defaults also forced c-kzg/portable + blst/portable onto the same c-kzg/blst linked via alloy for blob sidecar building. This is a hot per-block path in builders.

The portable feature is still available as an opt-in for anyone deploying to pre-Broadwell x86 CPUs without ADX/MULX:

trevm = { version = "0.34.3", features = ["portable"] }

Also fixes pre-existing breakage of the --lib --bins --no-default-features build, which CI surfaced but the --all-targets pre-push hook masked (dev-deps re-enable test-utils, which transitively pulls tracing in via the default estimate_gas feature):

  • Made tracing a non-optional dep. src/inspectors/spanning.rs, src/test_utils.rs, and the exported discard_if! macro all assume tracing is in scope unconditionally; gating it behind estimate_gas was the wrong shape. Dropped dep:tracing from the estimate_gas feature accordingly.
  • Feature-gated imports in evm/need_tx.rs, evm/ready.rs, evm/transacted.rs, evm/has_tx.rs, and fill/fillers.rs that were only consumed inside #[cfg(feature = "call")] / #[cfg(feature = "estimate_gas")] blocks.

Migration

Anyone who was implicitly relying on portable mode (rare - it's a fallback for old CPUs) needs to add features = ["portable"] to their trevm dependency. Modern x86_64 (Broadwell+/Ryzen+) and all aarch64 builds are unaffected by the default switch.

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Fraser999 Fraser999 changed the title remove revm/portable from default feature set chore: remove revm/portable from default feature set May 22, 2026
@Fraser999 Fraser999 force-pushed the fraser/disable-revm-portable branch from 2f4c7f7 to 2f9a693 Compare May 22, 2026 15:13
@Fraser999 Fraser999 marked this pull request as ready for review May 22, 2026 16:16
Copy link
Copy Markdown
Member

@prestwich prestwich left a comment

Choose a reason for hiding this comment

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

yeah this makes sense to me

@Fraser999 Fraser999 merged commit c220551 into main May 25, 2026
8 checks passed
@Fraser999 Fraser999 deleted the fraser/disable-revm-portable branch May 25, 2026 11:23
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.

3 participants