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

Recover collateral check #1361

Merged
merged 7 commits into from
Oct 26, 2022
Merged

Recover collateral check #1361

merged 7 commits into from
Oct 26, 2022

Conversation

MerlinEgalite
Copy link
Contributor

Pull Request

Issue(s) fixed

This pull request fixes #1262

@github-actions
Copy link

github-actions bot commented Oct 13, 2022

Morpho-aave-v2 gas impacts (eth-mainnet)

Generated at commit: 8a2f3a21c1ac0ce78a9cdf655603cb946f353278, compared to commit: 029c29f5b0033a87f267221a694a721ec1507553

🧾 Summary

Contract Method Avg (+/-) %
ExitPositionsManager liquidateLogic
withdrawLogic
+11,705 ❌
+1,557 ❌
+9.32%
+0.78%
Morpho aaveIncentivesController
borrow(address,uint256)
borrow(address,uint256,uint256)
createMarket
initialize
liquidate
setIncentivesVault
setRewardsManager
setTreasuryVault
supply(address,uint256)
withdraw(address,uint256)
+1 ❌
+11,627 ❌
+13,233 ❌
+3 ❌
+5 ❌
+5,717 ❌
+1 ❌
+1 ❌
+1 ❌
+754 ❌
+1,467 ❌
+0.15%
+2.90%
+6.41%
+0.00%
+0.00%
+8.18%
+0.00%
+0.00%
+0.00%
+0.22%
+0.76%
EntryPositionsManager borrowLogic
supplyLogic
+12,210 ❌
+727 ❌
+3.21%
+0.22%
RewardsManagerOnMainnetAndAvalanche initialize
updateUserAssetAndAccruedRewards
+1 ❌
+82 ❌
+0.00%
+0.27%
InterestRatesManager updateIndexes +16 ❌ +0.12%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
ExitPositionsManager 3,682,512 (+59,483) liquidateLogic
withdrawLogic
1,193 (0)
724 (0)
0.00%
0.00%
137,311 (+11,705)
201,256 (+1,557)
+9.32%
+0.78%
61,437 (+25,156)
121,724 (0)
+69.34%
0.00%
315,457 (+10,889)
2,111,247 (0)
+3.58%
0.00%
11 (0)
81 (0)
Morpho 3,436,193 (0) aaveIncentivesController
borrow(address,uint256)
borrow(address,uint256,uint256)
createMarket
initialize
liquidate
setIncentivesVault
setRewardsManager
setTreasuryVault
supply(address,uint256)
withdraw(address,uint256)
427 (0)
4,098 (0)
13,646 (0)
2,847 (0)
3,663 (0)
4,288 (0)
2,695 (0)
2,631 (0)
2,673 (0)
4,074 (0)
4,034 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
647 (+1)
413,230 (+11,627)
219,807 (+13,233)
208,168 (+3)
230,121 (+5)
75,644 (+5,717)
23,715 (+1)
21,596 (+1)
23,525 (+1)
336,296 (+754)
193,451 (+1,467)
+0.15%
+2.90%
+6.41%
+0.00%
+0.00%
+8.18%
+0.00%
+0.00%
+0.00%
+0.22%
+0.76%
427 (0)
396,250 (+10,851)
211,568 (+13,564)
204,995 (0)
231,146 (0)
9,695 (0)
23,878 (0)
21,814 (0)
23,856 (0)
202,008 (+742)
125,677 (0)
0.00%
+2.82%
+6.85%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
+0.37%
0.00%
2,427 (0)
1,907,420 (+10,909)
469,794 (+13,564)
234,710 (0)
231,146 (0)
323,513 (+10,889)
23,878 (0)
21,814 (0)
23,856 (0)
1,919,810 (0)
2,118,800 (0)
0.00%
+0.58%
+2.97%
0.00%
0.00%
+3.48%
0.00%
0.00%
0.00%
0.00%
0.00%
2,053 (+7)
247 (+1)
41 (0)
1,114 (+5)
222 (+1)
22 (0)
223 (+1)
224 (+1)
225 (+1)
507 (+2)
86 (0)
EntryPositionsManager 2,834,051 (+59,469) borrowLogic
supplyLogic
490 (0)
737 (0)
0.00%
0.00%
392,359 (+12,210)
336,224 (+727)
+3.21%
+0.22%
264,027 (+10,602)
202,955 (0)
+4.18%
0.00%
1,903,444 (+10,910)
1,915,836 (0)
+0.58%
0.00%
281 (+1)
502 (+2)
RewardsManagerOnMainnetAndAvalanche 1,133,544 (0) initialize
updateUserAssetAndAccruedRewards
2,742 (0)
2,117 (0)
0.00%
0.00%
92,721 (+1)
30,704 (+82)
+0.00%
+0.27%
93,129 (0)
26,959 (0)
0.00%
0.00%
93,129 (0)
78,353 (0)
0.00%
0.00%
222 (+1)
1,132 (+2)
InterestRatesManager 908,486 (0) updateIndexes 656 (0) 0.00% 13,036 (+16) +0.12% 14,287 (0) 0.00% 51,687 (0) 0.00% 2,722 (+4)

@Rubilmax
Copy link
Collaborator

Rubilmax commented Oct 13, 2022

Checked that all changes in #1264 are applied on this branch

@MerlinEgalite MerlinEgalite requested review from a team October 13, 2022 16:20
@MerlinEgalite MerlinEgalite self-assigned this Oct 14, 2022
@MerlinEgalite MerlinEgalite marked this pull request as ready for review October 14, 2022 07:24
Base automatically changed from fix/lens-visibility to fix/lens-aave-v2 October 15, 2022 08:22
Copy link
Collaborator

@MathisGD MathisGD left a comment

Choose a reason for hiding this comment

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

LGTM, the changes are here.

Base automatically changed from fix/lens-aave-v2 to refactor/reset-state October 17, 2022 14:56
@MerlinEgalite MerlinEgalite changed the base branch from refactor/reset-state to dev October 17, 2022 16:37
@MerlinEgalite MerlinEgalite changed the base branch from dev to upgrade-0 October 19, 2022 10:09
Copy link
Collaborator

@QGarchery QGarchery left a comment

Choose a reason for hiding this comment

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

Looks good, but we could clarify it a bit

contracts/aave-v2/MorphoUtils.sol Outdated Show resolved Hide resolved
test-foundry/aave-v2/TestBorrow.t.sol Outdated Show resolved Hide resolved
@github-actions
Copy link

Morpho-aave-v3 gas impacts (avalanche-mainnet)

Generated at commit: 8a2f3a21c1ac0ce78a9cdf655603cb946f353278, compared to commit: 029c29f5b0033a87f267221a694a721ec1507553

🧾 Summary

Contract Method Avg (+/-) %
Morpho borrow(address,uint256)
createMarket
initialize
setIncentivesVault
setRewardsManager
setTreasuryVault
supply(address,uint256)
-1,356 ✅
+5 ❌
+8 ❌
+1 ❌
+1 ❌
+3 ❌
+821 ❌
-0.36%
+0.00%
+0.00%
+0.00%
+0.00%
+0.01%
+0.27%
EntryPositionsManager borrowLogic
supplyLogic
-1,040 ✅
+805 ❌
-0.30%
+0.27%
RewardsManager initialize
updateUserAssetAndAccruedRewards
+3 ❌
+59 ❌
+0.00%
+0.19%
InterestRatesManager updateIndexes +22 ❌ +0.16%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
Morpho 3,497,474 (0) borrow(address,uint256)
createMarket
initialize
setIncentivesVault
setRewardsManager
setTreasuryVault
supply(address,uint256)
11,320 (0)
2,796 (0)
3,707 (0)
2,673 (0)
2,631 (0)
2,695 (0)
7,670 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
373,873 (-1,356)
211,470 (+5)
225,252 (+8)
23,643 (+1)
21,530 (+1)
23,448 (+3)
305,381 (+821)
-0.36%
+0.00%
+0.00%
+0.00%
+0.00%
+0.01%
+0.27%
276,019 (-141)
209,402 (0)
226,563 (0)
23,856 (0)
21,814 (0)
23,878 (0)
206,664 (0)
-0.05%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
2,098,700 (0)
231,574 (0)
226,563 (0)
23,856 (0)
21,814 (0)
23,878 (0)
2,143,480 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
200 (+1)
854 (+5)
170 (+1)
171 (+1)
172 (+1)
173 (+1)
422 (+2)
EntryPositionsManager 3,023,684 (0) borrowLogic
supplyLogic
484 (0)
731 (0)
0.00%
0.00%
349,308 (-1,040)
301,872 (+805)
-0.30%
+0.27%
269,892 (0)
205,088 (0)
0.00%
0.00%
2,095,249 (0)
2,139,980 (0)
0.00%
0.00%
241 (+1)
425 (+2)
RewardsManager 1,643,684 (0) initialize
updateUserAssetAndAccruedRewards
2,764 (0)
7,226 (0)
0.00%
0.00%
92,640 (+3)
30,334 (+59)
+0.00%
+0.19%
93,172 (0)
36,337 (0)
0.00%
0.00%
93,172 (0)
64,651 (0)
0.00%
0.00%
170 (+1)
983 (+2)
InterestRatesManager 827,828 (0) updateIndexes 659 (0) 0.00% 13,899 (+22) +0.16% 12,625 (0) 0.00% 49,975 (0) 0.00% 2,143 (+4)

@Rubilmax
Copy link
Collaborator

Storage checks fixed in #1379

@MerlinEgalite
Copy link
Contributor Author

Storage checks fixed in #1379

The CI is still failling though do you why?

@Rubilmax
Copy link
Collaborator

Rubilmax commented Oct 24, 2022

Storage checks fixed in #1379

The CI is still failling though do you why?

For the reason stated in #1379, which is not yet merged

@MerlinEgalite MerlinEgalite merged commit 7da1a5c into upgrade-0 Oct 26, 2022
@MerlinEgalite MerlinEgalite deleted the recover/collateral-check branch October 26, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants