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

feat: Save last validator timestsamps #166

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

deluca-mike
Copy link
Collaborator

No description provided.

@deluca-mike deluca-mike added the enhancement New feature or request label Apr 8, 2024
@deluca-mike deluca-mike self-assigned this Apr 8, 2024
@deluca-mike deluca-mike changed the title draft feat: Save last validator timestsamps Apr 8, 2024
Copy link

github-actions bot commented Apr 8, 2024

LCOV of commit beb74e0 during Forge Coverage #494

Summary coverage rate:
  lines......: 99.2% (386 of 389 lines)
  functions..: 96.0% (121 of 126 functions)
  branches...: no data found

Files changed coverage rate:
                                          |Lines       |Functions  |Branches    
  Filename                                |Rate     Num|Rate    Num|Rate     Num
  ==============================================================================
  src/MinterGateway.sol                   | 100%    235|98.4%    63|    -      0

src/MinterGateway.sol Outdated Show resolved Hide resolved
Copy link
Collaborator

@toninorair toninorair left a comment

Choose a reason for hiding this comment

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

great work, very neat

@deluca-mike deluca-mike force-pushed the feat/last-singature-timestamps branch 2 times, most recently from 64c93e8 to 0f4b3ef Compare April 9, 2024 12:51
@deluca-mike deluca-mike force-pushed the fix/malicious-validator branch 4 times, most recently from b082d2b to e8e8211 Compare April 10, 2024 15:29
@deluca-mike deluca-mike force-pushed the feat/last-singature-timestamps branch from 0f4b3ef to de022ef Compare April 10, 2024 15:31
@deluca-mike deluca-mike marked this pull request as ready for review April 10, 2024 15:35
@deluca-mike deluca-mike requested a review from toninorair April 10, 2024 15:35
src/MinterGateway.sol Show resolved Hide resolved
src/MinterGateway.sol Show resolved Hide resolved
src/MinterGateway.sol Outdated Show resolved Hide resolved
src/MinterGateway.sol Outdated Show resolved Hide resolved
@deluca-mike deluca-mike force-pushed the fix/malicious-validator branch from e8e8211 to ed60bf3 Compare April 11, 2024 01:43
@deluca-mike deluca-mike force-pushed the feat/last-singature-timestamps branch from de022ef to 8452437 Compare April 11, 2024 02:38
Copy link

github-actions bot commented Apr 11, 2024

Changes to gas cost

