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

Bit packing step1 #45

Closed
wants to merge 66 commits into from
Closed

Bit packing step1 #45

wants to merge 66 commits into from

Conversation

toninorair
Copy link
Collaborator

No description provided.

toninorair and others added 30 commits December 8, 2023 21:47
Co-authored-by: Michael De Luca <35537333+deluca-mike@users.noreply.github.com>
version 1 of mint, burn, indices
Co-authored-by: Michael De Luca <35537333+deluca-mike@users.noreply.github.com>
- populated interface
- ordered interfaces/functions
- `getMRateModel` -> `getMinterRateModel`
- refactored `_burn`, `_mint`, `_transfer` to optimize storage I/O based
- refactored `_burn`, `_mint`, `_transfer` to call `updateIndex` when needed
- added ability to opt out of having earning turned on
- removed "interest" wording
- better naming
- exposed `totalEarningSupply`
- added `SPOGRegistrarReader.isEarnersListIgnored` switch check
- cleaned up M Token tests and added more precise tests
- added coverage-summary
- 100% M Token coverage
- and renamed opt out functions with "earning"
Save progress, build with forge build --skip test

One more struggle

Fix tests

Save progress

Fix compilation issue and tests

Save progress

Save progress
PierrickGT and others added 25 commits December 8, 2023 21:47
Co-authored-by: toninorair <antonina.norair@gmail.com>
Co-authored-by: Michael De Luca <35537333+deluca-mike@users.noreply.github.com>
Co-authored-by: Michael De Luca <35537333+deluca-mike@users.noreply.github.com>
Co-authored-by: Michael De Luca <35537333+deluca-mike@users.noreply.github.com>
Co-authored-by: Michael De Luca <35537333+deluca-mike@users.noreply.github.com>
Co-authored-by: Michael De Luca <35537333+deluca-mike@users.noreply.github.com>
Copy link

github-actions bot commented Dec 9, 2023

Changes to gas cost

