Skip to content

Conversation

@dhil
Copy link
Contributor

@dhil dhil commented Sep 3, 2025

No description provided.

Copilot AI review requested due to automatic review settings September 3, 2025 15:09
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 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 MonadTracer enum 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.

@dhil dhil force-pushed the dhil/prestate-tracer branch from 5b7edaa to e23407f Compare September 3, 2025 15:46
@andr-dev andr-dev force-pushed the dhil/prestate-tracer branch from e23407f to 8c8a94c Compare September 3, 2025 16:13
@andr-dev andr-dev enabled auto-merge September 3, 2025 16:14
params: MonadDebugTraceCallParams,
) -> JsonRpcResult<Option<MonadCallFrame>> {
trace!("monad_debug_traceCall: {params:?}");
) -> JsonRpcResult<BoxRawValue> {
Copy link
Contributor

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.

Copy link
Contributor

@andr-dev andr-dev Sep 3, 2025

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.

@andr-dev andr-dev force-pushed the dhil/prestate-tracer branch from 8c8a94c to 8dd7d2c Compare September 3, 2025 20:35
@andr-dev andr-dev added this pull request to the merge queue Sep 3, 2025
Merged via the queue into master with commit 0c8324e Sep 3, 2025
3 of 4 checks passed
@andr-dev andr-dev deleted the dhil/prestate-tracer branch September 3, 2025 21:36
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.

5 participants