Skip to content

Generate report from simulation#4538

Open
MartinquaXD wants to merge 1 commit into
generate-simulation-reportfrom
integrate-simulation-report-into-simulator
Open

Generate report from simulation#4538
MartinquaXD wants to merge 1 commit into
generate-simulation-reportfrom
integrate-simulation-report-into-simulator

Conversation

@MartinquaXD

Copy link
Copy Markdown
Contributor

Description

Follow up to #4537. In order to understand whether our simulation or the order is at fault we also need to know what went wrong while building the simulation. The most likely issue with our simulation will be that we fail to compute the necessary state overrides for the buy token balance.

Changes

Instead of surfacing those issues as a hard error we simply return our best effort simulation inputs together with the state override errors. This is because a simulation can theoretically still work without the override and now that we can generate a simulation report for reverting simulations we can still get some important information (setup of wrappers, pre-hooks, signature check).

How to test

Rather than adding a unit test for this this logic together with the other PRs of this stack will be covered by an e2e tests asserting that orders which trigger the specific limitations of the simulation approach can still be placed.

@MartinquaXD MartinquaXD requested a review from a team as a code owner June 19, 2026 13:18
@claude

claude Bot commented Jun 19, 2026

Copy link
Copy Markdown

Claude finished @MartinquaXD's task in 2m 27s —— View job


PR Review

  • Read PR diff and changed files
  • Analyze encoding.rs changes
  • Analyze simulation_builder.rs changes
  • Post inline comments for issues found
  • Post summary

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the simulation builder to track state overrides that failed to resolve and introduces a new simulation_report method to generate high-level simulation reports using a Geth call tracer. Specifically, build_final_state_overrides now returns both the resolved overrides and the failed requests, which are then stored in EthCallInputs. Additionally, EthCallInputs::simulate was updated to take a reference instead of consuming the struct. No critical issues were found.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@MartinquaXD MartinquaXD changed the title generate simulation report from sim builder Generate report from simulation Jun 19, 2026
Comment on lines +640 to +643
Some(value) => Either::Left(value),
None => {
tracing::debug!(?request, "failed to compute state override");
Either::Right(request)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why use Either instead of Result?

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