Skip to content

Conversation

@riccardo-ssvlabs
Copy link
Contributor

Changes Requested by @MatheusFranco99 on 07/05/2025.

If the slash functions emits the ObligationUpdated event before the StrategySlashed event, then it will the slashable balance too soon.

@riccardo-ssvlabs riccardo-ssvlabs self-assigned this May 12, 2025
@riccardo-ssvlabs riccardo-ssvlabs changed the base branch from main to develop May 12, 2025 08:18
@github-actions
Copy link

Changes to gas cost

Generated at commit: 730981c38dde5369aed0073fe76739bdcf6ab372, compared to commit: 235ab56fa233069edfe524d4b6936e42cfba6f3e

🧾 Summary (10% most significant diffs)

Contract Method Avg (+/-) %
StrategyManager createObligation
createStrategy
finalizeUpdateObligation
proposeWithdrawal
-4,994 ✅
+27,393 ❌
-2,970 ✅
+4,029 ❌
-16.85%
+78.43%
-22.84%
+14.70%
SSVBasedApps createObligation
createStrategy
finalizeUpdateObligation
updateFeeTimelockPeriod
-4,972 ✅
+27,415 ❌
-2,969 ✅
+1,946 ❌
-14.06%
+67.47%
-15.95%
+23.06%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
StrategyManager 3,076,832 (-130,642) createObligation
createStrategy
depositERC20
depositETH
finalizeFeeUpdate
finalizeUpdateObligation
finalizeWithdrawal
finalizeWithdrawalETH
optInToBApp
proposeFeeUpdate
proposeUpdateObligation
proposeWithdrawal
proposeWithdrawalETH
removeDelegatedBalance
slash
updateDelegatedBalance
withdrawSlashingFund
3,282 (0)
656 (0)
821 (0)
721 (0)
2,988 (-22)
3,176 (0)
3,065 (-226)
2,920 (-270)
3,760 (0)
3,047 (0)
3,283 (0)
2,772 (+2,223)
2,651 (+2,218)
2,825 (-22)
3,427 (+2,261)
572 (+45)
745 (0)
0.00%
0.00%
0.00%
0.00%
-0.73%
0.00%
-6.87%
-8.46%
0.00%
0.00%
0.00%
+404.92%
+512.24%
-0.77%
+193.91%
+8.54%
0.00%
24,639 (-4,994)
62,321 (+27,393)
99,167 (-91)
73,472 (+76)
10,190 (-17)
10,032 (-2,970)
33,009 (+2,189)
20,776 (+1,322)
64,927 (-9,694)
15,357 (+4)
24,455 (-602)
31,441 (+4,029)
52,262 (+779)
9,349 (-22)
51,953 (+2,199)
6,457 (+44)
11,764 (+1,903)
-16.85%
+78.43%
-0.09%
+0.10%
-0.17%
-22.84%
+7.10%
+6.80%
-12.99%
+0.03%
-2.40%
+14.70%
+1.51%
-0.23%
+4.42%
+0.69%
+19.30%
32,759 (0)
75,123 (+44,461)
116,988 (-6)
76,881 (-6)
7,560 (-16)
7,852 (+6)
14,711 (+2,323)
7,971 (+2,279)
65,016 (-5,372)
5,556 (+6)
32,824 (0)
14,093 (+4,643)
60,538 (+2,273)
12,612 (-22)
51,769 (+2,470)
4,182 (+45)
788 (0)
0.00%
+145.00%
-0.01%
-0.01%
-0.21%
+0.08%
+18.75%
+40.04%
-7.63%
+0.11%
0.00%
+49.13%
+3.90%
-0.17%
+5.01%
+1.09%
0.00%
33,246 (-22,563)
92,223 (+44,461)
116,988 (-6)
76,881 (-6)
15,834 (-16)
18,493 (-23,211)
61,977 (+2,323)
45,965 (+2,279)
103,023 (-45,148)
29,496 (+6)
32,824 (0)
60,702 (+2,273)
60,538 (+2,273)
12,612 (-22)
79,862 (+1,904)
13,391 (+44)
47,821 (0)
-40.43%
+93.09%
-0.01%
-0.01%
-0.10%
-55.66%
+3.89%
+5.22%
-30.47%
+0.02%
0.00%
+3.89%
+3.90%
-0.17%
+2.44%
+0.33%
0.00%
231 (-15)
2,929 (+28)
299 (+13)
128 (+3)
39 (0)
192 (-27)
28 (+6)
59 (+3)
2,232 (+19)
87 (0)
348 (-27)
60 (+9)
89 (+6)
3 (0)
107 (+7)
6 (0)
7 (-2)
SSVBasedApps 2,708,189 (+199,606) bAppTokens
createObligation
createStrategy
depositERC20
depositETH
feeExpireTime
feeTimelockPeriod
feeUpdateRequests
finalizeFeeUpdate
finalizeUpdateObligation
finalizeWithdrawal
finalizeWithdrawalETH
getModuleAddress
getSlashableBalance
getVersion
initialize
maxFeeIncrement
maxPercentage
maxShares
obligationExpireTime
obligationRequests
obligationTimelockPeriod
obligations
optInToBApp
proposeFeeUpdate
proposeUpdateObligation
proposeWithdrawal
proposeWithdrawalETH
registerBApp
registeredBApps
removeDelegatedBalance
slash
strategyGeneration
strategyTotalShares
totalDelegatedPercentage
updateAccountMetadataURI
updateBAppMetadataURI
updateDelegatedBalance
updateFeeExpireTime
updateFeeTimelockPeriod
updateMaxFeeIncrement
updateMaxShares
updateModule
updateObligationExpireTime
updateObligationTimelockPeriod
updateWithdrawalExpireTime
updateWithdrawalTimelockPeriod
upgradeToAndCall
withdrawSlashingFund
withdrawalExpireTime
withdrawalTimelockPeriod
3,138 (+131)
9,039 (+22)
6,384 (+22)
6,411 (0)
6,159 (+22)
2,567 (+6)
2,579 (+6)
2,850 (+44)
8,457 (-22)
8,799 (0)
8,610 (-226)
8,405 (-226)
2,822 (+23)
5,554 (-22)
505 (+44)
3,183 (-676)
2,547 (+28)
280 (-44)
2,536 (-6)
2,546 (-37)
3,182 (+23)
2,547 (+6)
3,176 (-45)
10,112 (+22)
8,623 (0)
9,019 (+23)
8,339 (+2,223)
8,158 (+2,240)
9,399 (+22)
2,803 (-21)
8,316 (-22)
9,424 (+2,296)
2,955 (-22)
2,952 (-22)
2,761 (-65)
8,231 (+22)
8,367 (+27)
6,111 (+23)
2,678 (+23)
2,699 (+22)
2,654 (0)
2,631 (+44)
3,039 (-21)
2,678 (+22)
2,654 (-23)
2,678 (+22)
2,698 (0)
3,249 (-41)
6,236 (0)
2,545 (+6)
2,588 (+6)
+4.36%
+0.24%
+0.35%
0.00%
+0.36%
+0.23%
+0.23%
+1.57%
-0.26%
0.00%
-2.56%
-2.62%
+0.82%
-0.39%
+9.54%
-17.52%
+1.11%
-13.58%
-0.24%
-1.43%
+0.73%
+0.24%
-1.40%
+0.22%
0.00%
+0.26%
+36.35%
+37.85%
+0.23%
-0.74%
-0.26%
+32.21%
-0.74%
-0.74%
-2.30%
+0.27%
+0.32%
+0.38%
+0.87%
+0.82%
0.00%
+1.70%
-0.69%
+0.83%
-0.86%
+0.83%
0.00%
-1.25%
0.00%
+0.24%
+0.23%
3,138 (+131)
30,388 (-4,972)
68,048 (+27,415)
104,753 (-91)
78,906 (+98)
2,567 (+6)
2,579 (+6)
2,850 (+44)
15,652 (-17)
15,649 (-2,969)
38,552 (+2,189)
26,260 (+1,367)
2,822 (+23)
5,554 (-22)
505 (+44)
169,138 (+5,194)
2,547 (+28)
280 (-44)
2,536 (-6)
2,546 (-37)
3,182 (+23)
2,547 (+6)
3,176 (-45)
71,270 (-9,672)
20,932 (+3)
30,182 (-580)
37,006 (+4,029)
57,766 (+801)
61,236 (-445)
2,803 (-21)
14,838 (-22)
57,954 (+2,240)
2,955 (-22)
2,952 (-22)
2,761 (-65)
8,231 (+22)
9,426 (+32)
11,995 (+23)
7,045 (+26)
10,384 (+1,946)
8,422 (+26)
8,359 (+69)
9,261 (-21)
8,457 (+25)
8,432 (-20)
8,435 (+25)
8,454 (+3)
7,116 (-41)
17,254 (+1,903)
2,545 (+6)
2,588 (+6)
+4.36%
-14.06%
+67.47%
-0.09%
+0.12%
+0.23%
+0.23%
+1.57%
-0.11%
-15.95%
+6.02%
+5.49%
+0.82%
-0.39%
+9.54%
+3.17%
+1.11%
-13.58%
-0.24%
-1.43%
+0.73%
+0.24%
-1.40%
-11.95%
+0.01%
-1.89%
+12.22%
+1.41%
-0.72%
-0.74%
-0.15%
+4.02%
-0.74%
-0.74%
-2.30%
+0.27%
+0.34%
+0.19%
+0.37%
+23.06%
+0.31%
+0.83%
-0.23%
+0.30%
-0.24%
+0.30%
+0.04%
-0.57%
+12.40%
+0.24%
+0.23%
3,138 (+131)
38,506 (+22)
80,850 (+44,483)
122,574 (-6)
82,315 (+16)
2,567 (+6)
2,579 (+6)
2,850 (+44)
13,023 (-16)
13,469 (+6)
20,256 (+2,323)
13,456 (+2,323)
2,822 (+23)
5,554 (-22)
505 (+44)
169,946 (+5,151)
2,547 (+28)
280 (-44)
2,536 (-6)
2,546 (-37)
3,182 (+23)
2,547 (+6)
3,176 (-45)
71,358 (-5,350)
11,132 (+6)
38,550 (+23)
19,660 (+4,643)
66,041 (+2,295)
57,296 (-147)
2,803 (-21)
18,099 (-22)
57,768 (+2,511)
2,955 (-22)
2,952 (-22)
2,761 (-65)
8,231 (+22)
9,426 (+32)
9,721 (+23)
7,045 (+26)
14,227 (+5,789)
8,422 (+26)
8,359 (+69)
13,282 (-21)
8,457 (+25)
8,432 (-20)
8,435 (+25)
8,454 (+3)
7,116 (-41)
6,279 (0)
2,545 (+6)
2,588 (+6)
+4.36%
+0.06%
+122.32%
-0.00%
+0.02%
+0.23%
+0.23%
+1.57%
-0.12%
+0.04%
+12.95%
+20.87%
+0.82%
-0.39%
+9.54%
+3.13%
+1.11%
-13.58%
-0.24%
-1.43%
+0.73%
+0.24%
-1.40%
-6.97%
+0.05%
+0.06%
+30.92%
+3.60%
-0.26%
-0.74%
-0.12%
+4.54%
-0.74%
-0.74%
-2.30%
+0.27%
+0.34%
+0.24%
+0.37%
+68.61%
+0.31%
+0.83%
-0.16%
+0.30%
-0.24%
+0.30%
+0.04%
-0.57%
0.00%
+0.24%
+0.23%
3,138 (+131)
38,993 (-22,541)
97,950 (+44,483)
122,574 (-6)
82,315 (+16)
2,567 (+6)
2,579 (+6)
2,850 (+44)
21,293 (-16)
24,106 (-23,211)
67,518 (+2,323)
51,446 (+2,323)
2,822 (+23)
5,554 (-22)
505 (+44)
189,846 (+25,051)
2,547 (+28)
280 (-44)
2,536 (-6)
2,546 (-37)
3,182 (+23)
2,547 (+6)
3,176 (-45)
109,377 (-45,126)
35,068 (+6)
38,550 (+23)
66,265 (+2,273)
66,041 (+2,295)
152,817 (-823)
2,803 (-21)
18,099 (-22)
85,861 (+1,945)
2,955 (-22)
2,952 (-22)
2,761 (-65)
8,231 (+22)
10,485 (+36)
18,926 (+22)
11,413 (+29)
14,227 (+28)
14,190 (+51)
14,087 (+94)
13,282 (-21)
14,236 (+28)
14,211 (-17)
14,192 (+28)
14,211 (+6)
10,983 (-41)
53,308 (0)
2,545 (+6)
2,588 (+6)
+4.36%
-36.63%
+83.20%
-0.00%
+0.02%
+0.23%
+0.23%
+1.57%
-0.08%
-49.05%
+3.56%
+4.73%
+0.82%
-0.39%
+9.54%
+15.20%
+1.11%
-13.58%
-0.24%
-1.43%
+0.73%
+0.24%
-1.40%
-29.21%
+0.02%
+0.06%
+3.55%
+3.60%
-0.54%
-0.74%
-0.12%
+2.32%
-0.74%
-0.74%
-2.30%
+0.27%
+0.34%
+0.12%
+0.25%
+0.20%
+0.36%
+0.67%
-0.16%
+0.20%
-0.12%
+0.20%
+0.04%
-0.37%
0.00%
+0.24%
+0.23%
2,952 (+31)
231 (-15)
2,929 (+28)
299 (+13)
128 (+3)
31 (0)
38 (+1)
54 (0)
39 (0)
192 (-27)
28 (+6)
59 (+3)
1 (0)
101 (-2)
513 (+28)
518 (+29)
529 (+28)
1,343 (+179)
32 (0)
22 (0)
264 (-6)
70 (-27)
2,523 (-23)
2,232 (+19)
87 (0)
348 (-27)
60 (+9)
89 (+6)
2,504 (+23)
2,444 (+39)
3 (0)
107 (+7)
88 (0)
3,368 (+46)
47 (0)
3 (0)
32 (0)
6 (0)
2 (0)
3 (+1)
2 (0)
2 (0)
5 (0)
2 (0)
2 (0)
2 (0)
2 (0)
2 (0)
7 (-2)
19 (0)
85 (+9)
WhitelistExample 977,625 (+80,497) optInToBApp
registerBApp
removeWhitelisted
1,086 (-44)
90,993 (-169)
22,064 (+45)
-3.89%
-0.19%
+0.20%
1,086 (-44)
90,993 (-169)
22,938 (+45)
-3.89%
-0.19%
+0.20%
1,086 (-44)
90,993 (-169)
22,938 (+45)
-3.89%
-0.19%
+0.20%
1,086 (-44)
90,993 (-169)
23,813 (+45)
-3.89%
-0.19%
+0.19%
1 (0)
3 (0)
2 (0)
NonCompliantBApp 485,061 (+1,914) registerBApp
slash
88,946 (-125)
81,464 (+2,373)
-0.14%
+3.00%
88,946 (-125)
81,464 (+2,373)
-0.14%
+3.00%
88,946 (-125)
81,464 (+2,373)
-0.14%
+3.00%
88,946 (-125)
81,464 (+2,373)
-0.14%
+3.00%
25 (0)
5 (0)
BasedAppMock4 964,585 (+80,509) optInToBApp
registerBApp
slash
updateBAppMetadataURI
23,626 (-22)
64,450 (0)
23,434 (+482)
40,637 (+71)
-0.09%
0.00%
+2.10%
+0.18%
23,626 (-22)
96,192 (-499)
23,434 (+482)
41,697 (+76)
-0.09%
-0.52%
+2.10%
+0.18%
23,626 (-22)
91,755 (-169)
23,434 (+482)
41,697 (+76)
-0.09%
-0.18%
+2.10%
+0.18%
23,626 (-22)
190,255 (-845)
23,434 (+482)
42,757 (+80)
-0.09%
-0.44%
+2.10%
+0.19%
4 (0)
594 (+6)
1 (0)
8 (0)
BasedAppsManager 688,687 (+185,924) registerBApp
updateBAppMetadataURI
3,293 (+22)
2,793 (+27)
+0.67%
+0.98%
55,127 (-446)
3,854 (+32)
-0.80%
+0.84%
51,188 (-147)
3,854 (+32)
-0.29%
+0.84%
146,667 (-823)
4,915 (+36)
-0.56%
+0.74%
2,504 (+23)
32 (0)
ProtocolManager 436,465 (+75,979) updateFeeExpireTime
updateFeeTimelockPeriod
updateMaxFeeIncrement
updateMaxShares
updateObligationExpireTime
updateObligationTimelockPeriod
updateWithdrawalExpireTime
updateWithdrawalTimelockPeriod
3,732 (+6)
6,525 (+6)
6,533 (+51)
6,453 (+50)
6,555 (+6)
6,554 (+6)
6,511 (+6)
6,510 (+6)
+0.16%
+0.09%
+0.79%
+0.78%
+0.09%
+0.09%
+0.09%
+0.09%
3,732 (+6)
6,525 (+6)
6,533 (+51)
6,453 (+50)
6,555 (+6)
6,554 (+6)
6,511 (+6)
6,510 (+6)
+0.16%
+0.09%
+0.79%
+0.78%
+0.09%
+0.09%
+0.09%
+0.09%
3,732 (+6)
6,525 (+6)
6,533 (+51)
6,453 (+50)
6,555 (+6)
6,554 (+6)
6,511 (+6)
6,510 (+6)
+0.16%
+0.09%
+0.79%
+0.78%
+0.09%
+0.09%
+0.09%
+0.09%
3,732 (+6)
6,525 (+6)
6,533 (+51)
6,453 (+50)
6,555 (+6)
6,554 (+6)
6,511 (+6)
6,510 (+6)
+0.16%
+0.09%
+0.79%
+0.78%
+0.09%
+0.09%
+0.09%
+0.09%
1 (0)
2 (+1)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)
1 (0)

Copy link
Contributor

@MatheusFranco99 MatheusFranco99 left a comment

Choose a reason for hiding this comment

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

LGTM

@riccardo-ssvlabs riccardo-ssvlabs marked this pull request as ready for review May 14, 2025 10:29
@riccardo-ssvlabs riccardo-ssvlabs changed the base branch from develop to release/v0.1.1 May 14, 2025 10:32
@riccardo-ssvlabs riccardo-ssvlabs merged commit f3efb28 into release/v0.1.1 May 14, 2025
3 checks passed
@riccardo-ssvlabs riccardo-ssvlabs deleted the fix/event-order-slashing branch June 17, 2025 14:46
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.

4 participants