Generated at commit: 4b0e7e2c49733f40b44d25ac8610efe1a42f6560, compared to commit: ed60bf3d94af79574f0cb91f009bac58b086321c

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
MinterGatewayHarness frozenUntilOf
getMissedCollateralUpdateParameters
internalCollateralOf
isActiveMinter
minterFreezeTime
penalizedUntilOf
rateModel
updateCollateral
+89 ❌
+88 ❌
-44 ✅
-44 ✅
+87 ❌
-44 ✅
+67 ❌
+26,822 ❌
+13.86%
+10.23%
-5.91%
-6.24%
+6.85%
-6.02%
+5.47%
+24.21%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
MinterGatewayHarness 4,084,980 (+63,502) activateMinter
activeOwedMOf
burnM
cancelMint
collateralExpiryTimestampOf
collateralPenaltyDeadlineOf
collateralUpdateTimestampOf
deactivateMinter
freezeMinter
frozenUntilOf
getMissedCollateralUpdateParameters
getPenaltyForMissedCollateralUpdates
getPrincipalAmountRoundedUp
getUpdateCollateralDigest
inactiveOwedMOf
internalCollateralOf
isActiveMinter
isDeactivatedMinter
isFrozenMinter
isMinterApproved
isValidatorApprovedByTTG
latestIndex
maxAllowedActiveOwedMOf
mintDelay
mintM
mintNonce
mintProposalOf
mintRatio
minterFreezeTime
minterRate
penalizedUntilOf
penaltyRate
pendingCollateralRetrievalOf
principalOfActiveOwedMOf
principalOfTotalActiveOwedM
proposeMint
proposeRetrieval
rateModel
retrievalNonce
setCollateralOf
setIsActive
setIsDeactivated
setLatestIndex
setLatestProposedRetrievalTimestamp
setMintProposalOf
setPenalizedUntilOf
setPrincipalOfTotalActiveOwedM
setRawOwedMOf
setTotalInactiveOwedM
setTotalPendingRetrievalsOf
setUnfrozenTimeOf
setUpdateTimestampOf
totalActiveOwedM
totalInactiveOwedM
totalOwedM
totalPendingCollateralRetrievalOf
ttgRegistrar
ttgVault
updateCollateral
updateCollateralInterval
updateCollateralValidatorThreshold
27,741 (-22)
2,024 (-22)
25,362 (+22)
27,922 (+45)
1,744 (-22)
2,201 (-44)
647 (-22)
24,143 (+67)
27,782 (+67)
731 (+89)
941 (+88)
5,473 (+86)
1,674 (-22)
1,688 (-22)
910 (-22)
701 (-44)
661 (-44)
671 (+22)
710 (+22)
1,810 (+22)
1,747 (-22)
2,405 (-22)
3,569 (-22)
1,337 (-22)
23,836 (+66)
2,415 (-44)
961 (+22)
1,383 (-22)
1,358 (+87)
402 (+22)
687 (-44)
1,357 (+22)
817 (+22)
748 (-22)
470 (+22)
24,315 (0)
23,766 (-89)
1,291 (+67)
391 (-88)
27,129 (-22)
22,429 (0)
27,250 (+66)
26,619 (-22)
27,173 (-22)
67,337 (0)
27,211 (-22)
24,028 (-22)
24,363 (-22)
43,670 (-22)
44,237 (-22)
27,137 (-89)
27,171 (-22)
1,529 (-44)
429 (-22)
1,798 (+22)
770 (+22)
284 (-44)
329 (-44)
26,114 (-22)
1,286 (-44)
1,203 (-22)
-0.08%
-1.08%
+0.09%
+0.16%
-1.25%
-1.96%
-3.29%
+0.28%
+0.24%
+13.86%
+10.32%
+1.60%
-1.30%
-1.29%
-2.36%
-5.91%
-6.24%
+3.39%
+3.20%
+1.23%
-1.24%
-0.91%
-0.61%
-1.62%
+0.28%
-1.79%
+2.34%
-1.57%
+6.85%
+5.79%
-6.02%
+1.65%
+2.77%
-2.86%
+4.91%
0.00%
-0.37%
+5.47%
-18.37%
-0.08%
0.00%
+0.24%
-0.08%
-0.08%
0.00%
-0.08%
-0.09%
-0.09%
-0.05%
-0.05%
-0.33%
-0.08%
-2.80%
-4.88%
+1.24%
+2.94%
-13.41%
-11.80%
-0.08%
-3.31%
-1.80%
36,456 (-22)
2,694 (-22)
73,513 (+44)
31,828 (-1)
1,761 (-22)
2,220 (-44)
647 (-22)
70,496 (+67)
44,376 (+30)
731 (+89)
948 (+88)
10,289 (+86)
3,628 (-22)
1,691 (-22)
910 (-22)
701 (-44)
661 (-44)
671 (+22)
710 (+22)
4,060 (+22)
2,747 (-22)
2,405 (-22)
6,736 (+148)
1,337 (-22)
123,403 (+66)
2,415 (-44)
961 (+22)
1,383 (-22)
1,358 (+87)
402 (+22)
687 (-44)
1,357 (+22)
1,179 (+22)
933 (-22)
470 (+22)
111,284 (-13)
95,185 (-90)
1,291 (+67)
391 (-88)
27,269 (-25)
43,307 (+10)
27,250 (+66)
26,619 (-22)
32,873 (-22)
67,529 (-4)
27,211 (-22)
43,864 (-56)
44,191 (-55)
43,670 (-22)
44,261 (-22)
27,137 (-89)
44,205 (-22)
1,862 (-44)
429 (-22)
2,798 (+22)
991 (+22)
284 (-44)
329 (-44)
137,630 (+26,822)
1,286 (-44)
1,203 (-22)
-0.06%
-0.81%
+0.06%
-0.00%
-1.23%
-1.94%
-3.29%
+0.10%
+0.07%
+13.86%
+10.23%
+0.84%
-0.60%
-1.28%
-2.36%
-5.91%
-6.24%
+3.39%
+3.20%
+0.54%
-0.79%
-0.91%
+2.25%
-1.62%
+0.05%
-1.79%
+2.34%
-1.57%
+6.85%
+5.79%
-6.02%
+1.65%
+1.90%
-2.30%
+4.91%
-0.01%
-0.09%
+5.47%
-18.37%
-0.09%
+0.02%
+0.24%
-0.08%
-0.07%
-0.01%
-0.08%
-0.13%
-0.12%
-0.05%
-0.05%
-0.33%
-0.05%
-2.31%
-4.88%
+0.79%
+2.27%
-13.41%
-11.80%
+24.21%
-3.31%
-1.80%
29,965 (-22)
2,024 (-22)
74,461 (+22)
31,857 (-10)
1,744 (-22)
2,201 (-44)
647 (-22)
97,960 (+67)
45,985 (+22)
731 (+89)
948 (+88)
10,419 (+86)
3,674 (-22)
1,688 (-22)
910 (-22)
701 (-44)
661 (-44)
671 (+22)
710 (+22)
4,060 (+22)
2,747 (-22)
2,405 (-22)
5,569 (-22)
1,337 (-22)
124,911 (+66)
2,415 (-44)
961 (+22)
1,383 (-22)
1,358 (+87)
402 (+22)
687 (-44)
1,357 (+22)
1,180 (+22)
934 (-22)
470 (+22)
113,176 (0)
96,303 (-89)
1,291 (+67)
391 (-88)
27,285 (-22)
44,341 (0)
27,250 (+66)
26,619 (-22)
27,173 (-22)
67,553 (0)
27,211 (-22)
44,096 (-22)
44,401 (-40)
43,670 (-22)
44,261 (-22)
27,137 (-89)
44,271 (-22)
1,529 (-44)
429 (-22)
2,798 (+22)
992 (+22)
284 (-44)
329 (-44)
126,914 (+16,916)
1,286 (-44)
1,203 (-22)
-0.07%
-1.08%
+0.03%
-0.03%
-1.25%
-1.96%
-3.29%
+0.07%
+0.05%
+13.86%
+10.23%
+0.83%
-0.60%
-1.29%
-2.36%
-5.91%
-6.24%
+3.39%
+3.20%
+0.54%
-0.79%
-0.91%
-0.39%
-1.62%
+0.05%
-1.79%
+2.34%
-1.57%
+6.85%
+5.79%
-6.02%
+1.65%
+1.90%
-2.30%
+4.91%
0.00%
-0.09%
+5.47%
-18.37%
-0.08%
0.00%
+0.24%
-0.08%
-0.08%
0.00%
-0.08%
-0.05%
-0.09%
-0.05%
-0.05%
-0.33%
-0.05%
-2.80%
-4.88%
+0.79%
+2.27%
-13.41%
-11.80%
+15.38%
-3.31%
-1.80%
51,663 (-22)
6,024 (-22)
90,839 (+22)
31,886 (0)
6,244 (-22)
6,701 (-44)
647 (-22)
100,428 (+67)
54,535 (+22)
731 (+89)
955 (+88)
13,973 (+86)
3,674 (-22)
1,700 (-22)
910 (-22)
701 (-44)
661 (-44)
671 (+22)
710 (+22)
6,310 (+22)
3,747 (-22)
2,405 (-22)
12,069 (-22)
1,337 (-22)
190,004 (+22)
2,415 (-44)
961 (+22)
1,383 (-22)
1,358 (+87)
402 (+22)
687 (-44)
1,357 (+22)
1,180 (+22)
934 (-22)
470 (+22)
113,524 (0)
113,550 (-89)
1,291 (+67)
391 (-88)
27,477 (-22)
44,341 (0)
27,250 (+66)
26,619 (-22)
44,273 (-22)
67,709 (0)
27,211 (-22)
44,096 (-22)
44,431 (-22)
43,670 (-22)
44,285 (-22)
27,137 (-89)
44,271 (-22)
3,529 (-44)
429 (-22)
3,798 (+22)
992 (+22)
284 (-44)
329 (-44)
332,695 (+179,058)
1,286 (-44)
1,203 (-22)
-0.04%
-0.36%
+0.02%
0.00%
-0.35%
-0.65%
-3.29%
+0.07%
+0.04%
+13.86%
+10.15%
+0.62%
-0.60%
-1.28%
-2.36%
-5.91%
-6.24%
+3.39%
+3.20%
+0.35%
-0.58%
-0.91%
-0.18%
-1.62%
+0.01%
-1.79%
+2.34%
-1.57%
+6.85%
+5.79%
-6.02%
+1.65%
+1.90%
-2.30%
+4.91%
0.00%
-0.08%
+5.47%
-18.37%
-0.08%
0.00%
+0.24%
-0.08%
-0.05%
0.00%
-0.08%
-0.05%
-0.05%
-0.05%
-0.05%
-0.33%
-0.05%
-1.23%
-4.88%
+0.58%
+2.27%
-13.41%
-11.80%
+116.55%
-3.31%
-1.80%
3 (0)
2,313 (-3)
1,001 (-6)
261 (0)
261 (0)
264 (0)
520 (0)
5 (0)
6 (0)
2 (0)
2 (0)
1,552 (0)
263 (0)
3,850 (-22)
2 (0)
1 (0)
3 (0)
1 (0)
2 (0)
2 (0)
2 (0)
1 (0)
1,537 (-258)
1 (0)
526 (0)
2 (0)
768 (-2)
1 (0)
1 (0)
4 (0)
262 (0)
1 (0)
1,544 (0)
2,026 (-6)
258 (0)
261 (-2)
776 (0)
1 (0)
2 (0)
2,331 (0)
106 (+1)
1 (0)
4 (0)
3 (0)
780 (0)
7 (0)
1,808 (0)
1,814 (0)
2 (0)
2 (0)
1 (0)
2,343 (0)
6 (0)
2 (0)
2 (0)
1,545 (0)
2 (0)
1 (0)
2,594 (+3)
1 (0)
1 (0)
MinterGateway 0 (0) activateMinter
activeOwedMOf
burnM
deactivateMinter
frozenUntilOf
getPenaltyForMissedCollateralUpdates
getUpdateCollateralDigest
inactiveOwedMOf
latestIndex
mToken
maxAllowedActiveOwedMOf
mintM
principalOfActiveOwedMOf
proposeMint
totalActiveOwedM
totalInactiveOwedM
ttgRegistrar
updateCollateral
updateIndex
51,590 (-22)
707 (-22)
84,586 (-44)
128,303 (-88)
665 (-22)
5,364 (-44)
1,644 (-22)
717 (+23)
405 (-22)
349 (+65)
3,613 (+66)
143,275 (-88)
890 (-22)
96,079 (0)
1,549 (-44)
473 (-22)
328 (+44)
111,703 (-83)
69,136 (-88)
-0.04%
-3.02%
-0.05%
-0.07%
-3.20%
-0.81%
-1.32%
+3.31%
-5.15%
+22.89%
+1.86%
-0.06%
-2.41%
0.00%
-2.76%
-4.44%
+15.49%
-0.07%
-0.13%
51,590 (-22)
1,948 (-22)
122,588 (-53)
163,821 (-30)
665 (-22)
6,508 (-44)
1,644 (-22)
861 (+23)
405 (-22)
349 (+65)
3,613 (+66)
165,277 (-80)
890 (-22)
104,694 (+1)
1,549 (-44)
473 (-22)
328 (+44)
117,270 (+589)
87,279 (-76)
-0.04%
-1.12%
-0.04%
-0.02%
-3.20%
-0.67%
-1.32%
+2.74%
-5.15%
+22.89%
+1.86%
-0.05%
-2.41%
+0.00%
-2.76%
-4.44%
+15.49%
+0.50%
-0.09%
51,590 (-22)
1,980 (-22)
123,039 (-88)
163,593 (-88)
665 (-22)
7,364 (-44)
1,644 (-22)
933 (+23)
405 (-22)
349 (+65)
3,613 (+66)
165,185 (-132)
890 (-22)
113,179 (0)
1,549 (-44)
473 (-22)
328 (+44)
117,193 (-83)
92,589 (-88)
-0.04%
-1.10%
-0.07%
-0.05%
-3.20%
-0.59%
-1.32%
+2.53%
-5.15%
+22.89%
+1.86%
-0.08%
-2.41%
0.00%
-2.76%
-4.44%
+15.49%
-0.07%
-0.09%
51,590 (-22)
1,980 (-22)
150,143 (-44)
165,281 (-88)
665 (-22)
7,364 (-44)
1,656 (-22)
933 (+23)
405 (-22)
349 (+65)
3,613 (+66)
203,851 (-132)
890 (-22)
113,239 (0)
1,549 (-44)
473 (-22)
328 (+44)
177,572 (+4,959)
109,699 (-88)
-0.04%
-1.10%
-0.03%
-0.05%
-3.20%
-0.59%
-1.31%
+2.53%
-5.15%
+22.89%
+1.86%
-0.06%
-2.41%
0.00%
-2.76%
-4.44%
+15.49%
+2.87%
-0.08%
790 (0)
40 (0)
5 (0)
261 (0)
12 (0)
7 (0)
40 (0)
3 (0)
10 (0)
32 (0)
4 (0)
1,049 (0)
2 (0)
1,050 (0)
4,209 (0)
2 (0)
16 (0)
810 (0)
1,557 (0)

@deluca-mike deluca-mike force-pushed the feat/last-singature-timestamps branch from 8452437 to beb74e0 Compare April 11, 2024 10:59
@toninorair toninorair merged commit c783720 into fix/malicious-validator Apr 11, 2024
5 checks passed
@toninorair toninorair deleted the feat/last-singature-timestamps branch April 11, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants