Skip to content

refactor: extract RateLimitKeysLib#104

Closed
barrutko wants to merge 1 commit intodevfrom
extract-rlkl
Closed

refactor: extract RateLimitKeysLib#104
barrutko wants to merge 1 commit intodevfrom
extract-rlkl

Conversation

@barrutko
Copy link
Copy Markdown

@barrutko barrutko commented Feb 3, 2026

Rather small improvement size wise, but posting nevertheless

Before:

Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
ForeignController 21,932 23,343 2,644 25,809
MainnetController 22,856 24,981 1,720 24,171

After:

Contract Runtime Size (B) Initcode Size (B) Runtime Margin (B) Initcode Margin (B)
ForeignController 22,035 22,726 2,541 26,426
MainnetController 22,995 24,295 1,581 24,857

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 3, 2026

Coverage after merging extract-rlkl into dev will be

99.64%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
deploy
   ControllerDeploy.sol100%100%100%100%
   ForeignControllerInit.sol100%100%100%100%
   MainnetControllerInit.sol97.56%94.12%100%100%156, 92
src
   ALMProxy.sol100%100%100%100%
   ForeignController.sol96.64%84%97.73%98.22%138–139, 243, 350–351, 637, 893
   MainnetController.sol99.05%86.96%100%100%1015, 238, 504
   RateLimitHelpers.sol100%100%100%100%
   RateLimits.sol100%100%100%100%
src/libraries
   CCTPLib.sol100%100%100%100%
   CentrifugeLib.sol100%100%100%100%
   CurveLib.sol100%100%100%100%
   MerklLib.sol100%100%100%100%
   PSMLib.sol100%100%100%100%
   PendleLib.sol100%100%100%100%
   UniswapV3Lib.sol99.07%96.92%100%100%358–359
src/libraries/common
   ERC20Lib.sol100%100%100%100%
   MathLib.sol100%100%100%100%

rateLimits.setRateLimitData(controller.LIMIT_USDS_MINT(), maxAmount18, slope18);
rateLimits.setRateLimitData(controller.LIMIT_USDS_TO_USDC(), maxAmount6, slope6);
rateLimits.setRateLimitData(domainKeyBase, maxAmount6, slope6);
rateLimits.setRateLimitData(domainKeyArbitrum, maxAmount6, slope6);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

alignment

rateLimits.setRateLimitData(RateLimitHelpers.makeAssetKey(depositKey, address(usdsBase)), usdsMaxAmount, usdsSlope);
rateLimits.setRateLimitData(RateLimitHelpers.makeAssetKey(depositKey, address(susdsBase)), usdsMaxAmount, usdsSlope);
rateLimits.setRateLimitData(foreignController.LIMIT_USDC_TO_CCTP(), usdcMaxAmount, usdcSlope);
rateLimits.setRateLimitData(RateLimitKeysLib.LIMIT_USDC_TO_CCTP, usdcMaxAmount, usdcSlope);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

alignment

@barrutko
Copy link
Copy Markdown
Author

barrutko commented Feb 3, 2026

Wait, it actually decreases runtime margin. Nevermind.

@barrutko barrutko closed this Feb 3, 2026
@barrutko barrutko deleted the extract-rlkl branch February 3, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants