Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 📝 Summary This PR introduces a new building algorithm which parallelizes the process of building blocks. In particular, it moves the largely sequential process of processing orders, resolving conflicts, and building blocks into modular and parallel process. Each of these components now runs in parallel, allowing for continuous intake of orderflow, flexible resolution of conflicts, and building blocks with the latest flow and best conflict resolution results. It is a significant architecture change. See [run_parallel_builder](https://github.com/flashbots/rbuilder/blob/parallel-builder/crates/rbuilder/src/building/builders/parallel_builder/mod.rs#L180) for a good code entry point and the [readme.md](https://github.com/flashbots/rbuilder/blob/parallel-builder/crates/rbuilder/src/building/builders/parallel_builder/readme.md) for more architecture details. Key Changes: - Introduced a new parallel_builder module, replacing the merging_builder. This adds several components for orderflow intake, conflict identification, conflict resolution, and merging of resolved conflicts. - Added a simulation cache to optimize repeated simulations of similar order sequences. - Updated the builder configuration to use the new Parallel Builder instead of the Merging Builder. - Implemented backtest functionality for the Parallel Builder. ## 💡 Motivation and Context - Concurrency driven efficiency improvements: running significant processes in parallel is more efficient, and should lead to better blocks. Processes aren't sequential, so they aren't blocked on each other anymore. - Reuses previous work: Instead of repeating conflict resolution, we are able to reuse old resolved conflict results. - Better conflict management: We can prioritize "fast" conflict resolution tasks to get results for a conflict group to the building assembler fast, but then also queue "slow" tasks (like evolutionary algorithms) which might produce better results but are slower. ## Testing Finally, I've added a range of tests to the new algorithm. I further have tested it extensively on a local node using mempool txs. - --- ## ✅ I have completed the following steps: * [✅ ] Run `make lint` * [✅ ] Run `make test` * [ ✅] Added tests (if applicable)
- Loading branch information