-
Notifications
You must be signed in to change notification settings - Fork 19
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
Split maxSettlementFee
into maxSyncFee
and maxAsyncFee
#508
Conversation
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.
Please add deployment notes to PR description, stating that all oracle parameters must be reset in the deployment. Otherwise, the first 24 bits of maxSyncFee
would be read from where maxOracleFee
was stored in v2.3.
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.
LGTM
/// @param maxSyncFee The max sync fee | ||
/// @param maxAsyncFee The max async fee | ||
/// @param callbacks The number of settlement callbacks to be made | ||
function applyFeeMaximum(PriceResponse memory self, UFixed6 maxSyncFee, UFixed6 maxAsyncFee, uint256 callbacks) internal pure { |
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.
instead of
if (self.syncFee.gt(maxSyncFee))
self.syncFee = maxSyncFee;
it's a bit cleaner to write these caps as:
self.syncFee = self.syncFee.min(maxSyncFee);
function applyFeeMaximum(PriceResponse memory self, UFixed6 maxSyncFee, UFixed6 maxAsyncFee, uint256 callbacks) internal pure { | ||
if (self.syncFee.gt(maxSyncFee)) | ||
self.syncFee = maxSyncFee; | ||
UFixed6 asyncFee = self.asyncFee.mul(UFixed6Lib.from(callbacks)); |
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.
The async fee maximum will cap the individual async fees charges (so that if we have tons of orders in a single version we're not capping the total amount charged).
So no need to multiply this by the callback amount, that won't be needed anymore.
@@ -207,8 +207,8 @@ contract KeeperOracle is IKeeperOracle, Instance { | |||
priceResponse.asyncFee = UFixed6Lib.from(factory.settlementGasOracle().cost(0), true); | |||
priceResponse.oracleFee = keeperOracleParameter.oracleFee; |
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.
actually now that applyFeeMaximum
is so simple, maybe we can just apply the .min(oracleParameter....)
directly on these above and delete the helper function altogether.
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.
Removed helper method in aac4ffe
[Periphery] Unit Test Coverage ReportCoverage after merging prateek/pe-1982-split-maxSettlementFee into v2.4 will be
Coverage Report
|
Code Size Diff:View Report
|
Gas Report Diff:View Report
|
[Core] Integration Test Coverage ReportCoverage after merging prateek/pe-1982-split-maxSettlementFee into v2.4 will be
Coverage Report
|
[Core] Unit Test Coverage ReportCoverage after merging prateek/pe-1982-split-maxSettlementFee into v2.4 will be
Coverage Report
|
[Core] Combined Test Coverage ReportCoverage after merging prateek/pe-1982-split-maxSettlementFee into v2.4 will be
Coverage Report
|
[Periphery] Integration Test Coverage ReportCoverage after merging prateek/pe-1982-split-maxSettlementFee into v2.4 will be
Coverage Report
|
[Periphery] Combined Test Coverage ReportCoverage after merging prateek/pe-1982-split-maxSettlementFee into v2.4 will be
Coverage Report
|
Issue: https://linear.app/perennial/issue/PE-1982/[feature]-split-maxsettlementfee
Migration Note: