-
Notifications
You must be signed in to change notification settings - Fork 151
feat: pod integration #3910
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
feat: pod integration #3910
Conversation
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
MartinquaXD
left a comment
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.
Sorry for the late review. 🙇
| } | ||
| }; | ||
|
|
||
| let solve_response = dto::SolveResponse::new(score.clone(), solver); |
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.
Note to myself: we need to think about an upgrade path in case we have to change the response format in the future. Likely the same way ethereum handles hardforks (pick some auction_id at which all nodes should use the new format).
| self.config | ||
| .pod | ||
| .as_ref() | ||
| .map(|pod| pod.auction_contract_address) |
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.
Isn't this equivalent?
| self.config | |
| .pod | |
| .as_ref() | |
| .map(|pod| pod.auction_contract_address) | |
| self.config.pod?.auction_contract_address |
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.
No, but I refactored to this one:
Some(self.config.pod.as_ref()?.auction_contract_address)
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.
Would be good to separate out the playground changes into a separate PR.
|
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
# Description One of the prerequisites for integrating the Pod network[[more details](#3910)] is to extract the winner selection logic into a separate crate since the following flow is expected in the future: autopilot sends an auction to all the drivers to solve -> drivers send their solutions to the pod network -> once competition deadline is reached, each driver fetches all submitted solutions from the pod network -> each driver decides whether its solutions are among winning ones. Both driver and autopilot should use the same logic, so a separate crate is introduced in this PR. # Changes The PR is huge since it mostly moves the code. In any case, I made it as a POC before trying to split it into smaller parts, since this turned out to be non-trivial. I am open to any ideas on how to do this, if ever needed. - [ ] All the winning selection logic is now extracted to a separate crate, which tries to operate with minimal required data. That is useful for the future integration into the driver. The driver crate should already contain all the required competition data previously sent from autopilot to assess the solutions. - [ ] Autopilot now uses the new create. I tried to avoid many back-and-forth type conversions, but still, autopilot requires different extended data structures. - [ ] Winning selection includes a lot of stuff, such as protocol fees computation. Probably, in the future, it will make sense to create a separate crate for protocol fees. - [ ] The ranking traits are generalized, so the winner-selection crate uses its implementation with its own types, while autopilot continues using the Participant crate. ## How to test Existing tests
Description
Integration of pod network
Changes
This PR adds pod integration allowing solver to determine auction winner in a decentrilized shadow way.
When a solver has computed a solution, it also submits it to pod network.
Asynchronously it then waits for the auction to end, fetches all the bids from pod network and compute winner selection in the same way the autopilot does.
No existing functionality was replaced/updated. This PR only integrates the pod network in shadow mode.
How to test
A second baseline was added in playground. All tracing logs related to pod have the prefix
[pod]