-
Notifications
You must be signed in to change notification settings - Fork 53
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
[DRAFT] Build Enriched Traces & Transactions + Aggregation Tables #1161
base: main
Are you sure you want to change the base?
Conversation
Added a rough diagram to the first text bubble in the PR |
src/op_analytics/datapipeline/models/code/event_emitting_transactions.py
Outdated
Show resolved
Hide resolved
Remaining gap: How do we test in notebooks when there are input datasets we haven't built yet. |
@@ -15,6 +15,9 @@ def create_duckdb_macros(duckdb_client: duckdb.DuckDBPyConnection): | |||
|
|||
CREATE OR REPLACE MACRO wei_to_gwei(a) | |||
AS a::DECIMAL(28, 0) * 0.000000001::DECIMAL(10, 10); | |||
|
|||
CREATE OR REPLACE MACRO gwei_to_eth(a) |
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.
modified decimal precision here, it wasn't allowing for a to be a decimal before
The definition of the L1 fee scalar changed in Fjord, we should not combine them together.
-- L2 Legacy Fee | ||
if(l2_priority_fee = 0, l2_fee - l2_base_fee, 0) AS l2_legacy_extra_fee, | ||
-- | ||
-- L1 Base |
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.
We should build tests here that l1_base_fee + l1_blob_fee = l1_fee
This should hold through the history of time.
"refined_transactions_fees_v1": duckdb_client.view("refined_transactions_fees"), | ||
"refined_trace_calls_v1": duckdb_client.view("refined_trace_calls"), | ||
"event_emitting_transactions_v1": duckdb_client.view("event_emitting_transactions"), | ||
"summary_v1": duckdb_client.view("daily_address_summary"), |
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.
should we rename this to daily_address_summary_v1
? Maybe in a future PR to keep this clean-ish
refined_transactions_fees | ||
WHERE | ||
NOT is_system_transaction | ||
AND gas_price > 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.
this used to be at the transactions_fees level, but I unfiltered there (so we preserve those transactions) and brought it here.
# Conflicts: # src/op_analytics/datapipeline/models/templates/daily_address_summary.sql.j2 # src/op_analytics/datapipeline/models/templates/transaction_fees.sql.j2
# Conflicts: # src/op_analytics/datapipeline/models/code/daily_address_summary.py # src/op_analytics/datapipeline/models/templates/daily_address_summary.sql.j2
Working PR - See overall project #1055
closes #1160 - Transaction Models Exploration
closes #1168 - Trace Models Exploration
The end results of these models are also expected to be used in conjunction with: #1151
TODO:
Enriched TransactionsExtend existing transaction_fees modelAggregation strategy:
I'm the worst at excalidraw, but this is what I envision. Progress moves left to right, this PR ends at "Aggregation Models"