-
Notifications
You must be signed in to change notification settings - Fork 286
[rpc] Prestate tracing support for debug_trace{Transaction,BlockByNumber,BlockByHash}.
#2403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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_replaymodule 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
Copyand 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.
There was a problem hiding this 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( |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
db0c01d to
c657b0a
Compare
8e050b7 to
0a3580c
Compare
0a3580c to
6d7975e
Compare
This patch continues the work started in #2275.