Skip to content
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

AN-5331-v2/eth-standardization #974

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 13 additions & 9 deletions models/beacon_chain/silver/silver__eth_staking_deposits.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,19 @@ WITH deposit_evt AS (
TRY_TO_NUMBER(
utils.udf_hex_to_int(SUBSTR(INDEX, 15, 2) || SUBSTR(INDEX, 13, 2) || SUBSTR(INDEX, 11, 2) || SUBSTR(INDEX, 9, 2) || SUBSTR(INDEX, 7, 2) || SUBSTR(INDEX, 5, 2) || SUBSTR(INDEX, 3, 2))
) AS deposit_index,
_log_id,
_inserted_timestamp
CONCAT(
tx_hash :: STRING,
'-',
event_index :: STRING
) AS _log_id,
modified_timestamp AS _inserted_timestamp
FROM
{{ ref('silver__logs') }}
{{ ref('core__fact_event_logs') }}
WHERE
contract_address = '0x00000000219ab540356cbb839cbe05303d7705fa' --BeaconDepositContract
AND topics [0] :: STRING = '0x649bbc62d0e31342afea4e5cd82d4049e7e1ee912fc0889aa790803be39038c5' --DepositEvent
AND block_number >= 11185300
AND tx_status = 'SUCCESS'
AND tx_succeeded

{% if is_incremental() %}
AND _inserted_timestamp >= (
Expand Down Expand Up @@ -97,16 +101,16 @@ FINAL AS (
d._inserted_timestamp
FROM
deposit_evt d
LEFT JOIN {{ ref('silver__traces') }}
LEFT JOIN {{ ref('core__fact_traces') }}
t
ON d.block_number = t.block_number
AND d.tx_hash = t.tx_hash
AND d.deposit_amount :: FLOAT = t.eth_value :: FLOAT
AND tx_status = 'SUCCESS'
AND trace_status = 'SUCCESS'
AND d.deposit_amount :: FLOAT = t.value :: FLOAT
AND tx_succeeded
AND trace_succeeded

{% if is_incremental() %}
AND t._inserted_timestamp >= (
AND t.modified_timestamp >= (
SELECT
MAX(_inserted_timestamp) - INTERVAL '48 hours'
FROM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ WITH withdrawal_blocks AS (
{{ dbt_utils.generate_surrogate_key(
['block_number', 'withdrawal_address', 'withdrawal_index']
) }} AS _unique_key,
_inserted_timestamp
modified_timestamp AS _inserted_timestamp
FROM
{{ ref('silver__blocks') }},
{{ ref('core__fact_blocks') }},
LATERAL FLATTEN(
input => withdrawals
)
Expand Down
90 changes: 90 additions & 0 deletions models/doc_descriptions/fsc_evm/L1_submission_fields.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{% docs evm_batch_size %}

Total transactions included within the batch on the OP stack L2 chain.

{% enddocs %}

{% docs evm_max_block %}

The max block on the OP stack L2 chain this batch relates to.

{% enddocs %}

{% docs evm_min_block %}

The min block on the OP stack L2 chain this batch relates to.

{% enddocs %}

{% docs evm_batch_root %}

Root of the batch, either for submission or state on the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_block_no %}

The Ethereum block number that contained the batch from the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_block_time %}

The timestamp of the Ethereum block that contained this batch from the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_fee %}

The L1 portion of fees paid.

{% enddocs %}

{% docs evm_l1_fee_scalar %}

This value covers the change in L1 gas price between the time the transaction is submitted and when it is published from the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_gas_price %}

The gas price for L1 transactions when the transaction was processed from the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_gas_used %}

The gas used on L1 to publish the transaction from the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_state_batch %}

The batch index of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_state_tx_hash %}

The L1 tx hash of when this block was included in the Ethereum state root. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_sub_batch %}

The batch index of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain.

{% enddocs %}

{% docs evm_l1_sub_tx_hash %}

The L1 tx hash of when this block was submitted to L1. This column will be deprecated 8/7 and will be consolidated into an array column consisting of all L1 submission details from the OP stack L2 chain.

{% enddocs %}

{% docs evm_prev_total_elements %}

Confirmed blocks prior to this batch on the OP stack L2 chain.

{% enddocs %}

158 changes: 158 additions & 0 deletions models/doc_descriptions/fsc_evm/blocks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
{% docs evm_blocks_table_doc %}

This table contains block level data for this EVM blockchain. This table can be used to analyze trends at a block level, for example gas fees vs. total transactions over time. For more information, please see [Etherscan Resources](https://etherscan.io/directory/Learning_Resources/Ethereum) or [The Ethereum Organization](https://ethereum.org/en/developers/docs/blocks/)

{% enddocs %}


{% docs evm_block_header_json %}

This JSON column contains the block header details.

{% enddocs %}


{% docs evm_blockchain %}

The blockchain on which transactions are being confirmed.

{% enddocs %}


{% docs evm_blocks_hash %}

The hash of the block header for a given block.

{% enddocs %}


{% docs evm_blocks_nonce %}

Block nonce is a value used during mining to demonstrate proof of work for a given block.

{% enddocs %}


{% docs evm_difficulty %}

The effort required to mine the block.

{% enddocs %}


{% docs evm_extra_data %}

Any data included by the miner for a given block.

{% enddocs %}


{% docs evm_gas_limit %}

Total gas limit provided by all transactions in the block.

{% enddocs %}


{% docs evm_gas_used %}

Total gas used in the block.

{% enddocs %}

{% docs evm_network %}

The network on the blockchain used by a transaction.

{% enddocs %}


{% docs evm_parent_hash %}

The hash of the block from which a given block is generated. Also known as the parent block.

{% enddocs %}


{% docs evm_receipts_root %}

The root of the state trie.

{% enddocs %}


{% docs evm_sha3_uncles %}

The mechanism which Ethereum Javascript RLP encodes an empty string.

{% enddocs %}


{% docs evm_size %}

Block size, which is determined by a given block's gas limit.

{% enddocs %}


{% docs evm_total_difficulty %}

Total difficulty of the chain at a given block.

{% enddocs %}


{% docs evm_tx_count %}

Total number of transactions within a block.

{% enddocs %}


{% docs evm_uncle_blocks %}

Uncle blocks occur when two blocks are mined and broadcasted at the same time, with the same block number. The block validated across the most nodes will be added to the primary chain, and the other one becomes an uncle block. Miners do receive rewards for uncle blocks.

{% enddocs %}

{% docs evm_miner %}

The address of the beneficiary to whom the mining rewards were given

{% enddocs %}

{% docs evm_state_root %}

The root of the final state trie of the block

{% enddocs %}

{% docs evm_transactions_root %}

The root of the transaction trie of the block

{% enddocs %}

{% docs evm_logs_bloom %}

The bloom filter for the logs of the block.

{% enddocs %}

{% docs evm_mix_hash %}

A string of a 256-bit hash encoded as a hexadecimal

{% enddocs %}

{% docs evm_base_fee_per_gas %}

A string of the base fee encoded in hexadecimal format. Please note that this response field will not be included in a block requested before the EIP-1559 upgrade

{% enddocs %}

{% docs evm_withdrawals_root %}

The root of the withdrawals trie.

{% enddocs %}
65 changes: 65 additions & 0 deletions models/doc_descriptions/fsc_evm/complete_general.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{% docs evm_block_number %}

Also known as block height. The block number, which indicates the length of the blockchain, increases after the addition of each new block.

{% enddocs %}

{% docs evm_block_timestamp %}

The date and time at which the block was produced.

{% enddocs %}

{% docs evm_from_address %}

The sending address of this transaction.

{% enddocs %}

{% docs evm_ingested_at %}

Internal column.

{% enddocs %}

{% docs evm_to_address %}

The receiving address of this transaction. This can be a contract address.

{% enddocs %}

{% docs evm_pk %}

The unique identifier for each row in the table.

{% enddocs %}

{% docs evm_inserted_timestamp %}

The UTC timestamp at which the row was inserted into the table.

{% enddocs %}

{% docs evm_modified_timestamp %}

The UTC timestamp at which the row was last modified.

{% enddocs %}

{% docs evm_precise_amount_unadjusted %}

The precise, unadjusted amount of the transaction. This is returned as a string to avoid precision loss.

{% enddocs %}

{% docs evm_precise_amount_adjusted %}

The precise, adjusted amount of the transaction. This is returned as a string to avoid precision loss.

{% enddocs %}

{% docs evm_value_hex %}

The value of the transaction in hexadecimal format.

{% enddocs %}
Loading