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

[Epic] 7.1: Ext. solvers operating driver #57

Open
2 of 6 tasks
fleupold opened this issue Apr 11, 2024 · 0 comments
Open
2 of 6 tasks

[Epic] 7.1: Ext. solvers operating driver #57

fleupold opened this issue Apr 11, 2024 · 0 comments
Assignees
Labels
epic Tracks a yearly team epic (only for cowprotocol/pm repo)

Comments

@fleupold
Copy link
Contributor

fleupold commented Apr 11, 2024

Epic label: E:7.1 Ext. solvers operating driver
Planned start date: April 15th
Due date: June 30th

Summary

We want at least 3 external solvers running their own driver on mainnet by the end of Q2. This serves as a sanity check that full decentralisation of the matching engine is achievable by the end of the year and will allow us to count on "solely colocated" L2 deployments for Q3.

Deploying on a new network without having to run driver + Gnosis solvers will drastically reduce our development and maintenance overhead.

Acceptance Criteria

Three solvers are running their own driver (and control the solutions submission as well as their submission account).

Risks

With great power comes great responsibility. As soon as solvers own their own private keys they could potentially violate some of the competition's rules. Solvers are bonded with significant stake, however in practice the bond is currently covered by CoW DAO which has some minimal KYC from the solvers it vouches for. At the same time, requiring solvers to come up with the entire bond themselves has turned out to be a large barrier for adopting the new infrastructure.

We can differentiate between attack vectors that are already possible in today's architecture and one emerging in a fully colocated world.

Existing attack vectors

  • Drain buffers
  • Set bad allowance

Given the current cadence of fee withdrawal we assume this attack vector to be around ~$200k, whereby damage is only accrued to CoW DAO (not users). Note, that other than rudimentary KYC there are no bonding requirements for the solver despite this attack vector.

New attack vectors

  • Settle even though solver didn’t win
  • Missing pre/post interactions
  • Mess up fees computation (will lead to high negative slippage)

Fee computation errors are comprised in the existing buffer attack vector. While the the financial damage of omissions of pre/post interactions is hard to assess, we can estimate the amount of surplus (limit vs. execution price) a malicious solver could extract if settling order our of competition: Assuming proper detection and prompt disconnecting of solver we estimate the potential to be ~$300k (https://dune.com/queries/3667248).

It is important to note, that this damage would affect users of the protocol is thus more severe than buffer attacks.

Risk Mitigation

In order to mitigate the risk of misbehaviour while justifying smaller bonding requirements there are two initiatives we need to push.

Circuit Breaker

The size of damage heavily depends on how fast misbehaviour is detected and the solver is disconnected. If a solver starts settling orders outside of competition for instance it could potentially capture the entire difference between limit price and fair price of all orders until stopped.

Any violation of rules (and even accrual of significant negative liabilities such as fees or negative slippage) should thus be monitored and automatically acted upon if thresholds are reached.

Autopilot Signatures

image

In order to mitigate the new attack vectors mentioned above while still giving solvers control over the submission logic and their private keys, the autopilot could provide a signature to the solver, which commits to certain key aspects of the solution (ie. the fact that this solver won, the orders that need to get included, the execution price, etc).

We could then allow-list a meta contract to call settle on CoW Protocol, which takes the exact same arguments as settle but performs two additional checks

  1. Solver is allow listed in another registry (joining which requires significantly less bond)
  2. The solution is accompanied with an autopilot signature attesting that this settlement has won the competition

While this would alleviate all new attack vectors, it would also enshrine the autopilot as a long term centralized auctioneer (whose signature is required for the protocol to operate). While this would increase decentralisation in the short term it might chase a local optimum (some decentralisation) while making the global optimum (full decentralisation also of the autopilot) harder to achieve.
A counter argument to this concern is that even in the future we may have multiple autopilots (all of which are heavily bonded) who can chose to delegate execution rights to less well bonded solvers on the premise of having a look/verifying their solutions before allowing them to settle.

Another concern about this setup is the increased gas overhead of using the intermediary contract.

Tasks

Breakdown of the work (bold items are considered launch blocking)

Solver Team:

Backend Team

Issues tracked as part of here

Smart Contracts:

Solver Adoption Status

  • PLM
    • can start working on this in June
  • Otex
  • Copium
  • Barter
  • Rizzolver
  • Dialectic
    • Want to start solving immediately
    • Waiting for them to join shadow competition
@fleupold fleupold added the epic Tracks a yearly team epic (only for cowprotocol/pm repo) label Apr 11, 2024
@fleupold fleupold added this to the Solver Driver Colocation milestone Apr 11, 2024
@fleupold fleupold self-assigned this Apr 11, 2024
@mfw78 mfw78 changed the title [Epic]: E:7.1 Ext. solvers operating driver [Epic]: 7.1 Ext. solvers operating driver Apr 12, 2024
@mfw78 mfw78 changed the title [Epic]: 7.1 Ext. solvers operating driver [Epic] 7.1 Ext. solvers operating driver Apr 12, 2024
@mfw78 mfw78 changed the title [Epic] 7.1 Ext. solvers operating driver [Epic] 7.1: Ext. solvers operating driver Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Tracks a yearly team epic (only for cowprotocol/pm repo)
Projects
None yet
Development

No branches or pull requests

1 participant