An 4316/shapella upgrade (#230)

* new api fields - silver

* withdrawals
This commit is contained in:
Austin 2024-01-10 16:00:49 -05:00 committed by GitHub
parent b41c435646
commit a7244b523e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 40 additions and 10 deletions

View File

@ -122,7 +122,9 @@ SELECT
d.modified_timestamp,
'2000-01-01'
)
) AS modified_timestamp
) AS modified_timestamp,
withdrawals,
withdrawals_root
FROM
{{ ref('silver__blocks') }} A
LEFT JOIN {{ ref('silver__state_hashes') }}

View File

@ -53,4 +53,8 @@ models:
- name: INSERTED_TIMESTAMP
description: '{{ doc("inserted_timestamp") }}'
- name: MODIFIED_TIMESTAMP
description: '{{ doc("modified_timestamp") }}'
description: '{{ doc("modified_timestamp") }}'
- name: WITHDRAWALS
description: An array of withdrawals that occurred in this block.
- name: WITHDRAWALS_ROOT
description: A hash of the withdrawals that occurred in this block.

View File

@ -67,7 +67,9 @@ SELECT
GREATEST(COALESCE(A.modified_timestamp, '2000-01-01'), COALESCE(b.modified_timestamp, '2000-01-01'), COALESCE(C.modified_timestamp, '2000-01-01')) AS modified_timestamp,
VALUE AS eth_value,
value_precise_raw AS eth_value_precise_raw,
value_precise AS eth_value_precise
value_precise AS eth_value_precise,
deposit_nonce,
deposit_receipt_version
FROM
{{ ref('silver__transactions') }} A
LEFT JOIN {{ ref('silver__state_hashes') }}

View File

@ -87,4 +87,8 @@ models:
- name: INSERTED_TIMESTAMP
description: '{{ doc("inserted_timestamp") }}'
- name: MODIFIED_TIMESTAMP
description: '{{ doc("modified_timestamp") }}'
description: '{{ doc("modified_timestamp") }}'
- name: DEPOSIT_NONCE
description: The nonce of the deposit transaction.
- name: DEPOSIT_RECEIPT_VERSION
description: The version of the deposit receipt.

View File

@ -48,6 +48,8 @@ SELECT
) :: INT AS total_difficulty,
DATA :transactionsRoot :: STRING AS transactions_root,
DATA :uncles AS uncles,
DATA :result :withdrawals AS withdrawals,
DATA :result :withdrawalsRoot :: STRING AS withdrawals_root,
_inserted_timestamp,
{{ dbt_utils.generate_surrogate_key(
['block_number']

View File

@ -109,7 +109,13 @@ FINAL AS (
utils.udf_hex_to_int(
DATA :type :: STRING
) :: INT AS TYPE,
_inserted_timestamp
_inserted_timestamp,
utils.udf_hex_to_int(
DATA :depositNonce :: STRING
) :: INT AS deposit_nonce,
utils.udf_hex_to_int(
DATA: depositReceiptVersion :: STRING
) :: INT AS deposit_receipt_version
FROM
base
)

View File

@ -172,7 +172,9 @@ new_records AS (
effective_gas_price,
r.type AS tx_type,
t._inserted_timestamp,
t.data
t.data,
r.deposit_nonce,
r.deposit_receipt_version
FROM
base_tx t
LEFT OUTER JOIN {{ ref('silver__blocks') }}
@ -248,7 +250,9 @@ missing_data AS (
b._inserted_timestamp,
r._inserted_timestamp
) AS _inserted_timestamp,
t.data
t.data,
r.deposit_nonce,
r.deposit_receipt_version
FROM
{{ this }}
t
@ -311,7 +315,9 @@ FINAL AS (
tx_fee_precise,
tx_type,
_inserted_timestamp,
DATA
DATA,
deposit_nonce,
deposit_receipt_version
FROM
new_records
@ -354,7 +360,9 @@ SELECT
tx_fee_precise_heal AS tx_fee_precise,
tx_type,
_inserted_timestamp,
DATA
DATA,
deposit_nonce,
deposit_receipt_version
FROM
missing_data
{% endif %}
@ -421,7 +429,9 @@ SELECT
) }} AS transactions_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id
'{{ invocation_id }}' AS _invocation_id,
deposit_nonce,
deposit_receipt_version
FROM
FINAL
WHERE