Skip to content

refactor(rpc): remove transaction_pre_exec API#120

Merged
louisliu2048 merged 1 commit intomainfrom
cloud/remove-pre-exec
Jan 26, 2026
Merged

refactor(rpc): remove transaction_pre_exec API#120
louisliu2048 merged 1 commit intomainfrom
cloud/remove-pre-exec

Conversation

@googgoog
Copy link
Contributor

Summary

Remove the eth_transactionPreExec RPC API endpoint and all associated code to simplify the RPC module and reduce dependencies.

Motivation

The transaction_pre_exec API was not actively used and added significant complexity to the codebase. Removing it:

  • Reduces the codebase by over 1,000 lines
  • Removes 11 unused dependencies
  • Simplifies maintenance and testing
  • Reduces potential attack surface

Changes

Removed Files

  • crates/rpc/src/pre_exec_ext_xlayer.rs (890 lines)
    • PreExec trait and implementations
    • Call frame conversion logic
    • Transaction validation helpers
  • crates/rpc/src/pre_exec_types.rs (147 lines)
    • PreExecResult, PreExecError, PreExecInnerTx types

Modified Files

  • ✏️ crates/rpc/src/lib.rs - Remove module declarations
  • ✏️ crates/rpc/src/xlayer_ext.rs - Remove transaction_pre_exec method
  • ✏️ crates/rpc/Cargo.toml - Remove 11 unused dependencies

Removed Dependencies

  • reth-errors, reth-evm, reth-revm
  • alloy-eips, alloy-evm, alloy-rpc-types-eth, alloy-rpc-types-trace
  • op-alloy-rpc-types
  • revm, revm-inspectors, serde_json

Remaining API

The xlayer-rpc crate now only provides:

  • eth_minGasPrice - Returns minimum gas price (base fee + suggested fee)

Testing

  • ✅ All tests pass (cargo test -p xlayer-rpc)
  • ✅ No compilation warnings
  • ✅ Clean build with cargo check

Impact

  • Code reduction: -1,139 lines
  • Dependency reduction: -11 dependencies
  • Breaking change: Yes - removes the eth_transactionPreExec endpoint
    • ⚠️ Any external services calling this endpoint will need to be updated

Checklist

  • Tests pass
  • No compilation warnings
  • Dependencies cleaned up
  • Documentation updated (API removed from interface)

Copy link
Contributor

@JimmyShi22 JimmyShi22 left a comment

Choose a reason for hiding this comment

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

LGTM

@louisliu2048 louisliu2048 merged commit 0cf1787 into main Jan 26, 2026
@googgoog googgoog deleted the cloud/remove-pre-exec branch January 26, 2026 08:21
Vui-Chee added a commit that referenced this pull request Jan 30, 2026
* dev:
  fix: upgrade reth v1.10.2 version with bug fixes (#134)
  Update dependencies, use reth v1.10.2 and builder v0.3.0 (#133)
  chore: fix rust formatter (#132)
  chore: better rename, fix unused variable warning (#99) (#131)
  Fix comments (#127)
  Add trace log on tx cache hits (#126)
  replace magic error code number to INTERNAL_ERROR_CODE (#125)
  feat(legacy): remove eth_transactionPreExec (#124)
  fix tools readme (#123)
  fix(rpc): improve parameter validation in get_logs and service methods (#121)
  remove output file on error (#119)
  feat(legacy): support legacy routing for batch requests (#117)
  fix(legacy): avoid possible panic on malformed block params (#111)
  fallback to legacy if res is empty (#118)
  refactor(rpc): remove transaction_pre_exec API (#120)
  use XLayerPayloadServiceBuilder to simplify main() codes, merge to main branch (#112)
  fix(tools): check end block >= start block (#116)
  forward req to legacy on err (#110)
  fix: resolve audit issues related to flashblocks subscription (#113)
  fix(rpc): add trace_address for delegatecall and fix address format c… (#104)
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