Skip to content

Conversation

@MartinquaXD
Copy link
Contributor

Description

When the driver receives a solution from the solver it re-simulates it to make sure it doesn't actually revert.
Additionally the driver re-simulates a solution right before submitting it to the chain (in case it turned sour while the driver waited to be crowned the winner of the auction).
Both of these checks currently happen on the latest block but that is actually more risky than necessary. Instead we can also simulate on the pending block. This effectively tells the node to simulate the transaction taking any higher priced transactions into account. If there is already a transaction in the mempool that tries to take advantage of the same arbitrage opportunity as our solution but is higher priced than our tx the solution would revert on the pending block but not on latest.
Since we error out as early as possible to prevent the case of winning an auction with a solution that is doomed to fail it makes more sense to simulate on the pending block.

Changes

Changed driver code to do simulations on the pending instead of latest block

How to test

Since this is treating a bit of an edge case and relies on actual prod traffic it would likely take quite a while running this in prod to clearly see the effects. I suggest to merge as is and re-evaluate after having this on all networks for a week.

@MartinquaXD MartinquaXD requested a review from a team as a code owner December 18, 2025 11:52
Copy link
Contributor

@m-sz m-sz left a comment

Choose a reason for hiding this comment

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

Let's try it out!

@MartinquaXD MartinquaXD added this pull request to the merge queue Dec 19, 2025
Merged via the queue into main with commit b1700aa Dec 19, 2025
19 checks passed
@MartinquaXD MartinquaXD deleted the simulate-solution-on-pending-block branch December 19, 2025 09:03
@github-actions github-actions bot locked and limited conversation to collaborators Dec 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants