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

chore: Move settlement merging to solvers crate #1971

Closed
sunce86 opened this issue Oct 15, 2023 · 3 comments
Closed

chore: Move settlement merging to solvers crate #1971

sunce86 opened this issue Oct 15, 2023 · 3 comments
Labels
E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details

Comments

@sunce86
Copy link
Contributor

sunce86 commented Oct 15, 2023

Background

Currently settlement merging is done in the driver crate. We should consider moving the merging to solvers crate.

Leftover from #1893

@sunce86 sunce86 added the E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details label Oct 16, 2023
@fleupold
Copy link
Contributor

@sunce86 could you give a bit more context on why it's desirable to move the merging logic into the solver crate (why was it put in the driver crate initially and what did we learn since that makes us revisit this choice)? This is not obvious to me from the linked issue.

@sunce86
Copy link
Contributor Author

sunce86 commented Dec 18, 2023

Based on the linked issue, it's just a matter of what is whose responsibility. So, if RiskCalculator is part of the solvers, than the merging also needs to be done in solvers so that the success probability is accurately calculated for the merged settlements also. Right now, merged score for merged settlements is just an approximation of what it should be: https://github.com/cowprotocol/services/blob/main/crates/shared/src/http_solver/model.rs#L251-L254

Driver shouldn't do merging. It should just do the encoding, simulations and scoring. It should not generate additional solutions that the solvers is not even aware of.

IMO we can exclude this from the Colocation feature, because the merging was done on SettlementEncoder in the old driver also (so it's not strictly tied to colocation). It should probably be part of the new initiative where we simplify and port the SettlementEncoder into driver::domain.

Copy link

This issue has been marked as stale because it has been inactive a while. Please update this issue or it will be automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:3.1 Driver Colocation See https://github.com/cowprotocol/pm/issues/14 for details
Projects
None yet
Development

No branches or pull requests

2 participants