-
Notifications
You must be signed in to change notification settings - Fork 86
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
feat: Refactor auction_transaction
relation
#2282
Comments
Seems good to me. I don't see any obvious problems with this approach and always found that we had to join using |
Sounds good to me! If we make a new version of the contract, we will likely make auction ID a mandatory part of the calldata anyways. |
This was referenced Jan 15, 2024
fleupold
added a commit
that referenced
this issue
Jan 26, 2024
# Description Part of #2282 & #2275 Exchanges `tx_from/tx_nonce` for `auction_id` which can be directly encoded from the settlement transaction since we shipped colocation. This allows us to remove an entire database table and a bunch of other complicated code. I'm not yet removing the old columns in case something goes bad with this change. # Changes <!-- List of detailed changes (how the change is accomplished) --> - [x] Removed `auction_transaction` table. - [x] Redesigned `settlements` table to contain auction id ## How to test 1. db tests and e2e tests cover the new functionality. 2. Locally I've tested the db migration file like this: - First comment out the V_58 migration file and apply old schema. - Insert 10 settlements, of which first 5 have `auction_transaction` record (except one settlement (block_number 3), to simulate the existence of settlement from other environment staging/prod) - Then, manually apply migration script V_58 - Observed the `settlements` table,`auction_id` were populated as expected. --------- Co-authored-by: Felix Leupold <[email protected]>
Done with #2283 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
With colocation,
auction_id
is appended to transaction call_data always (and this will also be required and verified once solvers run their own driver), so it's not needed to keep the<from, nonce>
pair anymore. This paIr was used pre-colocation so that we connect the auction to the transaction hash.Currently, our database looks like this:
settlements
table (initially partially populated byEventHandler
(without<from, nonce>
), and laterOnSettlementEventHandler
updates<from, nonce>
):auction_transaction
table (populated byOnSettlementEventHandler
):Proposal:
settlements
table:Drop
auction_transaction
table.EventHandler
would insert settlement on each new event, whileOnSettlementEventHandler
would fetch all settlements withoutauction_id
and populate that field and all depending data (settlement observations and order executions). This would makeOnSettlementEventHandler
completely reorg friendly since right now theauction_transaction
table is not reorg friendly and does not contain columnblock_number
which would allow entry deletion whenEventHandler
detects reorg.Related to #2275
The text was updated successfully, but these errors were encountered: