Skip to content

Conversation

@dhil
Copy link
Contributor

@dhil dhil commented Sep 29, 2025

This patch continues the work started in #2275.

@dhil dhil requested a review from omegablitz as a code owner September 29, 2025 17:19
@Copilot Copilot AI review requested due to automatic review settings September 29, 2025 17:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds prestate tracing support to the Monad RPC debug methods. The implementation enables transaction replay for prestate tracers in debug_traceTransaction, debug_traceBlockByNumber, and debug_traceBlockByHash methods.

  • Adds a new debug_replay module that handles transaction replay for prestate tracing
  • Modifies existing debug trace handlers to detect when replay is needed and route to replay functionality
  • Updates parameter structs to be Copy and exposes fields as public to support the new replay system

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
monad-triedb-utils/src/triedb_env.rs Adds helper method to extract sequence number and block ID from BlockKey
monad-rpc/src/handlers/mod.rs Updates debug trace handlers to support replay routing and adds rate limiting
monad-rpc/src/handlers/eth/call.rs Makes prepare_eth_call function public for reuse in replay functionality
monad-rpc/src/handlers/debug_replay.rs New module implementing transaction replay logic for prestate tracing
monad-rpc/src/handlers/debug.rs Updates parameter structs to be Copy and exposes fields as public
monad-rpc/src/eth_json_types.rs Makes BlockTags Copy to support the new parameter requirements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@philipglazman philipglazman left a comment

Choose a reason for hiding this comment

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

Mentioned offline but its worth considering if archiver needs prestate traces.

for txn in txns {
let tx_hash = txn.tx.signature_hash();
// TODO(dhil): May skew the eth_call statistics tracker.
let raw_payload = match eth_call(
Copy link
Contributor

Choose a reason for hiding this comment

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

Will eth_call consider the case that state changes in tx0 in the block will affect tx1?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question! Probably not, as eth_call doesn't affect the state, I believe. This, I suppose this suggests we need a "batched" variant of eth_call. I will chat with execution about this. Thanks!

@dhil dhil force-pushed the dhil/debug-tracers branch from db0c01d to c657b0a Compare September 30, 2025 09:42
@dhil dhil force-pushed the dhil/debug-tracers branch 2 times, most recently from 8e050b7 to 0a3580c Compare October 20, 2025 14:22
@dhil dhil force-pushed the dhil/debug-tracers branch from 0a3580c to 6d7975e Compare October 21, 2025 15:11
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.

2 participants