Skip to content

Conversation

@zjg555543
Copy link

@zjg555543 zjg555543 commented Nov 12, 2025

Summary

This PR adds legacy RPC forwarding support for additional methods and improves block hash routing.
Support Legacy RPC List
Base on PR:#6

1. Added Legacy RPC Forwarding

Added legacy RPC forwarding support for the following methods:

  • eth_transactionPreExec - Transaction pre-execution simulation
  • eth_call - Contract call execution
  • eth_createAccessList - Access list creation (EIP-2930)
  • eth_estimateGas - Gas estimation
  • eth_getInternalTransactions - Get internal transactions by tx hash
  • eth_getBlockInternalTransactions - Get all internal transactions in a block

When querying historical data (block number < cutoff_block or block hash not found locally), these methods automatically forward requests to the configured legacy RPC endpoint.

2. Fixed Block Hash Routing

Improved should_route_block_id_to_legacy() to correctly handle block hash queries:

  • Block Number: Route to legacy if block_number < cutoff_block
  • Block Hash: Route to legacy if block hash not found in local database

match provider.block_number(block_hash) {
Some(_) => query_local(), // Found locally
None => forward_to_legacy(), // Not found, try legacy
}This ensures block hash queries work correctly across the cutoff boundary.

@zjg555543 zjg555543 changed the title Add new legacy api Add new legacy RPCs and fix block hash routing Nov 12, 2025
@zjg555543 zjg555543 marked this pull request as ready for review November 13, 2025 03:38
@louisliu2048 louisliu2048 merged commit 5dccd06 into dev Nov 14, 2025
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.

4 participants