Skip to content

feat: Add debug_traceTransaction migration support for historical backend#153

Draft
zjg555543 wants to merge 6 commits intodevfrom
zjg/legacy-debug-trace
Draft

feat: Add debug_traceTransaction migration support for historical backend#153
zjg555543 wants to merge 6 commits intodevfrom
zjg/legacy-debug-trace

Conversation

@zjg555543
Copy link

@zjg555543 zjg555543 commented Dec 9, 2025

Background

During the migration from Erigon to op-geth, the new node only stores data after the migration block, while historical data remains on the Erigon node. The debug_traceTransaction RPC method was not forwarding requests to the historical backend, causing failures when tracing transactions that occurred before the migration block.

Solution

Implemented hybrid routing for debug_traceTransaction following the LOCAL strategy pattern:

  1. Added GetBackend() method in eth/tracers/api.go to allow precise transaction existence checks
  2. Created XlayerHybridTracersAPI wrapper that:
    • Checks if a transaction exists locally using GetCanonicalTransaction
    • Handles indexing-in-progress scenarios by returning appropriate errors
    • Forwards to Erigon only when transaction is confirmed not found
    • Executes trace locally when transaction exists
  3. Extended WrapAPIsForXlayer to handle debug namespace APIs

@zjg555543 zjg555543 changed the title Zjg/legacy debug trace feat: Add debug_traceTransaction migration support for historical backend Dec 9, 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.

1 participant