Skip to content

Conversation

mralj
Copy link
Contributor

@mralj mralj commented Mar 15, 2025

📝 Summary

When testing #489, I noticed that when processing new orders, if one of them fails, we stop further processing.
This PR addresses this issue.

💡 Motivation and Context

The effect of the above-explained behaviour, in the worst case scenario, is that the whole slot can fail, meaning if the processing of the new order fails for the very first order, the whole slot ends up being empty, and in non-worse scenario we loose % of transactions, depending on when the processing was stopped.

When processing new order fails?

The processing of the new orders will fail only if the StateProvider was unable to provide the Nonce, i.e. the StateProvider errors.
This is edge-case, but this can happen.

I don't see any downsides with this approach, so this is why I opened PR instead of an issue. (I'm not saying hat there aren't any, just that I don't see them 🙂)

Process new simulations

Similar argument can be made for the processing new simulations, specifically for the following:

    pub fn submit_simulation_tasks_results(
        &mut self,
        results: Vec<SimulatedResult>,
    ) -> Result<(), ProviderError> {
        for result in results {
            // NOTE: we can refactor the following line to
            // let _ = self.process_simulation_task_result(result);
            self.process_simulation_task_result(result)?;
        }
        Ok(())
    }

The code above only errors in case of the nonce issues, and in that scenario we are stopping processing of all simulation tasks.
I haven't pushed this change because I wanted so se how you feel about the this, especially since simulations seem more serious than orders.


✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

continue processing orders on error
@ZanCorDX ZanCorDX merged commit 0abc8c1 into flashbots:develop Mar 17, 2025
3 of 4 checks passed
@mralj mralj deleted the mralj/continue-order-proccessing-on-err branch March 18, 2025 09:32
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