Generated at commit: 264f6f55e0c542c80c48895a9193105c9ab2fafe, compared to commit: 6f45dc01342483049795de14105368115a6391a8

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
ProtocolHarness deactivateMinter
mintM
proposeMint
proposeRetrieval
retrievalNonce
setLastCollateralUpdateIntervalOf
setMintProposalOf
-10,796 ✅
-5,983 ✅
-15,818 ✅
-20,163 ✅
-1,908 ✅
-21,766 ✅
-43,139 ✅
-20.64%
-15.80%
-30.97%
-35.62%
-74.24%
-95.05%
-38.42%
Protocol deactivateMinter
proposeMint
-15,333 ✅
-46,776 ✅
-17.63%
-37.39%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
ProtocolHarness 4,882,699 (+763,635) activeOwedMOf
burnM
cancelMint
collateralOf
collateralUpdateOf
deactivateMinter
freezeMinter
getPenaltyForMissedCollateralUpdates
inactiveOwedMOf
lastCollateralUpdateIntervalOf
mintM
mintNonce
mintProposalOf
penalizedUntilOf
pendingCollateralRetrievalOf
principalOfActiveOwedMOf
proposeMint
proposeRetrieval
retrievalNonce
setCollateralOf
setCollateralUpdateOf
setLastCollateralUpdateIntervalOf
setMintProposalOf
setPrincipalOfActiveOwedMOf
totalPendingCollateralRetrievalsOf
unfrozenTimeOf
updateCollateral
5,609 (+48)
16,622 (-1,810)
7,989 (0)
2,248 (+304)
1,029 (+98)
3,522 (0)
7,645 (+419)
5,836 (+90)
1,029 (+98)
1,000 (+48)
1,130 (+98)
2,612 (+42)
2,132 (+184)
1,052 (+98)
1,332 (+129)
957 (+48)
1,332 (+98)
2,835 (0)
662 (-1,908)
23,079 (+134)
23,084 (+184)
1,133 (-21,766)
69,136 (-43,139)
41,740 (+605)
1,009 (+98)
1,006 (+98)
3,933 (0)
+0.86%
-9.82%
0.00%
+15.64%
+10.53%
0.00%
+5.80%
+1.57%
+10.53%
+5.04%
+9.50%
+1.63%
+9.45%
+10.27%
+10.72%
+5.28%
+7.94%
0.00%
-74.24%
+0.58%
+0.80%
-95.05%
-38.42%
+1.47%
+10.76%
+10.79%
0.00%
6,680 (+48)
37,050 (-3,263)
9,294 (+103)
2,248 (+304)
1,029 (+98)
41,506 (-10,796)
21,963 (-2,886)
15,830 (-1,505)
1,029 (+98)
1,000 (+48)
31,881 (-5,983)
2,612 (+42)
2,132 (+184)
1,052 (+98)
1,332 (+129)
957 (+48)
35,265 (-15,818)
36,442 (-20,163)
662 (-1,908)
23,079 (+134)
23,084 (+184)
1,133 (-21,766)
69,136 (-43,139)
45,517 (+510)
1,009 (+98)
1,006 (+98)
66,571 (-10,001)
+0.72%
-8.09%
+1.12%
+15.64%
+10.53%
-20.64%
-11.61%
-8.68%
+10.53%
+5.04%
-15.80%
+1.63%
+9.45%
+10.27%
+10.72%
+5.28%
-30.97%
-35.62%
-74.24%
+0.58%
+0.80%
-95.05%
-38.42%
+1.13%
+10.76%
+10.79%
-13.06%
5,609 (+48)
34,683 (+803)
9,464 (+185)
2,248 (+304)
1,029 (+98)
62,566 (-16,758)
16,145 (-21,581)
18,578 (+138)
1,029 (+98)
1,000 (+48)
16,171 (+282)
2,612 (+42)
2,132 (+184)
1,052 (+98)
1,332 (+129)
957 (+48)
13,937 (-1,775)
40,224 (-33,989)
662 (-1,908)
23,079 (+134)
23,084 (+184)
1,133 (-21,766)
69,136 (-43,139)
45,740 (+505)
1,009 (+98)
1,006 (+98)
60,818 (+960)
+0.86%
+2.37%
+1.99%
+15.64%
+10.53%
-21.13%
-57.20%
+0.75%
+10.53%
+5.04%
+1.77%
+1.63%
+9.45%
+10.27%
+10.72%
+5.28%
-11.30%
-45.80%
-74.24%
+0.58%
+0.80%
-95.05%
-38.42%
+1.12%
+10.76%
+10.79%
+1.60%
11,609 (+48)
77,117 (-17,958)
10,261 (+42)
2,248 (+304)
1,029 (+98)
69,517 (-18,335)
38,045 (+319)
24,078 (-1,862)
1,029 (+98)
1,000 (+48)
78,968 (-19,388)
2,612 (+42)
2,132 (+184)
1,052 (+98)
1,332 (+129)
957 (+48)
92,778 (-46,776)
55,485 (-33,228)
662 (-1,908)
23,079 (+134)
23,084 (+184)
1,133 (-21,766)
69,136 (-43,139)
45,740 (+505)
1,009 (+98)
1,006 (+98)
135,769 (-24,616)
+0.42%
-18.89%
+0.41%
+15.64%
+10.53%
-20.87%
+0.85%
-7.18%
+10.53%
+5.04%
-19.71%
+1.63%
+9.45%
+10.27%
+10.72%
+5.28%
-33.52%
-37.46%
-74.24%
+0.58%
+0.80%
-95.05%
-38.42%
+1.12%
+10.76%
+10.79%
-15.35%
28 (0)
7 (0)
4 (0)
3 (0)
7 (0)
5 (0)
7 (0)
16 (0)
1 (0)
2 (0)
11 (0)
2 (0)
4 (0)
3 (0)
6 (0)
4 (0)
6 (0)
5 (0)
2 (0)
24 (0)
24 (0)
21 (0)
12 (0)
18 (0)
6 (0)
1 (0)
20 (0)
Protocol 4,417,656 (+633,437) activeOwedMOf
deactivateMinter
inactiveOwedMOf
mintM
proposeMint
totalActiveOwedM
updateCollateral
updateIndex
5,631 (+48)
71,639 (-15,333)
1,095 (+98)
146,224 (-14,440)
78,322 (-46,776)
5,292 (+92)
132,829 (-24,524)
66,353 (+184)
+0.86%
-17.63%
+9.83%
-8.99%
-37.39%
+1.77%
-15.59%
+0.28%
5,631 (+48)
71,639 (-15,333)
1,095 (+98)
146,224 (-14,440)
78,322 (-46,776)
5,292 (+92)
132,829 (-24,524)
68,950 (+184)
+0.86%
-17.63%
+9.83%
-8.99%
-37.39%
+1.77%
-15.59%
+0.27%
5,631 (+48)
71,639 (-15,333)
1,095 (+98)
146,224 (-14,440)
78,322 (-46,776)
5,292 (+92)
132,829 (-24,524)
68,489 (+184)
+0.86%
-17.63%
+9.83%
-8.99%
-37.39%
+1.77%
-15.59%
+0.27%
5,631 (+48)
71,639 (-15,333)
1,095 (+98)
146,224 (-14,440)
78,322 (-46,776)
5,292 (+92)
132,829 (-24,524)
72,009 (+184)
+0.86%
-17.63%
+9.83%
-8.99%
-37.39%
+1.77%
-15.59%
+0.26%
8 (0)
1 (0)
2 (0)
1 (0)
1 (0)
10 (0)
1 (0)
3 (0)
MToken 2,719,404 (0) mint
startEarning
transfer
updateIndex
23,489 (0)
51,018 (+92)
76,749 (+92)
12,416 (+74)
0.00%
+0.18%
+0.12%
+0.60%
55,833 (+46)
52,760 (+92)
76,749 (+92)
18,779 (+89)
+0.08%
+0.17%
+0.12%
+0.48%
55,833 (+46)
52,760 (+92)
76,749 (+92)
18,242 (+92)
+0.08%
+0.17%
+0.12%
+0.51%
88,178 (+92)
54,503 (+92)
76,749 (+92)
25,105 (+92)
+0.10%
+0.17%
+0.12%
+0.37%
2 (0)
2 (0)
1 (0)
6 (0)

Copy link

github-actions bot commented Dec 9, 2023

LCOV of commit 5901c31 during Forge Coverage #35

Summary coverage rate:
  lines......: 88.4% (259 of 293 lines)
  functions..: 63.6% (82 of 129 functions)
  branches...: no data found

Files changed coverage rate:
                                     |Lines       |Functions  |Branches    
  Filename                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================
  src/Protocol.sol                   |98.8%    169|74.6%    59|    -      0
  src/libs/UIntMath.sol              |66.7%      6|66.7%     3|    -      0

@toninorair toninorair closed this Dec 9, 2023
@toninorair toninorair deleted the toni/bit-packing-step1 branch December 9, 2023 04:00
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.

3 participants