Skip to content
Draft

tests #178

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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions tests/mainnet/pectra/models/canonical_execution_block.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,32 @@ network: mainnet
spec: pectra
external_data:
canonical_execution_block:
url: https://data.ethpandaops.io/xatu-cbt/pectra/canonical_execution_block.parquet
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_block.parquet
network_column: meta_network_name
assertions:
- name: total count
- name: total count and bounds
sql: |
SELECT
COUNT(*) AS count
COUNT(*) AS count,
MIN(block_number) AS min_block,
MAX(block_number) AS max_block
FROM
cluster('{remote_cluster}', default.canonical_execution_block) FINAL
expected:
count: 20
count: 42
min_block: "49018"
max_block: "6372586"
- name: Case 1 block exists (simple expiry-reactivation)
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_block) FINAL
WHERE block_number = 63809
expected:
count: 1
- name: Case 12 genesis-era block exists
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_block) FINAL
WHERE block_number = 49018
expected:
count: 1
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,52 @@ network: mainnet
spec: pectra
external_data:
canonical_execution_storage_diffs:
url: https://data.ethpandaops.io/xatu-cbt/pectra/canonical_execution_storage_diffs.parquet
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_storage_diffs.parquet
network_column: meta_network_name
assertions:
- name: total count
- name: total count and bounds
sql: |
SELECT
COUNT(*) AS count
COUNT(*) AS count,
MIN(block_number) AS min_block,
MAX(block_number) AS max_block,
uniq(address) AS unique_addresses
FROM
cluster('{remote_cluster}', default.canonical_execution_storage_diffs) FINAL
expected:
count: 12011
count: 38
min_block: "49018"
max_block: "5178368"
unique_addresses: "10"
- name: Case 1 diffs exist (simple expiry-reactivation)
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_storage_diffs) FINAL
WHERE address = '0x793ae8c1b1a160bfc07bfb0d04f85eab1a71f4f2'
AND slot = '0x0000000000000000000000000000000000000000000000000000000000000000'
expected:
count: 2
- name: Case 2 diffs exist (cleared and recreated)
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_storage_diffs) FINAL
WHERE address = '0x888666ca69e0f178ded6d75b5726cee99a87d698'
AND slot = '0xf5fa518bd9ef45a19f0eb529e4a900e5af17852b097fc69f632ec0d4fb198e4a'
expected:
count: 8
- name: Case 10 full 32-byte slot diff exists
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_storage_diffs) FINAL
WHERE address = '0x4eea5019ef91a8c8bfa80a1eea04bdda526316c4'
AND slot = '0x0000000000000000000000000000000000000000000000000000000000000000'
expected:
count: 2
- name: Case 12 genesis-era diffs exist
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_storage_diffs) FINAL
WHERE address = '0x630ea66c8c5dc205d45a978573fa86df5af1fe7a'
AND block_number = 49018
expected:
count: 6
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,45 @@ network: mainnet
spec: pectra
external_data:
canonical_execution_storage_reads:
url: https://data.ethpandaops.io/xatu-cbt/pectra/canonical_execution_storage_reads.parquet
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_storage_reads.parquet
network_column: meta_network_name
assertions:
- name: total count
- name: total count and bounds
sql: |
SELECT
COUNT(*) AS count
COUNT(*) AS count,
MIN(block_number) AS min_block,
MAX(block_number) AS max_block,
uniq(contract_address) AS unique_addresses
FROM
cluster('{remote_cluster}', default.canonical_execution_storage_reads) FINAL
expected:
count: 35145
count: 44
min_block: "49018"
max_block: "6372586"
unique_addresses: "10"
- name: Case 1 reads exist (simple expiry-reactivation)
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_storage_reads) FINAL
WHERE contract_address = '0x793ae8c1b1a160bfc07bfb0d04f85eab1a71f4f2'
AND slot = '0x0000000000000000000000000000000000000000000000000000000000000000'
expected:
count: 5
- name: Case 6 reactivation read exists (longest expiry ~2.5 years)
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_storage_reads) FINAL
WHERE contract_address = '0x329219be8810602a59b76df9ed7d52dc3afc3e8b'
AND slot = '0x0000000000000000000000000000000000000000000000000000000000000000'
AND block_number = 6365361
expected:
count: 1
- name: Case 11 reads exist (complete 3-cycle)
sql: |
SELECT COUNT(*) AS count
FROM cluster('{remote_cluster}', default.canonical_execution_storage_reads) FINAL
WHERE contract_address = '0xdbf03b407c01e7cd3cbea99509d93f8dddc8c6fb'
AND slot = '0x0000000000000000000000000000000000000000000000000000000000000002'
expected:
count: 12
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ network: mainnet
spec: pectra
external_data:
canonical_execution_storage_diffs:
url: https://data.ethpandaops.io/xatu-cbt/pectra/canonical_execution_storage_diffs.parquet
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_storage_diffs.parquet
network_column: meta_network_name
canonical_execution_storage_reads:
url: https://data.ethpandaops.io/xatu-cbt/pectra/canonical_execution_storage_reads.parquet
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_storage_reads.parquet
network_column: meta_network_name
assertions:
- name: Expected bounds and size
sql: |
SELECT
COUNT(*) AS count,
MIN(block_number) AS min,
MAX(block_number) AS max
MIN(block_number) AS min_block,
MAX(block_number) AS max_block
FROM
int_address_storage_slot_first_access FINAL
expected:
count: 16746
max: "22923437"
min: "22923418"
count: 17
min_block: "49018"
max_block: "6372586"
- name: Expected admin bounds
sql: |
SELECT
Expand All @@ -31,5 +31,21 @@ assertions:
WHERE
table = 'int_address_storage_slot_first_access'
expected:
max: "22923437"
min: "22923418"
max: "6372586"
min: "49018"
- name: Case 1 first access is at block 63809
sql: |
SELECT block_number
FROM int_address_storage_slot_first_access FINAL
WHERE address = '0x793ae8c1b1a160bfc07bfb0d04f85eab1a71f4f2'
AND slot_key = '0x0000000000000000000000000000000000000000000000000000000000000000'
expected:
block_number: "63809"
- name: Case 12 genesis-era first access at block 49018
sql: |
SELECT COUNT(*) AS count
FROM int_address_storage_slot_first_access FINAL
WHERE address = '0x630ea66c8c5dc205d45a978573fa86df5af1fe7a'
AND block_number = 49018
expected:
count: 3
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ network: mainnet
spec: pectra
external_data:
canonical_execution_storage_diffs:
url: https://data.ethpandaops.io/xatu-cbt/pectra/canonical_execution_storage_diffs.parquet
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_storage_diffs.parquet
network_column: meta_network_name
canonical_execution_storage_reads:
url: https://data.ethpandaops.io/xatu-cbt/pectra/canonical_execution_storage_reads.parquet
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_storage_reads.parquet
network_column: meta_network_name
assertions:
- name: Expected bounds and size
sql: |
SELECT
COUNT(*) AS count,
MIN(block_number) AS min,
MAX(block_number) AS max
MIN(block_number) AS min_block,
MAX(block_number) AS max_block
FROM
int_address_storage_slot_last_access FINAL
expected:
count: 16746
max: "22923437"
min: "22923418"
count: 17
min_block: "49018"
max_block: "6372586"
- name: Expected admin bounds
sql: |
SELECT
Expand All @@ -31,5 +31,21 @@ assertions:
WHERE
table = 'int_address_storage_slot_last_access'
expected:
max: "22923437"
min: "22923418"
max: "6372586"
min: "49018"
- name: Case 1 last access is at block 2143395
sql: |
SELECT block_number
FROM int_address_storage_slot_last_access FINAL
WHERE address = '0x793ae8c1b1a160bfc07bfb0d04f85eab1a71f4f2'
AND slot_key = '0x0000000000000000000000000000000000000000000000000000000000000000'
expected:
block_number: "2143395"
- name: Case 11 last access is at block 6372586 (3rd reactivation)
sql: |
SELECT block_number
FROM int_address_storage_slot_last_access FINAL
WHERE address = '0xdbf03b407c01e7cd3cbea99509d93f8dddc8c6fb'
AND slot_key = '0x0000000000000000000000000000000000000000000000000000000000000002'
expected:
block_number: "6372586"
26 changes: 20 additions & 6 deletions tests/mainnet/pectra/models/int_execution_block_by_date.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ network: mainnet
spec: pectra
external_data:
canonical_execution_block:
url: https://data.ethpandaops.io/xatu-cbt/pectra/canonical_execution_block.parquet
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_block.parquet
network_column: meta_network_name
assertions:
- name: Expected size
- name: Expected bounds and size
sql: |
SELECT
COUNT(*) AS count
COUNT(*) AS count,
MIN(block_number) AS min_block,
MAX(block_number) AS max_block
FROM
int_execution_block_by_date FINAL
expected:
count: 20
count: 42
min_block: "49018"
max_block: "6372586"
- name: Expected admin bounds
sql: |
SELECT
Expand All @@ -24,5 +28,15 @@ assertions:
WHERE
table = 'int_execution_block_by_date'
expected:
max: "22923437"
min: "22923418"
max: "6372586"
min: "49018"
- name: Case 12 genesis-era block timestamp exists
sql: |
SELECT
block_number,
toDate(block_date_time) AS block_date
FROM int_execution_block_by_date FINAL
WHERE block_number = 49018
expected:
block_number: "49018"
block_date: "2015-08-07"
60 changes: 60 additions & 0 deletions tests/mainnet/pectra/models/int_storage_slot_diff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
model: int_storage_slot_diff
network: mainnet
spec: pectra
external_data:
canonical_execution_storage_diffs:
url: https://data.ethpandaops.io/xatu-cbt/mainnet/pectra/canonical_execution_storage_diffs.parquet
network_column: meta_network_name
assertions:
- name: Expected bounds and size
sql: |
SELECT
COUNT(*) AS count,
MIN(block_number) AS min_block,
MAX(block_number) AS max_block
FROM
int_storage_slot_diff FINAL
expected:
count: 19
min_block: "49018"
max_block: "5178368"
- name: Expected admin bounds
sql: |
SELECT
MAX(position + interval) AS max,
MIN(position) AS min
FROM
admin_cbt_incremental FINAL
WHERE
table = 'int_storage_slot_diff'
expected:
max: "5178368"
min: "49018"
- name: Case 1 diff exists with correct effective_bytes (7 bytes)
sql: |
SELECT
COUNT(*) AS count,
MIN(effective_bytes_to) AS effective_bytes
FROM int_storage_slot_diff FINAL
WHERE address = '0x793ae8c1b1a160bfc07bfb0d04f85eab1a71f4f2'
AND slot_key = '0x0000000000000000000000000000000000000000000000000000000000000000'
expected:
count: 1
effective_bytes: "7"
- name: Case 10 full 32-byte slot exists
sql: |
SELECT effective_bytes_to AS effective_bytes
FROM int_storage_slot_diff FINAL
WHERE address = '0x4eea5019ef91a8c8bfa80a1eea04bdda526316c4'
AND slot_key = '0x0000000000000000000000000000000000000000000000000000000000000000'
AND block_number = 3873480
expected:
effective_bytes: "32"
- name: Case 12 genesis-era slots exist (3 slots)
sql: |
SELECT COUNT(*) AS count
FROM int_storage_slot_diff FINAL
WHERE address = '0x630ea66c8c5dc205d45a978573fa86df5af1fe7a'
AND block_number = 49018
expected:
count: 3
Loading
Loading