-
Couldn't load subscription status.
- Fork 290
[rpc] Prestate and statediff tracers #2275
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
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 support for prestate and statediff tracers to the RPC layer, extending the existing call tracer functionality. The implementation introduces a new MonadTracer enum to handle different tracer types and updates the tracing infrastructure to support both prestate and statediff modes.
- Introduces
MonadTracerenum with support for NoopTracer, CallTracer, PreStateTracer, and StateDiffTracer - Updates the tracing configuration to include diff_mode and only_top_call options
- Adds CBOR decoding support for prestate and statediff tracer outputs
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| monad-ethcall/src/lib.rs | Introduces MonadTracer enum and updates eth_call function to use tracer enum instead of boolean |
| monad-rpc/src/handlers/eth/call.rs | Updates call handling to support new tracer types and adds CBOR decoding for prestate/statediff outputs |
| monad-rpc/src/handlers/eth/gas.rs | Updates gas estimation to use MonadTracer::NoopTracer instead of boolean false |
| monad-rpc/src/handlers/debug.rs | Expands TracerObject to include TracerConfig with diff_mode and only_top_call options |
| monad-rpc/Cargo.toml | Adds serde_cbor dependency for CBOR deserialization |
| Cargo.toml | Adds serde_cbor workspace dependency |
| monad-cxx/monad-execution | Updates submodule commit to support new tracer functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
5b7edaa to
e23407f
Compare
e23407f to
8c8a94c
Compare
monad-rpc/src/handlers/eth/call.rs
Outdated
| params: MonadDebugTraceCallParams, | ||
| ) -> JsonRpcResult<Option<MonadCallFrame>> { | ||
| trace!("monad_debug_traceCall: {params:?}"); | ||
| ) -> JsonRpcResult<BoxRawValue> { |
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.
Returning BoxRawValue will break rpc documentation since we use the return type to generate user-facing docs and the return type will be ambigious.
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.
I think this is fine for now since debug_traceCall might return one of many types which do not yet exist in rust. They are CBOR serialized which we deserialize into a generic "Value" (like serde_json::Value) which then gets JSON serialized and returned.
8c8a94c to
8dd7d2c
Compare
No description provided.