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

Move out protocol fee into separate file #2157

Merged
merged 4 commits into from
Dec 21, 2023
Merged

Conversation

sunce86
Copy link
Contributor

@sunce86 sunce86 commented Dec 12, 2023

Description

Follow up to #2098
Implements second part of the comment: #2098 (comment)

Moves out the fee policy preparation of the auction into a separate file. This file should contain all the logic around protocol fees.

@sunce86 sunce86 requested a review from a team as a code owner December 12, 2023 16:04
crates/autopilot/src/protocol/fee.rs Outdated Show resolved Hide resolved
crates/autopilot/src/run_loop.rs Outdated Show resolved Hide resolved
crates/autopilot/src/protocol/fee.rs Outdated Show resolved Hide resolved
@sunce86 sunce86 requested a review from MartinquaXD December 15, 2023 13:56
Copy link
Contributor

@fleupold fleupold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to submit my comments yesterday.

@@ -497,6 +498,7 @@ pub fn solve_request(
time_limit: Duration,
fee_policy: arguments::FeePolicy,
) -> solve::Request {
let fee_policies = protocol::fee::fee_policies(auction, fee_policy);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this an object that is instantiated with the fee_policy config (and then passed as a dependency into the runloop instead of the fee_policy).

I assume this object will get more dependencies, such as app data look up, quote finding, etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@sunce86 sunce86 Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the next iteration we can have the fee::PolicyFactory that will contain arguments::FeePolicy and Arc<Database> and be defined on the RunLoop level, while by given Auction it creates the fee::Policies object.

crates/autopilot/src/protocol/fee.rs Outdated Show resolved Hide resolved
@sunce86 sunce86 requested a review from fleupold December 20, 2023 19:24
@sunce86
Copy link
Contributor Author

sunce86 commented Dec 21, 2023

Merging to unblock the dependent PR #2188.
All code review comments in this PR are resolved. If there are additional concerns, we can tackle them in ☝️

@sunce86 sunce86 merged commit b6510bb into main Dec 21, 2023
8 checks passed
@sunce86 sunce86 deleted the move-out-protocol-fee branch December 21, 2023 01:07
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants