Skip to content
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

Interactions no longer require an execution plan #237

Merged
merged 2 commits into from
May 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions crates/shared/src/http_solver/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@ impl SettledBatchAuctionModel {
pub fn has_execution_plan(&self) -> bool {
// Its a bit weird that we expect all entries to contain an execution plan. Could make
// execution plan required and assert that the vector of execution updates is non-empty
// - NOTE(nlordell): This was done as a way for the HTTP solvers to say "look, we found
// a solution but don't know how to order the AMMs to execute it". I think that we
// can, as the parent comment suggests, clean this up and just make the field required.

let amm_executions = self
.amms
.values()
.flat_map(|u| u.execution.iter().map(|e| &e.exec_plan));
let interaction_executions = self.interaction_data.iter().map(|i| &i.exec_plan);
// **Intentionally** allow interactions without execution plans.

amm_executions
.chain(interaction_executions)
self.amms
.values()
.flat_map(|u| u.execution.iter().map(|e| &e.exec_plan))
.all(|ex| ex.is_some())
}
}
Expand Down