Beacon ChainBlocks
Column Descriptions
for eth_cl.blocks
14 rows
Name | Type | Description |
---|---|---|
proposer_index | NUMBER | Index of the validator that proposed this block |
parent_slot | NUMBER | Slot number of the parent block directly preceding this block |
slot | NUMBER | Slot number of the block, representing its position in the beacon chain |
state_root | TEXT | Root hash of the state after processing this block |
version | NUMBER | Version of the block as defined by the consensus specification |
spec | TEXT | Specification or protocol version associated with this block |
root | TEXT | Root hash of the block, representing its state in the chain |
body_root | TEXT | Root hash of the block body, representing the transactions and other data |
time | TIMESTAMP_NTZ | Timestamp indicating when this block was created |
hash | TEXT | Unique identifier (hash) of the block |
parent_root | TEXT | Root hash of the parent block, linking this block to its predecessor |
number | NUMBER | Sequential number of the block in the blockchain |
date | DATE | Calendar date associated with the block |
signature | TEXT | Signature of the block, used for validation by the proposer |
Sample Queries
Latest Block Number
Retrieves the most recent block number in the blockchain.
SELECT
MAX(number) AS latest_block_number
FROM
eth_cl.blocks;
Blocks Proposed by a Specific Validator
Finds all blocks proposed by a particular validator index.
SELECT
number,
hash,
slot
FROM
eth_cl.blocks
WHERE
proposer_index = 12345;
Average Slot Time
Calculates the average time difference between consecutive slots.
WITH
SlotTimes AS (
SELECT
slot,
time,
LAG (time, 1, time) OVER (
ORDER BY
slot
) as prev_time
FROM
eth_cl.blocks
)
SELECT
AVG(datediff ('second', prev_time, time)) as avg_slot_time
FROM
SlotTimes;