-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Solve ToB-UNI4-3 without restricting sync #886
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
95d28ff
rm unnecessary unlocked check in sync
wjmelements 784dbc8
fix test
wjmelements dbd6f56
solve TOB-UNI4-3 without breaking external sync
wjmelements 777360b
add doc for the error
wjmelements 100b161
forge fmt
wjmelements ae093d6
updated forge snapshots
wjmelements d54c779
Merge branch 'main' into solve-TOB-UNI4-3
wjmelements 5907995
rerun with latest forge
wjmelements 0c762cb
remove unlocked check from collectProtocolFees
wjmelements 13afb31
fix tests
wjmelements 6d1ec06
rm unused ContractUnlocked
wjmelements 9d090bf
Merge remote-tracking branch 'upstream/main' into solve-TOB-UNI4-3
wjmelements 64b578f
Merge remote-tracking branch 'upstream/main' into solve-TOB-UNI4-3
wjmelements 7d6ef40
Merge remote-tracking branch 'upstream/main' into solve-TOB-UNI4-3
wjmelements 475de19
Update test/Sync.t.sol
wjmelements fd74a08
document the reason for the check
wjmelements e710ad1
test_collectProtocolFees_unlocked_revertsWithProtocolFeeCurrencySynced
wjmelements 6a86713
vm.prank
wjmelements 4d56810
debug test failure
wjmelements e2af146
test_collectProtocolFees_unlocked_revertsWithProtocolFeeCurrencySynced
wjmelements 58b48fb
Merge remote-tracking branch 'upstream/main' into solve-TOB-UNI4-3
wjmelements b692606
restore noIsolate, and test_collectProtocolFees_locked_revertsWithPro…
wjmelements 82dda85
test_sync_multiple_unlocked
wjmelements 2f12837
test_sync_locked_collectProtocolFees_unlocked_revertsWithProtocolFeeC…
wjmelements 0fded0b
getReserves snapshot appears to have changed
wjmelements File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"addLiquidity CA fee": "170928", | ||
"addLiquidity CA fee": "170690", | ||
"removeLiquidity CA fee": "141194", | ||
"swap CA custom curve + swap noop": "124635", | ||
"swap CA fee on unspecified": "154686" | ||
"swap CA custom curve + swap noop": "124397", | ||
"swap CA fee on unspecified": "154567" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"add liquidity to already existing position with salt": "144639", | ||
"create new liquidity to a position with salt": "292831" | ||
"add liquidity to already existing position with salt": "144401", | ||
"create new liquidity to a position with salt": "292593" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
{ | ||
"addLiquidity with empty hook": "274240", | ||
"addLiquidity with native token": "135120", | ||
"donate gas with 1 token": "106333", | ||
"donate gas with 2 tokens": "145748", | ||
"erc20 collect protocol fees": "57451", | ||
"native collect protocol fees": "59723", | ||
"poolManager bytecode size": "23694", | ||
"addLiquidity with empty hook": "274002", | ||
"addLiquidity with native token": "135001", | ||
"donate gas with 1 token": "106214", | ||
"donate gas with 2 tokens": "145510", | ||
"erc20 collect protocol fees": "57500", | ||
"native collect protocol fees": "59643", | ||
"poolManager bytecode size": "23671", | ||
"removeLiquidity with empty hook": "130603", | ||
"removeLiquidity with native token": "112523", | ||
"simple addLiquidity": "161395", | ||
"simple addLiquidity second addition same range": "98850", | ||
"simple addLiquidity": "161276", | ||
"simple addLiquidity second addition same range": "98731", | ||
"simple removeLiquidity": "85099", | ||
"simple removeLiquidity some liquidity remains": "92986", | ||
"simple swap": "123263", | ||
"simple swap": "123144", | ||
"simple swap with native": "108434", | ||
"swap against liquidity": "116646", | ||
"swap against liquidity": "116527", | ||
"swap against liquidity with native token": "105569", | ||
"swap burn 6909 for input": "129285", | ||
"swap burn native 6909 for input": "118672", | ||
"swap mint native output as 6909": "139739", | ||
"swap mint output as 6909": "155104", | ||
"swap with hooks": "132274" | ||
"swap mint native output as 6909": "139620", | ||
"swap mint output as 6909": "154985", | ||
"swap with hooks": "132155" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"swap skips hook call if hook is caller": "206263" | ||
"swap skips hook call if hook is caller": "206025" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"getReserves": "3931" | ||
"getReserves": "3973" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"swap with dynamic fee": "139272", | ||
"update dynamic fee in before swap": "147857" | ||
"swap with dynamic fee": "139153", | ||
"update dynamic fee in before swap": "147738" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"swap with return dynamic fee": "145589" | ||
"swap with return dynamic fee": "145470" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprisingly this increase seems to be caused by
noIsolate
intest_sync_multiple_unlocked
, even though this snapshot is fromtest_settle_nonNative_withoutSync_loseFunds
. When I revert 82dda85 it goes back to3931
. I'm unsure why.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change also results in
3931
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a problem but I am curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is super odd... not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i have been boggled by a few gas snapshot changes sometimes 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo this actually makes sense because of the way that
noIsolate
works! Its adding extra to the lastCallGas thats being snapshotted. So it isn't an actual increase to the v4 core code - its a testing-caused increase.I could explain it more if you want to know more, but I'm not concerned nor surprised 🫡
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My surprise is because the affected snapshot happens in another test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to understand if you have the time to explain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OH I did not see that 😆 ok now i no longer understand it 💀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it has to do with
noIsolate
though