Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions database/sql/V116__settlement_gas_cost.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Store the actual on-chain gas cost of each settlement transaction.
--
-- These values are read from the transaction receipt by the autopilot's
-- settlement observer), letting the orderbook attribute a real gas cost
Comment thread
jmg-duarte marked this conversation as resolved.
Outdated
-- to individual trades and orders.
--
-- Nullable: only populated for settlements observed after this migration is
-- deployed (no historical backfill).
ALTER TABLE settlements
ADD COLUMN gas_used numeric(78, 0),
ADD COLUMN effective_gas_price numeric(78, 0);
Comment on lines +9 to +11

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bot reminder asks to update the DB README when adding columns. The settlements table docs still don't list gas_used / effective_gas_price — worth adding the two rows so the schema doc stays in sync.

Type/naming look good: numeric(78,0) matches the u256 convention used elsewhere (and the existing gas_used numeric(78,0) in V048__create_settlement_rewards.sql), and nullable additive columns are backward-compatible with the k8s rollout overlap.

Loading