-
Notifications
You must be signed in to change notification settings - Fork 151
Do not preprocess COW AMMs when not configured #3925
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR optimizes the COW AMM preprocessing flow by making the COW AMM cache optional when no COW AMMs are configured. This prevents unnecessary processing and eliminates spurious warning logs on chains where COW AMMs are not expected.
- Modified
Cache::newto returnOption<Self>, returningNonewhen factory mappings are empty - Made
cow_amm_cachefield optional in preprocessing utilities - Added early return in
cow_amm_ordersmethod when cache is not configured
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/driver/src/domain/cow_amm.rs | Modified Cache::new to return Option<Self>, returning None when no factory mappings are configured |
| crates/driver/src/domain/competition/pre_processing.rs | Changed cow_amm_cache field to Option<cow_amm::Cache> and added early return logic in cow_amm_orders to handle unconfigured scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
When the driver's COW AMM config is empty, the corresponding task still tries to search for surplus capturing jit order owners among the AMMs and fires a redundant warning log in that case. When the driver doesn't expect any AMMs, this log doesn't make any sense. This PR fixes this.
Changes
How to test
Logs on chains where COW AMMs are not configured.
Related Issues
Fixes #3890