-
Notifications
You must be signed in to change notification settings - Fork 84
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
Executed total fee token #2966
Executed total fee token #2966
Conversation
Reminder: Please update the DB Readme. Caused by: |
&total_fee, | ||
&executed_protocol_fees, | ||
Asset { | ||
token: ByteArray(order_fee.total.token.0 .0), |
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.
Maybe worth having From<TokenAddress>
for ByteArray
as it appears in more occurrences 🤔
ADD COLUMN total_fee_token bytea NOT NULL DEFAULT '\x0000000000000000000000000000000000000000'; | ||
|
||
-- Now populate existing rows with the sell token taken from the 'orders' table, or if it doesn't exist, try from 'jit_orders'. | ||
UPDATE order_execution oe |
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.
Did you test that this query does not leave any surplus_token
uninitialized?
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.
Here are test results on mainnet prod db:
Number of rows in order_execution
: 1466450
Number of rows being updated: 1460019
So, there are ~6k entries in order_execution
that can't be found in orders
or jit_orders
(but all missing orders are older than 2 months).
My assumptions is that those are some jit orders from before we started saving them in the library. Example:
https://api.cow.fi/mainnet/api/v1/solver_competition/by_tx_hash/0x59ddfcab4910ad48b3550658f0c46c8892f114e6791dbc032c05a42c1e858b63
Note how the order https://explorer.cow.fi/search/0x0088e45fff8487b9d4c5edcf2ad6580cdfc3a689c3c3022d7282aebf6446a8a99bd702e05b9c97e4a4a3e47df1e0fe7a0c26d2f166ff4487
can't be found in the explorer.
So, for these, I am not too worried if their token is not populated since those can't be found in explorer anyway.
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
This pull request has been marked as stale because it has been inactive a while. Please update this pull request or it will be automatically closed. |
Reminder: Please update the DB Readme and comment whether migrations are reversible (include rollback scripts if applicable). Caused by: |
Reminder: Please consider backward compatibility when modifying the API specification.
Caused by: |
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.
LGTM
Description
Implements (1) and (2) from #2963.
Also, renames
surplus_fee
toexecuted_fee
in database.Changes
order_execution.executed_fee_token
to databaseexecuted_fee
.Note: all places where sell token needs to be substituted with surplus token are marked with
TODO surplus token
and this will be tackled as part of (3) from #2963.How to test
Existing e2e tests. Observed values during the tests.