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: Remove reveal roundtrip #2942

Closed
fleupold opened this issue Sep 4, 2024 · 8 comments · Fixed by #2964
Closed

chore: Remove reveal roundtrip #2942

fleupold opened this issue Sep 4, 2024 · 8 comments · Fixed by #2964
Assignees
Labels
E:6.1 One auction per block See https://github.com/cowprotocol/pm/issues/35 for details

Comments

@fleupold
Copy link
Contributor

fleupold commented Sep 4, 2024

Background

The current runloop first asks the winning solver to "reveal" their calldata before telling them to submit their transaction. The result is unused and can add additional latency on the critical path (current timeout is 10s I believe). It should be removed

Details

Reveal was originally introduced because we thought about doing some checks on the proposed solution and potentially signing it off, however as things panned out we now have no use for this information and are calling settle unconditionally after reveal. We are storing the internalised and uninternalised calldata that is returned in the database. However, since slippage accounting moved towards counting internal buffer trades as slippage we have no more use for the "uninternalised" calldata. The final calldata can also be recovered from the settled transaction, and doesn't matter in the case settlement failed.

We might want to keep reveal for the shadow competition, where we don't ask solvers to settle and thus could use this information for counterfactual analysis of the provided solution (e.g. running the circuit breaker on it to make sure a solver is not violating any rules)

Acceptance criteria

No longer call reveal in the "real" (ie non-shadow) run-loop. This change needs to be communicated with co-located solvers to make sure they don't rely on this being called.

@fleupold fleupold added the E:6.1 One auction per block See https://github.com/cowprotocol/pm/issues/35 for details label Sep 4, 2024
@fleupold
Copy link
Contributor Author

fleupold commented Sep 4, 2024

Related to #2939 which mentions that calldata is not useful anywhere at all anymore.

@m-lord-renkse m-lord-renkse self-assigned this Sep 9, 2024
@m-lord-renkse
Copy link
Contributor

@harisang I am letting you know I will start implemented this. This can potentially affect co-located solvers.

@m-lord-renkse
Copy link
Contributor

@fleupold where can I find the documentation to alter this docs: https://docs.cow.fi/cow-protocol/tutorials/arbitrate/autopilot ? after this is merge, this docs will be out of date.

@m-lord-renkse
Copy link
Contributor

@fleupold one question about this sentence

The final calldata can also be recovered from the settled transaction, and doesn't matter in the case settlement failed.

Do we need to do that in the backend in a background job, or will it be solver's team responsibility?

@fleupold
Copy link
Contributor Author

The source code for the docs is here: https://github.com/cowprotocol/docs

Do we need to do that in the backend in a background job [...]

If we want to keep the calldata on this endpoint, then yes it would have to be added in onSettlementUpdater. However, if I understand #2939 correctly, there might not be a need to expose it there either (note that the transaction hash is already part of the endpoint, so querying the calldata from a full node is trivial for any consumer).

Could you confirm this with @harisang and @fhenneke though?

@fhenneke
Copy link

fhenneke commented Sep 10, 2024

The solver team currently does not (edit: forgot that word) use call data from the competition endpoint for anything (that I know of).

@harisang
Copy link
Contributor

Yeap, as @fhenneke said above, we are fine with fully dropping calldata and not making the available at the competition endpoint.

@m-lord-renkse
Copy link
Contributor

m-lord-renkse commented Sep 10, 2024

@harisang @fhenneke in that case, the calldata will be removed from the following endpoints:

/api/v1/solver_competition/latest
/api/v1/solver_competition/by_tx_hash/{tx_hash}
/api/v1/solver_competition/{auction_id}

m-lord-renkse added a commit that referenced this issue Sep 11, 2024
# Description
Currently, we have no use for reveal and we are calling settle
unconditionally after it.

We are storing the internalised and uninternalised calldata that is
returned in the database. However, since slippage accounting moved
towards counting internal buffer trades as slippage we have no more use
for the "uninternalised" calldata. The final calldata can also be
recovered from the settled transaction, and doesn't matter in the case
settlement failed.

# Changes
- Remove `/reveal` roundtrip
- Remove internalised and uninternalised calldata from the
competition/solution objects

## How to test
1. Acceptance tests

## Related Issues
Fixes #2942
m-lord-renkse added a commit that referenced this issue Sep 11, 2024
# Description
Currently, we have no use for reveal and we are calling settle
unconditionally after it.

We are storing the internalised and uninternalised calldata that is
returned in the database. However, since slippage accounting moved
towards counting internal buffer trades as slippage we have no more use
for the "uninternalised" calldata. The final calldata can also be
recovered from the settled transaction, and doesn't matter in the case
settlement failed.

# Changes
- Remove `/reveal` roundtrip
- Remove internalised and uninternalised calldata from the
competition/solution objects

## How to test
1. Acceptance tests

## Related Issues
Fixes #2942
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E:6.1 One auction per block See https://github.com/cowprotocol/pm/issues/35 for details
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants