Skip to content

Commit

Permalink
Drop settlement_call_data table (#2968)
Browse files Browse the repository at this point in the history
# Description
Since we don't need to store then uninternalised and internalised
calldata, so the table `settlement_call_data` can be dropped.

PR rebased on top of #2964
as a continuation of it.

# Changes
- Drop the table `settlement_call_data`

## How to test
1. Regression tests

## Related Issues
Fixes #2939

---------

Co-authored-by: Martin Magnus <[email protected]>
  • Loading branch information
m-lord-renkse and MartinquaXD authored Sep 12, 2024
1 parent 8c863d5 commit d1458fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 67 deletions.
1 change: 0 additions & 1 deletion crates/database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub mod order_execution;
pub mod order_history;
pub mod orders;
pub mod quotes;
pub mod settlement_call_data;
pub mod settlement_observations;
pub mod settlement_scores;
pub mod settlements;
Expand Down
53 changes: 0 additions & 53 deletions crates/database/src/settlement_call_data.rs

This file was deleted.

13 changes: 0 additions & 13 deletions database/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,19 +343,6 @@ Stores the best and second best solution quality (score) of every auction promis
Indexes:
- PRIMARY KEY: btree(`auction_id`)

### settlement\_call\_data

Stores the final calldata and uninternalized calldata of the winning solution for each auction

Column | Type | Nullable | Details
------------------------------|----------|----------|--------
auction\_id | bigint | not null | id of the auction the winning transaction calldata belongs to
call_data | bytea | not null | final calldata as it appears on the blockchain
uninternalized\_call\_data | numeric | not null | uninternalized calldata, different from final calldata if solution contains interactions that can be internalized against gpv2 settlement contract internal buffers.

Indexes:
- PRIMARY KEY: btree(`auction_id`)

### settlements

Stores data and metadata of [`Settlement`](https://github.com/cowprotocol/contracts/blob/main/src/contracts/GPv2Settlement.sol#L67-L68) events emitted from the settlement contract.
Expand Down
5 changes: 5 additions & 0 deletions database/sql/V071__drop_settlement_call_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--- We don't need to store the uninternalised and internalised calldata, so this table can be dropped
--- This is because we don't need to show/return the calldata from the competition endpoints for safety reasons
--- The calldata can be recovered using any full node given the transaction hash which is later recovered when observing the settlement
--- See more: https://github.com/cowprotocol/services/issues/2942
DROP TABLE settlement_call_data;

0 comments on commit d1458fa

Please sign in to comment.