Skip to content
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

Feat: New tracing/simulation RPC endpoint #13857

Open
loocapro opened this issue Jan 18, 2025 · 0 comments
Open

Feat: New tracing/simulation RPC endpoint #13857

loocapro opened this issue Jan 18, 2025 · 0 comments
Labels
C-enhancement New feature or request S-needs-triage This issue needs to be labelled

Comments

@loocapro
Copy link
Contributor

Describe the feature

We observed high response latencies on eth_simulateV1, and debug_traceCallMany lacks the same override possibilities and does not return internal log traces.

Therefore, we propose a new tracing/simulation RPC endpoint that retains the override capabilities of eth_simulateV1, is as lightweight as debug_traceCallMany, and optionally returns internal log traces.

Additional context

Something like:

#[method(name = "simulate")]
async fn simulate(
    &self,
    opts: SimulatePayload,
    block_number: Option<BlockId>,
) -> RpcResult<Vec<Vec<SimulationTrace>>>;

pub struct SimulationTrace {
    /// The address of that initiated the call.
    pub from: Address,
    /// The address of the contract that was called.
    pub to: Option<Address>,
    /// How much gas was used by the call.
    pub gas_used: U256,
    /// Calldata input.
    pub input: Bytes,
    /// Output of the call, if any.
    pub output: Option<Bytes>,
    /// Error message, if any.
    pub error: Option<String>,
    /// Why this call reverted, if it reverted.
    pub revert_reason: Option<String>,
    /// Logs emitted by this call.
    pub logs: Vec<alloy_primitives::Log>,
    /// Value transferred.
    pub value: Option<U256>,
}

The difference with debug_traceCallMany would be that it computes internal logs and just expose alloy_primitives::Log and has the possibility to override state and block_env. I'd also like the idea to make the log computation optional.

What you think @mattsse?

@loocapro loocapro added C-enhancement New feature or request S-needs-triage This issue needs to be labelled labels Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request S-needs-triage This issue needs to be labelled
Projects
Status: Todo
Development

No branches or pull requests

1 participant