Fix/beacon slots view (#1145)
Some checks are pending
docs_update / called_workflow_template (push) Waiting to run

* updates

* filter
This commit is contained in:
Austin 2025-09-29 11:11:53 -04:00 committed by GitHub
parent 156ea356c1
commit ffdcf2262c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 8 deletions

View File

@ -9,7 +9,7 @@ WITH base AS (
slot_timestamp :: DATE AS block_date,
MAX(slot_number) block_number
FROM
{{ ref("silver__beacon_blocks") }}
{{ ref("beacon_chain__fact_blocks") }}
WHERE
block_included
AND TIME(slot_timestamp) = '23:59:59.000'
@ -17,12 +17,12 @@ WITH base AS (
slot_timestamp :: DATE
)
SELECT
slot_timestamp :: DATE AS block_date,
slot_number AS block_number,
state_root AS state_id
a.block_date,
a.block_number,
b.state_root AS state_id
FROM
{{ ref("silver__beacon_blocks") }} A
JOIN base b
ON A.slot_number = b.block_number
base a
LEFT JOIN {{ ref("silver__beacon_blocks") }} b
ON a.block_number = b.slot_number
WHERE
block_date IS NOT NULL

View File

@ -20,6 +20,15 @@ WITH to_do AS (
state_id
FROM
{{ ref("_max_beacon_block_by_date") }}
WHERE
slot_number > (
SELECT
MIN(slot_number)
FROM
{{ ref("beacon_chain__fact_blocks") }}
WHERE
slot_timestamp between DATEADD(day, -10, SYSDATE()) and DATEADD(day, -9, SYSDATE())
)
EXCEPT
SELECT
slot_number,
@ -49,7 +58,7 @@ SELECT
) AS partition_key,
{{ target.database }}.live.udf_api(
'GET',
'{service}/{Authentication}/eth/v1/beacon/states/' || state_id || '/validators',
'{service}/{Authentication}/eth/v1/beacon/states/' || slot_number || '/validators',
OBJECT_CONSTRUCT(
'accept', 'application/json',
'fsc-quantum-state', 'streamline'