-
Notifications
You must be signed in to change notification settings - Fork 302
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
Add test for and fix arbitrage swap execution output amount #4287
Merged
Conversation
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
zbuc
force-pushed
the
3790_arbitrage_fix
branch
from
April 29, 2024 20:15
419051f
to
0a6c792
Compare
erwanor
approved these changes
Apr 29, 2024
zbuc
force-pushed
the
3790_arbitrage_fix
branch
from
April 29, 2024 21:50
f3f2cd3
to
67ecb83
Compare
zbuc
force-pushed
the
3790_arbitrage_fix
branch
from
April 29, 2024 22:56
67ecb83
to
af80b38
Compare
erwanor
added
state-breaking
breaking change to on-chain data
A-dex
Area: Relates to the dex
labels
Apr 30, 2024
erwanor
approved these changes
May 1, 2024
new_key = ?EscapedByteSlice(&new_key), | ||
?old_key, | ||
"updated liquidity index" | ||
); |
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.
ACK, read through the code and it look correct to me, we:
- Create a (K, V) stream
- Pull the aggregate amount from the key @
32 + 7..32 + 7 + 16
- Compute the complement, encode it as big endian
- Delete the old key
- Insert the new key
cratelyn
reviewed
May 1, 2024
Co-authored-by: Erwan Or <[email protected]> Signed-off-by: Chris Czub <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-dex
Area: Relates to the dex
consensus-breaking
breaking change to execution of on-chain data
migration
A pull request that contains a migration
state-breaking
breaking change to on-chain data
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.
Describe your changes
This extends the existing arbitrage test to ensure that the created
SwapExecution
has the expected trace and input/output values, as well as fixes the bug described in #3790 whereSwapExecution
s were created with incorrectOutput
values.Issue ticket number and link
#3790
Checklist before requesting a review
Additional Follow-up
This will require a migration to update the existing
SwapExecution
structures. The migration should be as simple as adding theinput
to theoutput
for each of them.