diff --git a/deploy/migrations/clickhouse/001_init.down.sql b/deploy/migrations/clickhouse/001_init.down.sql new file mode 100644 index 000000000..5ad30a890 --- /dev/null +++ b/deploy/migrations/clickhouse/001_init.down.sql @@ -0,0 +1,339 @@ +-- Migration 102: Schema V2 (GENERATED) - DOWN +-- +-- Drops all objects created by 001_init.up.sql in reverse dependency order: +-- 1. Materialized Views +-- 2. Distributed Tables +-- 3. Local Tables +-- 4. Databases + +-- ----------------------------------------------------------------------------- +-- 1. Materialized Views +-- ----------------------------------------------------------------------------- + +DROP VIEW IF EXISTS default.beacon_api_slot_attestation_mv_local ON CLUSTER '{cluster}' SYNC; +DROP VIEW IF EXISTS default.beacon_api_slot_block_mv_local ON CLUSTER '{cluster}' SYNC; + +-- ----------------------------------------------------------------------------- +-- 2. Distributed Tables (default) +-- ----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS default.beacon_api_eth_v1_beacon_blob ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_block_gossip ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v3_validator_block ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_slot ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_block_classification ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.blob_submitter ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.block_native_mempool_transaction ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_sync_aggregate ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_committee ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_sync_committee ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_validators ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_validators_pubkeys ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_validators_withdrawal_credentials ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_address_appearances ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_balance_diffs ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_balance_reads ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_block ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_contracts ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_erc20_transfers ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_erc721_transfers ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_four_byte_counts ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_logs ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_native_transfers ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_nonce_diffs ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_nonce_reads ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_storage_diffs ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_storage_reads ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_traces ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_transaction ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_transaction_structlog ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_transaction_structlog_agg ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.consensus_engine_api_get_blobs ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.ethseer_validator_entity ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_block_metrics ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_engine_get_blobs ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_engine_new_payload ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_state_size ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_transaction ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.imported_sources ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_add_peer ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_connected ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_deliver_message ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_disconnected ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_drop_rpc ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_duplicate_message ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_aggregate_and_proof ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_data_column_sidecar ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_graft ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_handle_metadata ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_handle_status ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_identify ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_join ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_leave ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_peer ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_prune ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_publish_message ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_recv_rpc ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_reject_message ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_remove_peer ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_data_column_custody_probe ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_graft ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_idontwant ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_ihave ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_iwant ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_prune ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_message ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_subscription ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_send_rpc ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_synthetic_heartbeat ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mempool_dumpster_transaction ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mempool_transaction ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mev_relay_bid_trace ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mev_relay_proposer_payload_delivered ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mev_relay_validator_registration ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.node_record_consensus ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.node_record_execution ON CLUSTER '{cluster}' SYNC; + +-- ----------------------------------------------------------------------------- +-- 2. Distributed Tables (observoor) +-- ----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS observoor.block_merge ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.cpu_utilization ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.disk_bytes ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.disk_latency ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.disk_queue_depth ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.fd_close ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.fd_open ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.host_specs ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.mem_compaction ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.mem_reclaim ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.memory_usage ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.net_io ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.oom_kill ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.page_fault_major ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.page_fault_minor ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.process_exit ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.process_fd_usage ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.process_io_usage ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.process_sched_usage ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.raw_events ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.sched_off_cpu ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.sched_on_cpu ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.sched_runqueue ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.swap_in ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.swap_out ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.sync_state ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_epoll_wait ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_fdatasync ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_fsync ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_futex ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_mmap ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_pwrite ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_read ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_write ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.tcp_cwnd ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.tcp_retransmit ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.tcp_rtt ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.tcp_state_change ON CLUSTER '{cluster}' SYNC; + +-- ----------------------------------------------------------------------------- +-- 2. Distributed Tables (admin) +-- ----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS admin.cryo ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS admin.execution_block ON CLUSTER '{cluster}' SYNC; + +-- ----------------------------------------------------------------------------- +-- 3. Local Tables (default) +-- ----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS default.beacon_api_eth_v1_beacon_blob_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_block_gossip_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_data_column_sidecar_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_eth_v3_validator_block_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_api_slot_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.beacon_block_classification_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.blob_submitter_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.block_native_mempool_transaction_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_sync_aggregate_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_committee_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_sync_committee_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_validators_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_validators_pubkeys_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_beacon_validators_withdrawal_credentials_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_address_appearances_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_balance_diffs_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_balance_reads_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_block_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_contracts_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_erc20_transfers_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_erc721_transfers_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_four_byte_counts_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_logs_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_native_transfers_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_nonce_diffs_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_nonce_reads_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_storage_diffs_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_storage_reads_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_traces_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_transaction_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_transaction_structlog_agg_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.consensus_engine_api_get_blobs_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.ethseer_validator_entity_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_block_metrics_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_engine_get_blobs_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_engine_new_payload_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_state_size_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.execution_transaction_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.imported_sources_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_add_peer_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_connected_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_deliver_message_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_disconnected_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_drop_rpc_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_duplicate_message_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_aggregate_and_proof_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_gossipsub_data_column_sidecar_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_graft_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_handle_metadata_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_handle_status_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_identify_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_join_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_leave_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_peer_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_prune_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_publish_message_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_recv_rpc_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_reject_message_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_remove_peer_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_data_column_custody_probe_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_idontwant_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_message_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_send_rpc_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.libp2p_synthetic_heartbeat_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mempool_transaction_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mev_relay_bid_trace_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mev_relay_proposer_payload_delivered_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.mev_relay_validator_registration_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.node_record_consensus_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS default.node_record_execution_local ON CLUSTER '{cluster}' SYNC; + +-- ----------------------------------------------------------------------------- +-- 3. Local Tables (observoor) +-- ----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS observoor.block_merge_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.cpu_utilization_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.disk_bytes_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.disk_latency_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.disk_queue_depth_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.fd_close_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.fd_open_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.host_specs_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.mem_compaction_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.mem_reclaim_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.memory_usage_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.net_io_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.oom_kill_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.page_fault_major_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.page_fault_minor_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.process_exit_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.process_fd_usage_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.process_io_usage_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.process_sched_usage_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.raw_events_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.sched_off_cpu_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.sched_on_cpu_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.sched_runqueue_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.swap_in_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.swap_out_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.sync_state_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_epoll_wait_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_fdatasync_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_fsync_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_futex_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_mmap_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_pwrite_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_read_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.syscall_write_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.tcp_cwnd_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.tcp_retransmit_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.tcp_rtt_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS observoor.tcp_state_change_local ON CLUSTER '{cluster}' SYNC; + +-- ----------------------------------------------------------------------------- +-- 3. Local Tables (admin) +-- ----------------------------------------------------------------------------- + +DROP TABLE IF EXISTS admin.cryo_local ON CLUSTER '{cluster}' SYNC; +DROP TABLE IF EXISTS admin.execution_block_local ON CLUSTER '{cluster}' SYNC; + +-- ----------------------------------------------------------------------------- +-- 4. Databases +-- ----------------------------------------------------------------------------- + +DROP DATABASE IF EXISTS observoor ON CLUSTER '{cluster}' SYNC; +DROP DATABASE IF EXISTS admin ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/001_init.up.sql b/deploy/migrations/clickhouse/001_init.up.sql new file mode 100644 index 000000000..4f8090f52 --- /dev/null +++ b/deploy/migrations/clickhouse/001_init.up.sql @@ -0,0 +1,5078 @@ +-- Migration 102: Schema V2 (GENERATED) +-- +-- Source: schemas + spec.yaml +-- This file is generated by generate_migration.py. + +CREATE DATABASE IF NOT EXISTS observoor ON CLUSTER '{cluster}'; + +CREATE DATABASE IF NOT EXISTS admin ON CLUSTER '{cluster}'; + +-- LOCAL TABLES +-- default database + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_beacon_blob_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon block' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The beacon block root hash' CODEC(ZSTD(1)), + `block_parent_root` FixedString(66) COMMENT 'The beacon block parent root hash' CODEC(ZSTD(1)), + `proposer_index` UInt32 COMMENT 'The validator index of the block proposer' CODEC(ZSTD(1)), + `blob_index` UInt64 COMMENT 'The index of the blob within the block' CODEC(ZSTD(1)), + `kzg_commitment` FixedString(98) COMMENT 'The KZG commitment of the blob' CODEC(ZSTD(1)), + `versioned_hash` FixedString(66) COMMENT 'The versioned hash derived from the KZG commitment (key for joining with execution_engine_get_blobs)' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block_root, blob_index) +COMMENT 'Contains beacon API blob metadata derived from block blob_kzg_commitments from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API committee payload', + `validators` Array(UInt32) COMMENT 'The validator indices in the beacon API committee payload' CODEC(ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, committee_index) +COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), + `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API event stream payload', + `attesting_validator_index` Nullable(UInt32) COMMENT 'The index of the validator attesting to the event' CODEC(ZSTD(1)), + `attesting_validator_committee_index` LowCardinality(String) COMMENT 'The committee index of the attesting validator', + `aggregation_bits` String COMMENT 'The aggregation bits of the event in the beacon API event stream payload' CODEC(ZSTD(1)), + `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `source_epoch` UInt32 COMMENT 'The source epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), + `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `target_epoch` UInt32 COMMENT 'The target epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), + `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name) +COMMENT 'Contains beacon API attestation events from each sentry client attached to a beacon node'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `blob_index` UInt64 COMMENT 'The index of blob sidecar in the beacon API event stream payload' CODEC(ZSTD(1)), + `kzg_commitment` FixedString(98) COMMENT 'The KZG commitment in the beacon API event stream payload' CODEC(ZSTD(1)), + `versioned_hash` FixedString(66) COMMENT 'The versioned hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block_root, blob_index) +COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_block_gossip_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), + `block` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block) +COMMENT 'Contains beacon API eventstream "block_gossip" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), + `block` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `execution_optimistic` Bool COMMENT 'If the attached beacon node is running in execution optimistic mode', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block) +COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number of the chain reorg event in the beacon API event stream payload', + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the reorg slot started', + `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slots between when the reorg occurred and when the sentry received the event', + `depth` UInt16 COMMENT 'The depth of the chain reorg in the beacon API event stream payload', + `old_head_block` FixedString(66) COMMENT 'The old head block root hash in the beacon API event stream payload', + `new_head_block` FixedString(66) COMMENT 'The new head block root hash in the beacon API event stream payload', + `old_head_state` FixedString(66) COMMENT 'The old head state root hash in the beacon API event stream payload', + `new_head_state` FixedString(66) COMMENT 'The new head state root hash in the beacon API event stream payload', + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', + `execution_optimistic` Bool COMMENT 'Whether the execution of the epoch was optimistic', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, old_head_block, new_head_block) +COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `aggregator_index` UInt32 COMMENT 'The validator index of the aggregator in the beacon API event stream payload', + `contribution_slot` UInt32 COMMENT 'The slot number of the contribution in the beacon API event stream payload', + `contribution_slot_start_date_time` DateTime COMMENT 'The wall clock time when the contribution slot started', + `contribution_propagation_slot_start_diff` UInt32 COMMENT 'Difference in slots between when the contribution occurred and when the sentry received the event', + `contribution_beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload', + `contribution_subcommittee_index` LowCardinality(String) COMMENT 'The subcommittee index of the contribution in the beacon API event stream payload', + `contribution_aggregation_bits` String COMMENT 'The aggregation bits of the contribution in the beacon API event stream payload', + `contribution_signature` String COMMENT 'The signature of the contribution in the beacon API event stream payload', + `contribution_epoch` UInt32 COMMENT 'The epoch number of the contribution in the beacon API event stream payload', + `contribution_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the contribution epoch started', + `selection_proof` String COMMENT 'The selection proof in the beacon API event stream payload', + `signature` String COMMENT 'The signature in the beacon API event stream payload', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(contribution_slot_start_date_time)) +ORDER BY (meta_network_name, contribution_slot_start_date_time, meta_client_name, contribution_beacon_block_root, contribution_subcommittee_index, signature) +COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_data_column_sidecar_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `column_index` UInt64 COMMENT 'The index of column in the beacon API event stream payload' CODEC(ZSTD(1)), + `kzg_commitments_count` UInt32 COMMENT 'Number of KZG commitments associated with the record' CODEC(ZSTD(1)), + `kzg_commitments` Array(FixedString(98)) COMMENT 'The KZG commitments in the beacon API event stream payload' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block_root, column_index) +COMMENT 'Contains beacon API eventstream "data_column_sidecar" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', + `block` FixedString(66) COMMENT 'The finalized block root hash in the beacon API event stream payload', + `state` FixedString(66) COMMENT 'The finalized state root hash in the beacon API event stream payload', + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `execution_optimistic` Bool COMMENT 'Whether the execution of the epoch was optimistic', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(epoch_start_date_time)) +ORDER BY (meta_network_name, epoch_start_date_time, meta_client_name, block, state) +COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload', + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', + `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time', + `block` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload', + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', + `epoch_transition` Bool COMMENT 'If the event is an epoch transition', + `execution_optimistic` Bool COMMENT 'If the attached beacon node is running in execution optimistic mode', + `previous_duty_dependent_root` FixedString(66) COMMENT 'The previous duty dependent root in the beacon API event stream payload', + `current_duty_dependent_root` FixedString(66) COMMENT 'The current duty dependent root in the beacon API event stream payload', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block, previous_duty_dependent_root, current_duty_dependent_root) +COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', + `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `validator_index` UInt32 COMMENT 'The index of the validator making the voluntary exit', + `signature` String COMMENT 'The signature of the voluntary exit in the beacon API event stream payload', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(wallclock_epoch_start_date_time)) +ORDER BY (meta_network_name, wallclock_epoch_start_date_time, meta_client_name, validator_index) +COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `proposer_validator_index` UInt32 COMMENT 'The validator index from the proposer duty payload' CODEC(ZSTD(1)), + `proposer_pubkey` String COMMENT 'The BLS public key of the validator from the proposer duty payload' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, proposer_validator_index) +COMMENT 'Contains a proposer duty from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API validator attestation data payload', + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', + `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API validator attestation data payload', + `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API validator attestation data payload', + `epoch` UInt32 COMMENT 'The epoch number in the beacon API validator attestation data payload', + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', + `source_epoch` UInt32 COMMENT 'The source epoch number in the beacon API validator attestation data payload', + `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started', + `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the beacon API validator attestation data payload', + `target_epoch` UInt32 COMMENT 'The target epoch number in the beacon API validator attestation data payload', + `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started', + `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the beacon API validator attestation data payload', + `request_date_time` DateTime COMMENT 'When the request was sent to the beacon node', + `request_duration` UInt32 COMMENT 'The request duration in milliseconds', + `request_slot_start_diff` UInt32 COMMENT 'The difference between the request_date_time and the slot_start_date_time', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, committee_index, beacon_block_root, source_root, target_root) +COMMENT 'Contains beacon API validator attestation data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload', + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the reorg slot started', + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload', + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block', + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `block_total_bytes` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload', + `block_total_bytes_compressed` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload when compressed using snappy', + `parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block', + `state_root` FixedString(66) COMMENT 'The root hash of the beacon state at this block', + `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block', + `eth1_data_block_hash` FixedString(66) COMMENT 'The block hash of the associated execution block', + `eth1_data_deposit_root` FixedString(66) COMMENT 'The root of the deposit tree in the associated execution block', + `execution_payload_block_hash` Nullable(FixedString(66)) COMMENT 'The block hash of the execution payload', + `execution_payload_block_number` Nullable(UInt32) COMMENT 'The block number of the execution payload', + `execution_payload_fee_recipient` Nullable(String) COMMENT 'The recipient of the fee for this execution payload', + `execution_payload_base_fee_per_gas` Nullable(UInt128) COMMENT 'Base fee per gas for execution payload' CODEC(ZSTD(1)), + `execution_payload_blob_gas_used` Nullable(UInt64) COMMENT 'Gas used for blobs in execution payload' CODEC(ZSTD(1)), + `execution_payload_excess_blob_gas` Nullable(UInt64) COMMENT 'Excess gas used for blobs in execution payload' CODEC(ZSTD(1)), + `execution_payload_gas_limit` Nullable(UInt64) COMMENT 'Gas limit for execution payload' CODEC(DoubleDelta, ZSTD(1)), + `execution_payload_gas_used` Nullable(UInt64) COMMENT 'Gas used for execution payload' CODEC(ZSTD(1)), + `execution_payload_state_root` FixedString(66) COMMENT 'The state root of the execution payload', + `execution_payload_parent_hash` FixedString(66) COMMENT 'The parent hash of the execution payload', + `execution_payload_transactions_count` Nullable(UInt32) COMMENT 'The transaction count of the execution payload', + `execution_payload_transactions_total_bytes` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload', + `execution_payload_transactions_total_bytes_compressed` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload when compressed using snappy', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block_root, parent_root, state_root) +COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v3_validator_block_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number within the payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `block_total_bytes` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload' CODEC(ZSTD(1)), + `block_total_bytes_compressed` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload when compressed using snappy' CODEC(ZSTD(1)), + `consensus_payload_value` Nullable(UInt64) COMMENT 'Consensus rewards paid to the proposer for this block, in Wei. Use to determine relative value of consensus blocks.' CODEC(ZSTD(1)), + `execution_payload_value` Nullable(UInt64) COMMENT 'Execution payload value in Wei. Use to determine relative value of execution payload.' CODEC(ZSTD(1)), + `execution_payload_block_number` UInt32 COMMENT 'The block number of the execution payload', + `execution_payload_base_fee_per_gas` Nullable(UInt128) COMMENT 'Base fee per gas for execution payload' CODEC(ZSTD(1)), + `execution_payload_blob_gas_used` Nullable(UInt64) COMMENT 'Gas used for blobs in execution payload' CODEC(ZSTD(1)), + `execution_payload_excess_blob_gas` Nullable(UInt64) COMMENT 'Excess gas used for blobs in execution payload' CODEC(ZSTD(1)), + `execution_payload_gas_limit` Nullable(UInt64) COMMENT 'Gas limit for execution payload' CODEC(DoubleDelta, ZSTD(1)), + `execution_payload_gas_used` Nullable(UInt64) COMMENT 'Gas used for execution payload' CODEC(ZSTD(1)), + `execution_payload_transactions_count` Nullable(UInt32) COMMENT 'The transaction count of the execution payload' CODEC(ZSTD(1)), + `execution_payload_transactions_total_bytes` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload' CODEC(ZSTD(1)), + `execution_payload_transactions_total_bytes_compressed` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload when compressed using snappy' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, event_date_time) +COMMENT 'Contains beacon API /eth/v3/validator/blocks/{slot} data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_slot_local ON CLUSTER '{cluster}' +( + `slot` UInt32 COMMENT 'Slot number' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `blocks` AggregateFunction(sum, UInt16) COMMENT 'The number of beacon blocks seen in the slot' CODEC(ZSTD(1)), + `attestations` AggregateFunction(sum, UInt32) COMMENT 'The number of attestations seen in the slot' CODEC(ZSTD(1)) +) +ENGINE = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, slot) +COMMENT 'Contains beacon API slot data from each sentry client attached to a beacon node'; + +CREATE TABLE IF NOT EXISTS default.beacon_block_classification_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block classification', + `slot` UInt32 COMMENT 'The slot number from beacon block classification', + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block classification' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `best_guess_single` LowCardinality(String) COMMENT 'The best guess of the client that generated the beacon block', + `best_guess_multi` LowCardinality(String) COMMENT 'The best guess of the clients that generated the beacon block. This value will typically equal the best_guess_single value, but when multiple clients have high probabilities, this value will have multiple eg. "prysm or lighthouse"', + `client_probability_uncertain` Float32 COMMENT 'The probability that the client that generated the beacon block is uncertain' CODEC(ZSTD(1)), + `client_probability_prysm` Float32 COMMENT 'The probability that the client that generated the beacon block is Prysm' CODEC(ZSTD(1)), + `client_probability_teku` Float32 COMMENT 'The probability that the client that generated the beacon block is Teku' CODEC(ZSTD(1)), + `client_probability_nimbus` Float32 COMMENT 'The probability that the client that generated the beacon block is Nimbus' CODEC(ZSTD(1)), + `client_probability_lodestar` Float32 COMMENT 'The probability that the client that generated the beacon block is Lodestar' CODEC(ZSTD(1)), + `client_probability_grandine` Float32 COMMENT 'The probability that the client that generated the beacon block is Grandine' CODEC(ZSTD(1)), + `client_probability_lighthouse` Float32 COMMENT 'The probability that the client that generated the beacon block is Lighthouse' CODEC(ZSTD(1)), + `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', + `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', + `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', + `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', + `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, proposer_index) +COMMENT 'Contains beacon block classification for a given slot. This is a best guess based on the client probabilities of the proposer. This is not guaranteed to be correct.'; + +CREATE TABLE IF NOT EXISTS default.blob_submitter_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `address` FixedString(66) COMMENT 'Ethereum address of the blob submitter' CODEC(ZSTD(1)), + `name` String COMMENT 'Name of the blob submitter' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY meta_network_name +ORDER BY (meta_network_name, address) +COMMENT 'Contains blob submitter address to name mappings.'; + +CREATE TABLE IF NOT EXISTS default.block_native_mempool_transaction_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `detecttime` DateTime64(3) COMMENT 'Timestamp that the transaction was detected in mempool' CODEC(DoubleDelta, ZSTD(1)), + `hash` FixedString(66) COMMENT 'Unique identifier hash for a given transaction' CODEC(ZSTD(1)), + `status` LowCardinality(String) COMMENT 'Status of the transaction', + `region` LowCardinality(String) COMMENT 'The geographic region for the node that detected the transaction', + `reorg` Nullable(FixedString(66)) COMMENT 'If there was a reorg, refers to the blockhash of the reorg' CODEC(ZSTD(1)), + `replace` Nullable(FixedString(66)) COMMENT 'If the transaction was replaced (speedup/cancel), the transaction hash of the replacement' CODEC(ZSTD(1)), + `curblocknumber` Nullable(UInt64) COMMENT 'The block number the event was detected in' CODEC(ZSTD(1)), + `failurereason` Nullable(String) COMMENT 'If a transaction failed, this field provides contextual information' CODEC(ZSTD(1)), + `blockspending` Nullable(UInt64) COMMENT 'If a transaction was finalized (confirmed, failed), this refers to the number of blocks that the transaction was waiting to get on-chain' CODEC(ZSTD(1)), + `timepending` Nullable(UInt64) COMMENT 'If a transaction was finalized (confirmed, failed), this refers to the time in milliseconds that the transaction was waiting to get on-chain' CODEC(ZSTD(1)), + `nonce` UInt64 COMMENT 'A unique number which counts the number of transactions sent from a given address' CODEC(ZSTD(1)), + `gas` UInt64 COMMENT 'The maximum number of gas units allowed for the transaction' CODEC(ZSTD(1)), + `gasprice` UInt128 COMMENT 'The price offered to the miner/validator per unit of gas. Denominated in wei' CODEC(ZSTD(1)), + `value` UInt128 COMMENT 'The amount of ETH transferred or sent to contract. Denominated in wei' CODEC(ZSTD(1)), + `toaddress` Nullable(FixedString(42)) COMMENT 'The destination of a given transaction' CODEC(ZSTD(1)), + `fromaddress` FixedString(42) COMMENT 'The source/initiator of a given transaction' CODEC(ZSTD(1)), + `datasize` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), + `data4bytes` Nullable(FixedString(10)) COMMENT 'The first 4 bytes of the call data of the transaction' CODEC(ZSTD(1)), + `network` LowCardinality(String) COMMENT 'The specific Ethereum network used', + `type` UInt8 COMMENT '"Post EIP-1559, this indicates how the gas parameters are submitted to the network: - type 0 - legacy - type 1 - usage of access lists according to EIP-2930 - type 2 - using maxpriorityfeepergas and maxfeepergas"' CODEC(ZSTD(1)), + `maxpriorityfeepergas` Nullable(UInt128) COMMENT 'The maximum value for a tip offered to the miner/validator per unit of gas. The actual tip paid can be lower if (maxfee - basefee) < maxpriorityfee. Denominated in wei' CODEC(ZSTD(1)), + `maxfeepergas` Nullable(UInt128) COMMENT 'The maximum value for the transaction fee (including basefee and tip) offered to the miner/validator per unit of gas. Denominated in wei' CODEC(ZSTD(1)), + `basefeepergas` Nullable(UInt128) COMMENT 'The fee per unit of gas paid and burned for the curblocknumber. This fee is algorithmically determined. Denominated in wei' CODEC(ZSTD(1)), + `dropreason` Nullable(String) COMMENT 'If the transaction was dropped from the mempool, this describes the contextual reason for the drop' CODEC(ZSTD(1)), + `rejectionreason` Nullable(String) COMMENT 'If the transaction was rejected from the mempool, this describes the contextual reason for the rejection' CODEC(ZSTD(1)), + `stuck` Bool COMMENT 'A transaction was detected in the queued area of the mempool and is not eligible for inclusion in a block' CODEC(ZSTD(1)), + `gasused` Nullable(UInt64) COMMENT 'If the transaction was published on-chain, this value indicates the amount of gas that was actually consumed. Denominated in wei' CODEC(ZSTD(1)) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (network, toYYYYMM(detecttime)) +ORDER BY (network, detecttime, hash, fromaddress, nonce, gas) +COMMENT 'Contains transactions from block native mempool dataset'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block' CODEC(ZSTD(1)), + `versioned_hash` FixedString(66) COMMENT 'The versioned hash in the beacon API event stream payload' CODEC(ZSTD(1)), + `kzg_commitment` FixedString(98) COMMENT 'The KZG commitment in the blob sidecar payload' CODEC(ZSTD(1)), + `kzg_proof` FixedString(98) COMMENT 'The KZG proof in the blob sidecar payload' CODEC(ZSTD(1)), + `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), + `blob_index` UInt64 COMMENT 'The index of blob sidecar in the blob sidecar payload' CODEC(ZSTD(1)), + `blob_size` UInt32 COMMENT 'The total bytes of the blob' CODEC(ZSTD(1)), + `blob_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the blob in bytes' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, blob_index) +COMMENT 'Contains a blob sidecar from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `attestation_1_attesting_indices` Array(UInt32) COMMENT 'The attesting indices from the first attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_1_signature` String COMMENT 'The signature from the first attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_1_data_beacon_block_root` FixedString(66) COMMENT 'The beacon block root from the first attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_1_data_slot` UInt32 COMMENT 'The slot number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `attestation_1_data_index` UInt32 COMMENT 'The attestor index from the first attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_1_data_source_epoch` UInt32 COMMENT 'The source epoch number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `attestation_1_data_source_root` FixedString(66) COMMENT 'The source root from the first attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_1_data_target_epoch` UInt32 COMMENT 'The target epoch number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `attestation_1_data_target_root` FixedString(66) COMMENT 'The target root from the first attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_2_attesting_indices` Array(UInt32) COMMENT 'The attesting indices from the second attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_2_signature` String COMMENT 'The signature from the second attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_2_data_beacon_block_root` FixedString(66) COMMENT 'The beacon block root from the second attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_2_data_slot` UInt32 COMMENT 'The slot number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `attestation_2_data_index` UInt32 COMMENT 'The attestor index from the second attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_2_data_source_epoch` UInt32 COMMENT 'The source epoch number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `attestation_2_data_source_root` FixedString(66) COMMENT 'The source root from the second attestation in the slashing payload' CODEC(ZSTD(1)), + `attestation_2_data_target_epoch` UInt32 COMMENT 'The target epoch number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `attestation_2_data_target_root` FixedString(66) COMMENT 'The target root from the second attestation in the slashing payload' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, attestation_1_attesting_indices, attestation_2_attesting_indices, attestation_1_data_slot, attestation_2_data_slot, attestation_1_data_beacon_block_root, attestation_2_data_beacon_block_root) +COMMENT 'Contains attester slashing from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `exchanging_message_validator_index` UInt32 COMMENT 'The validator index from the exchanging message' CODEC(ZSTD(1)), + `exchanging_message_from_bls_pubkey` String COMMENT 'The BLS public key from the exchanging message' CODEC(ZSTD(1)), + `exchanging_message_to_execution_address` FixedString(42) COMMENT 'The execution address from the exchanging message' CODEC(ZSTD(1)), + `exchanging_signature` String COMMENT 'The signature for the exchanging message' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, exchanging_message_validator_index, exchanging_message_from_bls_pubkey, exchanging_message_to_execution_address) +COMMENT 'Contains bls to execution change from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `deposit_proof` Array(String) COMMENT 'The proof of the deposit data' CODEC(ZSTD(1)), + `deposit_data_pubkey` String COMMENT 'The BLS public key of the validator from the deposit data' CODEC(ZSTD(1)), + `deposit_data_withdrawal_credentials` FixedString(66) COMMENT 'The withdrawal credentials of the validator from the deposit data' CODEC(ZSTD(1)), + `deposit_data_amount` UInt128 COMMENT 'The amount of the deposit from the deposit data' CODEC(ZSTD(1)), + `deposit_data_signature` String COMMENT 'The signature of the deposit data' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, deposit_data_pubkey, deposit_proof) +COMMENT 'Contains a deposit from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `position` UInt32 COMMENT 'The position of the transaction in the beacon block' CODEC(DoubleDelta, ZSTD(1)), + `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), + `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), + `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), + `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), + `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), + `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), + `gas_tip_cap` Nullable(UInt128) COMMENT 'The priority fee (tip) the user has set for the transaction' CODEC(ZSTD(1)), + `gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), + `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), + `type` UInt8 COMMENT 'The type of the transaction' CODEC(ZSTD(1)), + `size` UInt32 COMMENT 'The size of the transaction data in bytes' CODEC(ZSTD(1)), + `call_data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), + `blob_gas` Nullable(UInt64) COMMENT 'The maximum gas provided for the blob transaction execution' CODEC(ZSTD(1)), + `blob_gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), + `blob_hashes` Array(String) COMMENT 'The hashes of the blob commitments for blob transactions' CODEC(ZSTD(1)), + `blob_sidecars_size` Nullable(UInt32) COMMENT 'The total size of the sidecars for blob transactions in bytes' CODEC(ZSTD(1)), + `blob_sidecars_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the sidecars for blob transactions in bytes' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, position, hash, nonce) +COMMENT 'Contains execution transaction from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `block_total_bytes` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload' CODEC(ZSTD(1)), + `block_total_bytes_compressed` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload when compressed using snappy' CODEC(ZSTD(1)), + `parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block' CODEC(ZSTD(1)), + `state_root` FixedString(66) COMMENT 'The root hash of the beacon state at this block' CODEC(ZSTD(1)), + `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), + `eth1_data_block_hash` FixedString(66) COMMENT 'The block hash of the associated execution block' CODEC(ZSTD(1)), + `eth1_data_deposit_root` FixedString(66) COMMENT 'The root of the deposit tree in the associated execution block' CODEC(ZSTD(1)), + `execution_payload_block_hash` Nullable(FixedString(66)) COMMENT 'The block hash of the execution payload' CODEC(ZSTD(1)), + `execution_payload_block_number` Nullable(UInt32) COMMENT 'The block number of the execution payload' CODEC(DoubleDelta, ZSTD(1)), + `execution_payload_fee_recipient` Nullable(String) COMMENT 'The recipient of the fee for this execution payload' CODEC(ZSTD(1)), + `execution_payload_base_fee_per_gas` Nullable(UInt128) COMMENT 'Base fee per gas for execution payload' CODEC(ZSTD(1)), + `execution_payload_blob_gas_used` Nullable(UInt64) COMMENT 'Gas used for blobs in execution payload' CODEC(ZSTD(1)), + `execution_payload_excess_blob_gas` Nullable(UInt64) COMMENT 'Excess gas used for blobs in execution payload' CODEC(ZSTD(1)), + `execution_payload_gas_limit` Nullable(UInt64) COMMENT 'Gas limit for execution payload' CODEC(DoubleDelta, ZSTD(1)), + `execution_payload_gas_used` Nullable(UInt64) COMMENT 'Gas used for execution payload' CODEC(ZSTD(1)), + `execution_payload_state_root` Nullable(FixedString(66)) COMMENT 'The state root of the execution payload' CODEC(ZSTD(1)), + `execution_payload_parent_hash` Nullable(FixedString(66)) COMMENT 'The parent hash of the execution payload' CODEC(ZSTD(1)), + `execution_payload_transactions_count` Nullable(UInt32) COMMENT 'The transaction count of the execution payload' CODEC(ZSTD(1)), + `execution_payload_transactions_total_bytes` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload' CODEC(ZSTD(1)), + `execution_payload_transactions_total_bytes_compressed` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload when compressed using snappy' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time) +COMMENT 'Contains beacon block from a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `signed_header_1_message_slot` UInt32 COMMENT 'The slot number from the first signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `signed_header_1_message_proposer_index` UInt32 COMMENT 'The proposer index from the first signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `signed_header_1_message_body_root` FixedString(66) COMMENT 'The body root from the first signed header in the slashing payload' CODEC(ZSTD(1)), + `signed_header_1_message_parent_root` FixedString(66) COMMENT 'The parent root from the first signed header in the slashing payload' CODEC(ZSTD(1)), + `signed_header_1_message_state_root` FixedString(66) COMMENT 'The state root from the first signed header in the slashing payload' CODEC(ZSTD(1)), + `signed_header_1_signature` String COMMENT 'The signature for the first signed header in the slashing payload' CODEC(ZSTD(1)), + `signed_header_2_message_slot` UInt32 COMMENT 'The slot number from the second signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `signed_header_2_message_proposer_index` UInt32 COMMENT 'The proposer index from the second signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), + `signed_header_2_message_body_root` FixedString(66) COMMENT 'The body root from the second signed header in the slashing payload' CODEC(ZSTD(1)), + `signed_header_2_message_parent_root` FixedString(66) COMMENT 'The parent root from the second signed header in the slashing payload' CODEC(ZSTD(1)), + `signed_header_2_message_state_root` FixedString(66) COMMENT 'The state root from the second signed header in the slashing payload' CODEC(ZSTD(1)), + `signed_header_2_signature` String COMMENT 'The signature for the second signed header in the slashing payload' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, signed_header_1_message_slot, signed_header_2_message_slot, signed_header_1_message_proposer_index, signed_header_2_message_proposer_index, signed_header_1_message_body_root, signed_header_2_message_body_root) +COMMENT 'Contains proposer slashing from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_sync_aggregate_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon chain' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon chain' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `sync_committee_period` UInt64 COMMENT 'The sync committee period number (epoch / 256)' CODEC(DoubleDelta, ZSTD(1)), + `sync_committee_bits` String COMMENT 'Raw 512-bit bitvector as hex string' CODEC(ZSTD(1)), + `sync_committee_signature` String COMMENT 'Aggregated signature from participating validators' CODEC(ZSTD(1)), + `validators_participated` Array(UInt32) COMMENT 'Validator indices that participated (voted)' CODEC(ZSTD(1)), + `validators_missed` Array(UInt32) COMMENT 'Validator indices that missed (did not vote)' CODEC(ZSTD(1)), + `participation_count` UInt16 COMMENT 'Number of validators that participated (0-512)' CODEC(DoubleDelta, ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, slot) +COMMENT 'Contains canonical beacon block sync aggregate data with expanded validator participation.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `voluntary_exit_message_epoch` UInt32 COMMENT 'The epoch number from the exit message' CODEC(DoubleDelta, ZSTD(1)), + `voluntary_exit_message_validator_index` UInt32 COMMENT 'The validator index from the exit message' CODEC(ZSTD(1)), + `voluntary_exit_signature` String COMMENT 'The signature of the exit message' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, voluntary_exit_message_epoch, voluntary_exit_message_validator_index) +COMMENT 'Contains a voluntary exit from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), + `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', + `withdrawal_index` UInt32 COMMENT 'The index of the withdrawal' CODEC(ZSTD(1)), + `withdrawal_validator_index` UInt32 COMMENT 'The validator index from the withdrawal data' CODEC(ZSTD(1)), + `withdrawal_address` FixedString(42) COMMENT 'The address of the account that is the withdrawal recipient' CODEC(ZSTD(1)), + `withdrawal_amount` UInt128 COMMENT 'The amount of the withdrawal from the withdrawal data' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, withdrawal_index, withdrawal_validator_index) +COMMENT 'Contains a withdrawal from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_committee_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API committee payload', + `validators` Array(UInt32) COMMENT 'The validator indices in the beacon API committee payload' CODEC(ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, committee_index) +COMMENT 'Contains canonical beacon API /eth/v1/beacon/committees data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_slot` UInt32 COMMENT 'The slot number of the block containing the attestation' CODEC(DoubleDelta, ZSTD(1)), + `block_slot_start_date_time` DateTime COMMENT 'The wall clock time when the block slot started' CODEC(DoubleDelta, ZSTD(1)), + `block_epoch` UInt32 COMMENT 'The epoch number of the block containing the attestation' CODEC(DoubleDelta, ZSTD(1)), + `block_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the block epoch started' CODEC(DoubleDelta, ZSTD(1)), + `position_in_block` UInt32 COMMENT 'The position of the attestation in the block' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'The root of the block containing the attestation' CODEC(ZSTD(1)), + `validators` Array(UInt32) COMMENT 'Array of validator indices participating in the attestation' CODEC(ZSTD(1)), + `committee_index` LowCardinality(String) COMMENT 'The index of the committee making the attestation', + `beacon_block_root` FixedString(66) COMMENT 'The root of the beacon block being attested to' CODEC(ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number being attested to' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), + `source_epoch` UInt32 COMMENT 'The source epoch referenced in the attestation' CODEC(DoubleDelta, ZSTD(1)), + `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), + `source_root` FixedString(66) COMMENT 'The root of the source checkpoint in the attestation' CODEC(ZSTD(1)), + `target_epoch` UInt32 COMMENT 'The target epoch referenced in the attestation' CODEC(DoubleDelta, ZSTD(1)), + `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), + `target_root` FixedString(66) COMMENT 'The root of the target checkpoint in the attestation' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, block_root, block_slot, position_in_block, beacon_block_root, slot, committee_index, source_root, target_root) +COMMENT 'Contains elaborated attestations from beacon blocks.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'The slot number for which the proposer duty is assigned' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number containing the slot' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `proposer_validator_index` UInt32 COMMENT 'The validator index of the proposer for the slot' CODEC(ZSTD(1)), + `proposer_pubkey` String COMMENT 'The public key of the validator proposer' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, proposer_validator_index, proposer_pubkey) +COMMENT 'Contains a proposer duty from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_sync_committee_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number for when the sync committee is active' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `sync_committee_period` UInt64 COMMENT 'The sync committee period number' CODEC(DoubleDelta, ZSTD(1)), + `validator_aggregates` Array(Array(UInt32)) COMMENT 'The validator indices grouped by subcommittee (64 groups of 8)' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(epoch_start_date_time)) +ORDER BY (meta_network_name, epoch_start_date_time, sync_committee_period) +COMMENT 'Contains canonical beacon API /eth/v1/beacon/states/{state_id}/sync_committees data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_validators_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `index` UInt32 COMMENT 'The index of the validator' CODEC(DoubleDelta, ZSTD(1)), + `balance` Nullable(UInt64) COMMENT 'The balance of the validator' CODEC(T64, ZSTD(1)), + `status` LowCardinality(String) COMMENT 'The status of the validator', + `effective_balance` Nullable(UInt64) COMMENT 'The effective balance of the validator' CODEC(ZSTD(1)), + `slashed` Bool COMMENT 'Whether the validator is slashed', + `activation_epoch` Nullable(UInt64) COMMENT 'The epoch when the validator was activated' CODEC(ZSTD(1)), + `activation_eligibility_epoch` Nullable(UInt64) COMMENT 'The epoch when the validator was activated' CODEC(ZSTD(1)), + `exit_epoch` Nullable(UInt64) COMMENT 'The epoch when the validator exited' CODEC(ZSTD(1)), + `withdrawable_epoch` Nullable(UInt64) COMMENT 'The epoch when the validator can withdraw' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(epoch_start_date_time)) +ORDER BY (meta_network_name, epoch_start_date_time, index, status) +COMMENT 'Contains a validator state for an epoch.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_validators_pubkeys_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `index` UInt32 COMMENT 'The index of the validator' CODEC(ZSTD(1)), + `pubkey` String COMMENT 'The public key of the validator' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY meta_network_name +ORDER BY (meta_network_name, index, pubkey) +COMMENT 'Contains a validator state for an epoch.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_validators_withdrawal_credentials_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `index` UInt32 COMMENT 'The index of the validator' CODEC(ZSTD(1)), + `withdrawal_credentials` String COMMENT 'The withdrawal credentials of the validator' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY meta_network_name +ORDER BY (meta_network_name, index, withdrawal_credentials); + +CREATE TABLE IF NOT EXISTS default.canonical_execution_address_appearances_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the address appearance' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the address appearance within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `address` String COMMENT 'The address of the address appearance' CODEC(ZSTD(1)), + `relationship` LowCardinality(String) COMMENT 'The relationship of the address to the transaction', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution address appearance data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_balance_diffs_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the balance diff' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the balance diff within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `address` String COMMENT 'The address of the balance diff' CODEC(ZSTD(1)), + `from_value` UInt256 COMMENT 'The from value of the balance diff' CODEC(ZSTD(1)), + `to_value` UInt256 COMMENT 'The to value of the balance diff' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution balance diff data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_balance_reads_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the balance read' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the balance read within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `address` String COMMENT 'The address of the balance read' CODEC(ZSTD(1)), + `balance` UInt256 COMMENT 'The balance that was read' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution balance read data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_block_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_date_time` DateTime64(3) COMMENT 'The block timestamp' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `block_hash` FixedString(66) COMMENT 'The block hash' CODEC(ZSTD(1)), + `author` Nullable(String) COMMENT 'The block author' CODEC(ZSTD(1)), + `gas_used` Nullable(UInt64) COMMENT 'The block gas used' CODEC(DoubleDelta, ZSTD(1)), + `gas_limit` UInt64 COMMENT 'The block gas limit' CODEC(DoubleDelta, ZSTD(1)), + `extra_data` Nullable(String) COMMENT 'The block extra data in hex' CODEC(ZSTD(1)), + `extra_data_string` Nullable(String) COMMENT 'The block extra data in UTF-8 string' CODEC(ZSTD(1)), + `base_fee_per_gas` Nullable(UInt64) COMMENT 'The block base fee per gas' CODEC(DoubleDelta, ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number) +COMMENT 'Contains canonical execution block data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_contracts_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash that created the contract' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the contract creation within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `create_index` UInt32 COMMENT 'The create index' CODEC(DoubleDelta, ZSTD(1)), + `contract_address` String COMMENT 'The contract address' CODEC(ZSTD(1)), + `deployer` String COMMENT 'The address of the contract deployer' CODEC(ZSTD(1)), + `factory` String COMMENT 'The address of the factory that deployed the contract' CODEC(ZSTD(1)), + `init_code` String COMMENT 'The initialization code of the contract' CODEC(ZSTD(1)), + `code` Nullable(String) COMMENT 'The code of the contract' CODEC(ZSTD(1)), + `init_code_hash` String COMMENT 'The hash of the initialization code' CODEC(ZSTD(1)), + `n_init_code_bytes` UInt32 COMMENT 'Number of bytes in the initialization code' CODEC(DoubleDelta, ZSTD(1)), + `n_code_bytes` UInt32 COMMENT 'Number of bytes in the contract code' CODEC(DoubleDelta, ZSTD(1)), + `code_hash` String COMMENT 'The hash of the contract code' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution contract data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_erc20_transfers_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the transfer within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `log_index` UInt64 COMMENT 'The log index in the block' CODEC(DoubleDelta, ZSTD(1)), + `erc20` String COMMENT 'The erc20 address' CODEC(ZSTD(1)), + `from_address` String COMMENT 'The from address' CODEC(ZSTD(1)), + `to_address` String COMMENT 'The to address' CODEC(ZSTD(1)), + `value` UInt256 COMMENT 'The value of the transfer' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution erc20 transfer data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_erc721_transfers_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the transfer within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `log_index` UInt64 COMMENT 'The log index in the block' CODEC(DoubleDelta, ZSTD(1)), + `erc721` String COMMENT 'The erc20 address' CODEC(ZSTD(1)), + `from_address` String COMMENT 'The from address' CODEC(ZSTD(1)), + `to_address` String COMMENT 'The to address' CODEC(ZSTD(1)), + `token` UInt256 COMMENT 'The token id' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution erc721 transfer data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_four_byte_counts_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), + `signature` String COMMENT 'The signature of the four byte count' CODEC(ZSTD(1)), + `size` UInt64 COMMENT 'The size of the four byte count' CODEC(ZSTD(1)), + `count` UInt64 COMMENT 'The count of the four byte count' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash) +COMMENT 'Contains canonical execution four byte count data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_logs_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash associated with the log' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the log within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `log_index` UInt32 COMMENT 'The log index within the block' CODEC(DoubleDelta, ZSTD(1)), + `address` String COMMENT 'The address associated with the log' CODEC(ZSTD(1)), + `topic0` String COMMENT 'The first topic of the log' CODEC(ZSTD(1)), + `topic1` Nullable(String) COMMENT 'The second topic of the log' CODEC(ZSTD(1)), + `topic2` Nullable(String) COMMENT 'The third topic of the log' CODEC(ZSTD(1)), + `topic3` Nullable(String) COMMENT 'The fourth topic of the log' CODEC(ZSTD(1)), + `data` Nullable(String) COMMENT 'The data associated with the log' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution logs data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_native_transfers_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the transfer within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `transfer_index` UInt64 COMMENT 'The transfer index' CODEC(DoubleDelta, ZSTD(1)), + `from_address` String COMMENT 'The from address' CODEC(ZSTD(1)), + `to_address` String COMMENT 'The to address' CODEC(ZSTD(1)), + `value` UInt256 COMMENT 'The value of the approval' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution native transfer data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_nonce_diffs_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the nonce diff' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the nonce diff within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `address` String COMMENT 'The address of the nonce diff' CODEC(ZSTD(1)), + `from_value` UInt64 COMMENT 'The from value of the nonce diff' CODEC(ZSTD(1)), + `to_value` UInt64 COMMENT 'The to value of the nonce diff' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution nonce diff data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_nonce_reads_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the nonce read' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the nonce read within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `address` String COMMENT 'The address of the nonce read' CODEC(ZSTD(1)), + `nonce` UInt64 COMMENT 'The nonce that was read' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution nonce read data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_storage_diffs_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash associated with the storage diff' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the storage diff within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `address` String COMMENT 'The address associated with the storage diff' CODEC(ZSTD(1)), + `slot` String COMMENT 'The storage slot key' CODEC(ZSTD(1)), + `from_value` String COMMENT 'The original value before the storage diff' CODEC(ZSTD(1)), + `to_value` String COMMENT 'The new value after the storage diff' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution storage diffs data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_storage_reads_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash associated with the storage read' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the storage read within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `contract_address` String COMMENT 'The contract address associated with the storage read' CODEC(ZSTD(1)), + `slot` String COMMENT 'The storage slot key' CODEC(ZSTD(1)), + `value` String COMMENT 'The value read from the storage slot' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution storage reads data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_traces_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), + `internal_index` UInt32 COMMENT 'The internal index of the trace within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `action_from` String COMMENT 'The from address of the action' CODEC(ZSTD(1)), + `action_to` Nullable(String) COMMENT 'The to address of the action' CODEC(ZSTD(1)), + `action_value` UInt256 COMMENT 'The value of the action' CODEC(ZSTD(1)), + `action_gas` UInt64 COMMENT 'The gas provided for the action' CODEC(DoubleDelta, ZSTD(1)), + `action_input` Nullable(String) COMMENT 'The input data for the action' CODEC(ZSTD(1)), + `action_call_type` LowCardinality(String) COMMENT 'The call type of the action' CODEC(ZSTD(1)), + `action_init` Nullable(String) COMMENT 'The initialization code for the action' CODEC(ZSTD(1)), + `action_reward_type` String COMMENT 'The reward type for the action' CODEC(ZSTD(1)), + `action_type` LowCardinality(String) COMMENT 'The type of the action' CODEC(ZSTD(1)), + `result_gas_used` UInt64 COMMENT 'The gas used in the result' CODEC(DoubleDelta, ZSTD(1)), + `result_output` Nullable(String) COMMENT 'The output of the result' CODEC(ZSTD(1)), + `result_code` Nullable(String) COMMENT 'The code returned in the result' CODEC(ZSTD(1)), + `result_address` Nullable(String) COMMENT 'The address returned in the result' CODEC(ZSTD(1)), + `trace_address` Nullable(String) COMMENT 'The trace address' CODEC(ZSTD(1)), + `subtraces` UInt32 COMMENT 'The number of subtraces' CODEC(DoubleDelta, ZSTD(1)), + `error` Nullable(String) COMMENT 'The error, if any, in the trace' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash, internal_index) +COMMENT 'Contains canonical execution traces data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_transaction_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), + `nonce` UInt64 COMMENT 'The transaction nonce' CODEC(ZSTD(1)), + `from_address` String COMMENT 'The transaction from address' CODEC(ZSTD(1)), + `to_address` Nullable(String) COMMENT 'The transaction to address' CODEC(ZSTD(1)), + `value` UInt256 COMMENT 'The transaction value in float64' CODEC(ZSTD(1)), + `input` Nullable(String) COMMENT 'The transaction input in hex' CODEC(ZSTD(1)), + `gas_limit` UInt64 COMMENT 'The transaction gas limit' CODEC(ZSTD(1)), + `gas_used` UInt64 COMMENT 'The transaction gas used' CODEC(ZSTD(1)), + `gas_price` UInt128 COMMENT 'The transaction gas price' CODEC(ZSTD(1)), + `transaction_type` UInt8 COMMENT 'The transaction type' CODEC(ZSTD(1)), + `max_priority_fee_per_gas` UInt64 COMMENT 'The transaction max priority fee per gas' CODEC(ZSTD(1)), + `max_fee_per_gas` UInt64 COMMENT 'The transaction max fee per gas' CODEC(ZSTD(1)), + `success` Bool COMMENT 'The transaction success' CODEC(ZSTD(1)), + `n_input_bytes` UInt32 COMMENT 'The transaction input bytes' CODEC(ZSTD(1)), + `n_input_zero_bytes` UInt32 COMMENT 'The transaction input zero bytes' CODEC(ZSTD(1)), + `n_input_nonzero_bytes` UInt32 COMMENT 'The transaction input nonzero bytes' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, transaction_hash) +COMMENT 'Contains canonical execution transaction data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_transaction_structlog_agg_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction position in the block' CODEC(DoubleDelta, ZSTD(1)), + `call_frame_id` UInt32 COMMENT 'Sequential frame ID within the transaction (0=root)' CODEC(DoubleDelta, ZSTD(1)), + `parent_call_frame_id` Nullable(UInt32) COMMENT 'Parent frame ID (NULL for root frame)' CODEC(ZSTD(1)), + `call_frame_path` Array(UInt32) COMMENT 'Path of frame IDs from root to current frame' CODEC(ZSTD(1)), + `depth` UInt32 COMMENT 'Call nesting depth (0=root)' CODEC(DoubleDelta, ZSTD(1)), + `target_address` Nullable(String) COMMENT 'Contract address being called' CODEC(ZSTD(1)), + `call_type` LowCardinality(String) COMMENT 'Call type: CALL/DELEGATECALL/STATICCALL/CALLCODE/CREATE/CREATE2 (empty for root)', + `operation` LowCardinality(String) COMMENT 'Opcode name for per-opcode rows, empty string for frame summary rows', + `opcode_count` UInt64 COMMENT 'Number of opcodes (total for summary row, count for per-opcode row)' CODEC(ZSTD(1)), + `error_count` UInt64 COMMENT 'Number of errors' CODEC(ZSTD(1)), + `gas` UInt64 COMMENT 'Gas consumed: SUM(gas_self) for per-opcode, frame self gas for summary' CODEC(ZSTD(1)), + `gas_cumulative` UInt64 COMMENT 'Cumulative gas: SUM(gas_used) for per-opcode, frame total for summary' CODEC(ZSTD(1)), + `min_depth` UInt32 COMMENT 'Minimum depth where opcode appeared (per-opcode rows)' CODEC(DoubleDelta, ZSTD(1)), + `max_depth` UInt32 COMMENT 'Maximum depth where opcode appeared (per-opcode rows)' CODEC(DoubleDelta, ZSTD(1)), + `memory_words_sum_before` UInt64 DEFAULT 0 COMMENT 'SUM(ceil(memory_bytes/32)) before each opcode executes. Used with sq_sum to compute memory expansion gas.' CODEC(ZSTD(1)), + `memory_words_sum_after` UInt64 DEFAULT 0 COMMENT 'SUM(ceil(memory_bytes/32)) after each opcode executes.' CODEC(ZSTD(1)), + `memory_words_sq_sum_before` UInt64 DEFAULT 0 COMMENT 'SUM(words_before²). With sum_before, enables exact memory gas via E[cost(after)] - E[cost(before)].' CODEC(ZSTD(1)), + `memory_words_sq_sum_after` UInt64 DEFAULT 0 COMMENT 'SUM(words_after²). With sum_after, enables exact memory gas via E[cost(after)] - E[cost(before)].' CODEC(ZSTD(1)), + `memory_expansion_gas` UInt64 DEFAULT 0 COMMENT 'SUM(memory_expansion_gas). Exact per-opcode memory expansion cost, pre-computed to avoid intDiv rounding in SQL reconstruction.' CODEC(ZSTD(1)), + `cold_access_count` UInt64 DEFAULT 0 COMMENT 'Number of cold storage/account accesses (EIP-2929). cold_gas = cold_count * (cold_cost - warm_cost).' CODEC(ZSTD(1)), + `gas_refund` Nullable(UInt64) COMMENT 'Gas refund (root summary row only)' CODEC(ZSTD(1)), + `intrinsic_gas` Nullable(UInt64) COMMENT 'Intrinsic gas (root summary row only, computed)' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 201600)) +ORDER BY (meta_network_name, block_number, transaction_hash, call_frame_id, operation) +COMMENT 'Aggregated EVM execution data. Summary rows (operation="") contain frame metadata. Per-opcode rows contain aggregated gas/count per (frame, opcode).'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), + `transaction_index` UInt64 COMMENT 'The transaction position in the block' CODEC(DoubleDelta, ZSTD(1)), + `transaction_gas` UInt64 COMMENT 'The transaction gas' CODEC(DoubleDelta, ZSTD(1)), + `transaction_failed` Bool COMMENT 'The transaction failed' CODEC(ZSTD(1)), + `transaction_return_value` Nullable(String) COMMENT 'The transaction return value' CODEC(ZSTD(1)), + `index` UInt32 COMMENT 'The index of this structlog in this transaction' CODEC(DoubleDelta, ZSTD(1)), + `operation` LowCardinality(String) COMMENT 'The operation', + `gas` UInt64 COMMENT 'The gas' CODEC(Delta(8), ZSTD(1)), + `gas_cost` UInt64 COMMENT 'The gas cost' CODEC(DoubleDelta, ZSTD(1)), + `gas_used` UInt64 DEFAULT 0 COMMENT 'Actual gas consumed (computed from consecutive gas values)' CODEC(ZSTD(1)), + `gas_self` UInt64 DEFAULT 0 COMMENT 'Gas consumed by this opcode only, excludes child frame gas for CALL/CREATE opcodes. sum(gas_self) = total execution gas without double counting' CODEC(ZSTD(1)), + `depth` UInt64 COMMENT 'The depth' CODEC(DoubleDelta, ZSTD(1)), + `return_data` Nullable(String) COMMENT 'The return data' CODEC(ZSTD(1)), + `refund` Nullable(UInt64) COMMENT 'The refund' CODEC(ZSTD(1)), + `error` Nullable(String) COMMENT 'The error' CODEC(ZSTD(1)), + `call_to_address` Nullable(String) COMMENT 'Address of a CALL operation' CODEC(ZSTD(1)), + `call_frame_id` UInt32 DEFAULT 0 COMMENT 'Sequential identifier for the call frame within the transaction' CODEC(DoubleDelta, ZSTD(1)), + `call_frame_path` Array(UInt32) DEFAULT [0] COMMENT 'Path of frame IDs from root to current frame' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 201600)) +ORDER BY (meta_network_name, block_number, transaction_hash, index) +COMMENT 'Contains canonical execution transaction structlog data.'; + +CREATE TABLE IF NOT EXISTS default.consensus_engine_api_get_blobs_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event' CODEC(DoubleDelta, ZSTD(1)), + `requested_date_time` DateTime64(3) COMMENT 'Timestamp when the engine_getBlobs call was initiated' CODEC(DoubleDelta, ZSTD(1)), + `duration_ms` UInt64 COMMENT 'How long the engine_getBlobs call took in milliseconds' CODEC(ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number of the beacon block being reconstructed' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number derived from the slot' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'Root of the beacon block (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `parent_block_root` FixedString(66) COMMENT 'Root of the parent beacon block (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `requested_count` UInt32 COMMENT 'Number of versioned hashes requested' CODEC(ZSTD(1)), + `versioned_hashes` Array(FixedString(66)) COMMENT 'List of versioned hashes requested (derived from KZG commitments)' CODEC(ZSTD(1)), + `returned_count` UInt32 COMMENT 'Number of non-null blobs returned' CODEC(ZSTD(1)), + `status` LowCardinality(String) COMMENT 'Result status (SUCCESS, PARTIAL, EMPTY, UNSUPPORTED, ERROR)', + `error_message` Nullable(String) COMMENT 'Error details if status is ERROR or UNSUPPORTED' CODEC(ZSTD(1)), + `method_version` LowCardinality(String) COMMENT 'Version of the engine_getBlobs method (e.g., V1, V2)', + `meta_execution_version` LowCardinality(String) COMMENT 'Full execution client version string from web3_clientVersion RPC', + `meta_execution_implementation` LowCardinality(String) COMMENT 'Execution client implementation name (e.g., Geth, Nethermind, Besu, Reth, Erigon)', + `meta_execution_version_major` LowCardinality(String) COMMENT 'Execution client major version number', + `meta_execution_version_minor` LowCardinality(String) COMMENT 'Execution client minor version number', + `meta_execution_version_patch` LowCardinality(String) COMMENT 'Execution client patch version number', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block_root, event_date_time) +COMMENT 'Contains timing and instrumentation data for engine_getBlobs calls between the consensus and execution layer.'; + +CREATE TABLE IF NOT EXISTS default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event' CODEC(DoubleDelta, ZSTD(1)), + `requested_date_time` DateTime64(3) COMMENT 'Timestamp when the engine_newPayload call was initiated' CODEC(DoubleDelta, ZSTD(1)), + `duration_ms` UInt64 COMMENT 'How long the engine_newPayload call took in milliseconds' CODEC(ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number of the beacon block containing the payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number derived from the slot' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `block_root` FixedString(66) COMMENT 'Root of the beacon block (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `parent_block_root` FixedString(66) COMMENT 'Root of the parent beacon block (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `proposer_index` UInt32 COMMENT 'Validator index of the block proposer' CODEC(ZSTD(1)), + `block_number` UInt64 COMMENT 'Execution block number' CODEC(DoubleDelta, ZSTD(1)), + `block_hash` FixedString(66) COMMENT 'Execution block hash (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `parent_hash` FixedString(66) COMMENT 'Parent execution block hash (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `gas_used` UInt64 COMMENT 'Total gas used by all transactions in the block' CODEC(ZSTD(1)), + `gas_limit` UInt64 COMMENT 'Gas limit of the block' CODEC(ZSTD(1)), + `tx_count` UInt32 COMMENT 'Number of transactions in the block' CODEC(ZSTD(1)), + `blob_count` UInt32 COMMENT 'Number of blobs in the block' CODEC(ZSTD(1)), + `status` LowCardinality(String) COMMENT 'Payload status returned by EL (VALID, INVALID, SYNCING, ACCEPTED, INVALID_BLOCK_HASH)', + `latest_valid_hash` Nullable(FixedString(66)) COMMENT 'Latest valid hash when status is INVALID (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `validation_error` Nullable(String) COMMENT 'Error message when validation fails' CODEC(ZSTD(1)), + `method_version` LowCardinality(String) COMMENT 'Version of the engine_newPayload method (e.g., V3, V4)', + `meta_execution_version` LowCardinality(String), + `meta_execution_implementation` LowCardinality(String) DEFAULT '' COMMENT 'Execution client implementation name (e.g., Geth, Nethermind, Besu, Reth, Erigon)', + `meta_execution_version_major` LowCardinality(String) DEFAULT '' COMMENT 'Execution client major version number', + `meta_execution_version_minor` LowCardinality(String) DEFAULT '' COMMENT 'Execution client minor version number', + `meta_execution_version_patch` LowCardinality(String) DEFAULT '' COMMENT 'Execution client patch version number', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, block_hash, event_date_time) +COMMENT 'Contains timing and instrumentation data for engine_newPayload calls between the consensus and execution layer.'; + +CREATE TABLE IF NOT EXISTS default.ethseer_validator_entity_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from ethseer.io' CODEC(DoubleDelta, ZSTD(1)), + `index` UInt32 COMMENT 'The index of the validator' CODEC(DoubleDelta, ZSTD(1)), + `pubkey` String COMMENT 'The public key of the validator' CODEC(ZSTD(1)), + `entity` String COMMENT 'The entity of the validator' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY meta_network_name +ORDER BY (meta_network_name, index, pubkey) +COMMENT 'Contains a mapping of validators to entities'; + +CREATE TABLE IF NOT EXISTS default.execution_block_metrics_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the event was received' CODEC(DoubleDelta, ZSTD(1)), + `source` LowCardinality(String) COMMENT 'Data source (e.g., client-logs)', + `block_number` UInt64 COMMENT 'Execution block number' CODEC(DoubleDelta, ZSTD(1)), + `block_hash` FixedString(66) COMMENT 'Execution block hash (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `gas_used` UInt64 COMMENT 'Total gas used by all transactions in the block' CODEC(ZSTD(1)), + `tx_count` UInt32 COMMENT 'Number of transactions in the block' CODEC(ZSTD(1)), + `execution_ms` Float64 COMMENT 'Time spent executing transactions in milliseconds' CODEC(ZSTD(1)), + `state_read_ms` Float64 COMMENT 'Time spent reading state in milliseconds' CODEC(ZSTD(1)), + `state_hash_ms` Float64 COMMENT 'Time spent computing state hash in milliseconds' CODEC(ZSTD(1)), + `commit_ms` Float64 COMMENT 'Time spent committing state changes in milliseconds' CODEC(ZSTD(1)), + `total_ms` Float64 COMMENT 'Total time for block processing in milliseconds' CODEC(ZSTD(1)), + `mgas_per_sec` Float64 COMMENT 'Throughput in million gas per second' CODEC(ZSTD(1)), + `state_reads_accounts` UInt64 COMMENT 'Number of account reads' CODEC(ZSTD(1)), + `state_reads_storage_slots` UInt64 COMMENT 'Number of storage slot reads' CODEC(ZSTD(1)), + `state_reads_code` UInt64 COMMENT 'Number of code reads' CODEC(ZSTD(1)), + `state_reads_code_bytes` UInt64 COMMENT 'Total bytes of code read' CODEC(ZSTD(1)), + `state_writes_accounts` UInt64 COMMENT 'Number of account writes' CODEC(ZSTD(1)), + `state_writes_accounts_deleted` UInt64 COMMENT 'Number of accounts deleted' CODEC(ZSTD(1)), + `state_writes_storage_slots` UInt64 COMMENT 'Number of storage slot writes' CODEC(ZSTD(1)), + `state_writes_storage_slots_deleted` UInt64 COMMENT 'Number of storage slots deleted' CODEC(ZSTD(1)), + `state_writes_code` UInt64 COMMENT 'Number of code writes' CODEC(ZSTD(1)), + `state_writes_code_bytes` UInt64 COMMENT 'Total bytes of code written' CODEC(ZSTD(1)), + `account_cache_hits` Int64 COMMENT 'Number of account cache hits' CODEC(ZSTD(1)), + `account_cache_misses` Int64 COMMENT 'Number of account cache misses' CODEC(ZSTD(1)), + `account_cache_hit_rate` Float64 COMMENT 'Account cache hit rate as percentage' CODEC(ZSTD(1)), + `storage_cache_hits` Int64 COMMENT 'Number of storage cache hits' CODEC(ZSTD(1)), + `storage_cache_misses` Int64 COMMENT 'Number of storage cache misses' CODEC(ZSTD(1)), + `storage_cache_hit_rate` Float64 COMMENT 'Storage cache hit rate as percentage' CODEC(ZSTD(1)), + `code_cache_hits` Int64 COMMENT 'Number of code cache hits' CODEC(ZSTD(1)), + `code_cache_misses` Int64 COMMENT 'Number of code cache misses' CODEC(ZSTD(1)), + `code_cache_hit_rate` Float64 COMMENT 'Code cache hit rate as percentage' CODEC(ZSTD(1)), + `code_cache_hit_bytes` Int64 COMMENT 'Total bytes of code cache hits' CODEC(ZSTD(1)), + `code_cache_miss_bytes` Int64 COMMENT 'Total bytes of code cache misses' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, meta_client_name, event_date_time) +COMMENT 'Contains detailed performance metrics from execution client structured logging for block execution'; + +CREATE TABLE IF NOT EXISTS default.execution_engine_get_blobs_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the event was received' CODEC(DoubleDelta, ZSTD(1)), + `requested_date_time` DateTime64(3) COMMENT 'Timestamp when the engine_getBlobs call was received' CODEC(DoubleDelta, ZSTD(1)), + `duration_ms` UInt64 COMMENT 'How long the engine_getBlobs call took in milliseconds' CODEC(ZSTD(1)), + `source` LowCardinality(String) COMMENT 'Source of the event (SNOOPER, EXECUTION_CLIENT)', + `requested_count` UInt32 COMMENT 'Number of versioned hashes requested' CODEC(ZSTD(1)), + `versioned_hashes` Array(FixedString(66)) COMMENT 'List of versioned hashes requested (hex encoded)' CODEC(ZSTD(1)), + `returned_count` UInt32 COMMENT 'Number of non-null blobs returned' CODEC(ZSTD(1)), + `returned_blob_indexes` Array(UInt8) COMMENT 'Indexes (0-based) of the requested versioned_hashes that were successfully returned', + `status` LowCardinality(String) COMMENT 'Result status (SUCCESS, PARTIAL, EMPTY, UNSUPPORTED, ERROR)', + `error_message` Nullable(String) COMMENT 'Error details if status is ERROR or UNSUPPORTED' CODEC(ZSTD(1)), + `method_version` LowCardinality(String) COMMENT 'Version of the engine_getBlobs method (e.g., V1, V2)', + `meta_execution_implementation` LowCardinality(String) COMMENT 'Implementation of the execution client (e.g., go-ethereum, reth, nethermind)', + `meta_execution_version` LowCardinality(String) COMMENT 'Version of the execution client', + `meta_execution_version_major` LowCardinality(String) COMMENT 'Major version number of the execution client', + `meta_execution_version_minor` LowCardinality(String) COMMENT 'Minor version number of the execution client', + `meta_execution_version_patch` LowCardinality(String) COMMENT 'Patch version number of the execution client', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name) +COMMENT 'Contains timing and instrumentation data for engine_getBlobs calls from the execution layer perspective.'; + +CREATE TABLE IF NOT EXISTS default.execution_engine_new_payload_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the event was received' CODEC(DoubleDelta, ZSTD(1)), + `requested_date_time` DateTime64(3) COMMENT 'Timestamp when the engine_newPayload call was received' CODEC(DoubleDelta, ZSTD(1)), + `duration_ms` UInt64 COMMENT 'How long the engine_newPayload call took in milliseconds' CODEC(ZSTD(1)), + `source` LowCardinality(String) COMMENT 'Source of the event (SNOOPER, EXECUTION_CLIENT)', + `block_number` UInt64 COMMENT 'Execution block number' CODEC(DoubleDelta, ZSTD(1)), + `block_hash` FixedString(66) COMMENT 'Execution block hash (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `parent_hash` FixedString(66) COMMENT 'Parent execution block hash (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `gas_used` UInt64 COMMENT 'Total gas used by all transactions in the block' CODEC(ZSTD(1)), + `gas_limit` UInt64 COMMENT 'Gas limit of the block' CODEC(ZSTD(1)), + `tx_count` UInt32 COMMENT 'Number of transactions in the block' CODEC(ZSTD(1)), + `blob_count` UInt32 COMMENT 'Number of blobs in the block' CODEC(ZSTD(1)), + `status` LowCardinality(String) COMMENT 'Payload status returned (VALID, INVALID, SYNCING, ACCEPTED, INVALID_BLOCK_HASH)', + `latest_valid_hash` Nullable(FixedString(66)) COMMENT 'Latest valid hash when status is INVALID (hex encoded with 0x prefix)' CODEC(ZSTD(1)), + `validation_error` Nullable(String) COMMENT 'Error message when validation fails' CODEC(ZSTD(1)), + `method_version` LowCardinality(String) COMMENT 'Version of the engine_newPayload method (e.g., V3, V4)', + `meta_execution_implementation` LowCardinality(String) COMMENT 'Implementation of the execution client (e.g., go-ethereum, reth, nethermind)', + `meta_execution_version` LowCardinality(String) COMMENT 'Version of the execution client', + `meta_execution_version_major` LowCardinality(String) COMMENT 'Major version number of the execution client', + `meta_execution_version_minor` LowCardinality(String) COMMENT 'Minor version number of the execution client', + `meta_execution_version_patch` LowCardinality(String) COMMENT 'Patch version number of the execution client', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, meta_client_name, block_hash, event_date_time) +COMMENT 'Contains timing and instrumentation data for engine_newPayload calls from the execution layer perspective.'; + +CREATE TABLE IF NOT EXISTS default.execution_state_size_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the state size measurement was taken' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'Block number at which the state size was measured' CODEC(DoubleDelta, ZSTD(1)), + `state_root` FixedString(66) COMMENT 'State root hash of the execution layer at this block' CODEC(ZSTD(1)), + `accounts` UInt64 COMMENT 'Total number of accounts in the state' CODEC(ZSTD(1)), + `account_bytes` UInt64 COMMENT 'Total bytes used by account data' CODEC(ZSTD(1)), + `account_trienodes` UInt64 COMMENT 'Number of trie nodes in the account trie' CODEC(ZSTD(1)), + `account_trienode_bytes` UInt64 COMMENT 'Total bytes used by account trie nodes' CODEC(ZSTD(1)), + `contract_codes` UInt64 COMMENT 'Total number of contract codes stored' CODEC(ZSTD(1)), + `contract_code_bytes` UInt64 COMMENT 'Total bytes used by contract code' CODEC(ZSTD(1)), + `storages` UInt64 COMMENT 'Total number of storage slots in the state' CODEC(ZSTD(1)), + `storage_bytes` UInt64 COMMENT 'Total bytes used by storage data' CODEC(ZSTD(1)), + `storage_trienodes` UInt64 COMMENT 'Number of trie nodes in the storage trie' CODEC(ZSTD(1)), + `storage_trienode_bytes` UInt64 COMMENT 'Total bytes used by storage trie nodes' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_execution_version` LowCardinality(String) COMMENT 'Execution client version that generated the event', + `meta_execution_version_major` LowCardinality(String) COMMENT 'Execution client major version that generated the event', + `meta_execution_version_minor` LowCardinality(String) COMMENT 'Execution client minor version that generated the event', + `meta_execution_version_patch` LowCardinality(String) COMMENT 'Execution client patch version that generated the event', + `meta_execution_implementation` LowCardinality(String) COMMENT 'Execution client implementation that generated the event' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, meta_client_name, state_root, event_date_time) +COMMENT 'Contains execution layer state size metrics including account, contract code, and storage data measurements at specific block heights.'; + +CREATE TABLE IF NOT EXISTS default.execution_transaction_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `block_hash` FixedString(66) COMMENT 'The block hash' CODEC(ZSTD(1)), + `parent_hash` FixedString(66) COMMENT 'The parent block hash' CODEC(ZSTD(1)), + `position` UInt32 COMMENT 'The position of the transaction in the beacon block' CODEC(DoubleDelta, ZSTD(1)), + `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), + `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), + `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), + `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), + `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), + `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), + `gas_tip_cap` Nullable(UInt128) COMMENT 'The priority fee (tip) the user has set for the transaction' CODEC(ZSTD(1)), + `gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), + `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), + `type` UInt8 COMMENT 'The type of the transaction' CODEC(ZSTD(1)), + `size` UInt32 COMMENT 'The size of the transaction data in bytes' CODEC(ZSTD(1)), + `call_data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), + `blob_gas` Nullable(UInt64) COMMENT 'The maximum gas provided for the blob transaction execution' CODEC(ZSTD(1)), + `blob_gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), + `blob_hashes` Array(String) COMMENT 'The hashes of the blob commitments for blob transactions' CODEC(ZSTD(1)), + `success` Bool COMMENT 'The transaction success' CODEC(ZSTD(1)), + `n_input_bytes` UInt32 COMMENT 'The transaction input bytes' CODEC(ZSTD(1)), + `n_input_zero_bytes` UInt32 COMMENT 'The transaction input zero bytes' CODEC(ZSTD(1)), + `n_input_nonzero_bytes` UInt32 COMMENT 'The transaction input nonzero bytes' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, intDiv(block_number, 5000000)) +ORDER BY (meta_network_name, block_number, block_hash, position) +COMMENT 'Contains execution transaction data that may not be canonical.'; + +CREATE TABLE IF NOT EXISTS default.imported_sources_local ON CLUSTER '{cluster}' +( + `create_date_time` DateTime64(3) COMMENT 'Creation date of this row' CODEC(DoubleDelta, ZSTD(1)), + `target_date_time` DateTime COMMENT 'The date of the data that was imported' CODEC(DoubleDelta, ZSTD(1)), + `source` LowCardinality(String) COMMENT 'Source of the data that was imported' +) +ENGINE = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') +PARTITION BY toStartOfMonth(create_date_time) +ORDER BY (create_date_time, source) +COMMENT 'This table contains the list of sources that have been imported into the database'; + +CREATE TABLE IF NOT EXISTS default.libp2p_add_peer_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `protocol` LowCardinality(String) COMMENT 'Protocol used by the peer', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key) +COMMENT 'Contains the details of the peers added to the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_connected_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `remote_peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the remote peer', + `remote_protocol` LowCardinality(String) COMMENT 'Protocol of the remote peer', + `remote_transport_protocol` LowCardinality(String) COMMENT 'Transport protocol of the remote peer', + `remote_port` Nullable(UInt16) COMMENT 'Port of the remote peer' CODEC(ZSTD(1)), + `remote_ip` Nullable(IPv6) COMMENT 'IP address of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_city` LowCardinality(String) COMMENT 'City of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_country` LowCardinality(String) COMMENT 'Country of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_country_code` LowCardinality(String) COMMENT 'Country code of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_agent_implementation` LowCardinality(String) COMMENT 'Implementation of the remote peer', + `remote_agent_version` LowCardinality(String) COMMENT 'Version of the remote peer', + `remote_agent_version_major` LowCardinality(String) COMMENT 'Major version of the remote peer', + `remote_agent_version_minor` LowCardinality(String) COMMENT 'Minor version of the remote peer', + `remote_agent_version_patch` LowCardinality(String) COMMENT 'Patch version of the remote peer', + `remote_agent_platform` LowCardinality(String) COMMENT 'Platform of the remote peer', + `direction` LowCardinality(String) COMMENT 'Connection direction', + `opened` DateTime COMMENT 'Timestamp when the connection was opened' CODEC(DoubleDelta, ZSTD(1)), + `transient` Bool COMMENT 'Whether the connection is transient', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, remote_peer_id_unique_key, direction, opened) +COMMENT 'Contains the details of the CONNECTED events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_deliver_message_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `seq_number` UInt64 COMMENT 'A linearly increasing number that is unique among messages originating from the given peer' CODEC(DoubleDelta, ZSTD(1)), + `local_delivery` Bool COMMENT 'Indicates if the message was delivered to in-process subscribers only', + `peer_id_unique_key` Int64 COMMENT 'Unique key for the peer that delivered the message', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name, message_id, seq_number) +COMMENT 'Contains the details of the DELIVER_MESSAGE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_disconnected_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `remote_peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the remote peer', + `remote_protocol` LowCardinality(String) COMMENT 'Protocol of the remote peer', + `remote_transport_protocol` LowCardinality(String) COMMENT 'Transport protocol of the remote peer', + `remote_port` Nullable(UInt16) COMMENT 'Port of the remote peer' CODEC(ZSTD(1)), + `remote_ip` Nullable(IPv6) COMMENT 'IP address of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_city` LowCardinality(String) COMMENT 'City of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_country` LowCardinality(String) COMMENT 'Country of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_country_code` LowCardinality(String) COMMENT 'Country code of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the remote peer that generated the event' CODEC(ZSTD(1)), + `remote_agent_implementation` LowCardinality(String) COMMENT 'Implementation of the remote peer', + `remote_agent_version` LowCardinality(String) COMMENT 'Version of the remote peer', + `remote_agent_version_major` LowCardinality(String) COMMENT 'Major version of the remote peer', + `remote_agent_version_minor` LowCardinality(String) COMMENT 'Minor version of the remote peer', + `remote_agent_version_patch` LowCardinality(String) COMMENT 'Patch version of the remote peer', + `remote_agent_platform` LowCardinality(String) COMMENT 'Platform of the remote peer', + `direction` LowCardinality(String) COMMENT 'Connection direction', + `opened` DateTime COMMENT 'Timestamp when the connection was opened' CODEC(DoubleDelta, ZSTD(1)), + `transient` Bool COMMENT 'Whether the connection is transient', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, remote_peer_id_unique_key, direction, opened) +COMMENT 'Contains the details of the DISCONNECTED events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_drop_rpc_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each record', + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer receiver', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, meta_client_name) +COMMENT 'Contains the details of the RPC messages dropped by the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_duplicate_message_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `seq_number` UInt64 COMMENT 'A linearly increasing number that is unique among messages originating from the given peer' CODEC(DoubleDelta, ZSTD(1)), + `local_delivery` Bool COMMENT 'Indicates if the message was duplicated locally', + `peer_id_unique_key` Int64 COMMENT 'Unique key for the peer that sent the duplicate message', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name, message_id, seq_number) +COMMENT 'Contains the details of the DUPLICATE_MESSAGE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_aggregate_and_proof_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', + `aggregator_index` UInt32 COMMENT 'Index of the validator who created this aggregate' CODEC(DoubleDelta, ZSTD(1)), + `committee_index` LowCardinality(String) COMMENT 'Committee index from the attestation', + `aggregation_bits` String COMMENT 'Bitfield of aggregated attestation' CODEC(ZSTD(1)), + `beacon_block_root` FixedString(66) COMMENT 'Root of the beacon block being attested to' CODEC(ZSTD(1)), + `source_epoch` UInt32 COMMENT 'Source epoch from the attestation' CODEC(DoubleDelta, ZSTD(1)), + `source_root` FixedString(66) COMMENT 'Source root from the attestation' CODEC(ZSTD(1)), + `target_epoch` UInt32 COMMENT 'Target epoch from the attestation' CODEC(DoubleDelta, ZSTD(1)), + `target_root` FixedString(66) COMMENT 'Target root from the attestation' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, peer_id_unique_key, message_id) +COMMENT 'Table for libp2p gossipsub aggregate and proof data.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'The epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `committee_index` LowCardinality(String) COMMENT 'The committee index in the attestation', + `attesting_validator_index` Nullable(UInt32) COMMENT 'The index of the validator attesting to the event' CODEC(ZSTD(1)), + `attesting_validator_committee_index` LowCardinality(String) COMMENT 'The committee index of the attesting validator', + `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', + `aggregation_bits` String COMMENT 'The aggregation bits of the event in the attestation' CODEC(ZSTD(1)), + `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the attestation' CODEC(ZSTD(1)), + `source_epoch` UInt32 COMMENT 'The source epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), + `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), + `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the attestation' CODEC(ZSTD(1)), + `target_epoch` UInt32 COMMENT 'The target epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), + `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), + `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the attestation' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, peer_id_unique_key, message_id) +COMMENT 'Table for libp2p gossipsub beacon attestation data.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), + `block` FixedString(66) COMMENT 'The beacon block root hash' CODEC(ZSTD(1)), + `proposer_index` UInt32 COMMENT 'The proposer index of the beacon block' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, peer_id_unique_key, message_id) +COMMENT 'Table for libp2p gossipsub beacon block data.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), + `proposer_index` UInt32 COMMENT 'The proposer index of the beacon block' CODEC(ZSTD(1)), + `blob_index` UInt32 COMMENT 'Blob index associated with the record' CODEC(ZSTD(1)), + `beacon_block_root` FixedString(66) CODEC(ZSTD(1)), + `parent_root` FixedString(66) COMMENT 'Parent root of the beacon block' CODEC(ZSTD(1)), + `state_root` FixedString(66) COMMENT 'State root of the beacon block' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, peer_id_unique_key, message_id) +COMMENT 'Table for libp2p gossipsub blob sidecar data'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_data_column_sidecar_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), + `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), + `proposer_index` UInt32 COMMENT 'The proposer index of the beacon block' CODEC(ZSTD(1)), + `column_index` UInt64 COMMENT 'Column index associated with the record' CODEC(ZSTD(1)), + `kzg_commitments_count` UInt32 COMMENT 'Number of KZG commitments associated with the record' CODEC(ZSTD(1)), + `beacon_block_root` FixedString(66) CODEC(ZSTD(1)), + `parent_root` FixedString(66) COMMENT 'Parent root of the beacon block' CODEC(ZSTD(1)), + `state_root` FixedString(66) COMMENT 'State root of the beacon block' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, meta_client_name, peer_id_unique_key, message_id) +COMMENT 'Table for libp2p gossipsub data column sidecar data'; + +CREATE TABLE IF NOT EXISTS default.libp2p_graft_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `peer_id_unique_key` Int64 COMMENT 'Unique key for the peer that initiated the GRAFT (eg joined the mesh for this topic) identifies mesh membership changes per peer.', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name) +COMMENT 'Contains the details of the GRAFT events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_handle_metadata_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the RPC', + `error` Nullable(String) COMMENT 'Error message if the metadata handling failed' CODEC(ZSTD(1)), + `protocol` LowCardinality(String) COMMENT 'The protocol of the metadata handling event', + `direction` LowCardinality(String) COMMENT 'Direction of the RPC request (inbound or outbound)' CODEC(ZSTD(1)), + `attnets` String COMMENT 'Attestation subnets the peer is subscribed to' CODEC(ZSTD(1)), + `seq_number` UInt64 COMMENT 'Sequence number of the metadata' CODEC(DoubleDelta, ZSTD(1)), + `syncnets` String COMMENT 'Sync subnets the peer is subscribed to' CODEC(ZSTD(1)), + `custody_group_count` Nullable(UInt8) COMMENT 'Number of custody groups (0-127)' CODEC(ZSTD(1)), + `latency_milliseconds` Decimal(10, 3) COMMENT 'How long it took to handle the metadata request in milliseconds' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, attnets, seq_number, syncnets, latency_milliseconds) +COMMENT 'Contains the metadata handling events for libp2p peers.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_handle_status_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `error` Nullable(String) COMMENT 'Error message if the status handling failed' CODEC(ZSTD(1)), + `protocol` LowCardinality(String) COMMENT 'The protocol of the status handling event', + `direction` LowCardinality(String) COMMENT 'Direction of the RPC request (inbound or outbound)' CODEC(ZSTD(1)), + `request_finalized_epoch` Nullable(UInt32) COMMENT 'Requested finalized epoch' CODEC(DoubleDelta, ZSTD(1)), + `request_finalized_root` Nullable(String) COMMENT 'Requested finalized root', + `request_fork_digest` LowCardinality(String) COMMENT 'Requested fork digest', + `request_head_root` Nullable(FixedString(66)) COMMENT 'Requested head root' CODEC(ZSTD(1)), + `request_head_slot` Nullable(UInt32) COMMENT 'Requested head slot' CODEC(ZSTD(1)), + `request_earliest_available_slot` Nullable(UInt32) COMMENT 'Requested earliest available slot' CODEC(ZSTD(1)), + `response_finalized_epoch` Nullable(UInt32) COMMENT 'Response finalized epoch' CODEC(DoubleDelta, ZSTD(1)), + `response_finalized_root` Nullable(FixedString(66)) COMMENT 'Response finalized root' CODEC(ZSTD(1)), + `response_fork_digest` LowCardinality(String) COMMENT 'Response fork digest', + `response_head_root` Nullable(FixedString(66)) COMMENT 'Response head root' CODEC(ZSTD(1)), + `response_head_slot` Nullable(UInt32) COMMENT 'Response head slot' CODEC(DoubleDelta, ZSTD(1)), + `response_earliest_available_slot` Nullable(UInt32) COMMENT 'Response earliest available slot' CODEC(ZSTD(1)), + `latency_milliseconds` Decimal(10, 3) COMMENT 'How long it took to handle the status request in milliseconds' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, latency_milliseconds) +COMMENT 'Contains the status handling events for libp2p peers.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_identify_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `remote_peer_id_unique_key` Int64 CODEC(ZSTD(1)), + `success` Bool CODEC(ZSTD(1)), + `error` Nullable(String) CODEC(ZSTD(1)), + `remote_protocol` LowCardinality(String), + `remote_transport_protocol` LowCardinality(String), + `remote_port` UInt16 CODEC(ZSTD(1)), + `remote_ip` Nullable(IPv6) CODEC(ZSTD(1)), + `remote_geo_city` LowCardinality(String) CODEC(ZSTD(1)), + `remote_geo_country` LowCardinality(String) CODEC(ZSTD(1)), + `remote_geo_country_code` LowCardinality(String) CODEC(ZSTD(1)), + `remote_geo_continent_code` LowCardinality(String) CODEC(ZSTD(1)), + `remote_geo_longitude` Nullable(Float64) CODEC(ZSTD(1)), + `remote_geo_latitude` Nullable(Float64) CODEC(ZSTD(1)), + `remote_geo_autonomous_system_number` Nullable(UInt32) CODEC(ZSTD(1)), + `remote_geo_autonomous_system_organization` Nullable(String) CODEC(ZSTD(1)), + `remote_agent_implementation` LowCardinality(String), + `remote_agent_version` LowCardinality(String), + `remote_agent_version_major` LowCardinality(String), + `remote_agent_version_minor` LowCardinality(String), + `remote_agent_version_patch` LowCardinality(String), + `remote_agent_platform` LowCardinality(String), + `protocol_version` LowCardinality(String), + `protocols` Array(String) CODEC(ZSTD(1)), + `listen_addrs` Array(String) CODEC(ZSTD(1)), + `observed_addr` String CODEC(ZSTD(1)), + `transport` LowCardinality(String), + `security` LowCardinality(String), + `muxer` LowCardinality(String), + `direction` LowCardinality(String), + `remote_multiaddr` String CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_client_version` LowCardinality(String), + `meta_client_implementation` LowCardinality(String), + `meta_client_os` LowCardinality(String), + `meta_client_ip` Nullable(IPv6) CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, remote_peer_id_unique_key, direction) +COMMENT 'Contains libp2p identify protocol exchange results including remote peer agent info, supported protocols, and connection metadata'; + +CREATE TABLE IF NOT EXISTS default.libp2p_join_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer that joined the topic', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name) +COMMENT 'Contains the details of the JOIN events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_leave_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer that left the topic', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name) +COMMENT 'Contains the details of the LEAVE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_peer_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each record, seahash of peer_id + meta_network_name', + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `peer_id` String COMMENT 'Peer ID' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY meta_network_name +ORDER BY unique_key +COMMENT 'Contains the original peer id of a seahashed peer_id + meta_network_name, commonly seen in other tables as the field peer_id_unique_key'; + +CREATE TABLE IF NOT EXISTS default.libp2p_prune_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `peer_id_unique_key` Int64 COMMENT 'Unique key for the peer that was PRUNED (eg removed from the mesh for this topic) identifies mesh membership changes per peer.', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name) +COMMENT 'Contains the details of the PRUNE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_publish_message_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, topic_fork_digest_value, topic_name, message_id) +COMMENT 'Contains the details of the PUBLISH_MESSAGE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_recv_rpc_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each record', + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer sender', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, meta_client_name) +COMMENT 'Contains the details of the RPC messages received by the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_reject_message_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `seq_number` UInt64 COMMENT 'A linearly increasing number that is unique among messages originating from the given peer' CODEC(DoubleDelta, ZSTD(1)), + `local_delivery` Bool COMMENT 'Indicates if the message was rejected by local subscriber', + `peer_id_unique_key` Int64 COMMENT 'Unique key for the peer that rejected the message', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), + `reason` String COMMENT 'Reason for message rejection' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name, message_id, seq_number) +COMMENT 'Contains the details of the REJECT_MESSAGE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_remove_peer_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key) +COMMENT 'Contains the details of the peers removed from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_data_column_custody_probe_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the probe was executed' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number being probed' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number of the slot being probed' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_request_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_request_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_request_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_request_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `column_index` UInt64 COMMENT 'Column index being probed' CODEC(ZSTD(1)), + `column_rows_count` UInt16 COMMENT 'Number of rows in the column' CODEC(ZSTD(1)), + `beacon_block_root` FixedString(66) COMMENT 'Root of the beacon block' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', + `result` LowCardinality(String) COMMENT 'Result of the probe' CODEC(ZSTD(1)), + `response_time_ms` Int32 COMMENT 'Response time in milliseconds' CODEC(ZSTD(1)), + `error` Nullable(String) COMMENT 'Error message if probe failed' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that executed the probe', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, peer_id_unique_key, slot, column_index) +COMMENT 'Contains custody probe events for data column availability verification'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each "Graft" control record', + `updated_date_time` DateTime COMMENT 'Timestamp when the "Graft" control record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the "Graft" control event' CODEC(DoubleDelta, ZSTD(1)), + `control_index` Int32 COMMENT 'Position in the RPC meta control GRAFT array' CODEC(DoubleDelta, ZSTD(1)), + `rpc_meta_unique_key` Int64 COMMENT 'Unique key associated with the "Graft" control metadata', + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the Graft control', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, control_index, meta_client_name) +COMMENT 'Contains the details of the "Graft" control messages from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_idontwant_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each IDONTWANT control record', + `updated_date_time` DateTime COMMENT 'Timestamp when the IDONTWANT control record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the IDONTWANT control event' CODEC(DoubleDelta, ZSTD(1)), + `control_index` Int32 COMMENT 'Position in the RPC meta control idontwant array' CODEC(DoubleDelta, ZSTD(1)), + `message_index` Int32 COMMENT 'Position in the RPC meta control idontwant message_ids array' CODEC(DoubleDelta, ZSTD(1)), + `rpc_meta_unique_key` Int64 COMMENT 'Unique key associated with the IDONTWANT control metadata', + `message_id` String COMMENT 'Identifier of the message associated with the IDONTWANT control' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the IDONTWANT control', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, control_index, peer_id_unique_key, message_id, message_index, meta_client_name) +COMMENT 'Contains the details of the IDONTWANT control messages from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each "I have" control record', + `updated_date_time` DateTime COMMENT 'Timestamp when the "I have" control record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the "I have" control event' CODEC(DoubleDelta, ZSTD(1)), + `rpc_meta_unique_key` Int64 COMMENT 'Unique key associated with the "I have" control metadata', + `message_index` Int32 COMMENT 'Position in the RPC meta control IWANT message_ids array' CODEC(DoubleDelta, ZSTD(1)), + `control_index` Int32 COMMENT 'Position in the RPC meta control IWANT array' CODEC(DoubleDelta, ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `message_id` String COMMENT 'Identifier of the message associated with the "I have" control' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the I have control', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, control_index, message_index, meta_client_name) +COMMENT 'Contains the details of the "I have" control messages from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each "I want" control record', + `updated_date_time` DateTime COMMENT 'Timestamp when the "I want" control record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the "I want" control event' CODEC(DoubleDelta, ZSTD(1)), + `control_index` Int32 COMMENT 'Position in the RPC meta control IWANT array' CODEC(DoubleDelta, ZSTD(1)), + `message_index` Int32 COMMENT 'Position in the RPC meta control IWANT message_ids array' CODEC(DoubleDelta, ZSTD(1)), + `rpc_meta_unique_key` Int64 COMMENT 'Unique key associated with the "I want" control metadata', + `message_id` String COMMENT 'Identifier of the message associated with the "I want" control' CODEC(ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the I want control', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, control_index, message_index, meta_client_name) +COMMENT 'Contains IWANT control messages from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Peers request specific message IDs. Partition: monthly by `event_date_time`'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each "Prune" control record', + `updated_date_time` DateTime COMMENT 'Timestamp when the "Prune" control record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the "Prune" control event' CODEC(DoubleDelta, ZSTD(1)), + `control_index` Int32 COMMENT 'Position in the RPC meta control PRUNE array' CODEC(DoubleDelta, ZSTD(1)), + `rpc_meta_unique_key` Int64 COMMENT 'Unique key associated with the "Prune" control metadata', + `peer_id_index` Int32 CODEC(DoubleDelta, ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the Prune control', + `graft_peer_id_unique_key` Nullable(Int64) COMMENT 'Unique key associated with the identifier of the graft peer involved in the Prune control', + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, control_index, meta_client_name) +COMMENT 'Contains the details of the "Prune" control messages from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_message_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each RPC message record', + `updated_date_time` DateTime COMMENT 'Timestamp when the RPC message record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the RPC event' CODEC(DoubleDelta, ZSTD(1)), + `control_index` Int32 COMMENT 'Position in the RPC meta message array' CODEC(DoubleDelta, ZSTD(1)), + `rpc_meta_unique_key` Int64 COMMENT 'Unique key associated with the RPC metadata', + `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the RPC', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, control_index, meta_client_name) +COMMENT 'Contains the details of the RPC meta messages from the peer'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each RPC subscription record', + `updated_date_time` DateTime COMMENT 'Timestamp when the RPC subscription record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the RPC subscription event' CODEC(DoubleDelta, ZSTD(1)), + `control_index` Int32 COMMENT 'Position in the RPC meta subscription array' CODEC(DoubleDelta, ZSTD(1)), + `rpc_meta_unique_key` Int64 COMMENT 'Unique key associated with the RPC subscription metadata', + `subscribe` Bool COMMENT 'Boolean indicating if it is a subscription or unsubscription', + `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', + `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', + `topic_name` LowCardinality(String) COMMENT 'Name of the topic', + `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the subscription', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, control_index, meta_client_name) +COMMENT 'Contains the details of the RPC subscriptions from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_send_rpc_local ON CLUSTER '{cluster}' +( + `unique_key` Int64 COMMENT 'Unique identifier for each record', + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), + `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer receiver', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, unique_key, meta_client_name) +COMMENT 'Contains the details of the RPC messages sent by the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_synthetic_heartbeat_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'Timestamp of the heartbeat event' CODEC(DoubleDelta, ZSTD(1)), + `remote_peer_id_unique_key` Int64 COMMENT 'Unique key of the remote peer', + `remote_maddrs` String COMMENT 'Multiaddress of the remote peer' CODEC(ZSTD(1)), + `latency_ms` Nullable(Int64) COMMENT 'EWMA latency in milliseconds (0 if unavailable)' CODEC(ZSTD(1)), + `direction` LowCardinality(String) COMMENT 'Connection direction (Unknown/Inbound/Outbound)', + `protocols` Array(String) COMMENT 'List of supported protocols' CODEC(ZSTD(1)), + `connection_age_ms` Nullable(Int64) COMMENT 'Connection age in milliseconds' CODEC(ZSTD(1)), + `remote_agent_implementation` LowCardinality(String) COMMENT 'Implementation of the remote peer', + `remote_agent_version` LowCardinality(String) COMMENT 'Version of the remote peer', + `remote_agent_version_major` LowCardinality(String) COMMENT 'Major version of the remote peer', + `remote_agent_version_minor` LowCardinality(String) COMMENT 'Minor version of the remote peer', + `remote_agent_version_patch` LowCardinality(String) COMMENT 'Patch version of the remote peer', + `remote_agent_platform` LowCardinality(String) COMMENT 'Platform of the remote peer', + `remote_ip` Nullable(IPv6) COMMENT 'IP address of the remote peer' CODEC(ZSTD(1)), + `remote_port` Nullable(UInt16) COMMENT 'Port of the remote peer' CODEC(ZSTD(1)), + `remote_geo_city` LowCardinality(String) COMMENT 'City of the remote peer' CODEC(ZSTD(1)), + `remote_geo_country` LowCardinality(String) COMMENT 'Country of the remote peer' CODEC(ZSTD(1)), + `remote_geo_country_code` LowCardinality(String) COMMENT 'Country code of the remote peer' CODEC(ZSTD(1)), + `remote_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the remote peer' CODEC(ZSTD(1)), + `remote_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the remote peer' CODEC(ZSTD(1)), + `remote_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the remote peer' CODEC(ZSTD(1)), + `remote_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'ASN of the remote peer' CODEC(ZSTD(1)), + `remote_geo_autonomous_system_organization` Nullable(String) COMMENT 'AS organization of the remote peer' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'ASN of the client' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'AS organization of the client' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, remote_peer_id_unique_key, updated_date_time) +COMMENT 'Contains heartbeat events from libp2p peers'; + +CREATE TABLE IF NOT EXISTS default.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'When this row was last updated, this is outside the source data and used for deduplication' CODEC(DoubleDelta, ZSTD(1)), + `timestamp` DateTime64(3) COMMENT 'Timestamp of the transaction' CODEC(DoubleDelta, ZSTD(1)), + `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), + `chain_id` UInt32 COMMENT 'The chain id of the transaction' CODEC(ZSTD(1)), + `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), + `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), + `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), + `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), + `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), + `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), + `gas_tip_cap` Nullable(UInt128) COMMENT 'The gas tip cap of the transaction in wei' CODEC(ZSTD(1)), + `gas_fee_cap` Nullable(UInt128) COMMENT 'The gas fee cap of the transaction in wei' CODEC(ZSTD(1)), + `data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), + `data_4bytes` Nullable(FixedString(10)) COMMENT 'The first 4 bytes of the call data of the transaction' CODEC(ZSTD(1)), + `sources` Array(LowCardinality(String)) COMMENT 'The sources that saw this transaction in their mempool', + `included_at_block_height` Nullable(UInt64) COMMENT 'The block height at which this transaction was included' CODEC(ZSTD(1)), + `included_block_timestamp` Nullable(DateTime64(3)) COMMENT 'The timestamp of the block at which this transaction was included' CODEC(DoubleDelta, ZSTD(1)), + `inclusion_delay_ms` Nullable(Int64) COMMENT 'The delay between the transaction timestamp and the block timestamp' CODEC(ZSTD(1)) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (chain_id, toYYYYMM(timestamp)) +ORDER BY (chain_id, timestamp, hash, from, nonce, gas) +COMMENT 'Contains transactions from mempool dumpster dataset. Following the parquet schema with some additions'; + +CREATE TABLE IF NOT EXISTS default.mempool_transaction_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'The time when the sentry saw the transaction in the mempool' CODEC(DoubleDelta, ZSTD(1)), + `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), + `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), + `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), + `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), + `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), + `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), + `gas_tip_cap` Nullable(UInt128) COMMENT 'The priority fee (tip) the user has set for the transaction', + `gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction', + `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), + `type` Nullable(UInt8) COMMENT 'The type of the transaction', + `size` UInt32 COMMENT 'The size of the transaction data in bytes' CODEC(ZSTD(1)), + `call_data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), + `blob_gas` Nullable(UInt64) COMMENT 'The maximum gas provided for the blob transaction execution', + `blob_gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction', + `blob_hashes` Array(String) COMMENT 'The hashes of the blob commitments for blob transactions', + `blob_sidecars_size` Nullable(UInt32) COMMENT 'The total size of the sidecars for blob transactions in bytes', + `blob_sidecars_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the sidecars for blob transactions in bytes', + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `meta_execution_fork_id_hash` LowCardinality(String) COMMENT 'The hash of the fork ID of the current Ethereum network', + `meta_execution_fork_id_next` LowCardinality(String) COMMENT 'The fork ID of the next planned Ethereum network upgrade' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, hash, from, nonce, gas) +COMMENT 'Each row represents a transaction that was seen in the mempool by a sentry client. Sentries can report the same transaction multiple times if it has been long enough since the last report.'; + +CREATE TABLE IF NOT EXISTS default.mev_relay_bid_trace_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the bid was fetched' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number within the block bid' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The start time for the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number derived from the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The start time for the epoch that the bid is for' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_request_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_request_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_request_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_request_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `requested_at_slot_time` UInt32 COMMENT 'The time in the slot when the request was sent' CODEC(ZSTD(1)), + `response_at_slot_time` UInt32 COMMENT 'The time in the slot when the response was received' CODEC(ZSTD(1)), + `relay_name` String COMMENT 'The relay that the bid was fetched from' CODEC(ZSTD(1)), + `parent_hash` FixedString(66) COMMENT 'The parent hash of the bid' CODEC(ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number of the bid' CODEC(DoubleDelta, ZSTD(1)), + `block_hash` FixedString(66) COMMENT 'The block hash of the bid' CODEC(ZSTD(1)), + `builder_pubkey` String COMMENT 'The builder pubkey of the bid' CODEC(ZSTD(1)), + `proposer_pubkey` String COMMENT 'The proposer pubkey of the bid' CODEC(ZSTD(1)), + `proposer_fee_recipient` FixedString(42) COMMENT 'The proposer fee recipient of the bid' CODEC(ZSTD(1)), + `gas_limit` UInt64 COMMENT 'The gas limit of the bid' CODEC(DoubleDelta, ZSTD(1)), + `gas_used` UInt64 COMMENT 'The gas used of the bid' CODEC(DoubleDelta, ZSTD(1)), + `value` UInt256 COMMENT 'The transaction value in float64' CODEC(ZSTD(1)), + `num_tx` UInt32 COMMENT 'The number of transactions in the bid' CODEC(DoubleDelta, ZSTD(1)), + `timestamp` Int64 COMMENT 'The timestamp of the bid' CODEC(DoubleDelta, ZSTD(1)), + `timestamp_ms` Int64 COMMENT 'The timestamp of the bid in milliseconds' CODEC(DoubleDelta, ZSTD(1)), + `optimistic_submission` Bool COMMENT 'Whether the bid was optimistic' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, relay_name, block_hash, meta_client_name, builder_pubkey, proposer_pubkey) +COMMENT 'Contains MEV relay block bids data.'; + +CREATE TABLE IF NOT EXISTS default.mev_relay_proposer_payload_delivered_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the payload was delivered' CODEC(DoubleDelta, ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number within the payload' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The start time for the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number derived from the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The start time for the epoch that the bid is for' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number of the payload' CODEC(DoubleDelta, ZSTD(1)), + `relay_name` String COMMENT 'The relay that delivered the payload' CODEC(ZSTD(1)), + `block_hash` FixedString(66) COMMENT 'The block hash associated with the payload' CODEC(ZSTD(1)), + `proposer_pubkey` String COMMENT 'The proposer pubkey that received the payload' CODEC(ZSTD(1)), + `builder_pubkey` String COMMENT 'The builder pubkey that sent the payload' CODEC(ZSTD(1)), + `proposer_fee_recipient` FixedString(42) COMMENT 'The proposer fee recipient of the payload' CODEC(ZSTD(1)), + `gas_limit` UInt64 COMMENT 'The gas limit of the payload' CODEC(DoubleDelta, ZSTD(1)), + `gas_used` UInt64 COMMENT 'The gas used by the payload' CODEC(DoubleDelta, ZSTD(1)), + `value` UInt256 COMMENT 'The bid value in wei' CODEC(ZSTD(1)), + `num_tx` UInt32 COMMENT 'The number of transactions in the payload' CODEC(DoubleDelta, ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(slot_start_date_time)) +ORDER BY (meta_network_name, slot_start_date_time, relay_name, block_hash, meta_client_name, builder_pubkey, proposer_pubkey) +COMMENT 'Contains MEV relay proposer payload delivered data.'; + +CREATE TABLE IF NOT EXISTS default.mev_relay_validator_registration_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the registration was fetched' CODEC(DoubleDelta, ZSTD(1)), + `timestamp` Int64 COMMENT 'The timestamp of the registration' CODEC(DoubleDelta, ZSTD(1)), + `relay_name` String COMMENT 'The relay that the registration was fetched from' CODEC(ZSTD(1)), + `validator_index` UInt32 COMMENT 'The validator index of the validator registration' CODEC(ZSTD(1)), + `gas_limit` UInt64 COMMENT 'The gas limit of the validator registration' CODEC(DoubleDelta, ZSTD(1)), + `fee_recipient` String COMMENT 'The fee recipient of the validator registration' CODEC(ZSTD(1)), + `slot` UInt32 COMMENT 'Slot number derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), + `slot_start_date_time` DateTime COMMENT 'The slot start time derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), + `epoch` UInt32 COMMENT 'Epoch number derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), + `epoch_start_date_time` DateTime COMMENT 'The epoch start time derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, meta_client_name, relay_name, validator_index, timestamp) +COMMENT 'Contains MEV relay validator registrations data.'; + +CREATE TABLE IF NOT EXISTS default.node_record_consensus_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the discovery module found the node' CODEC(DoubleDelta, ZSTD(1)), + `enr` String COMMENT 'Ethereum Node Record as text' CODEC(ZSTD(1)), + `node_id` String COMMENT 'ID of the Ethereum Node Record' CODEC(ZSTD(1)), + `peer_id_unique_key` Nullable(Int64) COMMENT 'Unique key associated with the identifier of the peer', + `timestamp` Int64 COMMENT 'Event timestamp in unix time' CODEC(DoubleDelta, ZSTD(1)), + `name` String COMMENT 'Consensus client name' CODEC(ZSTD(1)), + `version` LowCardinality(String) COMMENT 'Consensus client version' CODEC(ZSTD(1)), + `version_major` LowCardinality(String) COMMENT 'Consensus client major version' CODEC(ZSTD(1)), + `version_minor` LowCardinality(String) COMMENT 'Consensus client minor version' CODEC(ZSTD(1)), + `version_patch` LowCardinality(String) COMMENT 'Consensus client patch version' CODEC(ZSTD(1)), + `implementation` LowCardinality(String) COMMENT 'Consensus client implementation' CODEC(ZSTD(1)), + `fork_digest` String COMMENT 'Fork digest value' CODEC(ZSTD(1)), + `next_fork_digest` Nullable(String) COMMENT 'Next fork digest of the next scheduled fork' CODEC(ZSTD(1)), + `finalized_root` String COMMENT 'Finalized beacon block root' CODEC(ZSTD(1)), + `finalized_epoch` UInt64 COMMENT 'Finalized epoch number' CODEC(DoubleDelta, ZSTD(1)), + `head_root` String COMMENT 'Head beacon block root' CODEC(ZSTD(1)), + `head_slot` UInt64 COMMENT 'Head slot number' CODEC(DoubleDelta, ZSTD(1)), + `cgc` Nullable(String) COMMENT 'Represents the nodes custody group count' CODEC(ZSTD(1)), + `finalized_epoch_start_date_time` Nullable(DateTime) COMMENT 'Finalized epoch start time' CODEC(DoubleDelta, ZSTD(1)), + `head_slot_start_date_time` Nullable(DateTime) COMMENT 'Head slot start time' CODEC(DoubleDelta, ZSTD(1)), + `ip` Nullable(IPv6) COMMENT 'IP address of the consensus node' CODEC(ZSTD(1)), + `tcp` Nullable(UInt16) COMMENT 'TCP port from ENR' CODEC(DoubleDelta, ZSTD(1)), + `udp` Nullable(UInt16) COMMENT 'UDP port from ENR' CODEC(DoubleDelta, ZSTD(1)), + `quic` Nullable(UInt16) COMMENT 'QUIC port from ENR' CODEC(DoubleDelta, ZSTD(1)), + `has_ipv6` Bool COMMENT 'Whether the consensus node has an IPv6 address' CODEC(ZSTD(1)), + `geo_city` LowCardinality(String) COMMENT 'City of the consensus node' CODEC(ZSTD(1)), + `geo_country` LowCardinality(String) COMMENT 'Country of the consensus node' CODEC(ZSTD(1)), + `geo_country_code` LowCardinality(String) COMMENT 'Country code of the consensus node' CODEC(ZSTD(1)), + `geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the consensus node' CODEC(ZSTD(1)), + `geo_longitude` Nullable(Float64) COMMENT 'Longitude of the consensus node' CODEC(ZSTD(1)), + `geo_latitude` Nullable(Float64) COMMENT 'Latitude of the consensus node' CODEC(ZSTD(1)), + `geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the consensus node' CODEC(ZSTD(1)), + `geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the consensus node' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, enr, meta_client_name) +COMMENT 'Contains consensus node records discovered by the Xatu discovery module.'; + +CREATE TABLE IF NOT EXISTS default.node_record_execution_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), + `event_date_time` DateTime64(3) COMMENT 'When the event was generated' CODEC(DoubleDelta, ZSTD(1)), + `enr` String COMMENT 'Ethereum Node Record as text' CODEC(ZSTD(1)), + `name` String COMMENT 'Execution client name' CODEC(ZSTD(1)), + `version` LowCardinality(String) COMMENT 'Execution client version' CODEC(ZSTD(1)), + `version_major` LowCardinality(String) COMMENT 'Execution client major version' CODEC(ZSTD(1)), + `version_minor` LowCardinality(String) COMMENT 'Execution client minor version' CODEC(ZSTD(1)), + `version_patch` LowCardinality(String) COMMENT 'Execution client patch version' CODEC(ZSTD(1)), + `implementation` LowCardinality(String) COMMENT 'Execution client implementation' CODEC(ZSTD(1)), + `capabilities` Array(String) COMMENT 'List of capabilities (e.g., eth/65,eth/66)' CODEC(ZSTD(1)), + `protocol_version` String COMMENT 'Protocol version' CODEC(ZSTD(1)), + `total_difficulty` String COMMENT 'Total difficulty of the chain' CODEC(ZSTD(1)), + `head` String COMMENT 'Head block hash' CODEC(ZSTD(1)), + `genesis` String COMMENT 'Genesis block hash' CODEC(ZSTD(1)), + `fork_id_hash` String COMMENT 'Fork ID hash' CODEC(ZSTD(1)), + `fork_id_next` String COMMENT 'Fork ID next block' CODEC(ZSTD(1)), + `node_id` String COMMENT 'Node ID from ENR' CODEC(ZSTD(1)), + `ip` Nullable(IPv6) COMMENT 'IP address of the execution node' CODEC(ZSTD(1)), + `tcp` Nullable(UInt16) COMMENT 'TCP port from ENR' CODEC(DoubleDelta, ZSTD(1)), + `udp` Nullable(UInt16) COMMENT 'UDP port from ENR' CODEC(DoubleDelta, ZSTD(1)), + `has_ipv6` Bool COMMENT 'Whether the execution node has an IPv6 address' CODEC(ZSTD(1)), + `geo_city` LowCardinality(String) COMMENT 'City of the execution node' CODEC(ZSTD(1)), + `geo_country` LowCardinality(String) COMMENT 'Country of the execution node' CODEC(ZSTD(1)), + `geo_country_code` LowCardinality(String) COMMENT 'Country code of the execution node' CODEC(ZSTD(1)), + `geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the execution node' CODEC(ZSTD(1)), + `geo_longitude` Nullable(Float64) COMMENT 'Longitude of the execution node' CODEC(ZSTD(1)), + `geo_latitude` Nullable(Float64) COMMENT 'Latitude of the execution node' CODEC(ZSTD(1)), + `geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the execution node' CODEC(ZSTD(1)), + `geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the execution node' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', + `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', + `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', + `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', + `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), + `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_date_time)) +ORDER BY (meta_network_name, event_date_time, node_id, meta_client_name) +COMMENT 'Contains execution node records discovered by the Xatu discovery module.'; + +-- observoor database + +CREATE TABLE IF NOT EXISTS observoor.block_merge_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `device_id` UInt32 CODEC(ZSTD(1)), + `rw` LowCardinality(String), + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, device_id, rw) +COMMENT 'Aggregated block device I/O merge metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.cpu_utilization_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `total_on_cpu_ns` Float32 CODEC(ZSTD(1)), + `event_count` UInt32 CODEC(ZSTD(1)), + `active_cores` UInt16 CODEC(ZSTD(1)), + `system_cores` UInt16 CODEC(ZSTD(1)), + `max_core_on_cpu_ns` Float32 CODEC(ZSTD(1)), + `max_core_id` UInt32 CODEC(ZSTD(1)), + `mean_core_pct` Float32 CODEC(ZSTD(1)), + `min_core_pct` Float32 CODEC(ZSTD(1)), + `max_core_pct` Float32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated CPU utilization metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.disk_bytes_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `device_id` UInt32 CODEC(ZSTD(1)), + `rw` LowCardinality(String), + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, device_id, rw) +COMMENT 'Aggregated disk I/O byte metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.disk_latency_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `device_id` UInt32 CODEC(ZSTD(1)), + `rw` LowCardinality(String), + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, device_id, rw) +COMMENT 'Aggregated disk I/O latency metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.disk_queue_depth_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `device_id` UInt32 CODEC(ZSTD(1)), + `rw` LowCardinality(String), + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, device_id, rw) +COMMENT 'Aggregated disk queue depth metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.fd_close_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated file descriptor close metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.fd_open_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated file descriptor open metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.host_specs_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `event_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `host_id` String, + `kernel_release` LowCardinality(String), + `os_name` LowCardinality(String), + `architecture` LowCardinality(String), + `cpu_model` String, + `cpu_vendor` LowCardinality(String), + `cpu_online_cores` UInt16 CODEC(ZSTD(1)), + `cpu_logical_cores` UInt16 CODEC(ZSTD(1)), + `cpu_physical_cores` UInt16 CODEC(ZSTD(1)), + `cpu_performance_cores` UInt16 CODEC(ZSTD(1)), + `cpu_efficiency_cores` UInt16 CODEC(ZSTD(1)), + `cpu_unknown_type_cores` UInt16 CODEC(ZSTD(1)), + `cpu_logical_ids` Array(UInt16), + `cpu_core_ids` Array(Int32), + `cpu_package_ids` Array(Int32), + `cpu_die_ids` Array(Int32), + `cpu_cluster_ids` Array(Int32), + `cpu_core_types` Array(UInt8), + `cpu_core_type_labels` Array(String), + `cpu_online_flags` Array(UInt8), + `cpu_max_freq_khz` Array(UInt64), + `cpu_base_freq_khz` Array(UInt64), + `memory_total_bytes` UInt64 CODEC(ZSTD(1)), + `memory_type` LowCardinality(String), + `memory_speed_mts` UInt32 CODEC(ZSTD(1)), + `memory_dimm_count` UInt16 CODEC(ZSTD(1)), + `memory_dimm_sizes_bytes` Array(UInt64), + `memory_dimm_types` Array(String), + `memory_dimm_speeds_mts` Array(UInt32), + `memory_dimm_configured_speeds_mts` Array(UInt32), + `memory_dimm_locators` Array(String), + `memory_dimm_bank_locators` Array(String), + `memory_dimm_manufacturers` Array(String), + `memory_dimm_part_numbers` Array(String), + `memory_dimm_serials` Array(String), + `disk_count` UInt16 CODEC(ZSTD(1)), + `disk_total_bytes` UInt64 CODEC(ZSTD(1)), + `disk_names` Array(String), + `disk_models` Array(String), + `disk_vendors` Array(String), + `disk_serials` Array(String), + `disk_sizes_bytes` Array(UInt64), + `disk_rotational` Array(UInt8), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_time)) +ORDER BY (meta_network_name, event_time, host_id, meta_client_name) +COMMENT 'Periodic host hardware specification snapshots including CPU, memory, and disk details'; + +CREATE TABLE IF NOT EXISTS observoor.mem_compaction_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated memory compaction metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.mem_reclaim_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated memory reclaim metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.memory_usage_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String), + `sampling_rate` Float32 CODEC(ZSTD(1)), + `vm_size_bytes` UInt64 CODEC(ZSTD(1)), + `vm_rss_bytes` UInt64 CODEC(ZSTD(1)), + `rss_anon_bytes` UInt64 CODEC(ZSTD(1)), + `rss_file_bytes` UInt64 CODEC(ZSTD(1)), + `rss_shmem_bytes` UInt64 CODEC(ZSTD(1)), + `vm_swap_bytes` UInt64 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Periodic memory usage snapshots of Ethereum client processes from /proc/[pid]/status'; + +CREATE TABLE IF NOT EXISTS observoor.net_io_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `port_label` LowCardinality(String), + `direction` LowCardinality(String), + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, port_label, direction) +COMMENT 'Aggregated network I/O metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.oom_kill_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated OOM kill events from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.page_fault_major_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated major page fault metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.page_fault_minor_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated minor page fault metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.process_exit_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated process exit events from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.process_fd_usage_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String), + `sampling_rate` Float32 CODEC(ZSTD(1)), + `open_fds` UInt32 CODEC(ZSTD(1)), + `fd_limit_soft` UInt64 CODEC(ZSTD(1)), + `fd_limit_hard` UInt64 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Periodic file descriptor usage snapshots of Ethereum client processes from /proc/[pid]/fd and /proc/[pid]/limits'; + +CREATE TABLE IF NOT EXISTS observoor.process_io_usage_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String), + `sampling_rate` Float32 CODEC(ZSTD(1)), + `rchar_bytes` UInt64 CODEC(ZSTD(1)), + `wchar_bytes` UInt64 CODEC(ZSTD(1)), + `syscr` UInt64 CODEC(ZSTD(1)), + `syscw` UInt64 CODEC(ZSTD(1)), + `read_bytes` UInt64 CODEC(ZSTD(1)), + `write_bytes` UInt64 CODEC(ZSTD(1)), + `cancelled_write_bytes` Int64 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Periodic I/O usage snapshots of Ethereum client processes from /proc/[pid]/io'; + +CREATE TABLE IF NOT EXISTS observoor.process_sched_usage_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String), + `sampling_rate` Float32 CODEC(ZSTD(1)), + `threads` UInt32 CODEC(ZSTD(1)), + `voluntary_ctxt_switches` UInt64 CODEC(ZSTD(1)), + `nonvoluntary_ctxt_switches` UInt64 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Periodic scheduler usage snapshots of Ethereum client processes from /proc/[pid]/status and /proc/[pid]/sched'; + +CREATE TABLE IF NOT EXISTS observoor.raw_events_local ON CLUSTER '{cluster}' +( + `timestamp_ns` UInt64 COMMENT 'Wall clock time of the event in nanoseconds since Unix epoch' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt64 COMMENT 'Ethereum slot number at the time of the event (from wall clock)' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) COMMENT 'Wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `cl_syncing` Bool COMMENT 'Whether the consensus layer was syncing when this event was captured' CODEC(ZSTD(1)), + `el_optimistic` Bool COMMENT 'Whether the execution layer was in optimistic sync mode when this event was captured' CODEC(ZSTD(1)), + `el_offline` Bool COMMENT 'Whether the execution layer was unreachable when this event was captured' CODEC(ZSTD(1)), + `pid` UInt32 COMMENT 'Process ID of the traced Ethereum client' CODEC(ZSTD(1)), + `tid` UInt32 COMMENT 'Thread ID within the traced process' CODEC(ZSTD(1)), + `event_type` LowCardinality(String) COMMENT 'Type of eBPF event (syscall_read, disk_io, net_tx, etc.)', + `client_type` LowCardinality(String) COMMENT 'Ethereum client implementation (geth, reth, prysm, lighthouse, etc.)', + `latency_ns` UInt64 COMMENT 'Latency in nanoseconds for syscall and disk I/O events' CODEC(ZSTD(1)), + `bytes` Int64 COMMENT 'Byte count for I/O events' CODEC(ZSTD(1)), + `src_port` UInt16 COMMENT 'Source port for network events' CODEC(ZSTD(1)), + `dst_port` UInt16 COMMENT 'Destination port for network events' CODEC(ZSTD(1)), + `fd` Int32 COMMENT 'File descriptor number' CODEC(ZSTD(1)), + `filename` String COMMENT 'Filename for fd_open events' CODEC(ZSTD(1)), + `voluntary` Bool COMMENT 'Whether a context switch was voluntary' CODEC(ZSTD(1)), + `on_cpu_ns` UInt64 COMMENT 'Time spent on CPU in nanoseconds before a context switch' CODEC(ZSTD(1)), + `runqueue_ns` UInt64 COMMENT 'Time spent waiting in the run queue' CODEC(ZSTD(1)), + `off_cpu_ns` UInt64 COMMENT 'Time spent off CPU' CODEC(ZSTD(1)), + `major` Bool COMMENT 'Whether a page fault was a major fault' CODEC(ZSTD(1)), + `address` UInt64 COMMENT 'Faulting address for page fault events' CODEC(ZSTD(1)), + `pages` UInt64 COMMENT 'Number of pages for swap events' CODEC(ZSTD(1)), + `rw` UInt8 COMMENT 'Read (0) or write (1) for disk I/O' CODEC(ZSTD(1)), + `queue_depth` UInt32 COMMENT 'Block device queue depth at time of I/O' CODEC(ZSTD(1)), + `device_id` UInt32 COMMENT 'Block device ID (major:minor encoded)' CODEC(ZSTD(1)), + `tcp_state` UInt8 COMMENT 'New TCP state after state change' CODEC(ZSTD(1)), + `tcp_old_state` UInt8 COMMENT 'Previous TCP state before state change' CODEC(ZSTD(1)), + `tcp_srtt_us` UInt32 COMMENT 'Smoothed RTT in microseconds' CODEC(ZSTD(1)), + `tcp_cwnd` UInt32 COMMENT 'Congestion window size' CODEC(ZSTD(1)), + `exit_code` UInt32 COMMENT 'Process exit code' CODEC(ZSTD(1)), + `target_pid` UInt32 COMMENT 'Target PID for OOM kill events' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the node running the observoor agent', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name (mainnet, holesky, etc.)' +) +ENGINE = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') +PARTITION BY (meta_network_name, toYYYYMM(wallclock_slot_start_date_time)) +ORDER BY (meta_network_name, wallclock_slot_start_date_time, client_type, event_type, pid) +COMMENT 'Raw eBPF events captured from Ethereum client processes, one row per kernel event.'; + +CREATE TABLE IF NOT EXISTS observoor.sched_off_cpu_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated scheduler off-CPU metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.sched_on_cpu_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated scheduler on-CPU metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.sched_runqueue_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated scheduler run queue metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.swap_in_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated swap-in metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.swap_out_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated swap-out metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.sync_state_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) COMMENT 'Version column for ReplacingMergeTree deduplication' CODEC(DoubleDelta, ZSTD(1)), + `event_time` DateTime64(3) COMMENT 'Time when the sync state was sampled' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot` UInt32 COMMENT 'Ethereum slot number at sampling time' CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) COMMENT 'Wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), + `cl_syncing` Bool COMMENT 'Whether the consensus layer is syncing' CODEC(ZSTD(1)), + `el_optimistic` Bool COMMENT 'Whether the execution layer is in optimistic sync mode' CODEC(ZSTD(1)), + `el_offline` Bool COMMENT 'Whether the execution layer is unreachable' CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String) COMMENT 'Name of the node running the observoor agent', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name (mainnet, holesky, etc.)' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(event_time)) +ORDER BY (meta_network_name, event_time, meta_client_name) +COMMENT 'Sync state snapshots for consensus and execution layers'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_epoll_wait_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated epoll_wait syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_fdatasync_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated fdatasync syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_fsync_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated fsync syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_futex_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated futex syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_mmap_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated mmap syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_pwrite_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated pwrite syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_read_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated read syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_write_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `histogram` Tuple( le_1us UInt32, le_10us UInt32, le_100us UInt32, le_1ms UInt32, le_10ms UInt32, le_100ms UInt32, le_1s UInt32, le_10s UInt32, le_100s UInt32, inf UInt32) CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated write syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.tcp_cwnd_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `port_label` LowCardinality(String), + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, port_label) +COMMENT 'Aggregated TCP congestion window metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.tcp_retransmit_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `port_label` LowCardinality(String), + `direction` LowCardinality(String), + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, port_label, direction) +COMMENT 'Aggregated TCP retransmit metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.tcp_rtt_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `port_label` LowCardinality(String), + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `min` Float32 CODEC(ZSTD(1)), + `max` Float32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, port_label) +COMMENT 'Aggregated TCP round-trip time metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.tcp_state_change_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `window_start` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `interval_ms` UInt16 CODEC(ZSTD(1)), + `wallclock_slot` UInt32 CODEC(DoubleDelta, ZSTD(1)), + `wallclock_slot_start_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `pid` UInt32 CODEC(ZSTD(1)), + `client_type` LowCardinality(String), + `sampling_mode` LowCardinality(String) DEFAULT 'none', + `sampling_rate` Float32 DEFAULT 1., + `sum` Float32 CODEC(ZSTD(1)), + `count` UInt32 CODEC(ZSTD(1)), + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String) +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY (meta_network_name, toYYYYMM(window_start)) +ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type) +COMMENT 'Aggregated TCP state change events from eBPF tracing of Ethereum client processes'; + +-- admin database + +CREATE TABLE IF NOT EXISTS admin.cryo_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), + `dataset` LowCardinality(String), + `mode` LowCardinality(String), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY meta_network_name +ORDER BY (dataset, mode, meta_network_name) +COMMENT 'Tracks cryo dataset processing state per block'; + +CREATE TABLE IF NOT EXISTS admin.execution_block_local ON CLUSTER '{cluster}' +( + `updated_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), + `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), + `processor` LowCardinality(String) COMMENT 'The type of processor that processed the block', + `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', + `complete` UInt8, + `task_count` UInt32 +) +ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) +PARTITION BY meta_network_name +ORDER BY (block_number, processor, meta_network_name) +COMMENT 'Tracks execution block processing state'; + +-- DISTRIBUTED TABLES +-- default database + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_beacon_blob ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_beacon_blob_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_beacon_blob_local', cityHash64(slot_start_date_time, meta_client_name, block_root)) +COMMENT 'Contains beacon API blob metadata derived from block blob_kzg_commitments from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_beacon_committee_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_beacon_committee_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, committee_index)) +COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_attestation_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_attestation_local', cityHash64(slot_start_date_time, meta_client_name)) +COMMENT 'Contains beacon API eventstream "attestation" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_blob_sidecar_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_blob_sidecar_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, block_root, blob_index)) +COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_block_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_block_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, block)) +COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_block_gossip ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_block_gossip_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_block_gossip_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, block)) +COMMENT 'Contains beacon API eventstream "block_gossip" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_chain_reorg_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_chain_reorg_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, old_head_block, new_head_block)) +COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_contribution_and_proof_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_contribution_and_proof_local', cityHash64(contribution_slot_start_date_time, meta_network_name, meta_client_name, contribution_beacon_block_root, contribution_subcommittee_index, signature)) +COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_data_column_sidecar_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_data_column_sidecar_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, block_root, column_index)) +COMMENT 'Contains beacon API eventstream "data_column_sidecar" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_finalized_checkpoint_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_finalized_checkpoint_local', cityHash64(epoch_start_date_time, meta_network_name, meta_client_name, block, state)) +COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_head_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_head_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, block, previous_duty_dependent_root, current_duty_dependent_root)) +COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures head events. Each row represents a `head` event from the Beacon API `/eth/v1/events?topics=head`, indicating the chain''s canonical head has been updated. Sentry adds client metadata and propagation timing. Partition: monthly by `slot_start_date_time`.'''; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_events_voluntary_exit_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_events_voluntary_exit_local', cityHash64(wallclock_epoch_start_date_time, meta_network_name, meta_client_name, validator_index)) +COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_proposer_duty_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_proposer_duty_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, proposer_validator_index)) +COMMENT 'Contains a proposer duty from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v1_validator_attestation_data_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v1_validator_attestation_data_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, committee_index, beacon_block_root, source_root, target_root)) +COMMENT 'Contains beacon API validator attestation data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v2_beacon_block_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v2_beacon_block_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, block_root, parent_root, state_root)) +COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_eth_v3_validator_block ON CLUSTER '{cluster}' +AS default.beacon_api_eth_v3_validator_block_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_eth_v3_validator_block_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, event_date_time)) +COMMENT 'Contains beacon API /eth/v3/validator/blocks/{slot} data from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_api_slot ON CLUSTER '{cluster}' +AS default.beacon_api_slot_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_api_slot_local', cityHash64(slot_start_date_time, slot)) +COMMENT 'Aggregated beacon API slot data. Each row represents a slot from each sentry client attached to a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.beacon_block_classification ON CLUSTER '{cluster}' +AS default.beacon_block_classification_local +ENGINE = Distributed('{cluster}', 'default', 'beacon_block_classification_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, proposer_index)) +COMMENT 'Contains beacon block classification for a given slot. This is a best guess based on the client probabilities of the proposer. This is not guaranteed to be correct.'; + +CREATE TABLE IF NOT EXISTS default.blob_submitter ON CLUSTER '{cluster}' +AS default.blob_submitter_local +ENGINE = Distributed('{cluster}', 'default', 'blob_submitter_local', cityHash64(address, meta_network_name)) +COMMENT 'Contains blob submitter address to name mappings.'; + +CREATE TABLE IF NOT EXISTS default.block_native_mempool_transaction ON CLUSTER '{cluster}' +AS default.block_native_mempool_transaction_local +ENGINE = Distributed('{cluster}', 'default', 'block_native_mempool_transaction_local', cityHash64(detecttime, network, hash, fromaddress, nonce, gas)) +COMMENT 'Contains transactions from block native mempool dataset'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' +AS default.canonical_beacon_blob_sidecar_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_blob_sidecar_local', cityHash64(slot_start_date_time, meta_network_name, block_root, blob_index)) +COMMENT 'Contains a blob sidecar from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_local', cityHash64(slot_start_date_time, meta_network_name)) +COMMENT 'Contains beacon block from a beacon node.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_attester_slashing_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_attester_slashing_local', cityHash64(slot_start_date_time, meta_network_name, block_root, attestation_1_attesting_indices, attestation_2_attesting_indices, attestation_1_data_slot, attestation_2_data_slot, attestation_1_data_beacon_block_root, attestation_2_data_beacon_block_root)) +COMMENT 'Contains attester slashing from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_bls_to_execution_change_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_bls_to_execution_change_local', cityHash64(slot_start_date_time, meta_network_name, block_root, exchanging_message_validator_index, exchanging_message_from_bls_pubkey, exchanging_message_to_execution_address)) +COMMENT 'Contains bls to execution change from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_deposit_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_deposit_local', cityHash64(slot_start_date_time, meta_network_name, block_root, deposit_data_pubkey, deposit_proof)) +COMMENT 'Contains a deposit from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_execution_transaction_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_execution_transaction_local', cityHash64(slot_start_date_time, meta_network_name, block_root, position, hash, nonce)) +COMMENT 'Contains execution transaction from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_proposer_slashing_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_proposer_slashing_local', cityHash64(slot_start_date_time, meta_network_name, block_root, signed_header_1_message_slot, signed_header_2_message_slot, signed_header_1_message_proposer_index, signed_header_2_message_proposer_index, signed_header_1_message_body_root, signed_header_2_message_body_root)) +COMMENT 'Contains proposer slashing from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_sync_aggregate ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_sync_aggregate_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_sync_aggregate_local', cityHash64(slot_start_date_time, meta_network_name, slot)) +COMMENT 'Contains canonical beacon block sync aggregate data with expanded validator participation.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_voluntary_exit_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_voluntary_exit_local', cityHash64(slot_start_date_time, meta_network_name, block_root, voluntary_exit_message_epoch, voluntary_exit_message_validator_index)) +COMMENT 'Contains a voluntary exit from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' +AS default.canonical_beacon_block_withdrawal_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_block_withdrawal_local', cityHash64(slot_start_date_time, meta_network_name, block_root, withdrawal_index, withdrawal_validator_index)) +COMMENT 'Contains a withdrawal from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_committee ON CLUSTER '{cluster}' +AS default.canonical_beacon_committee_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_committee_local', cityHash64(slot_start_date_time, meta_network_name, committee_index)) +COMMENT 'Contains canonical beacon API /eth/v1/beacon/committees data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' +AS default.canonical_beacon_elaborated_attestation_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_elaborated_attestation_local', cityHash64(slot_start_date_time, meta_network_name, block_root, block_slot, position_in_block, beacon_block_root, slot, committee_index, source_root, target_root)) +COMMENT 'Contains elaborated attestations from beacon blocks.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' +AS default.canonical_beacon_proposer_duty_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_proposer_duty_local', cityHash64(slot_start_date_time, meta_network_name, proposer_validator_index, proposer_pubkey)) +COMMENT 'Contains a proposer duty from a beacon block.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_sync_committee ON CLUSTER '{cluster}' +AS default.canonical_beacon_sync_committee_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_sync_committee_local', cityHash64(epoch_start_date_time, meta_network_name, sync_committee_period)) +COMMENT 'Contains canonical beacon API /eth/v1/beacon/states/{state_id}/sync_committees data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_validators ON CLUSTER '{cluster}' +AS default.canonical_beacon_validators_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_validators_local', cityHash64(epoch_start_date_time, meta_network_name, index, status)) +COMMENT 'Contains a validator state for an epoch.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_validators_pubkeys ON CLUSTER '{cluster}' +AS default.canonical_beacon_validators_pubkeys_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_validators_pubkeys_local', cityHash64(index, meta_network_name)) +COMMENT 'Contains a validator pubkeys for an epoch.'; + +CREATE TABLE IF NOT EXISTS default.canonical_beacon_validators_withdrawal_credentials ON CLUSTER '{cluster}' +AS default.canonical_beacon_validators_withdrawal_credentials_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_beacon_validators_withdrawal_credentials_local', cityHash64(index, meta_network_name)) +COMMENT 'Contains a validator withdrawal credentials for an epoch.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_address_appearances ON CLUSTER '{cluster}' +AS default.canonical_execution_address_appearances_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_address_appearances_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution address appearance data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_balance_diffs ON CLUSTER '{cluster}' +AS default.canonical_execution_balance_diffs_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_balance_diffs_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution balance diff data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_balance_reads ON CLUSTER '{cluster}' +AS default.canonical_execution_balance_reads_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_balance_reads_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution balance read data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_block ON CLUSTER '{cluster}' +AS default.canonical_execution_block_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_block_local', cityHash64(block_number, meta_network_name)) +COMMENT 'Contains canonical execution block data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_contracts ON CLUSTER '{cluster}' +AS default.canonical_execution_contracts_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_contracts_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution contract data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_erc20_transfers ON CLUSTER '{cluster}' +AS default.canonical_execution_erc20_transfers_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_erc20_transfers_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution erc20 transfer data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_erc721_transfers ON CLUSTER '{cluster}' +AS default.canonical_execution_erc721_transfers_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_erc721_transfers_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution erc721 transfer data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_four_byte_counts ON CLUSTER '{cluster}' +AS default.canonical_execution_four_byte_counts_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_four_byte_counts_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution four byte count data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_logs ON CLUSTER '{cluster}' +AS default.canonical_execution_logs_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_logs_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution logs data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_native_transfers ON CLUSTER '{cluster}' +AS default.canonical_execution_native_transfers_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_native_transfers_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution native transfer data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_nonce_diffs ON CLUSTER '{cluster}' +AS default.canonical_execution_nonce_diffs_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_nonce_diffs_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution nonce diff data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_nonce_reads ON CLUSTER '{cluster}' +AS default.canonical_execution_nonce_reads_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_nonce_reads_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution nonce read data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_storage_diffs ON CLUSTER '{cluster}' +AS default.canonical_execution_storage_diffs_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_storage_diffs_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution storage diffs data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_storage_reads ON CLUSTER '{cluster}' +AS default.canonical_execution_storage_reads_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_storage_reads_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution storage reads data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_traces ON CLUSTER '{cluster}' +AS default.canonical_execution_traces_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_traces_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution traces data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_transaction ON CLUSTER '{cluster}' +AS default.canonical_execution_transaction_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_transaction_local', cityHash64(block_number, meta_network_name, transaction_hash)) +COMMENT 'Contains canonical execution transaction data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_transaction_structlog ON CLUSTER '{cluster}' +AS default.canonical_execution_transaction_structlog_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_transaction_structlog_local', cityHash64(block_number, meta_network_name, transaction_hash, index)) +COMMENT 'Contains canonical execution transaction structlog data.'; + +CREATE TABLE IF NOT EXISTS default.canonical_execution_transaction_structlog_agg ON CLUSTER '{cluster}' +AS default.canonical_execution_transaction_structlog_agg_local +ENGINE = Distributed('{cluster}', 'default', 'canonical_execution_transaction_structlog_agg_local', cityHash64(block_number, meta_network_name, transaction_hash, call_frame_id)) +COMMENT 'Aggregated EVM execution data. Summary rows (operation="") contain frame metadata. Per-opcode rows contain aggregated gas/count per (frame, opcode).'; + +CREATE TABLE IF NOT EXISTS default.consensus_engine_api_get_blobs ON CLUSTER '{cluster}' +AS default.consensus_engine_api_get_blobs_local +ENGINE = Distributed('{cluster}', 'default', 'consensus_engine_api_get_blobs_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, block_root, event_date_time)) +COMMENT 'Contains timing and instrumentation data for engine_getBlobs calls between the consensus and execution layer.'; + +CREATE TABLE IF NOT EXISTS default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' +AS default.consensus_engine_api_new_payload_local +ENGINE = Distributed('{cluster}', 'default', 'consensus_engine_api_new_payload_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, block_hash, event_date_time)) +COMMENT 'Contains timing and instrumentation data for engine_newPayload calls between the consensus and execution layer.'; + +CREATE TABLE IF NOT EXISTS default.ethseer_validator_entity ON CLUSTER '{cluster}' +AS default.ethseer_validator_entity_local +ENGINE = Distributed('{cluster}', 'default', 'ethseer_validator_entity_local', cityHash64(index, pubkey, meta_network_name)) +COMMENT 'Contains a mapping of validators to entities'; + +CREATE TABLE IF NOT EXISTS default.execution_block_metrics ON CLUSTER '{cluster}' +AS default.execution_block_metrics_local +ENGINE = Distributed('{cluster}', 'default', 'execution_block_metrics_local', cityHash64(block_number, meta_network_name, meta_client_name)) +COMMENT 'Contains detailed performance metrics from execution client structured logging for block execution'; + +CREATE TABLE IF NOT EXISTS default.execution_engine_get_blobs ON CLUSTER '{cluster}' +AS default.execution_engine_get_blobs_local +ENGINE = Distributed('{cluster}', 'default', 'execution_engine_get_blobs_local', cityHash64(event_date_time, meta_network_name, meta_client_name)) +COMMENT 'Contains timing and instrumentation data for engine_getBlobs calls from the execution layer perspective.'; + +CREATE TABLE IF NOT EXISTS default.execution_engine_new_payload ON CLUSTER '{cluster}' +AS default.execution_engine_new_payload_local +ENGINE = Distributed('{cluster}', 'default', 'execution_engine_new_payload_local', cityHash64(block_number, meta_network_name, meta_client_name, block_hash, event_date_time)) +COMMENT 'Contains timing and instrumentation data for engine_newPayload calls from the execution layer perspective.'; + +CREATE TABLE IF NOT EXISTS default.execution_state_size ON CLUSTER '{cluster}' +AS default.execution_state_size_local +ENGINE = Distributed('{cluster}', 'default', 'execution_state_size_local', cityHash64(block_number, meta_network_name, meta_client_name, state_root, event_date_time)) +COMMENT 'Contains execution layer state size metrics including account, contract code, and storage data measurements at specific block heights.'; + +CREATE TABLE IF NOT EXISTS default.execution_transaction ON CLUSTER '{cluster}' +AS default.execution_transaction_local +ENGINE = Distributed('{cluster}', 'default', 'execution_transaction_local', cityHash64(block_number, meta_network_name, block_hash, position)) +COMMENT 'Contains execution transaction data that may not be canonical.'; + +CREATE TABLE IF NOT EXISTS default.imported_sources ON CLUSTER '{cluster}' +AS default.imported_sources_local +ENGINE = Distributed('{cluster}', 'default', 'imported_sources_local', rand()) +COMMENT 'This table contains the list of sources that have been imported into the database'; + +CREATE TABLE IF NOT EXISTS default.libp2p_add_peer ON CLUSTER '{cluster}' +AS default.libp2p_add_peer_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_add_peer_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key)) +COMMENT 'Contains the details of the peers added to the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_connected ON CLUSTER '{cluster}' +AS default.libp2p_connected_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_connected_local', cityHash64(event_date_time, meta_network_name, meta_client_name, remote_peer_id_unique_key, direction, opened)) +COMMENT 'Contains the details of the CONNECTED events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_deliver_message ON CLUSTER '{cluster}' +AS default.libp2p_deliver_message_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_deliver_message_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name, message_id, seq_number)) +COMMENT 'Contains the details of the DELIVER_MESSAGE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_disconnected ON CLUSTER '{cluster}' +AS default.libp2p_disconnected_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_disconnected_local', cityHash64(event_date_time, meta_network_name, meta_client_name, remote_peer_id_unique_key, direction, opened)) +COMMENT 'Contains the details of the DISCONNECTED events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_drop_rpc ON CLUSTER '{cluster}' +AS default.libp2p_drop_rpc_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_drop_rpc_local', unique_key) +COMMENT 'Contains the details of the RPC messages dropped by the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_duplicate_message ON CLUSTER '{cluster}' +AS default.libp2p_duplicate_message_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_duplicate_message_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name, message_id, seq_number)) +COMMENT 'Contains the details of the DUPLICATE_MESSAGE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_aggregate_and_proof ON CLUSTER '{cluster}' +AS default.libp2p_gossipsub_aggregate_and_proof_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_gossipsub_aggregate_and_proof_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, peer_id_unique_key, message_id)) +COMMENT 'Table for libp2p gossipsub aggregate and proof data.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' +AS default.libp2p_gossipsub_beacon_attestation_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_gossipsub_beacon_attestation_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, peer_id_unique_key, message_id)) +COMMENT 'Table for libp2p gossipsub beacon attestation data.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' +AS default.libp2p_gossipsub_beacon_block_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_gossipsub_beacon_block_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, peer_id_unique_key, message_id)) +COMMENT 'Table for libp2p gossipsub beacon block data.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' +AS default.libp2p_gossipsub_blob_sidecar_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_gossipsub_blob_sidecar_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, peer_id_unique_key, message_id)) +COMMENT 'Table for libp2p gossipsub blob sidecar data'; + +CREATE TABLE IF NOT EXISTS default.libp2p_gossipsub_data_column_sidecar ON CLUSTER '{cluster}' +AS default.libp2p_gossipsub_data_column_sidecar_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_gossipsub_data_column_sidecar_local', cityHash64(slot_start_date_time, meta_network_name, meta_client_name, peer_id_unique_key, message_id)) +COMMENT 'Table for libp2p gossipsub data column sidecar data'; + +CREATE TABLE IF NOT EXISTS default.libp2p_graft ON CLUSTER '{cluster}' +AS default.libp2p_graft_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_graft_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name)) +COMMENT 'Contains the details of the GRAFT events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_handle_metadata ON CLUSTER '{cluster}' +AS default.libp2p_handle_metadata_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_handle_metadata_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, latency_milliseconds)) +COMMENT 'Contains the metadata handling events for libp2p peers.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_handle_status ON CLUSTER '{cluster}' +AS default.libp2p_handle_status_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_handle_status_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, latency_milliseconds)) +COMMENT 'Contains the status handling events for libp2p peers.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_identify ON CLUSTER '{cluster}' +AS default.libp2p_identify_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_identify_local', cityHash64(event_date_time, meta_network_name, meta_client_name, remote_peer_id_unique_key, direction)) +COMMENT 'Contains libp2p identify protocol exchange results including remote peer agent info, supported protocols, and connection metadata'; + +CREATE TABLE IF NOT EXISTS default.libp2p_join ON CLUSTER '{cluster}' +AS default.libp2p_join_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_join_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name)) +COMMENT 'Contains the details of the JOIN events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_leave ON CLUSTER '{cluster}' +AS default.libp2p_leave_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_leave_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name)) +COMMENT 'Contains the details of the LEAVE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_peer ON CLUSTER '{cluster}' +AS default.libp2p_peer_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_peer_local', unique_key) +COMMENT 'Contains the original peer id of a seahashed peer_id + meta_network_name, commonly seen in other tables as the field peer_id_unique_key'; + +CREATE TABLE IF NOT EXISTS default.libp2p_prune ON CLUSTER '{cluster}' +AS default.libp2p_prune_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_prune_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name)) +COMMENT 'Contains the details of the PRUNE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_publish_message ON CLUSTER '{cluster}' +AS default.libp2p_publish_message_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_publish_message_local', cityHash64(event_date_time, meta_network_name, meta_client_name, topic_fork_digest_value, topic_name, message_id)) +COMMENT 'Contains the details of the PUBLISH_MESSAGE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_recv_rpc ON CLUSTER '{cluster}' +AS default.libp2p_recv_rpc_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_recv_rpc_local', unique_key) +COMMENT 'Contains the details of the RPC messages received by the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_reject_message ON CLUSTER '{cluster}' +AS default.libp2p_reject_message_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_reject_message_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, topic_fork_digest_value, topic_name, message_id, seq_number)) +COMMENT 'Contains the details of the REJECT_MESSAGE events from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_remove_peer ON CLUSTER '{cluster}' +AS default.libp2p_remove_peer_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_remove_peer_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key)) +COMMENT 'Contains the details of the peers removed from the libp2p client.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_data_column_custody_probe ON CLUSTER '{cluster}' +AS default.libp2p_rpc_data_column_custody_probe_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_rpc_data_column_custody_probe_local', cityHash64(event_date_time, meta_network_name, meta_client_name, peer_id_unique_key, slot, column_index)) +COMMENT 'Contains custody probe events for data column availability verification'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_graft ON CLUSTER '{cluster}' +AS default.libp2p_rpc_meta_control_graft_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_rpc_meta_control_graft_local', unique_key) +COMMENT 'Contains the details of the "Graft" control messages from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_idontwant ON CLUSTER '{cluster}' +AS default.libp2p_rpc_meta_control_idontwant_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_rpc_meta_control_idontwant_local', unique_key) +COMMENT 'Contains the details of the IDONTWANT control messages from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_ihave ON CLUSTER '{cluster}' +AS default.libp2p_rpc_meta_control_ihave_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_rpc_meta_control_ihave_local', unique_key) +COMMENT 'Contains the details of the "I have" control messages from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_iwant ON CLUSTER '{cluster}' +AS default.libp2p_rpc_meta_control_iwant_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_rpc_meta_control_iwant_local', unique_key) +COMMENT 'Contains IWANT control messages from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Peers request specific message IDs. Partition: monthly by `event_date_time`'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_control_prune ON CLUSTER '{cluster}' +AS default.libp2p_rpc_meta_control_prune_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_rpc_meta_control_prune_local', unique_key) +COMMENT 'Contains the details of the "Prune" control messages from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_message ON CLUSTER '{cluster}' +AS default.libp2p_rpc_meta_message_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_rpc_meta_message_local', unique_key) +COMMENT 'Contains the details of the RPC meta messages from the peer'; + +CREATE TABLE IF NOT EXISTS default.libp2p_rpc_meta_subscription ON CLUSTER '{cluster}' +AS default.libp2p_rpc_meta_subscription_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_rpc_meta_subscription_local', unique_key) +COMMENT 'Contains the details of the RPC subscriptions from the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_send_rpc ON CLUSTER '{cluster}' +AS default.libp2p_send_rpc_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_send_rpc_local', unique_key) +COMMENT 'Contains the details of the RPC messages sent by the peer.'; + +CREATE TABLE IF NOT EXISTS default.libp2p_synthetic_heartbeat ON CLUSTER '{cluster}' +AS default.libp2p_synthetic_heartbeat_local +ENGINE = Distributed('{cluster}', 'default', 'libp2p_synthetic_heartbeat_local', cityHash64(event_date_time, meta_network_name, meta_client_name, remote_peer_id_unique_key, updated_date_time)) +COMMENT 'Contains heartbeat events from libp2p peers'; + +CREATE TABLE IF NOT EXISTS default.mempool_dumpster_transaction ON CLUSTER '{cluster}' +AS default.mempool_dumpster_transaction_local +ENGINE = Distributed('{cluster}', 'default', 'mempool_dumpster_transaction_local', cityHash64(timestamp, chain_id, hash, from, nonce, gas)) +COMMENT 'Contains transactions from mempool dumpster dataset. Following the parquet schema with some additions'; + +CREATE TABLE IF NOT EXISTS default.mempool_transaction ON CLUSTER '{cluster}' +AS default.mempool_transaction_local +ENGINE = Distributed('{cluster}', 'default', 'mempool_transaction_local', cityHash64(event_date_time, meta_network_name, meta_client_name, hash, from, nonce, gas)) +COMMENT 'Each row represents a transaction that was seen in the mempool by a sentry client. Sentries can report the same transaction multiple times if it has been long enough since the last report.'; + +CREATE TABLE IF NOT EXISTS default.mev_relay_bid_trace ON CLUSTER '{cluster}' +AS default.mev_relay_bid_trace_local +ENGINE = Distributed('{cluster}', 'default', 'mev_relay_bid_trace_local', cityHash64(slot, meta_network_name)) +COMMENT 'Contains MEV relay block bids data.'; + +CREATE TABLE IF NOT EXISTS default.mev_relay_proposer_payload_delivered ON CLUSTER '{cluster}' +AS default.mev_relay_proposer_payload_delivered_local +ENGINE = Distributed('{cluster}', 'default', 'mev_relay_proposer_payload_delivered_local', cityHash64(slot, meta_network_name)) +COMMENT 'Contains MEV relay proposer payload delivered data.'; + +CREATE TABLE IF NOT EXISTS default.mev_relay_validator_registration ON CLUSTER '{cluster}' +AS default.mev_relay_validator_registration_local +ENGINE = Distributed('{cluster}', 'default', 'mev_relay_validator_registration_local', cityHash64(slot, meta_network_name)) +COMMENT 'Contains MEV relay validator registrations data.'; + +CREATE TABLE IF NOT EXISTS default.node_record_consensus ON CLUSTER '{cluster}' +AS default.node_record_consensus_local +ENGINE = Distributed('{cluster}', 'default', 'node_record_consensus_local', cityHash64(event_date_time, meta_network_name, enr, meta_client_name)) +COMMENT 'Contains consensus node records discovered by the Xatu discovery module.'; + +CREATE TABLE IF NOT EXISTS default.node_record_execution ON CLUSTER '{cluster}' +AS default.node_record_execution_local +ENGINE = Distributed('{cluster}', 'default', 'node_record_execution_local', cityHash64(event_date_time, meta_network_name, node_id, meta_client_name)) +COMMENT 'Contains execution node records discovered by the Xatu discovery module.'; + +-- observoor database + +CREATE TABLE IF NOT EXISTS observoor.block_merge ON CLUSTER '{cluster}' +AS observoor.block_merge_local +ENGINE = Distributed('{cluster}', 'observoor', 'block_merge_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated block device I/O merge metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.cpu_utilization ON CLUSTER '{cluster}' +AS observoor.cpu_utilization_local +ENGINE = Distributed('{cluster}', 'observoor', 'cpu_utilization_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated CPU utilization metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.disk_bytes ON CLUSTER '{cluster}' +AS observoor.disk_bytes_local +ENGINE = Distributed('{cluster}', 'observoor', 'disk_bytes_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated disk I/O byte metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.disk_latency ON CLUSTER '{cluster}' +AS observoor.disk_latency_local +ENGINE = Distributed('{cluster}', 'observoor', 'disk_latency_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated disk I/O latency metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.disk_queue_depth ON CLUSTER '{cluster}' +AS observoor.disk_queue_depth_local +ENGINE = Distributed('{cluster}', 'observoor', 'disk_queue_depth_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated disk queue depth metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.fd_close ON CLUSTER '{cluster}' +AS observoor.fd_close_local +ENGINE = Distributed('{cluster}', 'observoor', 'fd_close_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated file descriptor close metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.fd_open ON CLUSTER '{cluster}' +AS observoor.fd_open_local +ENGINE = Distributed('{cluster}', 'observoor', 'fd_open_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated file descriptor open metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.host_specs ON CLUSTER '{cluster}' +AS observoor.host_specs_local +ENGINE = Distributed('{cluster}', 'observoor', 'host_specs_local', cityHash64(event_time, meta_network_name, host_id, meta_client_name)) +COMMENT 'Periodic host hardware specification snapshots including CPU, memory, and disk details'; + +CREATE TABLE IF NOT EXISTS observoor.mem_compaction ON CLUSTER '{cluster}' +AS observoor.mem_compaction_local +ENGINE = Distributed('{cluster}', 'observoor', 'mem_compaction_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated memory compaction metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.mem_reclaim ON CLUSTER '{cluster}' +AS observoor.mem_reclaim_local +ENGINE = Distributed('{cluster}', 'observoor', 'mem_reclaim_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated memory reclaim metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.memory_usage ON CLUSTER '{cluster}' +AS observoor.memory_usage_local +ENGINE = Distributed('{cluster}', 'observoor', 'memory_usage_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Periodic memory usage snapshots of Ethereum client processes from /proc/[pid]/status'; + +CREATE TABLE IF NOT EXISTS observoor.net_io ON CLUSTER '{cluster}' +AS observoor.net_io_local +ENGINE = Distributed('{cluster}', 'observoor', 'net_io_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated network I/O metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.oom_kill ON CLUSTER '{cluster}' +AS observoor.oom_kill_local +ENGINE = Distributed('{cluster}', 'observoor', 'oom_kill_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated OOM kill events from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.page_fault_major ON CLUSTER '{cluster}' +AS observoor.page_fault_major_local +ENGINE = Distributed('{cluster}', 'observoor', 'page_fault_major_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated major page fault metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.page_fault_minor ON CLUSTER '{cluster}' +AS observoor.page_fault_minor_local +ENGINE = Distributed('{cluster}', 'observoor', 'page_fault_minor_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated minor page fault metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.process_exit ON CLUSTER '{cluster}' +AS observoor.process_exit_local +ENGINE = Distributed('{cluster}', 'observoor', 'process_exit_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated process exit events from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.process_fd_usage ON CLUSTER '{cluster}' +AS observoor.process_fd_usage_local +ENGINE = Distributed('{cluster}', 'observoor', 'process_fd_usage_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Periodic file descriptor usage snapshots of Ethereum client processes from /proc/[pid]/fd and /proc/[pid]/limits'; + +CREATE TABLE IF NOT EXISTS observoor.process_io_usage ON CLUSTER '{cluster}' +AS observoor.process_io_usage_local +ENGINE = Distributed('{cluster}', 'observoor', 'process_io_usage_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Periodic I/O usage snapshots of Ethereum client processes from /proc/[pid]/io'; + +CREATE TABLE IF NOT EXISTS observoor.process_sched_usage ON CLUSTER '{cluster}' +AS observoor.process_sched_usage_local +ENGINE = Distributed('{cluster}', 'observoor', 'process_sched_usage_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Periodic scheduler usage snapshots of Ethereum client processes from /proc/[pid]/status and /proc/[pid]/sched'; + +CREATE TABLE IF NOT EXISTS observoor.raw_events ON CLUSTER '{cluster}' +AS observoor.raw_events_local +ENGINE = Distributed('{cluster}', 'observoor', 'raw_events_local', rand()) +COMMENT 'Raw eBPF events captured from Ethereum client processes, one row per kernel event.'; + +CREATE TABLE IF NOT EXISTS observoor.sched_off_cpu ON CLUSTER '{cluster}' +AS observoor.sched_off_cpu_local +ENGINE = Distributed('{cluster}', 'observoor', 'sched_off_cpu_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated scheduler off-CPU metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.sched_on_cpu ON CLUSTER '{cluster}' +AS observoor.sched_on_cpu_local +ENGINE = Distributed('{cluster}', 'observoor', 'sched_on_cpu_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated scheduler on-CPU metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.sched_runqueue ON CLUSTER '{cluster}' +AS observoor.sched_runqueue_local +ENGINE = Distributed('{cluster}', 'observoor', 'sched_runqueue_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated scheduler run queue metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.swap_in ON CLUSTER '{cluster}' +AS observoor.swap_in_local +ENGINE = Distributed('{cluster}', 'observoor', 'swap_in_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated swap-in metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.swap_out ON CLUSTER '{cluster}' +AS observoor.swap_out_local +ENGINE = Distributed('{cluster}', 'observoor', 'swap_out_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated swap-out metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.sync_state ON CLUSTER '{cluster}' +AS observoor.sync_state_local +ENGINE = Distributed('{cluster}', 'observoor', 'sync_state_local', cityHash64(event_time, meta_network_name, meta_client_name)) +COMMENT 'Sync state snapshots for consensus and execution layers'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_epoll_wait ON CLUSTER '{cluster}' +AS observoor.syscall_epoll_wait_local +ENGINE = Distributed('{cluster}', 'observoor', 'syscall_epoll_wait_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated epoll_wait syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_fdatasync ON CLUSTER '{cluster}' +AS observoor.syscall_fdatasync_local +ENGINE = Distributed('{cluster}', 'observoor', 'syscall_fdatasync_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated fdatasync syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_fsync ON CLUSTER '{cluster}' +AS observoor.syscall_fsync_local +ENGINE = Distributed('{cluster}', 'observoor', 'syscall_fsync_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated fsync syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_futex ON CLUSTER '{cluster}' +AS observoor.syscall_futex_local +ENGINE = Distributed('{cluster}', 'observoor', 'syscall_futex_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated futex syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_mmap ON CLUSTER '{cluster}' +AS observoor.syscall_mmap_local +ENGINE = Distributed('{cluster}', 'observoor', 'syscall_mmap_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated mmap syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_pwrite ON CLUSTER '{cluster}' +AS observoor.syscall_pwrite_local +ENGINE = Distributed('{cluster}', 'observoor', 'syscall_pwrite_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated pwrite syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_read ON CLUSTER '{cluster}' +AS observoor.syscall_read_local +ENGINE = Distributed('{cluster}', 'observoor', 'syscall_read_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated read syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.syscall_write ON CLUSTER '{cluster}' +AS observoor.syscall_write_local +ENGINE = Distributed('{cluster}', 'observoor', 'syscall_write_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated write syscall metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.tcp_cwnd ON CLUSTER '{cluster}' +AS observoor.tcp_cwnd_local +ENGINE = Distributed('{cluster}', 'observoor', 'tcp_cwnd_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated TCP congestion window metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.tcp_retransmit ON CLUSTER '{cluster}' +AS observoor.tcp_retransmit_local +ENGINE = Distributed('{cluster}', 'observoor', 'tcp_retransmit_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated TCP retransmit metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.tcp_rtt ON CLUSTER '{cluster}' +AS observoor.tcp_rtt_local +ENGINE = Distributed('{cluster}', 'observoor', 'tcp_rtt_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated TCP round-trip time metrics from eBPF tracing of Ethereum client processes'; + +CREATE TABLE IF NOT EXISTS observoor.tcp_state_change ON CLUSTER '{cluster}' +AS observoor.tcp_state_change_local +ENGINE = Distributed('{cluster}', 'observoor', 'tcp_state_change_local', cityHash64(window_start, meta_network_name, meta_client_name)) +COMMENT 'Aggregated TCP state change events from eBPF tracing of Ethereum client processes'; + +-- admin database + +CREATE TABLE IF NOT EXISTS admin.cryo ON CLUSTER '{cluster}' +AS admin.cryo_local +ENGINE = Distributed('{cluster}', 'admin', 'cryo_local', cityHash64(dataset, mode, meta_network_name)) +COMMENT 'Tracks cryo dataset processing state per block'; + +CREATE TABLE IF NOT EXISTS admin.execution_block ON CLUSTER '{cluster}' +AS admin.execution_block_local +ENGINE = Distributed('{cluster}', 'admin', 'execution_block_local', cityHash64(block_number, processor, meta_network_name)) +COMMENT 'Tracks execution block processing state'; + +-- MATERIALIZED VIEWS + +CREATE MATERIALIZED VIEW IF NOT EXISTS default.beacon_api_slot_attestation_mv_local ON CLUSTER '{cluster}' TO default.beacon_api_slot_local +( + `slot` UInt32, + `slot_start_date_time` DateTime, + `epoch` UInt32, + `epoch_start_date_time` DateTime, + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String), + `meta_client_geo_city` LowCardinality(String), + `meta_client_geo_continent_code` LowCardinality(String), + `meta_client_geo_longitude` Nullable(Float64), + `meta_client_geo_latitude` Nullable(Float64), + `meta_consensus_implementation` LowCardinality(String), + `meta_consensus_version` LowCardinality(String), + `attestations` AggregateFunction(sum, UInt32) +) +AS SELECT + slot, + slot_start_date_time, + epoch, + epoch_start_date_time, + meta_client_name, + meta_network_name, + meta_client_geo_city, + meta_client_geo_continent_code, + meta_client_geo_longitude, + meta_client_geo_latitude, + meta_consensus_implementation, + meta_consensus_version, + sumState(toUInt32(1)) AS attestations +FROM default.beacon_api_eth_v1_events_attestation_local +GROUP BY + slot, + slot_start_date_time, + epoch, + epoch_start_date_time, + meta_client_name, + meta_network_name, + meta_client_geo_city, + meta_client_geo_continent_code, + meta_client_geo_longitude, + meta_client_geo_latitude, + meta_consensus_implementation, + meta_consensus_version; + +CREATE MATERIALIZED VIEW IF NOT EXISTS default.beacon_api_slot_block_mv_local ON CLUSTER '{cluster}' TO default.beacon_api_slot_local +( + `slot` UInt32, + `slot_start_date_time` DateTime, + `epoch` UInt32, + `epoch_start_date_time` DateTime, + `meta_client_name` LowCardinality(String), + `meta_network_name` LowCardinality(String), + `meta_client_geo_city` LowCardinality(String), + `meta_client_geo_continent_code` LowCardinality(String), + `meta_client_geo_longitude` Nullable(Float64), + `meta_client_geo_latitude` Nullable(Float64), + `meta_consensus_implementation` LowCardinality(String), + `meta_consensus_version` LowCardinality(String), + `blocks` AggregateFunction(sum, UInt16) +) +AS SELECT + slot, + slot_start_date_time, + epoch, + epoch_start_date_time, + meta_client_name, + meta_network_name, + meta_client_geo_city, + meta_client_geo_continent_code, + meta_client_geo_longitude, + meta_client_geo_latitude, + meta_consensus_implementation, + meta_consensus_version, + sumState(toUInt16(1)) AS blocks +FROM default.beacon_api_eth_v1_events_block_local +GROUP BY + slot, + slot_start_date_time, + epoch, + epoch_start_date_time, + meta_client_name, + meta_network_name, + meta_client_geo_city, + meta_client_geo_continent_code, + meta_client_geo_longitude, + meta_client_geo_latitude, + meta_consensus_implementation, + meta_consensus_version; diff --git a/deploy/migrations/clickhouse/001_initialize_schema.down.sql b/deploy/migrations/clickhouse/001_initialize_schema.down.sql deleted file mode 100644 index 407d0f39d..000000000 --- a/deploy/migrations/clickhouse/001_initialize_schema.down.sql +++ /dev/null @@ -1,22 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_events_head on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_head_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_block on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_block_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_attestation on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_attestation_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_voluntary_exit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_voluntary_exit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_finalized_checkpoint on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_finalized_checkpoint_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_chain_reorg on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_chain_reorg_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_contribution_and_proof on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_contribution_and_proof_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_slot_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_slot on cluster '{cluster}' SYNC; -DROP VIEW IF EXISTS beacon_api_slot_attestation_mv_local on cluster '{cluster}' SYNC; -DROP VIEW IF EXISTS beacon_api_slot_block_mv_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS mempool_transaction on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS mempool_transaction_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/001_initialize_schema.up.sql b/deploy/migrations/clickhouse/001_initialize_schema.up.sql deleted file mode 100644 index cbf0dba8e..000000000 --- a/deploy/migrations/clickhouse/001_initialize_schema.up.sql +++ /dev/null @@ -1,467 +0,0 @@ -CREATE TABLE beacon_api_eth_v1_events_head_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - block FixedString(66) Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - epoch_transition Bool, - execution_optimistic Bool, - previous_duty_dependent_root FixedString(66) Codec(ZSTD(1)), - current_duty_dependent_root FixedString(66) Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_slot (SELECT * ORDER BY slot), - PROJECTION projection_epoch (SELECT * ORDER BY epoch), - PROJECTION projection_block (SELECT * ORDER BY block) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v1_events_head on cluster '{cluster}' AS beacon_api_eth_v1_events_head_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_head_local, rand()); - -CREATE TABLE beacon_api_eth_v1_events_block_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - block FixedString(66) Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_slot (SELECT * ORDER BY slot), - PROJECTION projection_epoch (SELECT * ORDER BY epoch), - PROJECTION projection_block (SELECT * ORDER BY block) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v1_events_block on cluster '{cluster}' AS beacon_api_eth_v1_events_block_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_block_local, rand()); - -CREATE TABLE beacon_api_eth_v1_events_attestation_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - committee_index LowCardinality(String), - signature String Codec(ZSTD(1)), - aggregation_bits String Codec(ZSTD(1)), - beacon_block_root FixedString(66) Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - source_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source_root FixedString(66) Codec(ZSTD(1)), - target_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - target_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - target_root FixedString(66) Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_slot (SELECT * ORDER BY slot), - PROJECTION projection_epoch (SELECT * ORDER BY epoch), - PROJECTION projection_beacon_block_root (SELECT * ORDER BY beacon_block_root) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v1_events_attestation on cluster '{cluster}' AS beacon_api_eth_v1_events_attestation_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_attestation_local, rand()); - -CREATE TABLE beacon_api_eth_v1_events_voluntary_exit_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - validator_index UInt32 Codec(ZSTD(1)), - signature String Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_epoch (SELECT * ORDER BY epoch), - PROJECTION projection_validator_index (SELECT * ORDER BY validator_index) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v1_events_voluntary_exit on cluster '{cluster}' AS beacon_api_eth_v1_events_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_voluntary_exit_local, rand()); - -CREATE TABLE beacon_api_eth_v1_events_finalized_checkpoint_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - block FixedString(66) Codec(ZSTD(1)), - state FixedString(66) Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_epoch (SELECT * ORDER BY epoch), - PROJECTION projection_block (SELECT * ORDER BY block), - PROJECTION projection_state (SELECT * ORDER BY state) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v1_events_finalized_checkpoint on cluster '{cluster}' AS beacon_api_eth_v1_events_finalized_checkpoint_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_finalized_checkpoint_local, rand()); - -CREATE TABLE beacon_api_eth_v1_events_chain_reorg_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - depth UInt16 Codec(DoubleDelta, ZSTD(1)), - old_head_block FixedString(66) Codec(ZSTD(1)), - new_head_block FixedString(66) Codec(ZSTD(1)), - old_head_state FixedString(66) Codec(ZSTD(1)), - new_head_state FixedString(66) Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_slot (SELECT * ORDER BY slot), - PROJECTION projection_epoch (SELECT * ORDER BY epoch), - PROJECTION projection_new_head_state (SELECT * ORDER BY new_head_state), - PROJECTION projection_old_head_state (SELECT * ORDER BY old_head_state), - PROJECTION projection_new_head_block (SELECT * ORDER BY new_head_block), - PROJECTION projection_old_head_block (SELECT * ORDER BY old_head_block) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v1_events_chain_reorg on cluster '{cluster}' AS beacon_api_eth_v1_events_chain_reorg_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_chain_reorg_local, rand()); - -CREATE TABLE beacon_api_eth_v1_events_contribution_and_proof_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - aggregator_index UInt32 Codec(ZSTD(1)), - contribution_slot UInt32 Codec(DoubleDelta, ZSTD(1)), - contribution_slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - contribution_propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - contribution_beacon_block_root FixedString(66) Codec(ZSTD(1)), - contribution_subcommittee_index LowCardinality(String), - contribution_aggregation_bits String Codec(ZSTD(1)), - contribution_signature String Codec(ZSTD(1)), - contribution_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - contribution_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - selection_proof String Codec(ZSTD(1)), - signature String Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_contribution_slot (SELECT * ORDER BY contribution_slot), - PROJECTION projection_contribution_epoch (SELECT * ORDER BY contribution_epoch), - PROJECTION projection_contribution_beacon_block_root (SELECT * ORDER BY contribution_beacon_block_root) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(contribution_slot_start_date_time) -ORDER BY (contribution_slot_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v1_events_contribution_and_proof on cluster '{cluster}' AS beacon_api_eth_v1_events_contribution_and_proof_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_contribution_and_proof_local, rand()); - -CREATE TABLE beacon_api_slot_local on cluster '{cluster}' ( - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_consensus_implementation LowCardinality(String), - meta_consensus_version LowCardinality(String), - blocks AggregateFunction(sum, UInt16) Codec(ZSTD(1)), - attestations AggregateFunction(sum, UInt32) Codec(ZSTD(1)), - PROJECTION projection_slot (SELECT * ORDER BY slot), - PROJECTION projection_epoch (SELECT * ORDER BY epoch) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, slot, meta_network_name); - -CREATE MATERIALIZED VIEW beacon_api_slot_block_mv_local on cluster '{cluster}' -TO beacon_api_slot_local -AS SELECT - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - meta_client_name, - meta_network_name, - meta_client_geo_city, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_consensus_implementation, - meta_consensus_version, - sumState(toUInt16(1)) AS blocks -FROM beacon_api_eth_v1_events_block_local -GROUP BY slot, slot_start_date_time, epoch, epoch_start_date_time, meta_client_name, meta_network_name, meta_client_geo_city, meta_client_geo_continent_code, meta_client_geo_longitude, meta_client_geo_latitude, meta_consensus_implementation, meta_consensus_version; - -CREATE MATERIALIZED VIEW beacon_api_slot_attestation_mv_local on cluster '{cluster}' -TO beacon_api_slot_local -AS SELECT - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - meta_client_name, - meta_network_name, - meta_client_geo_city, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_consensus_implementation, - meta_consensus_version, - sumState(toUInt32(1)) AS attestations -FROM beacon_api_eth_v1_events_attestation_local -GROUP BY slot, slot_start_date_time, epoch, epoch_start_date_time, meta_client_name, meta_network_name, meta_client_geo_city, meta_client_geo_continent_code, meta_client_geo_longitude, meta_client_geo_latitude, meta_consensus_implementation, meta_consensus_version; - -CREATE TABLE beacon_api_slot on cluster '{cluster}' AS beacon_api_slot_local -ENGINE = Distributed('{cluster}', default, beacon_api_slot_local, rand()); - -CREATE TABLE mempool_transaction_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - hash FixedString(66) Codec(ZSTD(1)), - from FixedString(42) Codec(ZSTD(1)), - to FixedString(42) Codec(ZSTD(1)), - nonce UInt64 Codec(ZSTD(1)), - gas_price UInt128 Codec(ZSTD(1)), - gas UInt64 Codec(ZSTD(1)), - value UInt128 Codec(ZSTD(1)), - size UInt32 Codec(ZSTD(1)), - call_data_size UInt32 Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_execution_fork_id_hash LowCardinality(String), - meta_execution_fork_id_next LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_hash (SELECT * ORDER BY hash), - PROJECTION projection_from (SELECT * ORDER BY from), - PROJECTION projection_to (SELECT * ORDER BY to) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(event_date_time) -ORDER BY (event_date_time, meta_network_name, meta_client_name); - -CREATE TABLE mempool_transaction on cluster '{cluster}' AS mempool_transaction_local -ENGINE = Distributed('{cluster}', default, mempool_transaction_local, rand()); - -CREATE TABLE beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - block_root FixedString(66) Codec(ZSTD(1)), - parent_root FixedString(66) Codec(ZSTD(1)), - state_root FixedString(66) Codec(ZSTD(1)), - proposer_index UInt32 Codec(ZSTD(1)), - eth1_data_block_hash FixedString(66) Codec(ZSTD(1)), - eth1_data_deposit_root FixedString(66) Codec(ZSTD(1)), - execution_payload_block_hash FixedString(66) Codec(ZSTD(1)), - execution_payload_block_number UInt32 Codec(DoubleDelta, ZSTD(1)), - execution_payload_fee_recipient String Codec(ZSTD(1)), - execution_payload_state_root FixedString(66) Codec(ZSTD(1)), - execution_payload_parent_hash FixedString(66) Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_execution_fork_id_hash LowCardinality(String), - meta_execution_fork_id_next LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)), - PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time), - PROJECTION projection_slot (SELECT * ORDER BY slot), - PROJECTION projection_epoch (SELECT * ORDER BY epoch), - PROJECTION projection_block_root (SELECT * ORDER BY block_root), - PROJECTION projection_parent_root (SELECT * ORDER BY parent_root), - PROJECTION projection_state_root (SELECT * ORDER BY state_root), - PROJECTION projection_eth1_data_block_hash (SELECT * ORDER BY eth1_data_block_hash), - PROJECTION projection_execution_payload_block_hash (SELECT * ORDER BY execution_payload_block_hash), - PROJECTION projection_execution_payload_block_number (SELECT * ORDER BY execution_payload_block_number), - PROJECTION projection_execution_payload_state_root (SELECT * ORDER BY execution_payload_state_root), - PROJECTION projection_execution_payload_parent_hash (SELECT * ORDER BY execution_payload_parent_hash) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v2_beacon_block on cluster '{cluster}' AS beacon_api_eth_v2_beacon_block_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_local, rand()); diff --git a/deploy/migrations/clickhouse/002_attesting_validator.down.sql b/deploy/migrations/clickhouse/002_attesting_validator.down.sql deleted file mode 100644 index 57177a359..000000000 --- a/deploy/migrations/clickhouse/002_attesting_validator.down.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE beacon_api_eth_v1_events_attestation on cluster '{cluster}' - DROP COLUMN attesting_validator_index, - DROP COLUMN attesting_validator_committee_index; - -ALTER TABLE beacon_api_eth_v1_events_attestation_local on cluster '{cluster}' - DROP COLUMN attesting_validator_index, - DROP COLUMN attesting_validator_committee_index; diff --git a/deploy/migrations/clickhouse/002_attesting_validator.up.sql b/deploy/migrations/clickhouse/002_attesting_validator.up.sql deleted file mode 100644 index 145ead969..000000000 --- a/deploy/migrations/clickhouse/002_attesting_validator.up.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE beacon_api_eth_v1_events_attestation_local on cluster '{cluster}' - ADD COLUMN attesting_validator_index Nullable(UInt32) Codec(ZSTD(1)) AFTER committee_index, - ADD COLUMN attesting_validator_committee_index LowCardinality(String) AFTER attesting_validator_index; - -ALTER TABLE beacon_api_eth_v1_events_attestation on cluster '{cluster}' - ADD COLUMN attesting_validator_index Nullable(UInt32) Codec(ZSTD(1)) AFTER committee_index, - ADD COLUMN attesting_validator_committee_index LowCardinality(String) AFTER attesting_validator_index; diff --git a/deploy/migrations/clickhouse/003_remove_projections.down.sql b/deploy/migrations/clickhouse/003_remove_projections.down.sql deleted file mode 100644 index fbc771277..000000000 --- a/deploy/migrations/clickhouse/003_remove_projections.down.sql +++ /dev/null @@ -1,47 +0,0 @@ -ALTER TABLE beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' ADD PROJECTION projection_slot (SELECT * ORDER BY slot); -ALTER TABLE beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' ADD PROJECTION projection_epoch (SELECT * ORDER BY epoch); -ALTER TABLE beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' ADD PROJECTION projection_block (SELECT * ORDER BY block) -ALTER TABLE beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_slot (SELECT * ORDER BY slot); -ALTER TABLE beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_epoch (SELECT * ORDER BY epoch); -ALTER TABLE beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_block (SELECT * ORDER BY block); -ALTER TABLE beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' ADD PROJECTION projection_slot (SELECT * ORDER BY slot); -ALTER TABLE beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' ADD PROJECTION projection_epoch (SELECT * ORDER BY epoch); -ALTER TABLE beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' ADD PROJECTION projection_beacon_block_root (SELECT * ORDER BY beacon_block_root); -ALTER TABLE beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ADD PROJECTION projection_epoch (SELECT * ORDER BY epoch); -ALTER TABLE beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ADD PROJECTION projection_validator_index (SELECT * ORDER BY validator_index); -ALTER TABLE beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' ADD PROJECTION projection_epoch (SELECT * ORDER BY epoch); -ALTER TABLE beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' ADD PROJECTION projection_block (SELECT * ORDER BY block); -ALTER TABLE beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' ADD PROJECTION projection_state (SELECT * ORDER BY state); -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ADD PROJECTION projection_slot (SELECT * ORDER BY slot); -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ADD PROJECTION projection_epoch (SELECT * ORDER BY epoch); -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ADD PROJECTION projection_new_head_state (SELECT * ORDER BY new_head_state); -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ADD PROJECTION projection_old_head_state (SELECT * ORDER BY old_head_state); -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ADD PROJECTION projection_new_head_block (SELECT * ORDER BY new_head_block); -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ADD PROJECTION projection_old_head_block (SELECT * ORDER BY old_head_block); -ALTER TABLE beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' ADD PROJECTION projection_contribution_slot (SELECT * ORDER BY contribution_slot); -ALTER TABLE beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' ADD PROJECTION projection_contribution_epoch (SELECT * ORDER BY contribution_epoch); -ALTER TABLE beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' ADD PROJECTION projection_contribution_beacon_block_root (SELECT * ORDER BY contribution_beacon_block_root); -ALTER TABLE beacon_api_slot_local ON CLUSTER '{cluster}' ADD PROJECTION projection_slot (SELECT * ORDER BY slot); -ALTER TABLE beacon_api_slot_local ON CLUSTER '{cluster}' ADD PROJECTION projection_epoch (SELECT * ORDER BY epoch); -ALTER TABLE mempool_transaction_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE mempool_transaction_local ON CLUSTER '{cluster}' ADD PROJECTION projection_hash (SELECT * ORDER BY hash); -ALTER TABLE mempool_transaction_local ON CLUSTER '{cluster}' ADD PROJECTION projection_from (SELECT * ORDER BY from); -ALTER TABLE mempool_transaction_local ON CLUSTER '{cluster}' ADD PROJECTION projection_to (SELECT * ORDER BY to); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_event_date_time (SELECT * ORDER BY event_date_time); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_slot (SELECT * ORDER BY slot); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_epoch (SELECT * ORDER BY epoch); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_block_root (SELECT * ORDER BY block_root); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_parent_root (SELECT * ORDER BY parent_root); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_state_root (SELECT * ORDER BY state_root); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_eth1_data_block_hash (SELECT * ORDER BY eth1_data_block_hash); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_execution_payload_block_hash (SELECT * ORDER BY execution_payload_block_hash); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_execution_payload_block_number (SELECT * ORDER BY execution_payload_block_number); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_execution_payload_state_root (SELECT * ORDER BY execution_payload_state_root); -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ADD PROJECTION projection_execution_payload_parent_hash (SELECT * ORDER BY execution_payload_parent_hash); diff --git a/deploy/migrations/clickhouse/003_remove_projections.up.sql b/deploy/migrations/clickhouse/003_remove_projections.up.sql deleted file mode 100644 index 3bc74169a..000000000 --- a/deploy/migrations/clickhouse/003_remove_projections.up.sql +++ /dev/null @@ -1,47 +0,0 @@ -ALTER TABLE beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' DROP PROJECTION projection_slot; -ALTER TABLE beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' DROP PROJECTION projection_epoch; -ALTER TABLE beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' DROP PROJECTION projection_block; -ALTER TABLE beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_slot; -ALTER TABLE beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_epoch; -ALTER TABLE beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_block; -ALTER TABLE beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' DROP PROJECTION projection_slot; -ALTER TABLE beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' DROP PROJECTION projection_epoch; -ALTER TABLE beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' DROP PROJECTION projection_beacon_block_root; -ALTER TABLE beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' DROP PROJECTION projection_epoch; -ALTER TABLE beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' DROP PROJECTION projection_validator_index; -ALTER TABLE beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' DROP PROJECTION projection_epoch; -ALTER TABLE beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' DROP PROJECTION projection_block; -ALTER TABLE beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' DROP PROJECTION projection_state; -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' DROP PROJECTION projection_slot; -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' DROP PROJECTION projection_epoch; -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' DROP PROJECTION projection_new_head_state; -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' DROP PROJECTION projection_old_head_state; -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' DROP PROJECTION projection_new_head_block; -ALTER TABLE beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' DROP PROJECTION projection_old_head_block; -ALTER TABLE beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' DROP PROJECTION projection_contribution_slot; -ALTER TABLE beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' DROP PROJECTION projection_contribution_epoch; -ALTER TABLE beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' DROP PROJECTION projection_contribution_beacon_block_root; -ALTER TABLE beacon_api_slot_local ON CLUSTER '{cluster}' DROP PROJECTION projection_slot; -ALTER TABLE beacon_api_slot_local ON CLUSTER '{cluster}' DROP PROJECTION projection_epoch; -ALTER TABLE mempool_transaction_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE mempool_transaction_local ON CLUSTER '{cluster}' DROP PROJECTION projection_hash; -ALTER TABLE mempool_transaction_local ON CLUSTER '{cluster}' DROP PROJECTION projection_from; -ALTER TABLE mempool_transaction_local ON CLUSTER '{cluster}' DROP PROJECTION projection_to; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_event_date_time; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_slot; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_epoch; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_block_root; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_parent_root; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_state_root; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_eth1_data_block_hash; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_execution_payload_block_hash; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_execution_payload_block_number; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_execution_payload_state_root; -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' DROP PROJECTION projection_execution_payload_parent_hash; diff --git a/deploy/migrations/clickhouse/004_dbt.down.sql b/deploy/migrations/clickhouse/004_dbt.down.sql deleted file mode 100644 index 2014046b9..000000000 --- a/deploy/migrations/clickhouse/004_dbt.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP DATABASE dbt ON CLUSTER '{cluster}' diff --git a/deploy/migrations/clickhouse/004_dbt.up.sql b/deploy/migrations/clickhouse/004_dbt.up.sql deleted file mode 100644 index e229b8c3e..000000000 --- a/deploy/migrations/clickhouse/004_dbt.up.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE DATABASE IF NOT EXISTS dbt ON CLUSTER '{cluster}' diff --git a/deploy/migrations/clickhouse/005_beacon_committee.down.sql b/deploy/migrations/clickhouse/005_beacon_committee.down.sql deleted file mode 100644 index 69e7d17f1..000000000 --- a/deploy/migrations/clickhouse/005_beacon_committee.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_beacon_committee on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_beacon_committee_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/005_beacon_committee.up.sql b/deploy/migrations/clickhouse/005_beacon_committee.up.sql deleted file mode 100644 index 69abd6366..000000000 --- a/deploy/migrations/clickhouse/005_beacon_committee.up.sql +++ /dev/null @@ -1,36 +0,0 @@ -CREATE TABLE beacon_api_eth_v1_beacon_committee_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - committee_index LowCardinality(String), - validators Array(UInt32) Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -CREATE TABLE beacon_api_eth_v1_beacon_committee on cluster '{cluster}' AS beacon_api_eth_v1_beacon_committee_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_beacon_committee_local, rand()); diff --git a/deploy/migrations/clickhouse/006_comments.down.sql b/deploy/migrations/clickhouse/006_comments.down.sql deleted file mode 100644 index a98a5ff89..000000000 --- a/deploy/migrations/clickhouse/006_comments.down.sql +++ /dev/null @@ -1,669 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN propagation_slot_start_diff '', -COMMENT COLUMN block '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN epoch_transition '', -COMMENT COLUMN execution_optimistic '', -COMMENT COLUMN previous_duty_dependent_root '', -COMMENT COLUMN current_duty_dependent_root '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN propagation_slot_start_diff '', -COMMENT COLUMN block '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN epoch_transition '', -COMMENT COLUMN execution_optimistic '', -COMMENT COLUMN previous_duty_dependent_root '', -COMMENT COLUMN current_duty_dependent_root '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN propagation_slot_start_diff '', -COMMENT COLUMN block '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN execution_optimistic '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN propagation_slot_start_diff '', -COMMENT COLUMN block '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN execution_optimistic '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN propagation_slot_start_diff '', -COMMENT COLUMN committee_index '', -COMMENT COLUMN attesting_validator_index '', -COMMENT COLUMN attesting_validator_committee_index '', -COMMENT COLUMN signature '', -COMMENT COLUMN aggregation_bits '', -COMMENT COLUMN beacon_block_root '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN source_epoch '', -COMMENT COLUMN source_epoch_start_date_time '', -COMMENT COLUMN source_root '', -COMMENT COLUMN target_epoch '', -COMMENT COLUMN target_epoch_start_date_time '', -COMMENT COLUMN target_root '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN propagation_slot_start_diff '', -COMMENT COLUMN committee_index '', -COMMENT COLUMN attesting_validator_index '', -COMMENT COLUMN attesting_validator_committee_index '', -COMMENT COLUMN signature '', -COMMENT COLUMN aggregation_bits '', -COMMENT COLUMN beacon_block_root '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN source_epoch '', -COMMENT COLUMN source_epoch_start_date_time '', -COMMENT COLUMN source_root '', -COMMENT COLUMN target_epoch '', -COMMENT COLUMN target_epoch_start_date_time '', -COMMENT COLUMN target_root '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN validator_index '', -COMMENT COLUMN signature '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN validator_index '', -COMMENT COLUMN signature '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN block '', -COMMENT COLUMN state '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN execution_optimistic '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN block '', -COMMENT COLUMN state '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN execution_optimistic '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN propagation_slot_start_diff '', -COMMENT COLUMN depth '', -COMMENT COLUMN old_head_block '', -COMMENT COLUMN new_head_block '', -COMMENT COLUMN old_head_state '', -COMMENT COLUMN new_head_state '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN execution_optimistic '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN propagation_slot_start_diff '', -COMMENT COLUMN depth '', -COMMENT COLUMN old_head_block '', -COMMENT COLUMN new_head_block '', -COMMENT COLUMN old_head_state '', -COMMENT COLUMN new_head_state '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN execution_optimistic '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN aggregator_index '', -COMMENT COLUMN contribution_slot '', -COMMENT COLUMN contribution_slot_start_date_time '', -COMMENT COLUMN contribution_propagation_slot_start_diff '', -COMMENT COLUMN contribution_beacon_block_root '', -COMMENT COLUMN contribution_subcommittee_index '', -COMMENT COLUMN contribution_aggregation_bits '', -COMMENT COLUMN contribution_signature '', -COMMENT COLUMN contribution_epoch '', -COMMENT COLUMN contribution_epoch_start_date_time '', -COMMENT COLUMN selection_proof '', -COMMENT COLUMN signature '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN aggregator_index '', -COMMENT COLUMN contribution_slot '', -COMMENT COLUMN contribution_slot_start_date_time '', -COMMENT COLUMN contribution_propagation_slot_start_diff '', -COMMENT COLUMN contribution_beacon_block_root '', -COMMENT COLUMN contribution_subcommittee_index '', -COMMENT COLUMN contribution_aggregation_bits '', -COMMENT COLUMN contribution_signature '', -COMMENT COLUMN contribution_epoch '', -COMMENT COLUMN contribution_epoch_start_date_time '', -COMMENT COLUMN selection_proof '', -COMMENT COLUMN signature '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_slot ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN blocks'', -COMMENT COLUMN attestations''; - -ALTER TABLE default.beacon_api_slot_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN blocks'', -COMMENT COLUMN attestations''; - -ALTER TABLE default.mempool_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN hash '', -COMMENT COLUMN from'', -COMMENT COLUMN to'', -COMMENT COLUMN nonce '', -COMMENT COLUMN gas_price '', -COMMENT COLUMN gas '', -COMMENT COLUMN value '', -COMMENT COLUMN size '', -COMMENT COLUMN call_data_size '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_execution_fork_id_hash '', -COMMENT COLUMN meta_execution_fork_id_next '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.mempool_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN hash '', -COMMENT COLUMN from'', -COMMENT COLUMN to'', -COMMENT COLUMN nonce '', -COMMENT COLUMN gas_price '', -COMMENT COLUMN gas '', -COMMENT COLUMN value '', -COMMENT COLUMN size '', -COMMENT COLUMN call_data_size '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_execution_fork_id_hash '', -COMMENT COLUMN meta_execution_fork_id_next '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN block_root '', -COMMENT COLUMN parent_root '', -COMMENT COLUMN state_root '', -COMMENT COLUMN proposer_index '', -COMMENT COLUMN eth1_data_block_hash '', -COMMENT COLUMN eth1_data_deposit_root '', -COMMENT COLUMN execution_payload_block_hash '', -COMMENT COLUMN execution_payload_block_number '', -COMMENT COLUMN execution_payload_fee_recipient '', -COMMENT COLUMN execution_payload_state_root '', -COMMENT COLUMN execution_payload_parent_hash '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_execution_fork_id_hash '', -COMMENT COLUMN meta_execution_fork_id_next '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN block_root '', -COMMENT COLUMN parent_root '', -COMMENT COLUMN state_root '', -COMMENT COLUMN proposer_index '', -COMMENT COLUMN eth1_data_block_hash '', -COMMENT COLUMN eth1_data_deposit_root '', -COMMENT COLUMN execution_payload_block_hash '', -COMMENT COLUMN execution_payload_block_number '', -COMMENT COLUMN execution_payload_fee_recipient '', -COMMENT COLUMN execution_payload_state_root '', -COMMENT COLUMN execution_payload_parent_hash '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_execution_fork_id_hash '', -COMMENT COLUMN meta_execution_fork_id_next '', -COMMENT COLUMN meta_labels ''; diff --git a/deploy/migrations/clickhouse/006_comments.up.sql b/deploy/migrations/clickhouse/006_comments.up.sql deleted file mode 100644 index d9a999e02..000000000 --- a/deploy/migrations/clickhouse/006_comments.up.sql +++ /dev/null @@ -1,669 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN block 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN epoch_transition 'If the event is an epoch transition', -COMMENT COLUMN execution_optimistic 'If the attached beacon node is running in execution optimistic mode', -COMMENT COLUMN previous_duty_dependent_root 'The previous duty dependent root in the beacon API event stream payload', -COMMENT COLUMN current_duty_dependent_root 'The current duty dependent root in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN block 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN epoch_transition 'If the event is an epoch transition', -COMMENT COLUMN execution_optimistic 'If the attached beacon node is running in execution optimistic mode', -COMMENT COLUMN previous_duty_dependent_root 'The previous duty dependent root in the beacon API event stream payload', -COMMENT COLUMN current_duty_dependent_root 'The current duty dependent root in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN block 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'If the attached beacon node is running in execution optimistic mode', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN block 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'If the attached beacon node is running in execution optimistic mode', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "attestation" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN committee_index 'The committee index in the beacon API event stream payload', -COMMENT COLUMN attesting_validator_index 'The index of the validator attesting to the event', -COMMENT COLUMN attesting_validator_committee_index 'The committee index of the attesting validator', -COMMENT COLUMN signature 'The signature of the event in the beacon API event stream payload', -COMMENT COLUMN aggregation_bits 'The aggregation bits of the event in the beacon API event stream payload', -COMMENT COLUMN beacon_block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN source_epoch 'The source epoch number in the beacon API event stream payload', -COMMENT COLUMN source_epoch_start_date_time 'The wall clock time when the source epoch started', -COMMENT COLUMN source_root 'The source beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN target_epoch 'The target epoch number in the beacon API event stream payload', -COMMENT COLUMN target_epoch_start_date_time 'The wall clock time when the target epoch started', -COMMENT COLUMN target_root 'The target beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "attestation" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN committee_index 'The committee index in the beacon API event stream payload', -COMMENT COLUMN attesting_validator_index 'The index of the validator attesting to the event', -COMMENT COLUMN attesting_validator_committee_index 'The committee index of the attesting validator', -COMMENT COLUMN signature 'The signature of the event in the beacon API event stream payload', -COMMENT COLUMN aggregation_bits 'The aggregation bits of the event in the beacon API event stream payload', -COMMENT COLUMN beacon_block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN source_epoch 'The source epoch number in the beacon API event stream payload', -COMMENT COLUMN source_epoch_start_date_time 'The wall clock time when the source epoch started', -COMMENT COLUMN source_root 'The source beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN target_epoch 'The target epoch number in the beacon API event stream payload', -COMMENT COLUMN target_epoch_start_date_time 'The wall clock time when the target epoch started', -COMMENT COLUMN target_root 'The target beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN validator_index 'The index of the validator making the voluntary exit', -COMMENT COLUMN signature 'The signature of the voluntary exit in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN validator_index 'The index of the validator making the voluntary exit', -COMMENT COLUMN signature 'The signature of the voluntary exit in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN block 'The finalized block root hash in the beacon API event stream payload', -COMMENT COLUMN state 'The finalized state root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'Whether the execution of the epoch was optimistic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN block 'The finalized block root hash in the beacon API event stream payload', -COMMENT COLUMN state 'The finalized state root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'Whether the execution of the epoch was optimistic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'The slot number of the chain reorg event in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the reorg slot started', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slots between when the reorg occurred and when the sentry received the event', -COMMENT COLUMN depth 'The depth of the chain reorg in the beacon API event stream payload', -COMMENT COLUMN old_head_block 'The old head block root hash in the beacon API event stream payload', -COMMENT COLUMN new_head_block 'The new head block root hash in the beacon API event stream payload', -COMMENT COLUMN old_head_state 'The old head state root hash in the beacon API event stream payload', -COMMENT COLUMN new_head_state 'The new head state root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'Whether the execution of the epoch was optimistic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'The slot number of the chain reorg event in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the reorg slot started', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slots between when the reorg occurred and when the sentry received the event', -COMMENT COLUMN depth 'The depth of the chain reorg in the beacon API event stream payload', -COMMENT COLUMN old_head_block 'The old head block root hash in the beacon API event stream payload', -COMMENT COLUMN new_head_block 'The new head block root hash in the beacon API event stream payload', -COMMENT COLUMN old_head_state 'The old head state root hash in the beacon API event stream payload', -COMMENT COLUMN new_head_state 'The new head state root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'Whether the execution of the epoch was optimistic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN aggregator_index 'The validator index of the aggregator in the beacon API event stream payload', -COMMENT COLUMN contribution_slot 'The slot number of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_slot_start_date_time 'The wall clock time when the contribution slot started', -COMMENT COLUMN contribution_propagation_slot_start_diff 'Difference in slots between when the contribution occurred and when the sentry received the event', -COMMENT COLUMN contribution_beacon_block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN contribution_subcommittee_index 'The subcommittee index of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_aggregation_bits 'The aggregation bits of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_signature 'The signature of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_epoch 'The epoch number of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_epoch_start_date_time 'The wall clock time when the contribution epoch started', -COMMENT COLUMN selection_proof 'The selection proof in the beacon API event stream payload', -COMMENT COLUMN signature 'The signature in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN aggregator_index 'The validator index of the aggregator in the beacon API event stream payload', -COMMENT COLUMN contribution_slot 'The slot number of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_slot_start_date_time 'The wall clock time when the contribution slot started', -COMMENT COLUMN contribution_propagation_slot_start_diff 'Difference in slots between when the contribution occurred and when the sentry received the event', -COMMENT COLUMN contribution_beacon_block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN contribution_subcommittee_index 'The subcommittee index of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_aggregation_bits 'The aggregation bits of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_signature 'The signature of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_epoch 'The epoch number of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_epoch_start_date_time 'The wall clock time when the contribution epoch started', -COMMENT COLUMN selection_proof 'The selection proof in the beacon API event stream payload', -COMMENT COLUMN signature 'The signature in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_slot ON CLUSTER '{cluster}' -MODIFY COMMENT 'Aggregated beacon API slot data. Each row represents a slot from each sentry client attached to a beacon node.', -COMMENT COLUMN slot 'Slot number', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'Epoch number', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN blocks 'The number of beacon blocks seen in the slot', -COMMENT COLUMN attestations 'The number of attestations seen in the slot'; - -ALTER TABLE default.beacon_api_slot_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Aggregated beacon API slot data. Each row represents a slot from each sentry client attached to a beacon node.', -COMMENT COLUMN slot 'Slot number', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'Epoch number', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN blocks 'The number of beacon blocks seen in the slot', -COMMENT COLUMN attestations 'The number of attestations seen in the slot'; - -ALTER TABLE default.mempool_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT 'Each row represents a transaction that was seen in the mempool by a sentry client. Sentries can report the same transaction multiple times if it has been long enough since the last report.', -COMMENT COLUMN event_date_time 'The time when the sentry saw the transaction in the mempool', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN size 'The size of the transaction data in bytes', -COMMENT COLUMN call_data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_execution_fork_id_hash 'The hash of the fork ID of the current Ethereum network', -COMMENT COLUMN meta_execution_fork_id_next 'The fork ID of the next planned Ethereum network upgrade', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.mempool_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Each row represents a transaction that was seen in the mempool by a sentry client. Sentries can report the same transaction multiple times if it has been long enough since the last report.', -COMMENT COLUMN event_date_time 'The time when the sentry saw the transaction in the mempool', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN size 'The size of the transaction data in bytes', -COMMENT COLUMN call_data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_execution_fork_id_hash 'The hash of the fork ID of the current Ethereum network', -COMMENT COLUMN meta_execution_fork_id_next 'The fork ID of the next planned Ethereum network upgrade', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the reorg slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN parent_root 'The root hash of the parent beacon block', -COMMENT COLUMN state_root 'The root hash of the beacon state at this block', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN eth1_data_block_hash 'The block hash of the associated execution block', -COMMENT COLUMN eth1_data_deposit_root 'The root of the deposit tree in the associated execution block', -COMMENT COLUMN execution_payload_block_hash 'The block hash of the execution payload', -COMMENT COLUMN execution_payload_block_number 'The block number of the execution payload', -COMMENT COLUMN execution_payload_fee_recipient 'The recipient of the fee for this execution payload', -COMMENT COLUMN execution_payload_state_root 'The state root of the execution payload', -COMMENT COLUMN execution_payload_parent_hash 'The parent hash of the execution payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_execution_fork_id_hash 'The hash of the fork ID of the current Ethereum network', -COMMENT COLUMN meta_execution_fork_id_next 'The fork ID of the next planned Ethereum network upgrade', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the reorg slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN parent_root 'The root hash of the parent beacon block', -COMMENT COLUMN state_root 'The root hash of the beacon state at this block', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN eth1_data_block_hash 'The block hash of the associated execution block', -COMMENT COLUMN eth1_data_deposit_root 'The root of the deposit tree in the associated execution block', -COMMENT COLUMN execution_payload_block_hash 'The block hash of the execution payload', -COMMENT COLUMN execution_payload_block_number 'The block number of the execution payload', -COMMENT COLUMN execution_payload_fee_recipient 'The recipient of the fee for this execution payload', -COMMENT COLUMN execution_payload_state_root 'The state root of the execution payload', -COMMENT COLUMN execution_payload_parent_hash 'The parent hash of the execution payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_execution_fork_id_hash 'The hash of the fork ID of the current Ethereum network', -COMMENT COLUMN meta_execution_fork_id_next 'The fork ID of the next planned Ethereum network upgrade', -COMMENT COLUMN meta_labels 'Labels associated with the event'; diff --git a/deploy/migrations/clickhouse/007_tmp.down.sql b/deploy/migrations/clickhouse/007_tmp.down.sql deleted file mode 100644 index a78a4b189..000000000 --- a/deploy/migrations/clickhouse/007_tmp.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP DATABASE tmp ON CLUSTER '{cluster}' diff --git a/deploy/migrations/clickhouse/007_tmp.up.sql b/deploy/migrations/clickhouse/007_tmp.up.sql deleted file mode 100644 index 757da6cd5..000000000 --- a/deploy/migrations/clickhouse/007_tmp.up.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE DATABASE IF NOT EXISTS tmp ON CLUSTER '{cluster}' diff --git a/deploy/migrations/clickhouse/008_block_transactions_size.down.sql b/deploy/migrations/clickhouse/008_block_transactions_size.down.sql deleted file mode 100644 index 3d27976b6..000000000 --- a/deploy/migrations/clickhouse/008_block_transactions_size.down.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE beacon_api_eth_v2_beacon_block on cluster '{cluster}' - DROP COLUMN execution_payload_transactions_count, - DROP COLUMN execution_payload_transactions_total_bytes; - -ALTER TABLE beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' - DROP COLUMN execution_payload_transactions_count, - DROP COLUMN execution_payload_transactions_total_bytes; diff --git a/deploy/migrations/clickhouse/008_block_transactions_size.up.sql b/deploy/migrations/clickhouse/008_block_transactions_size.up.sql deleted file mode 100644 index f58cd5972..000000000 --- a/deploy/migrations/clickhouse/008_block_transactions_size.up.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' - ADD COLUMN execution_payload_transactions_count Nullable(UInt32) Codec(ZSTD(1)) AFTER execution_payload_parent_hash, - ADD COLUMN execution_payload_transactions_total_bytes Nullable(UInt32) Codec(ZSTD(1)) AFTER execution_payload_transactions_count; - -ALTER TABLE beacon_api_eth_v2_beacon_block on cluster '{cluster}' - ADD COLUMN execution_payload_transactions_count Nullable(UInt32) Codec(ZSTD(1)) AFTER execution_payload_parent_hash, - ADD COLUMN execution_payload_transactions_total_bytes Nullable(UInt32) Codec(ZSTD(1)) AFTER execution_payload_transactions_count; diff --git a/deploy/migrations/clickhouse/009_beacon_block_v2_update.down.sql b/deploy/migrations/clickhouse/009_beacon_block_v2_update.down.sql deleted file mode 100644 index e70eb21bf..000000000 --- a/deploy/migrations/clickhouse/009_beacon_block_v2_update.down.sql +++ /dev/null @@ -1,21 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS meta_consensus_version, - DROP COLUMN IF EXISTS meta_consensus_version_major, - DROP COLUMN IF EXISTS meta_consensus_version_minor, - DROP COLUMN IF EXISTS meta_consensus_version_patch, - DROP COLUMN IF EXISTS meta_consensus_implementation, - ADD COLUMN IF NOT EXISTS meta_execution_fork_id_hash LowCardinality(String) AFTER meta_network_name, - ADD COLUMN IF NOT EXISTS meta_execution_fork_id_next LowCardinality(String) AFTER meta_execution_fork_id_hash, - COMMENT COLUMN execution_payload_transactions_count '', - COMMENT COLUMN execution_payload_transactions_total_bytes ''; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS meta_consensus_version, - DROP COLUMN IF EXISTS meta_consensus_version_major, - DROP COLUMN IF EXISTS meta_consensus_version_minor, - DROP COLUMN IF EXISTS meta_consensus_version_patch, - DROP COLUMN IF EXISTS meta_consensus_implementation, - ADD COLUMN IF NOT EXISTS meta_execution_fork_id_hash LowCardinality(String) AFTER meta_network_name, - ADD COLUMN IF NOT EXISTS meta_execution_fork_id_next LowCardinality(String) AFTER meta_execution_fork_id_hash, - COMMENT COLUMN execution_payload_transactions_count '', - COMMENT COLUMN execution_payload_transactions_total_bytes ''; diff --git a/deploy/migrations/clickhouse/009_beacon_block_v2_update.up.sql b/deploy/migrations/clickhouse/009_beacon_block_v2_update.up.sql deleted file mode 100644 index c795d3ca2..000000000 --- a/deploy/migrations/clickhouse/009_beacon_block_v2_update.up.sql +++ /dev/null @@ -1,31 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' - ADD COLUMN meta_consensus_version LowCardinality(String) AFTER meta_network_name, - ADD COLUMN meta_consensus_version_major LowCardinality(String) AFTER meta_consensus_version, - ADD COLUMN meta_consensus_version_minor LowCardinality(String) AFTER meta_consensus_version_major, - ADD COLUMN meta_consensus_version_patch LowCardinality(String) AFTER meta_consensus_version_minor, - ADD COLUMN meta_consensus_implementation LowCardinality(String) AFTER meta_consensus_version_patch, - DROP COLUMN meta_execution_fork_id_hash, - DROP COLUMN meta_execution_fork_id_next, - COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', - COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', - COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', - COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', - COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', - COMMENT COLUMN execution_payload_transactions_count 'The transaction count of the execution payload', - COMMENT COLUMN execution_payload_transactions_total_bytes 'The transaction total bytes of the execution payload'; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' - ADD COLUMN meta_consensus_version LowCardinality(String) AFTER meta_network_name, - ADD COLUMN meta_consensus_version_major LowCardinality(String) AFTER meta_consensus_version, - ADD COLUMN meta_consensus_version_minor LowCardinality(String) AFTER meta_consensus_version_major, - ADD COLUMN meta_consensus_version_patch LowCardinality(String) AFTER meta_consensus_version_minor, - ADD COLUMN meta_consensus_implementation LowCardinality(String) AFTER meta_consensus_version_patch, - DROP COLUMN meta_execution_fork_id_hash, - DROP COLUMN meta_execution_fork_id_next, - COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', - COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', - COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', - COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', - COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', - COMMENT COLUMN execution_payload_transactions_count 'The transaction count of the execution payload', - COMMENT COLUMN execution_payload_transactions_total_bytes 'The transaction total bytes of the execution payload'; diff --git a/deploy/migrations/clickhouse/010_validator_attestation_data.down.sql b/deploy/migrations/clickhouse/010_validator_attestation_data.down.sql deleted file mode 100644 index 98ad7703d..000000000 --- a/deploy/migrations/clickhouse/010_validator_attestation_data.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_validator_attestation_data on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_validator_attestation_data_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/010_validator_attestation_data.up.sql b/deploy/migrations/clickhouse/010_validator_attestation_data.up.sql deleted file mode 100644 index 69638da3f..000000000 --- a/deploy/migrations/clickhouse/010_validator_attestation_data.up.sql +++ /dev/null @@ -1,86 +0,0 @@ -CREATE TABLE beacon_api_eth_v1_validator_attestation_data_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - committee_index LowCardinality(String), - beacon_block_root FixedString(66) Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - source_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source_root FixedString(66) Codec(ZSTD(1)), - target_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - target_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - target_root FixedString(66) Codec(ZSTD(1)), - request_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - request_duration UInt32 Codec(ZSTD(1)), - request_slot_start_diff UInt32 Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) Codec(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API validator attestation data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API validator attestation data payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN committee_index 'The committee index in the beacon API validator attestation data payload', -COMMENT COLUMN beacon_block_root 'The beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN source_epoch 'The source epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN source_epoch_start_date_time 'The wall clock time when the source epoch started', -COMMENT COLUMN source_root 'The source beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN target_epoch 'The target epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN target_epoch_start_date_time 'The wall clock time when the target epoch started', -COMMENT COLUMN target_root 'The target beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN request_date_time 'When the request was sent to the beacon node', -COMMENT COLUMN request_duration 'The request duration in milliseconds', -COMMENT COLUMN request_slot_start_diff 'The difference between the request_date_time and the slot_start_date_time', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v1_validator_attestation_data on cluster '{cluster}' AS beacon_api_eth_v1_validator_attestation_data_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_validator_attestation_data_local, rand()); diff --git a/deploy/migrations/clickhouse/011_block_transactions_size.down.sql b/deploy/migrations/clickhouse/011_block_transactions_size.down.sql deleted file mode 100644 index 791e30f09..000000000 --- a/deploy/migrations/clickhouse/011_block_transactions_size.down.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TABLE beacon_api_eth_v2_beacon_block on cluster '{cluster}' - DROP COLUMN block_total_bytes, - DROP COLUMN block_total_bytes_compressed, - DROP COLUMN execution_payload_transactions_total_bytes_compressed; - -ALTER TABLE beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' - DROP COLUMN block_total_bytes, - DROP COLUMN block_total_bytes_compressed, - DROP COLUMN execution_payload_transactions_total_bytes_compressed; diff --git a/deploy/migrations/clickhouse/011_block_transactions_size.up.sql b/deploy/migrations/clickhouse/011_block_transactions_size.up.sql deleted file mode 100644 index 647d3753f..000000000 --- a/deploy/migrations/clickhouse/011_block_transactions_size.up.sql +++ /dev/null @@ -1,15 +0,0 @@ -ALTER TABLE beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' - ADD COLUMN block_total_bytes Nullable(UInt32) Codec(ZSTD(1)) AFTER block_root, - ADD COLUMN block_total_bytes_compressed Nullable(UInt32) Codec(ZSTD(1)) AFTER block_total_bytes, - ADD COLUMN execution_payload_transactions_total_bytes_compressed Nullable(UInt32) Codec(ZSTD(1)) AFTER execution_payload_transactions_total_bytes, - COMMENT COLUMN block_total_bytes 'The total bytes of the beacon block payload', - COMMENT COLUMN block_total_bytes_compressed 'The total bytes of the beacon block payload when compressed using snappy', - COMMENT COLUMN execution_payload_transactions_total_bytes_compressed 'The transaction total bytes of the execution payload when compressed using snappy'; - -ALTER TABLE beacon_api_eth_v2_beacon_block on cluster '{cluster}' - ADD COLUMN block_total_bytes Nullable(UInt32) Codec(ZSTD(1)) AFTER block_root, - ADD COLUMN block_total_bytes_compressed Nullable(UInt32) Codec(ZSTD(1)) AFTER block_total_bytes, - ADD COLUMN execution_payload_transactions_total_bytes_compressed Nullable(UInt32) Codec(ZSTD(1)) AFTER execution_payload_transactions_total_bytes, - COMMENT COLUMN block_total_bytes 'The total bytes of the beacon block payload', - COMMENT COLUMN block_total_bytes_compressed 'The total bytes of the beacon block payload when compressed using snappy', - COMMENT COLUMN execution_payload_transactions_total_bytes_compressed 'The transaction total bytes of the execution payload when compressed using snappy'; diff --git a/deploy/migrations/clickhouse/012_cannon.down.sql b/deploy/migrations/clickhouse/012_cannon.down.sql deleted file mode 100644 index 8cfcbae72..000000000 --- a/deploy/migrations/clickhouse/012_cannon.down.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_proposer_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_attester_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_attester_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_bls_to_execution_change_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_execution_transaction on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_execution_transaction_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_voluntary_exit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_deposit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_deposit_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/012_cannon.up.sql b/deploy/migrations/clickhouse/012_cannon.up.sql deleted file mode 100644 index 637b74d9b..000000000 --- a/deploy/migrations/clickhouse/012_cannon.up.sql +++ /dev/null @@ -1,525 +0,0 @@ -CREATE TABLE default.beacon_api_eth_v2_beacon_block_proposer_slashing_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - signed_header_1_message_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_1_message_proposer_index UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_1_message_body_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_message_parent_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_message_state_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_signature String CODEC(ZSTD(1)), - signed_header_2_message_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_2_message_proposer_index UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_2_message_body_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_message_parent_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_message_state_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains proposer slashing from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN signed_header_1_message_slot 'The slot number from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_proposer_index 'The proposer index from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_body_root 'The body root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_parent_root 'The parent root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_state_root 'The state root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_signature 'The signature for the first signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_slot 'The slot number from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_proposer_index 'The proposer index from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_body_root 'The body root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_parent_root 'The parent root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_state_root 'The state root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_signature 'The signature for the second signed header in the slashing payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v2_beacon_block_proposer_slashing on cluster '{cluster}' AS beacon_api_eth_v2_beacon_block_proposer_slashing_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_proposer_slashing_local, rand()); - -CREATE TABLE default.beacon_api_eth_v2_beacon_block_attester_slashing_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - attestation_1_attesting_indices Array(UInt32) Codec(ZSTD(1)), - attestation_1_signature String CODEC(ZSTD(1)), - attestation_1_data_beacon_block_root FixedString(66) CODEC(ZSTD(1)), - attestation_1_data_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_index UInt32 Codec(ZSTD(1)), - attestation_1_data_source_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_source_root FixedString(66) CODEC(ZSTD(1)), - attestation_1_data_target_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_target_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_attesting_indices Array(UInt32) Codec(ZSTD(1)), - attestation_2_signature String CODEC(ZSTD(1)), - attestation_2_data_beacon_block_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_data_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_index UInt32 Codec(ZSTD(1)), - attestation_2_data_source_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_source_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_data_target_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_target_root FixedString(66) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains attester slashing from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN attestation_1_attesting_indices 'The attesting indices from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_signature 'The signature from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_beacon_block_root 'The beacon block root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_slot 'The slot number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_index 'The attestor index from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_source_epoch 'The source epoch number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_source_root 'The source root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_target_epoch 'The target epoch number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_target_root 'The target root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_2_attesting_indices 'The attesting indices from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_signature 'The signature from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_beacon_block_root 'The beacon block root from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_slot 'The slot number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_index 'The attestor index from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_source_epoch 'The source epoch number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_source_root 'The source root from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_target_epoch 'The target epoch number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_target_root 'The target root from the second attestation in the slashing payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v2_beacon_block_attester_slashing on cluster '{cluster}' AS beacon_api_eth_v2_beacon_block_attester_slashing_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_attester_slashing_local, rand()); - -CREATE TABLE default.beacon_api_eth_v2_beacon_block_bls_to_execution_change_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - exchanging_message_validator_index UInt32 CODEC(ZSTD(1)), - exchanging_message_from_bls_pubkey String CODEC(ZSTD(1)), - exchanging_message_to_execution_address FixedString(42) CODEC(ZSTD(1)), - exchanging_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains bls to execution change from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN exchanging_message_validator_index 'The validator index from the exchanging message', -COMMENT COLUMN exchanging_message_from_bls_pubkey 'The BLS public key from the exchanging message', -COMMENT COLUMN exchanging_message_to_execution_address 'The execution address from the exchanging message', -COMMENT COLUMN exchanging_signature 'The signature for the exchanging message', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v2_beacon_block_bls_to_execution_change on cluster '{cluster}' AS beacon_api_eth_v2_beacon_block_bls_to_execution_change_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_bls_to_execution_change_local, rand()); - -CREATE TABLE default.beacon_api_eth_v2_beacon_block_execution_transaction_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - position UInt32 CODEC(DoubleDelta, ZSTD(1)), - hash FixedString(66) Codec(ZSTD(1)), - from FixedString(42) Codec(ZSTD(1)), - to Nullable(FixedString(42)) Codec(ZSTD(1)), - nonce UInt64 Codec(ZSTD(1)), - gas_price UInt128 Codec(ZSTD(1)), - gas UInt64 Codec(ZSTD(1)), - value UInt128 Codec(ZSTD(1)), - type UInt8 Codec(ZSTD(1)), - size UInt32 Codec(ZSTD(1)), - call_data_size UInt32 Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution transaction from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN position 'The position of the transaction in the beacon block', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN type 'The type of the transaction', -COMMENT COLUMN size 'The size of the transaction data in bytes', -COMMENT COLUMN call_data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v2_beacon_block_execution_transaction on cluster '{cluster}' AS beacon_api_eth_v2_beacon_block_execution_transaction_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_execution_transaction_local, rand()); - -CREATE TABLE default.beacon_api_eth_v2_beacon_block_voluntary_exit_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - voluntary_exit_message_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - voluntary_exit_message_validator_index UInt32 CODEC(ZSTD(1)), - voluntary_exit_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a voluntary exit from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN voluntary_exit_message_epoch 'The epoch number from the exit message', -COMMENT COLUMN voluntary_exit_message_validator_index 'The validator index from the exit message', -COMMENT COLUMN voluntary_exit_signature 'The signature of the exit message', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v2_beacon_block_voluntary_exit on cluster '{cluster}' AS beacon_api_eth_v2_beacon_block_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_voluntary_exit_local, rand()); - -CREATE TABLE default.beacon_api_eth_v2_beacon_block_deposit_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - deposit_proof Array(String) CODEC(ZSTD(1)), - deposit_data_pubkey String CODEC(ZSTD(1)), - deposit_data_withdrawal_credentials FixedString(66) CODEC(ZSTD(1)), - deposit_data_amount UInt128 CODEC(ZSTD(1)), - deposit_data_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_deposit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a deposit from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN deposit_proof 'The proof of the deposit data', -COMMENT COLUMN deposit_data_pubkey 'The BLS public key of the validator from the deposit data', -COMMENT COLUMN deposit_data_withdrawal_credentials 'The withdrawal credentials of the validator from the deposit data', -COMMENT COLUMN deposit_data_amount 'The amount of the deposit from the deposit data', -COMMENT COLUMN deposit_data_signature 'The signature of the deposit data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v2_beacon_block_deposit on cluster '{cluster}' AS beacon_api_eth_v2_beacon_block_deposit_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_deposit_local, rand()); diff --git a/deploy/migrations/clickhouse/013_mempool_txn_type.down.sql b/deploy/migrations/clickhouse/013_mempool_txn_type.down.sql deleted file mode 100644 index 25895c3d1..000000000 --- a/deploy/migrations/clickhouse/013_mempool_txn_type.down.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE mempool_transaction_local on cluster '{cluster}' - DROP COLUMN type; - -ALTER TABLE mempool_transaction on cluster '{cluster}' - DROP COLUMN type; - -ALTER TABLE mempool_transaction_local on cluster '{cluster}' -MODIFY COLUMN to FixedString(42) Codec(ZSTD(1)); - -ALTER TABLE mempool_transaction on cluster '{cluster}' -MODIFY COLUMN to FixedString(42) Codec(ZSTD(1)); diff --git a/deploy/migrations/clickhouse/013_mempool_txn_type.up.sql b/deploy/migrations/clickhouse/013_mempool_txn_type.up.sql deleted file mode 100644 index 8e370b6de..000000000 --- a/deploy/migrations/clickhouse/013_mempool_txn_type.up.sql +++ /dev/null @@ -1,17 +0,0 @@ -ALTER TABLE mempool_transaction_local on cluster '{cluster}' -MODIFY COLUMN to Nullable(FixedString(42)) Codec(ZSTD(1)); - -ALTER TABLE mempool_transaction on cluster '{cluster}' -MODIFY COLUMN to Nullable(FixedString(42)) Codec(ZSTD(1)); - -ALTER TABLE mempool_transaction_local on cluster '{cluster}' -ADD COLUMN type Nullable(UInt8) Codec(ZSTD(1)) AFTER value; - -ALTER TABLE mempool_transaction on cluster '{cluster}' -ADD COLUMN type Nullable(UInt8) Codec(ZSTD(1)) AFTER value; - -ALTER TABLE mempool_transaction_local on cluster '{cluster}' -COMMENT COLUMN type 'The type of the transaction'; - -ALTER TABLE mempool_transaction on cluster '{cluster}' -COMMENT COLUMN type 'The type of the transaction'; diff --git a/deploy/migrations/clickhouse/014_cannon_rename.down.sql b/deploy/migrations/clickhouse/014_cannon_rename.down.sql deleted file mode 100644 index 4dca5fbe0..000000000 --- a/deploy/migrations/clickhouse/014_cannon_rename.down.sql +++ /dev/null @@ -1,22 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_block on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_deposit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_deposit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_withdrawal on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_withdrawal_local on cluster '{cluster}' SYNC; - -ALTER TABLE beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' - DROP COLUMN block_version; - -ALTER TABLE beacon_api_eth_v2_beacon_block on cluster '{cluster}' - DROP COLUMN block_version; diff --git a/deploy/migrations/clickhouse/014_cannon_rename.up.sql b/deploy/migrations/clickhouse/014_cannon_rename.up.sql deleted file mode 100644 index 412e12762..000000000 --- a/deploy/migrations/clickhouse/014_cannon_rename.up.sql +++ /dev/null @@ -1,728 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_proposer_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_attester_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_attester_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_bls_to_execution_change_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_execution_transaction on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_execution_transaction_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_voluntary_exit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_deposit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v2_beacon_block_deposit_local on cluster '{cluster}' SYNC; - -ALTER TABLE beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' -ADD COLUMN block_version LowCardinality(String) Codec(ZSTD(1)) AFTER block_root; - -ALTER TABLE beacon_api_eth_v2_beacon_block on cluster '{cluster}' -ADD COLUMN block_version LowCardinality(String) Codec(ZSTD(1)) AFTER block_root; - -ALTER TABLE beacon_api_eth_v2_beacon_block_local on cluster '{cluster}' -COMMENT COLUMN block_version 'The version of the beacon block'; - -ALTER TABLE beacon_api_eth_v2_beacon_block on cluster '{cluster}' -COMMENT COLUMN block_version 'The version of the beacon block'; - -CREATE TABLE default.canonical_beacon_block_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - block_total_bytes Nullable(UInt32) CODEC(ZSTD(1)), - block_total_bytes_compressed Nullable(UInt32) CODEC(ZSTD(1)), - parent_root FixedString(66) CODEC(ZSTD(1)), - state_root FixedString(66) CODEC(ZSTD(1)), - proposer_index UInt32 CODEC(ZSTD(1)), - eth1_data_block_hash FixedString(66) CODEC(ZSTD(1)), - eth1_data_deposit_root FixedString(66) CODEC(ZSTD(1)), - execution_payload_block_hash FixedString(66) CODEC(ZSTD(1)), - execution_payload_block_number UInt32 CODEC(DoubleDelta, ZSTD(1)), - execution_payload_fee_recipient String CODEC(ZSTD(1)), - execution_payload_state_root FixedString(66) CODEC(ZSTD(1)), - execution_payload_parent_hash FixedString(66) CODEC(ZSTD(1)), - execution_payload_transactions_count Nullable(UInt32) CODEC(ZSTD(1)), - execution_payload_transactions_total_bytes Nullable(UInt32) CODEC(ZSTD(1)), - execution_payload_transactions_total_bytes_compressed Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon block from a beacon node.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN block_total_bytes 'The total bytes of the beacon block payload', -COMMENT COLUMN block_total_bytes_compressed 'The total bytes of the beacon block payload when compressed using snappy', -COMMENT COLUMN parent_root 'The root hash of the parent beacon block', -COMMENT COLUMN state_root 'The root hash of the beacon state at this block', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN eth1_data_block_hash 'The block hash of the associated execution block', -COMMENT COLUMN eth1_data_deposit_root 'The root of the deposit tree in the associated execution block', -COMMENT COLUMN execution_payload_block_hash 'The block hash of the execution payload', -COMMENT COLUMN execution_payload_block_number 'The block number of the execution payload', -COMMENT COLUMN execution_payload_fee_recipient 'The recipient of the fee for this execution payload', -COMMENT COLUMN execution_payload_state_root 'The state root of the execution payload', -COMMENT COLUMN execution_payload_parent_hash 'The parent hash of the execution payload', -COMMENT COLUMN execution_payload_transactions_count 'The transaction count of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes 'The transaction total bytes of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes_compressed 'The transaction total bytes of the execution payload when compressed using snappy', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block on cluster '{cluster}' AS canonical_beacon_block_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_local, rand()); - -CREATE TABLE default.canonical_beacon_block_proposer_slashing_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - signed_header_1_message_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_1_message_proposer_index UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_1_message_body_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_message_parent_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_message_state_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_signature String CODEC(ZSTD(1)), - signed_header_2_message_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_2_message_proposer_index UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_2_message_body_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_message_parent_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_message_state_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains proposer slashing from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN signed_header_1_message_slot 'The slot number from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_proposer_index 'The proposer index from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_body_root 'The body root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_parent_root 'The parent root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_state_root 'The state root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_signature 'The signature for the first signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_slot 'The slot number from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_proposer_index 'The proposer index from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_body_root 'The body root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_parent_root 'The parent root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_state_root 'The state root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_signature 'The signature for the second signed header in the slashing payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_proposer_slashing on cluster '{cluster}' AS canonical_beacon_block_proposer_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_proposer_slashing_local, rand()); - -CREATE TABLE default.canonical_beacon_block_attester_slashing_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - attestation_1_attesting_indices Array(UInt32) Codec(ZSTD(1)), - attestation_1_signature String CODEC(ZSTD(1)), - attestation_1_data_beacon_block_root FixedString(66) CODEC(ZSTD(1)), - attestation_1_data_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_index UInt32 Codec(ZSTD(1)), - attestation_1_data_source_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_source_root FixedString(66) CODEC(ZSTD(1)), - attestation_1_data_target_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_target_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_attesting_indices Array(UInt32) Codec(ZSTD(1)), - attestation_2_signature String CODEC(ZSTD(1)), - attestation_2_data_beacon_block_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_data_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_index UInt32 Codec(ZSTD(1)), - attestation_2_data_source_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_source_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_data_target_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_target_root FixedString(66) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains attester slashing from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN attestation_1_attesting_indices 'The attesting indices from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_signature 'The signature from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_beacon_block_root 'The beacon block root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_slot 'The slot number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_index 'The attestor index from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_source_epoch 'The source epoch number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_source_root 'The source root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_target_epoch 'The target epoch number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_target_root 'The target root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_2_attesting_indices 'The attesting indices from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_signature 'The signature from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_beacon_block_root 'The beacon block root from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_slot 'The slot number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_index 'The attestor index from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_source_epoch 'The source epoch number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_source_root 'The source root from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_target_epoch 'The target epoch number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_target_root 'The target root from the second attestation in the slashing payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_attester_slashing on cluster '{cluster}' AS canonical_beacon_block_attester_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_attester_slashing_local, rand()); - -CREATE TABLE default.canonical_beacon_block_bls_to_execution_change_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - exchanging_message_validator_index UInt32 CODEC(ZSTD(1)), - exchanging_message_from_bls_pubkey String CODEC(ZSTD(1)), - exchanging_message_to_execution_address FixedString(42) CODEC(ZSTD(1)), - exchanging_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains bls to execution change from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN exchanging_message_validator_index 'The validator index from the exchanging message', -COMMENT COLUMN exchanging_message_from_bls_pubkey 'The BLS public key from the exchanging message', -COMMENT COLUMN exchanging_message_to_execution_address 'The execution address from the exchanging message', -COMMENT COLUMN exchanging_signature 'The signature for the exchanging message', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' AS canonical_beacon_block_bls_to_execution_change_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_bls_to_execution_change_local, rand()); - -CREATE TABLE default.canonical_beacon_block_execution_transaction_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - position UInt32 CODEC(DoubleDelta, ZSTD(1)), - hash FixedString(66) Codec(ZSTD(1)), - from FixedString(42) Codec(ZSTD(1)), - to Nullable(FixedString(42)) Codec(ZSTD(1)), - nonce UInt64 Codec(ZSTD(1)), - gas_price UInt128 Codec(ZSTD(1)), - gas UInt64 Codec(ZSTD(1)), - value UInt128 Codec(ZSTD(1)), - type UInt8 Codec(ZSTD(1)), - size UInt32 Codec(ZSTD(1)), - call_data_size UInt32 Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution transaction from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN position 'The position of the transaction in the beacon block', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN type 'The type of the transaction', -COMMENT COLUMN size 'The size of the transaction data in bytes', -COMMENT COLUMN call_data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' AS canonical_beacon_block_execution_transaction_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_execution_transaction_local, rand()); - -CREATE TABLE default.canonical_beacon_block_voluntary_exit_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - voluntary_exit_message_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - voluntary_exit_message_validator_index UInt32 CODEC(ZSTD(1)), - voluntary_exit_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a voluntary exit from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN voluntary_exit_message_epoch 'The epoch number from the exit message', -COMMENT COLUMN voluntary_exit_message_validator_index 'The validator index from the exit message', -COMMENT COLUMN voluntary_exit_signature 'The signature of the exit message', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_voluntary_exit on cluster '{cluster}' AS canonical_beacon_block_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_voluntary_exit_local, rand()); - -CREATE TABLE default.canonical_beacon_block_deposit_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - deposit_proof Array(String) CODEC(ZSTD(1)), - deposit_data_pubkey String CODEC(ZSTD(1)), - deposit_data_withdrawal_credentials FixedString(66) CODEC(ZSTD(1)), - deposit_data_amount UInt128 CODEC(ZSTD(1)), - deposit_data_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a deposit from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN deposit_proof 'The proof of the deposit data', -COMMENT COLUMN deposit_data_pubkey 'The BLS public key of the validator from the deposit data', -COMMENT COLUMN deposit_data_withdrawal_credentials 'The withdrawal credentials of the validator from the deposit data', -COMMENT COLUMN deposit_data_amount 'The amount of the deposit from the deposit data', -COMMENT COLUMN deposit_data_signature 'The signature of the deposit data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_deposit on cluster '{cluster}' AS canonical_beacon_block_deposit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_deposit_local, rand()); - -CREATE TABLE default.canonical_beacon_block_withdrawal_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - withdrawal_index UInt32 CODEC(ZSTD(1)), - withdrawal_validator_index UInt32 CODEC(ZSTD(1)), - withdrawal_address FixedString(42) Codec(ZSTD(1)), - withdrawal_amount UInt128 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a withdrawal from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN withdrawal_index 'The index of the withdrawal', -COMMENT COLUMN withdrawal_validator_index 'The validator index from the withdrawal data', -COMMENT COLUMN withdrawal_address 'The address of the account that is the withdrawal recipient', -COMMENT COLUMN withdrawal_amount 'The amount of the withdrawal from the withdrawal data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_withdrawal on cluster '{cluster}' AS canonical_beacon_block_withdrawal_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_withdrawal_local, rand()); diff --git a/deploy/migrations/clickhouse/015_cannon_replacing.down.sql b/deploy/migrations/clickhouse/015_cannon_replacing.down.sql deleted file mode 100644 index bc0b6f892..000000000 --- a/deploy/migrations/clickhouse/015_cannon_replacing.down.sql +++ /dev/null @@ -1,721 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_block on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_deposit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_deposit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_withdrawal on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_withdrawal_local on cluster '{cluster}' SYNC; - - -CREATE TABLE default.canonical_beacon_block_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - block_total_bytes Nullable(UInt32) CODEC(ZSTD(1)), - block_total_bytes_compressed Nullable(UInt32) CODEC(ZSTD(1)), - parent_root FixedString(66) CODEC(ZSTD(1)), - state_root FixedString(66) CODEC(ZSTD(1)), - proposer_index UInt32 CODEC(ZSTD(1)), - eth1_data_block_hash FixedString(66) CODEC(ZSTD(1)), - eth1_data_deposit_root FixedString(66) CODEC(ZSTD(1)), - execution_payload_block_hash FixedString(66) CODEC(ZSTD(1)), - execution_payload_block_number UInt32 CODEC(DoubleDelta, ZSTD(1)), - execution_payload_fee_recipient String CODEC(ZSTD(1)), - execution_payload_state_root FixedString(66) CODEC(ZSTD(1)), - execution_payload_parent_hash FixedString(66) CODEC(ZSTD(1)), - execution_payload_transactions_count Nullable(UInt32) CODEC(ZSTD(1)), - execution_payload_transactions_total_bytes Nullable(UInt32) CODEC(ZSTD(1)), - execution_payload_transactions_total_bytes_compressed Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon block from a beacon node.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN block_total_bytes 'The total bytes of the beacon block payload', -COMMENT COLUMN block_total_bytes_compressed 'The total bytes of the beacon block payload when compressed using snappy', -COMMENT COLUMN parent_root 'The root hash of the parent beacon block', -COMMENT COLUMN state_root 'The root hash of the beacon state at this block', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN eth1_data_block_hash 'The block hash of the associated execution block', -COMMENT COLUMN eth1_data_deposit_root 'The root of the deposit tree in the associated execution block', -COMMENT COLUMN execution_payload_block_hash 'The block hash of the execution payload', -COMMENT COLUMN execution_payload_block_number 'The block number of the execution payload', -COMMENT COLUMN execution_payload_fee_recipient 'The recipient of the fee for this execution payload', -COMMENT COLUMN execution_payload_state_root 'The state root of the execution payload', -COMMENT COLUMN execution_payload_parent_hash 'The parent hash of the execution payload', -COMMENT COLUMN execution_payload_transactions_count 'The transaction count of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes 'The transaction total bytes of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes_compressed 'The transaction total bytes of the execution payload when compressed using snappy', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block on cluster '{cluster}' AS canonical_beacon_block_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_local, rand()); - -CREATE TABLE default.canonical_beacon_block_proposer_slashing_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - signed_header_1_message_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_1_message_proposer_index UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_1_message_body_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_message_parent_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_message_state_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_signature String CODEC(ZSTD(1)), - signed_header_2_message_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_2_message_proposer_index UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_2_message_body_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_message_parent_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_message_state_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains proposer slashing from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN signed_header_1_message_slot 'The slot number from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_proposer_index 'The proposer index from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_body_root 'The body root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_parent_root 'The parent root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_state_root 'The state root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_signature 'The signature for the first signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_slot 'The slot number from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_proposer_index 'The proposer index from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_body_root 'The body root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_parent_root 'The parent root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_state_root 'The state root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_signature 'The signature for the second signed header in the slashing payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_proposer_slashing on cluster '{cluster}' AS canonical_beacon_block_proposer_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_proposer_slashing_local, rand()); - -CREATE TABLE default.canonical_beacon_block_attester_slashing_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - attestation_1_attesting_indices Array(UInt32) Codec(ZSTD(1)), - attestation_1_signature String CODEC(ZSTD(1)), - attestation_1_data_beacon_block_root FixedString(66) CODEC(ZSTD(1)), - attestation_1_data_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_index UInt32 Codec(ZSTD(1)), - attestation_1_data_source_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_source_root FixedString(66) CODEC(ZSTD(1)), - attestation_1_data_target_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_target_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_attesting_indices Array(UInt32) Codec(ZSTD(1)), - attestation_2_signature String CODEC(ZSTD(1)), - attestation_2_data_beacon_block_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_data_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_index UInt32 Codec(ZSTD(1)), - attestation_2_data_source_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_source_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_data_target_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_target_root FixedString(66) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains attester slashing from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN attestation_1_attesting_indices 'The attesting indices from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_signature 'The signature from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_beacon_block_root 'The beacon block root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_slot 'The slot number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_index 'The attestor index from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_source_epoch 'The source epoch number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_source_root 'The source root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_target_epoch 'The target epoch number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_target_root 'The target root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_2_attesting_indices 'The attesting indices from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_signature 'The signature from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_beacon_block_root 'The beacon block root from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_slot 'The slot number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_index 'The attestor index from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_source_epoch 'The source epoch number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_source_root 'The source root from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_target_epoch 'The target epoch number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_target_root 'The target root from the second attestation in the slashing payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_attester_slashing on cluster '{cluster}' AS canonical_beacon_block_attester_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_attester_slashing_local, rand()); - -CREATE TABLE default.canonical_beacon_block_bls_to_execution_change_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - exchanging_message_validator_index UInt32 CODEC(ZSTD(1)), - exchanging_message_from_bls_pubkey String CODEC(ZSTD(1)), - exchanging_message_to_execution_address FixedString(42) CODEC(ZSTD(1)), - exchanging_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains bls to execution change from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN exchanging_message_validator_index 'The validator index from the exchanging message', -COMMENT COLUMN exchanging_message_from_bls_pubkey 'The BLS public key from the exchanging message', -COMMENT COLUMN exchanging_message_to_execution_address 'The execution address from the exchanging message', -COMMENT COLUMN exchanging_signature 'The signature for the exchanging message', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' AS canonical_beacon_block_bls_to_execution_change_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_bls_to_execution_change_local, rand()); - -CREATE TABLE default.canonical_beacon_block_execution_transaction_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - position UInt32 CODEC(DoubleDelta, ZSTD(1)), - hash FixedString(66) Codec(ZSTD(1)), - from FixedString(42) Codec(ZSTD(1)), - to Nullable(FixedString(42)) Codec(ZSTD(1)), - nonce UInt64 Codec(ZSTD(1)), - gas_price UInt128 Codec(ZSTD(1)), - gas UInt64 Codec(ZSTD(1)), - value UInt128 Codec(ZSTD(1)), - type UInt8 Codec(ZSTD(1)), - size UInt32 Codec(ZSTD(1)), - call_data_size UInt32 Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution transaction from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN position 'The position of the transaction in the beacon block', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN type 'The type of the transaction', -COMMENT COLUMN size 'The size of the transaction data in bytes', -COMMENT COLUMN call_data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' AS canonical_beacon_block_execution_transaction_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_execution_transaction_local, rand()); - -CREATE TABLE default.canonical_beacon_block_voluntary_exit_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - voluntary_exit_message_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - voluntary_exit_message_validator_index UInt32 CODEC(ZSTD(1)), - voluntary_exit_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a voluntary exit from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN voluntary_exit_message_epoch 'The epoch number from the exit message', -COMMENT COLUMN voluntary_exit_message_validator_index 'The validator index from the exit message', -COMMENT COLUMN voluntary_exit_signature 'The signature of the exit message', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_voluntary_exit on cluster '{cluster}' AS canonical_beacon_block_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_voluntary_exit_local, rand()); - -CREATE TABLE default.canonical_beacon_block_deposit_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - deposit_proof Array(String) CODEC(ZSTD(1)), - deposit_data_pubkey String CODEC(ZSTD(1)), - deposit_data_withdrawal_credentials FixedString(66) CODEC(ZSTD(1)), - deposit_data_amount UInt128 CODEC(ZSTD(1)), - deposit_data_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a deposit from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN deposit_proof 'The proof of the deposit data', -COMMENT COLUMN deposit_data_pubkey 'The BLS public key of the validator from the deposit data', -COMMENT COLUMN deposit_data_withdrawal_credentials 'The withdrawal credentials of the validator from the deposit data', -COMMENT COLUMN deposit_data_amount 'The amount of the deposit from the deposit data', -COMMENT COLUMN deposit_data_signature 'The signature of the deposit data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_deposit on cluster '{cluster}' AS canonical_beacon_block_deposit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_deposit_local, rand()); - -CREATE TABLE default.canonical_beacon_block_withdrawal_local on cluster '{cluster}' -( - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - withdrawal_index UInt32 CODEC(ZSTD(1)), - withdrawal_validator_index UInt32 CODEC(ZSTD(1)), - withdrawal_address FixedString(42) Codec(ZSTD(1)), - withdrawal_amount UInt128 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a withdrawal from a beacon block.', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN withdrawal_index 'The index of the withdrawal', -COMMENT COLUMN withdrawal_validator_index 'The validator index from the withdrawal data', -COMMENT COLUMN withdrawal_address 'The address of the account that is the withdrawal recipient', -COMMENT COLUMN withdrawal_amount 'The amount of the withdrawal from the withdrawal data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_withdrawal on cluster '{cluster}' AS canonical_beacon_block_withdrawal_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_withdrawal_local, rand()); diff --git a/deploy/migrations/clickhouse/015_cannon_replacing.up.sql b/deploy/migrations/clickhouse/015_cannon_replacing.up.sql deleted file mode 100644 index 1b3207ad7..000000000 --- a/deploy/migrations/clickhouse/015_cannon_replacing.up.sql +++ /dev/null @@ -1,750 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_block on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_deposit on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_deposit_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_withdrawal on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_block_withdrawal_local on cluster '{cluster}' SYNC; - -CREATE TABLE default.canonical_beacon_block_local on cluster '{cluster}' -( - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - block_total_bytes Nullable(UInt32) CODEC(ZSTD(1)), - block_total_bytes_compressed Nullable(UInt32) CODEC(ZSTD(1)), - parent_root FixedString(66) CODEC(ZSTD(1)), - state_root FixedString(66) CODEC(ZSTD(1)), - proposer_index UInt32 CODEC(ZSTD(1)), - eth1_data_block_hash FixedString(66) CODEC(ZSTD(1)), - eth1_data_deposit_root FixedString(66) CODEC(ZSTD(1)), - execution_payload_block_hash FixedString(66) CODEC(ZSTD(1)), - execution_payload_block_number UInt32 CODEC(DoubleDelta, ZSTD(1)), - execution_payload_fee_recipient String CODEC(ZSTD(1)), - execution_payload_state_root FixedString(66) CODEC(ZSTD(1)), - execution_payload_parent_hash FixedString(66) CODEC(ZSTD(1)), - execution_payload_transactions_count Nullable(UInt32) CODEC(ZSTD(1)), - execution_payload_transactions_total_bytes Nullable(UInt32) CODEC(ZSTD(1)), - execution_payload_transactions_total_bytes_compressed Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name); - -ALTER TABLE default.canonical_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon block from a beacon node.', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN block_total_bytes 'The total bytes of the beacon block payload', -COMMENT COLUMN block_total_bytes_compressed 'The total bytes of the beacon block payload when compressed using snappy', -COMMENT COLUMN parent_root 'The root hash of the parent beacon block', -COMMENT COLUMN state_root 'The root hash of the beacon state at this block', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN eth1_data_block_hash 'The block hash of the associated execution block', -COMMENT COLUMN eth1_data_deposit_root 'The root of the deposit tree in the associated execution block', -COMMENT COLUMN execution_payload_block_hash 'The block hash of the execution payload', -COMMENT COLUMN execution_payload_block_number 'The block number of the execution payload', -COMMENT COLUMN execution_payload_fee_recipient 'The recipient of the fee for this execution payload', -COMMENT COLUMN execution_payload_state_root 'The state root of the execution payload', -COMMENT COLUMN execution_payload_parent_hash 'The parent hash of the execution payload', -COMMENT COLUMN execution_payload_transactions_count 'The transaction count of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes 'The transaction total bytes of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes_compressed 'The transaction total bytes of the execution payload when compressed using snappy', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block on cluster '{cluster}' AS canonical_beacon_block_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_local, rand()); - -CREATE TABLE default.canonical_beacon_block_proposer_slashing_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - signed_header_1_message_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_1_message_proposer_index UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_1_message_body_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_message_parent_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_message_state_root FixedString(66) CODEC(ZSTD(1)), - signed_header_1_signature String CODEC(ZSTD(1)), - signed_header_2_message_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_2_message_proposer_index UInt32 CODEC(DoubleDelta, ZSTD(1)), - signed_header_2_message_body_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_message_parent_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_message_state_root FixedString(66) CODEC(ZSTD(1)), - signed_header_2_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains proposer slashing from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN signed_header_1_message_slot 'The slot number from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_proposer_index 'The proposer index from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_body_root 'The body root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_parent_root 'The parent root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_message_state_root 'The state root from the first signed header in the slashing payload', -COMMENT COLUMN signed_header_1_signature 'The signature for the first signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_slot 'The slot number from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_proposer_index 'The proposer index from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_body_root 'The body root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_parent_root 'The parent root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_message_state_root 'The state root from the second signed header in the slashing payload', -COMMENT COLUMN signed_header_2_signature 'The signature for the second signed header in the slashing payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_proposer_slashing on cluster '{cluster}' AS canonical_beacon_block_proposer_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_proposer_slashing_local, rand()); - -CREATE TABLE default.canonical_beacon_block_attester_slashing_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - attestation_1_attesting_indices Array(UInt32) Codec(ZSTD(1)), - attestation_1_signature String CODEC(ZSTD(1)), - attestation_1_data_beacon_block_root FixedString(66) CODEC(ZSTD(1)), - attestation_1_data_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_index UInt32 Codec(ZSTD(1)), - attestation_1_data_source_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_source_root FixedString(66) CODEC(ZSTD(1)), - attestation_1_data_target_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_1_data_target_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_attesting_indices Array(UInt32) Codec(ZSTD(1)), - attestation_2_signature String CODEC(ZSTD(1)), - attestation_2_data_beacon_block_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_data_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_index UInt32 Codec(ZSTD(1)), - attestation_2_data_source_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_source_root FixedString(66) CODEC(ZSTD(1)), - attestation_2_data_target_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - attestation_2_data_target_root FixedString(66) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains attester slashing from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN attestation_1_attesting_indices 'The attesting indices from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_signature 'The signature from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_beacon_block_root 'The beacon block root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_slot 'The slot number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_index 'The attestor index from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_source_epoch 'The source epoch number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_source_root 'The source root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_target_epoch 'The target epoch number from the first attestation in the slashing payload', -COMMENT COLUMN attestation_1_data_target_root 'The target root from the first attestation in the slashing payload', -COMMENT COLUMN attestation_2_attesting_indices 'The attesting indices from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_signature 'The signature from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_beacon_block_root 'The beacon block root from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_slot 'The slot number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_index 'The attestor index from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_source_epoch 'The source epoch number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_source_root 'The source root from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_target_epoch 'The target epoch number from the second attestation in the slashing payload', -COMMENT COLUMN attestation_2_data_target_root 'The target root from the second attestation in the slashing payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_attester_slashing on cluster '{cluster}' AS canonical_beacon_block_attester_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_attester_slashing_local, rand()); - -CREATE TABLE default.canonical_beacon_block_bls_to_execution_change_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - exchanging_message_validator_index UInt32 CODEC(ZSTD(1)), - exchanging_message_from_bls_pubkey String CODEC(ZSTD(1)), - exchanging_message_to_execution_address FixedString(42) CODEC(ZSTD(1)), - exchanging_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains bls to execution change from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN exchanging_message_validator_index 'The validator index from the exchanging message', -COMMENT COLUMN exchanging_message_from_bls_pubkey 'The BLS public key from the exchanging message', -COMMENT COLUMN exchanging_message_to_execution_address 'The execution address from the exchanging message', -COMMENT COLUMN exchanging_signature 'The signature for the exchanging message', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' AS canonical_beacon_block_bls_to_execution_change_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_bls_to_execution_change_local, rand()); - -CREATE TABLE default.canonical_beacon_block_execution_transaction_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - position UInt32 CODEC(DoubleDelta, ZSTD(1)), - hash FixedString(66) Codec(ZSTD(1)), - from FixedString(42) Codec(ZSTD(1)), - to Nullable(FixedString(42)) Codec(ZSTD(1)), - nonce UInt64 Codec(ZSTD(1)), - gas_price UInt128 Codec(ZSTD(1)), - gas UInt64 Codec(ZSTD(1)), - value UInt128 Codec(ZSTD(1)), - type UInt8 Codec(ZSTD(1)), - size UInt32 Codec(ZSTD(1)), - call_data_size UInt32 Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution transaction from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN position 'The position of the transaction in the beacon block', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN type 'The type of the transaction', -COMMENT COLUMN size 'The size of the transaction data in bytes', -COMMENT COLUMN call_data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' AS canonical_beacon_block_execution_transaction_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_execution_transaction_local, rand()); - -CREATE TABLE default.canonical_beacon_block_voluntary_exit_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - voluntary_exit_message_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - voluntary_exit_message_validator_index UInt32 CODEC(ZSTD(1)), - voluntary_exit_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a voluntary exit from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN voluntary_exit_message_epoch 'The epoch number from the exit message', -COMMENT COLUMN voluntary_exit_message_validator_index 'The validator index from the exit message', -COMMENT COLUMN voluntary_exit_signature 'The signature of the exit message', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_voluntary_exit on cluster '{cluster}' AS canonical_beacon_block_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_voluntary_exit_local, rand()); - -CREATE TABLE default.canonical_beacon_block_deposit_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - deposit_proof Array(String) CODEC(ZSTD(1)), - deposit_data_pubkey String CODEC(ZSTD(1)), - deposit_data_withdrawal_credentials FixedString(66) CODEC(ZSTD(1)), - deposit_data_amount UInt128 CODEC(ZSTD(1)), - deposit_data_signature String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a deposit from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN deposit_proof 'The proof of the deposit data', -COMMENT COLUMN deposit_data_pubkey 'The BLS public key of the validator from the deposit data', -COMMENT COLUMN deposit_data_withdrawal_credentials 'The withdrawal credentials of the validator from the deposit data', -COMMENT COLUMN deposit_data_amount 'The amount of the deposit from the deposit data', -COMMENT COLUMN deposit_data_signature 'The signature of the deposit data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_deposit on cluster '{cluster}' AS canonical_beacon_block_deposit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_deposit_local, rand()); - -CREATE TABLE default.canonical_beacon_block_withdrawal_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_version LowCardinality(String), - withdrawal_index UInt32 CODEC(ZSTD(1)), - withdrawal_validator_index UInt32 CODEC(ZSTD(1)), - withdrawal_address FixedString(42) Codec(ZSTD(1)), - withdrawal_amount UInt128 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a withdrawal from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN withdrawal_index 'The index of the withdrawal', -COMMENT COLUMN withdrawal_validator_index 'The validator index from the withdrawal data', -COMMENT COLUMN withdrawal_address 'The address of the account that is the withdrawal recipient', -COMMENT COLUMN withdrawal_amount 'The amount of the withdrawal from the withdrawal data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_block_withdrawal on cluster '{cluster}' AS canonical_beacon_block_withdrawal_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_withdrawal_local, rand()); diff --git a/deploy/migrations/clickhouse/016_blob_sidecar.down.sql b/deploy/migrations/clickhouse/016_blob_sidecar.down.sql deleted file mode 100644 index 3550bb153..000000000 --- a/deploy/migrations/clickhouse/016_blob_sidecar.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_events_blob_sidecar on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_blob_sidecar_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/016_blob_sidecar.up.sql b/deploy/migrations/clickhouse/016_blob_sidecar.up.sql deleted file mode 100644 index 8b6b34eec..000000000 --- a/deploy/migrations/clickhouse/016_blob_sidecar.up.sql +++ /dev/null @@ -1,74 +0,0 @@ -CREATE TABLE beacon_api_eth_v1_events_blob_sidecar_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - block_root FixedString(66) Codec(ZSTD(1)), - blob_index UInt64 Codec(ZSTD(1)), - kzg_commitment FixedString(98) Codec(ZSTD(1)), - versioned_hash FixedString(66) Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name); - -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN blob_index 'The index of blob sidecar in the beacon API event stream payload', -COMMENT COLUMN kzg_commitment 'The KZG commitment in the beacon API event stream payload', -COMMENT COLUMN versioned_hash 'The versioned hash in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v1_events_blob_sidecar on cluster '{cluster}' AS beacon_api_eth_v1_events_blob_sidecar_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_blob_sidecar_local, rand()); diff --git a/deploy/migrations/clickhouse/017_cannon_blockprint.down.sql b/deploy/migrations/clickhouse/017_cannon_blockprint.down.sql deleted file mode 100644 index d06ac31a0..000000000 --- a/deploy/migrations/clickhouse/017_cannon_blockprint.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_block_classification on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_block_classification_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/017_cannon_blockprint.up.sql b/deploy/migrations/clickhouse/017_cannon_blockprint.up.sql deleted file mode 100644 index 0ca96935f..000000000 --- a/deploy/migrations/clickhouse/017_cannon_blockprint.up.sql +++ /dev/null @@ -1,87 +0,0 @@ -CREATE TABLE default.beacon_block_classification_local on cluster '{cluster}' -( - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - best_guess_single LowCardinality(String), - best_guess_multi LowCardinality(String), - client_probability_uncertain Float32 CODEC(ZSTD(1)), - client_probability_prysm Float32 CODEC(ZSTD(1)), - client_probability_teku Float32 CODEC(ZSTD(1)), - client_probability_nimbus Float32 CODEC(ZSTD(1)), - client_probability_lodestar Float32 CODEC(ZSTD(1)), - client_probability_grandine Float32 CODEC(ZSTD(1)), - client_probability_lighthouse Float32 CODEC(ZSTD(1)), - proposer_index UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name); - -ALTER TABLE default.beacon_block_classification_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon block classification for a given slot. This is a best guess based on the client probabilities of the proposer. This is not guaranteed to be correct.', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block classification', -COMMENT COLUMN slot 'The slot number from beacon block classification', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block classification', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN best_guess_single 'The best guess of the client that generated the beacon block', -COMMENT COLUMN best_guess_multi 'The best guess of the clients that generated the beacon block. This value will typically equal the best_guess_single value, but when multiple clients have high probabilities, this value will have multiple eg. "prysm or lighthouse"', -COMMENT COLUMN client_probability_uncertain 'The probability that the client that generated the beacon block is uncertain', -COMMENT COLUMN client_probability_prysm 'The probability that the client that generated the beacon block is Prysm', -COMMENT COLUMN client_probability_teku 'The probability that the client that generated the beacon block is Teku', -COMMENT COLUMN client_probability_nimbus 'The probability that the client that generated the beacon block is Nimbus', -COMMENT COLUMN client_probability_lodestar 'The probability that the client that generated the beacon block is Lodestar', -COMMENT COLUMN client_probability_grandine 'The probability that the client that generated the beacon block is Grandine', -COMMENT COLUMN client_probability_lighthouse 'The probability that the client that generated the beacon block is Lighthouse', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_block_classification on cluster '{cluster}' AS beacon_block_classification_local -ENGINE = Distributed('{cluster}', default, beacon_block_classification_local, rand()); diff --git a/deploy/migrations/clickhouse/018_cannon_blob_sidecar.down.sql b/deploy/migrations/clickhouse/018_cannon_blob_sidecar.down.sql deleted file mode 100644 index aed2ce016..000000000 --- a/deploy/migrations/clickhouse/018_cannon_blob_sidecar.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_blob_sidecar on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_blob_sidecar_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/018_cannon_blob_sidecar.up.sql b/deploy/migrations/clickhouse/018_cannon_blob_sidecar.up.sql deleted file mode 100644 index ac4680798..000000000 --- a/deploy/migrations/clickhouse/018_cannon_blob_sidecar.up.sql +++ /dev/null @@ -1,83 +0,0 @@ -CREATE TABLE default.canonical_beacon_blob_sidecar_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - block_parent_root FixedString(66) CODEC(ZSTD(1)), - kzg_commitment FixedString(98) Codec(ZSTD(1)), - kzg_proof FixedString(98) Codec(ZSTD(1)), - proposer_index UInt32 Codec(ZSTD(1)), - blob_index UInt64 Codec(ZSTD(1)), - blob_size UInt32 Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a blob sidecar from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_parent_root 'The root hash of the parent beacon block', -COMMENT COLUMN kzg_commitment 'The KZG commitment in the blob sidecar payload', -COMMENT COLUMN kzg_proof 'The KZG proof in the blob sidecar payload', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN blob_index 'The index of blob sidecar in the blob sidecar payload', -COMMENT COLUMN blob_size 'The total bytes of the blob', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' AS canonical_beacon_blob_sidecar_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_blob_sidecar_local, rand()); diff --git a/deploy/migrations/clickhouse/019_blob_sidecar_versioned_hash.down.sql b/deploy/migrations/clickhouse/019_blob_sidecar_versioned_hash.down.sql deleted file mode 100644 index 65e06a127..000000000 --- a/deploy/migrations/clickhouse/019_blob_sidecar_versioned_hash.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE canonical_beacon_blob_sidecar_local on cluster '{cluster}' - DROP COLUMN versioned_hash; - -ALTER TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' - DROP COLUMN versioned_hash; diff --git a/deploy/migrations/clickhouse/019_blob_sidecar_versioned_hash.up.sql b/deploy/migrations/clickhouse/019_blob_sidecar_versioned_hash.up.sql deleted file mode 100644 index 8260370ad..000000000 --- a/deploy/migrations/clickhouse/019_blob_sidecar_versioned_hash.up.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE canonical_beacon_blob_sidecar_local on cluster '{cluster}' -ADD COLUMN versioned_hash FixedString(66) Codec(ZSTD(1)) AFTER block_parent_root; - -ALTER TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' -ADD COLUMN versioned_hash FixedString(66) Codec(ZSTD(1)) AFTER block_parent_root; - -ALTER TABLE canonical_beacon_blob_sidecar_local on cluster '{cluster}' -COMMENT COLUMN versioned_hash 'The versioned hash in the beacon API event stream payload'; - -ALTER TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' -COMMENT COLUMN versioned_hash 'The versioned hash in the beacon API event stream payload'; diff --git a/deploy/migrations/clickhouse/020_imports.down.sql b/deploy/migrations/clickhouse/020_imports.down.sql deleted file mode 100644 index 8b2e92f0c..000000000 --- a/deploy/migrations/clickhouse/020_imports.down.sql +++ /dev/null @@ -1,6 +0,0 @@ -DROP TABLE IF EXISTS imported_sources on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS imported_sources_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS mempool_dumpster_transaction on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS mempool_dumpster_transaction_local on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS block_native_mempool_transaction on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS block_native_mempool_transaction_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/020_imports.up.sql b/deploy/migrations/clickhouse/020_imports.up.sql deleted file mode 100644 index 7066d03e3..000000000 --- a/deploy/migrations/clickhouse/020_imports.up.sql +++ /dev/null @@ -1,137 +0,0 @@ -CREATE TABLE default.imported_sources_local on cluster '{cluster}' -( - create_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - target_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source LowCardinality(String) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(create_date_time) -ORDER BY (create_date_time, source); - -ALTER TABLE default.imported_sources_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'This table contains the list of sources that have been imported into the database', -COMMENT COLUMN create_date_time 'Creation date of this row', -COMMENT COLUMN target_date_time 'The date of the data that was imported', -COMMENT COLUMN source 'Source of the data that was imported'; - -CREATE TABLE imported_sources on cluster '{cluster}' AS imported_sources_local -ENGINE = Distributed('{cluster}', default, imported_sources_local, rand()); - -CREATE TABLE default.mempool_dumpster_transaction_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - timestamp DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - hash FixedString(66) Codec(ZSTD(1)), - chain_id UInt32 Codec(ZSTD(1)), - from FixedString(42) Codec(ZSTD(1)), - to Nullable(FixedString(42)) Codec(ZSTD(1)), - value UInt128 Codec(ZSTD(1)), - nonce UInt64 Codec(ZSTD(1)), - gas UInt64 Codec(ZSTD(1)), - gas_price UInt128 Codec(ZSTD(1)), - gas_tip_cap Nullable(UInt128) Codec(ZSTD(1)), - gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)), - data_size UInt32 Codec(ZSTD(1)), - data_4bytes Nullable(FixedString(10)) Codec(ZSTD(1)), - sources Array(LowCardinality(String)), - included_at_block_height Nullable(UInt64) Codec(ZSTD(1)), - included_block_timestamp Nullable(DateTime64(3)) Codec(DoubleDelta, ZSTD(1)), - inclusion_delay_ms Nullable(Int64) Codec(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(timestamp) -ORDER BY (timestamp, unique_key, chain_id); - -ALTER TABLE default.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions from mempool dumpster dataset. Following the parquet schema with some additions', -COMMENT COLUMN unique_key 'Unique key for the row, this is outside the source data and used for deduplication', -COMMENT COLUMN updated_date_time 'When this row was last updated, this is outside the source data and used for deduplication', -COMMENT COLUMN timestamp 'Timestamp of the transaction', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN chain_id 'The chain id of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas_tip_cap 'The gas tip cap of the transaction in wei', -COMMENT COLUMN gas_fee_cap 'The gas fee cap of the transaction in wei', -COMMENT COLUMN data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN data_4bytes 'The first 4 bytes of the call data of the transaction', -COMMENT COLUMN sources 'The sources that saw this transaction in their mempool', -COMMENT COLUMN included_at_block_height 'The block height at which this transaction was included', -COMMENT COLUMN included_block_timestamp 'The timestamp of the block at which this transaction was included', -COMMENT COLUMN inclusion_delay_ms 'The delay between the transaction timestamp and the block timestamp'; - -CREATE TABLE mempool_dumpster_transaction on cluster '{cluster}' AS mempool_dumpster_transaction_local -ENGINE = Distributed('{cluster}', default, mempool_dumpster_transaction_local, rand()); - -CREATE TABLE default.block_native_mempool_transaction_local on cluster '{cluster}' -( - unique_key Int64 CODEC(ZSTD(1)), - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - detecttime DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - hash FixedString(66) Codec(ZSTD(1)), - status LowCardinality(String), - region LowCardinality(String), - reorg Nullable(FixedString(66)) Codec(ZSTD(1)), - replace Nullable(FixedString(66)) Codec(ZSTD(1)), - curblocknumber Nullable(UInt64) Codec(ZSTD(1)), - failurereason Nullable(String) Codec(ZSTD(1)), - blockspending Nullable(UInt64) Codec(ZSTD(1)), - timepending Nullable(UInt64) Codec(ZSTD(1)), - nonce UInt64 Codec(ZSTD(1)), - gas UInt64 Codec(ZSTD(1)), - gasprice UInt128 Codec(ZSTD(1)), - value UInt128 Codec(ZSTD(1)), - toaddress Nullable(FixedString(42)) Codec(ZSTD(1)), - fromaddress FixedString(42) Codec(ZSTD(1)), - datasize UInt32 Codec(ZSTD(1)), - data4bytes Nullable(FixedString(10)) Codec(ZSTD(1)), - network LowCardinality(String), - type UInt8 Codec(ZSTD(1)), - maxpriorityfeepergas Nullable(UInt128) Codec(ZSTD(1)), - maxfeepergas Nullable(UInt128) Codec(ZSTD(1)), - basefeepergas Nullable(UInt128) Codec(ZSTD(1)), - dropreason Nullable(String) Codec(ZSTD(1)), - rejectionreason Nullable(String) Codec(ZSTD(1)), - stuck Bool Codec(ZSTD(1)), - gasused Nullable(UInt64) Codec(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(detecttime) -ORDER BY (detecttime, unique_key, network); - -ALTER TABLE default.block_native_mempool_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions from block native mempool dataset', -COMMENT COLUMN unique_key 'Unique key for the row, this is outside the source data and used for deduplication', -COMMENT COLUMN updated_date_time 'When this row was last updated, this is outside the source data and used for deduplication', -COMMENT COLUMN detecttime 'Timestamp that the transaction was detected in mempool', -COMMENT COLUMN hash 'Unique identifier hash for a given transaction', -COMMENT COLUMN status 'Status of the transaction', -COMMENT COLUMN region 'The geographic region for the node that detected the transaction', -COMMENT COLUMN reorg 'If there was a reorg, refers to the blockhash of the reorg', -COMMENT COLUMN replace 'If the transaction was replaced (speedup/cancel), the transaction hash of the replacement', -COMMENT COLUMN curblocknumber 'The block number the event was detected in', -COMMENT COLUMN failurereason 'If a transaction failed, this field provides contextual information', -COMMENT COLUMN blockspending 'If a transaction was finalized (confirmed, failed), this refers to the number of blocks that the transaction was waiting to get on-chain', -COMMENT COLUMN timepending 'If a transaction was finalized (confirmed, failed), this refers to the time in milliseconds that the transaction was waiting to get on-chain', -COMMENT COLUMN nonce 'A unique number which counts the number of transactions sent from a given address', -COMMENT COLUMN gas 'The maximum number of gas units allowed for the transaction', -COMMENT COLUMN gasprice 'The price offered to the miner/validator per unit of gas. Denominated in wei', -COMMENT COLUMN value 'The amount of ETH transferred or sent to contract. Denominated in wei', -COMMENT COLUMN toaddress 'The destination of a given transaction', -COMMENT COLUMN fromaddress 'The source/initiator of a given transaction', -COMMENT COLUMN datasize 'The size of the call data of the transaction in bytes', -COMMENT COLUMN data4bytes 'The first 4 bytes of the call data of the transaction', -COMMENT COLUMN network 'The specific Ethereum network used', -COMMENT COLUMN type 'Post EIP-1559, this indicates how the gas parameters are submitted to the network: - type 0 - legacy - type 1 - usage of access lists according to EIP-2930 - type 2 - using maxpriorityfeepergas and maxfeepergas', -COMMENT COLUMN maxpriorityfeepergas 'The maximum value for a tip offered to the miner/validator per unit of gas. The actual tip paid can be lower if (maxfee - basefee) < maxpriorityfee. Denominated in wei', -COMMENT COLUMN maxfeepergas 'The maximum value for the transaction fee (including basefee and tip) offered to the miner/validator per unit of gas. Denominated in wei', -COMMENT COLUMN basefeepergas 'The fee per unit of gas paid and burned for the curblocknumber. This fee is algorithmically determined. Denominated in wei', -COMMENT COLUMN dropreason 'If the transaction was dropped from the mempool, this describes the contextual reason for the drop', -COMMENT COLUMN rejectionreason 'If the transaction was rejected from the mempool, this describes the contextual reason for the rejection', -COMMENT COLUMN stuck 'A transaction was detected in the queued area of the mempool and is not eligible for inclusion in a block', -COMMENT COLUMN gasused 'If the transaction was published on-chain, this value indicates the amount of gas that was actually consumed. Denominated in wei'; - -CREATE TABLE block_native_mempool_transaction on cluster '{cluster}' AS block_native_mempool_transaction_local -ENGINE = Distributed('{cluster}', default, block_native_mempool_transaction_local, rand()); diff --git a/deploy/migrations/clickhouse/021_fix_beacon_block.down.sql b/deploy/migrations/clickhouse/021_fix_beacon_block.down.sql deleted file mode 100644 index 83802d3ec..000000000 --- a/deploy/migrations/clickhouse/021_fix_beacon_block.down.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' - DROP COLUMN meta_execution_fork_id_hash, - DROP COLUMN meta_execution_fork_id_next; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' - DROP COLUMN meta_execution_fork_id_hash, - DROP COLUMN meta_execution_fork_id_next; diff --git a/deploy/migrations/clickhouse/021_fix_beacon_block.up.sql b/deploy/migrations/clickhouse/021_fix_beacon_block.up.sql deleted file mode 100644 index 7850731c3..000000000 --- a/deploy/migrations/clickhouse/021_fix_beacon_block.up.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS meta_execution_fork_id_hash LowCardinality(String) AFTER meta_network_name, - ADD COLUMN IF NOT EXISTS meta_execution_fork_id_next LowCardinality(String) AFTER meta_execution_fork_id_hash; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS meta_execution_fork_id_hash LowCardinality(String) AFTER meta_network_name, - ADD COLUMN IF NOT EXISTS meta_execution_fork_id_next LowCardinality(String) AFTER meta_execution_fork_id_hash; diff --git a/deploy/migrations/clickhouse/022_beacon_p2p_attestation.down.sql b/deploy/migrations/clickhouse/022_beacon_p2p_attestation.down.sql deleted file mode 100644 index 1ced0e127..000000000 --- a/deploy/migrations/clickhouse/022_beacon_p2p_attestation.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_p2p_attestation on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_p2p_attestation_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/022_beacon_p2p_attestation.up.sql b/deploy/migrations/clickhouse/022_beacon_p2p_attestation.up.sql deleted file mode 100644 index a2e917008..000000000 --- a/deploy/migrations/clickhouse/022_beacon_p2p_attestation.up.sql +++ /dev/null @@ -1,131 +0,0 @@ -CREATE TABLE default.beacon_p2p_attestation_local on cluster '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - committee_index LowCardinality(String), - attesting_validator_index Nullable(UInt32) Codec(ZSTD(1)), - attesting_validator_committee_index LowCardinality(String), - signature String Codec(ZSTD(1)), - aggregation_bits String Codec(ZSTD(1)), - beacon_block_root FixedString(66) Codec(ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - source_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source_root FixedString(66) Codec(ZSTD(1)), - target_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - target_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - target_root FixedString(66) Codec(ZSTD(1)), - attestation_subnet LowCardinality(String), - validated Bool, - peer_id String CODEC(ZSTD(1)), - peer_latency UInt32 Codec(ZSTD(1)), - peer_version LowCardinality(String), - peer_version_major LowCardinality(String), - peer_version_minor LowCardinality(String), - peer_version_patch LowCardinality(String), - peer_implementation LowCardinality(String), - peer_ip Nullable(IPv6) CODEC(ZSTD(1)), - peer_geo_city LowCardinality(String) CODEC(ZSTD(1)), - peer_geo_country LowCardinality(String) CODEC(ZSTD(1)), - peer_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - peer_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - peer_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - peer_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - peer_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - peer_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.beacon_p2p_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon chain P2P "attestation" data', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon P2P payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN committee_index 'The committee index in the beacon P2P payload', -COMMENT COLUMN attesting_validator_index 'The index of the validator attesting to the event', -COMMENT COLUMN attesting_validator_committee_index 'The committee index of the attesting validator', -COMMENT COLUMN signature 'The signature of the event in the beacon P2P payload', -COMMENT COLUMN aggregation_bits 'The aggregation bits of the event in the beacon P2P payload', -COMMENT COLUMN beacon_block_root 'The beacon block root hash in the beacon P2P payload', -COMMENT COLUMN epoch 'The epoch number in the beacon P2P payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN source_epoch 'The source epoch number in the beacon P2P payload', -COMMENT COLUMN source_epoch_start_date_time 'The wall clock time when the source epoch started', -COMMENT COLUMN source_root 'The source beacon block root hash in the beacon P2P payload', -COMMENT COLUMN target_epoch 'The target epoch number in the beacon P2P payload', -COMMENT COLUMN target_epoch_start_date_time 'The wall clock time when the target epoch started', -COMMENT COLUMN target_root 'The target beacon block root hash in the beacon P2P payload', -COMMENT COLUMN attestation_subnet 'The attestation subnet the attestation was gossiped on', -COMMENT COLUMN validated 'Whether the attestation was validated by the client', -COMMENT COLUMN peer_id 'The originating peer ID for the gossiped data', -COMMENT COLUMN peer_latency 'The latency of the peer that gossiped the data', -COMMENT COLUMN peer_version 'Peer client version that gossiped the data', -COMMENT COLUMN peer_version_major 'Peer client major version that gossiped the data', -COMMENT COLUMN peer_version_minor 'Peer client minor version that gossiped the data', -COMMENT COLUMN peer_version_patch 'Peer client patch version that gossiped the data', -COMMENT COLUMN peer_implementation 'Peer client implementation that gossiped the data', -COMMENT COLUMN peer_ip 'IP address of the peer that gossiped the data', -COMMENT COLUMN peer_geo_city 'City of the peer that gossiped the data', -COMMENT COLUMN peer_geo_country 'Country of the peer that gossiped the data', -COMMENT COLUMN peer_geo_country_code 'Country code of the peer that gossiped the data', -COMMENT COLUMN peer_geo_continent_code 'Continent code of the peer that gossiped the data', -COMMENT COLUMN peer_geo_longitude 'Longitude of the peer that gossiped the data', -COMMENT COLUMN peer_geo_latitude 'Latitude of the peer that gossiped the data', -COMMENT COLUMN peer_geo_autonomous_system_number 'Autonomous system number of the peer that gossiped the data', -COMMENT COLUMN peer_geo_autonomous_system_organization 'Autonomous system organization of the peer that gossiped the data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_p2p_attestation on cluster '{cluster}' AS beacon_p2p_attestation_local -ENGINE = Distributed('{cluster}', default, beacon_p2p_attestation_local, rand()); diff --git a/deploy/migrations/clickhouse/023_cannon_proposer_duty.down.sql b/deploy/migrations/clickhouse/023_cannon_proposer_duty.down.sql deleted file mode 100644 index 1b68c6a68..000000000 --- a/deploy/migrations/clickhouse/023_cannon_proposer_duty.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_proposer_duty on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_proposer_duty_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/023_cannon_proposer_duty.up.sql b/deploy/migrations/clickhouse/023_cannon_proposer_duty.up.sql deleted file mode 100644 index 4e722eeef..000000000 --- a/deploy/migrations/clickhouse/023_cannon_proposer_duty.up.sql +++ /dev/null @@ -1,73 +0,0 @@ -CREATE TABLE default.canonical_beacon_proposer_duty_local on cluster '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - proposer_validator_index UInt32 CODEC(ZSTD(1)), - proposer_pubkey String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a proposer duty from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN proposer_validator_index 'The validator index from the proposer duty payload', -COMMENT COLUMN proposer_pubkey 'The BLS public key of the validator from the proposer duty payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_proposer_duty on cluster '{cluster}' AS canonical_beacon_proposer_duty_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_proposer_duty_local, rand()); diff --git a/deploy/migrations/clickhouse/024_cannon_elaborated_attestation.down.sql b/deploy/migrations/clickhouse/024_cannon_elaborated_attestation.down.sql deleted file mode 100644 index 859cc835a..000000000 --- a/deploy/migrations/clickhouse/024_cannon_elaborated_attestation.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_elaborated_attestation on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_elaborated_attestation_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/024_cannon_elaborated_attestation.up.sql b/deploy/migrations/clickhouse/024_cannon_elaborated_attestation.up.sql deleted file mode 100644 index ec5255494..000000000 --- a/deploy/migrations/clickhouse/024_cannon_elaborated_attestation.up.sql +++ /dev/null @@ -1,96 +0,0 @@ -CREATE TABLE default.canonical_beacon_elaborated_attestation_local on cluster '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - block_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - block_slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - block_epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - position_in_block UInt32 Codec(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - validators Array(UInt32) Codec(ZSTD(1)), - committee_index LowCardinality(String), - beacon_block_root FixedString(66) Codec(ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - source_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - source_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source_root FixedString(66) Codec(ZSTD(1)), - target_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - target_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - target_root FixedString(66) Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains elaborated attestations from beacon blocks.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the elaborated attestation from a beacon node', -COMMENT COLUMN block_slot 'The slot number of the block containing the attestation', -COMMENT COLUMN block_slot_start_date_time 'The wall clock time when the block slot started', -COMMENT COLUMN block_epoch 'The epoch number of the block containing the attestation', -COMMENT COLUMN block_epoch_start_date_time 'The wall clock time when the block epoch started', -COMMENT COLUMN position_in_block 'The position of the attestation in the block', -COMMENT COLUMN block_root 'The root of the block containing the attestation', -COMMENT COLUMN validators 'Array of validator indices participating in the attestation', -COMMENT COLUMN committee_index 'The index of the committee making the attestation', -COMMENT COLUMN beacon_block_root 'The root of the beacon block being attested to', -COMMENT COLUMN slot 'The slot number being attested to', -COMMENT COLUMN source_epoch 'The source epoch referenced in the attestation', -COMMENT COLUMN source_epoch_start_date_time 'The wall clock time when the source epoch started', -COMMENT COLUMN source_root 'The root of the source checkpoint in the attestation', -COMMENT COLUMN target_epoch 'The target epoch referenced in the attestation', -COMMENT COLUMN target_epoch_start_date_time 'The wall clock time when the target epoch started', -COMMENT COLUMN target_root 'The root of the target checkpoint in the attestation', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_elaborated_attestation on cluster '{cluster}' AS canonical_beacon_elaborated_attestation_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_elaborated_attestation_local, rand()); diff --git a/deploy/migrations/clickhouse/025_rm_beacon_attestation_signature.down.sql b/deploy/migrations/clickhouse/025_rm_beacon_attestation_signature.down.sql deleted file mode 100644 index 79e942cc7..000000000 --- a/deploy/migrations/clickhouse/025_rm_beacon_attestation_signature.down.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' -ADD COLUMN signature String Codec(ZSTD(1)) AFTER attesting_validator_committee_index; - -ALTER TABLE default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' -ADD COLUMN signature String Codec(ZSTD(1)) AFTER attesting_validator_committee_index; - -ALTER TABLE default.beacon_p2p_attestation_local ON CLUSTER '{cluster}' -ADD COLUMN signature String Codec(ZSTD(1)) AFTER attesting_validator_committee_index; - -ALTER TABLE default.beacon_p2p_attestation ON CLUSTER '{cluster}' -ADD COLUMN signature String Codec(ZSTD(1)) AFTER attesting_validator_committee_index; diff --git a/deploy/migrations/clickhouse/025_rm_beacon_attestation_signature.up.sql b/deploy/migrations/clickhouse/025_rm_beacon_attestation_signature.up.sql deleted file mode 100644 index 6415862e2..000000000 --- a/deploy/migrations/clickhouse/025_rm_beacon_attestation_signature.up.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' -DROP COLUMN signature; - -ALTER TABLE default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' -DROP COLUMN signature; - -ALTER TABLE default.beacon_p2p_attestation ON CLUSTER '{cluster}' -DROP COLUMN signature; - -ALTER TABLE default.beacon_p2p_attestation_local ON CLUSTER '{cluster}' -DROP COLUMN signature; diff --git a/deploy/migrations/clickhouse/026_dbt_model_metadata.down.sql b/deploy/migrations/clickhouse/026_dbt_model_metadata.down.sql deleted file mode 100644 index a72b57abe..000000000 --- a/deploy/migrations/clickhouse/026_dbt_model_metadata.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS model_metadata on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS model_metadata_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/026_dbt_model_metadata.up.sql b/deploy/migrations/clickhouse/026_dbt_model_metadata.up.sql deleted file mode 100644 index 2f5d64d42..000000000 --- a/deploy/migrations/clickhouse/026_dbt_model_metadata.up.sql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE dbt.model_metadata_local on cluster '{cluster}' -( - model LowCardinality(String), - updated_date_time DateTime Codec(ZSTD(1)), - last_run_date_time DateTime Codec(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY model -ORDER BY (model); - -ALTER TABLE dbt.model_metadata_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Stores metadata about the dbt model run', -COMMENT COLUMN model 'Source of the data that was imported', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN last_run_date_time 'The end date the model was last run with'; - -CREATE TABLE dbt.model_metadata on cluster '{cluster}' AS dbt.model_metadata_local -ENGINE = Distributed('{cluster}', dbt, model_metadata_local, cityHash64(model)); diff --git a/deploy/migrations/clickhouse/027_blob_txn.down.sql b/deploy/migrations/clickhouse/027_blob_txn.down.sql deleted file mode 100644 index 42d1a3d4a..000000000 --- a/deploy/migrations/clickhouse/027_blob_txn.down.sql +++ /dev/null @@ -1,169 +0,0 @@ -ALTER TABLE mempool_transaction_local on cluster '{cluster}' - DROP COLUMN gas_tip_cap, - DROP COLUMN gas_fee_cap, - DROP COLUMN blob_gas, - DROP COLUMN blob_gas_fee_cap, - DROP COLUMN blob_hashes, - DROP COLUMN blob_sidecars_size, - DROP COLUMN blob_sidecars_empty_size; - -ALTER TABLE mempool_transaction on cluster '{cluster}' - DROP COLUMN gas_tip_cap, - DROP COLUMN gas_fee_cap, - DROP COLUMN blob_gas, - DROP COLUMN blob_gas_fee_cap, - DROP COLUMN blob_hashes, - DROP COLUMN blob_sidecars_size, - DROP COLUMN blob_sidecars_empty_size; - -ALTER TABLE canonical_beacon_block_execution_transaction_local on cluster '{cluster}' - DROP COLUMN gas_tip_cap, - DROP COLUMN gas_fee_cap, - DROP COLUMN blob_gas, - DROP COLUMN blob_gas_fee_cap, - DROP COLUMN blob_hashes, - DROP COLUMN blob_sidecars_size, - DROP COLUMN blob_sidecars_empty_size; - -ALTER TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' - DROP COLUMN gas_tip_cap, - DROP COLUMN gas_fee_cap, - DROP COLUMN blob_gas, - DROP COLUMN blob_gas_fee_cap, - DROP COLUMN blob_hashes, - DROP COLUMN blob_sidecars_size, - DROP COLUMN blob_sidecars_empty_size; - -ALTER TABLE canonical_beacon_blob_sidecar_local on cluster '{cluster}' - DROP COLUMN blob_empty_size; - -ALTER TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' - DROP COLUMN blob_empty_size; - -ALTER TABLE block_native_mempool_transaction_local on cluster '{cluster}' -COMMENT COLUMN unique_key '', -COMMENT COLUMN updated_date_time '', -COMMENT COLUMN detecttime '', -COMMENT COLUMN hash '', -COMMENT COLUMN status '', -COMMENT COLUMN region '', -COMMENT COLUMN reorg '', -COMMENT COLUMN replace '', -COMMENT COLUMN curblocknumber '', -COMMENT COLUMN failurereason '', -COMMENT COLUMN blockspending '', -COMMENT COLUMN timepending '', -COMMENT COLUMN nonce '', -COMMENT COLUMN gas '', -COMMENT COLUMN gasprice '', -COMMENT COLUMN value '', -COMMENT COLUMN toaddress '', -COMMENT COLUMN fromaddress '', -COMMENT COLUMN datasize '', -COMMENT COLUMN data4bytes '', -COMMENT COLUMN network '', -COMMENT COLUMN type '', -COMMENT COLUMN maxpriorityfeepergas '', -COMMENT COLUMN maxfeepergas '', -COMMENT COLUMN basefeepergas '', -COMMENT COLUMN dropreason '', -COMMENT COLUMN rejectionreason '', -COMMENT COLUMN stuck '', -COMMENT COLUMN gasused ''; - -ALTER TABLE block_native_mempool_transaction on cluster '{cluster}' -COMMENT COLUMN unique_key '', -COMMENT COLUMN updated_date_time '', -COMMENT COLUMN detecttime '', -COMMENT COLUMN hash '', -COMMENT COLUMN status '', -COMMENT COLUMN region '', -COMMENT COLUMN reorg '', -COMMENT COLUMN replace '', -COMMENT COLUMN curblocknumber '', -COMMENT COLUMN failurereason '', -COMMENT COLUMN blockspending '', -COMMENT COLUMN timepending '', -COMMENT COLUMN nonce '', -COMMENT COLUMN gas '', -COMMENT COLUMN gasprice '', -COMMENT COLUMN value '', -COMMENT COLUMN toaddress '', -COMMENT COLUMN fromaddress '', -COMMENT COLUMN datasize '', -COMMENT COLUMN data4bytes '', -COMMENT COLUMN network '', -COMMENT COLUMN type '', -COMMENT COLUMN maxpriorityfeepergas '', -COMMENT COLUMN maxfeepergas '', -COMMENT COLUMN basefeepergas '', -COMMENT COLUMN dropreason '', -COMMENT COLUMN rejectionreason '', -COMMENT COLUMN stuck '', -COMMENT COLUMN gasused ''; - -ALTER TABLE canonical_beacon_proposer_duty_local on cluster '{cluster}' -COMMENT COLUMN unique_key '', -COMMENT COLUMN updated_date_time '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN proposer_validator_index '', -COMMENT COLUMN proposer_pubkey '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE canonical_beacon_proposer_duty on cluster '{cluster}' -COMMENT COLUMN unique_key '', -COMMENT COLUMN updated_date_time '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN proposer_validator_index '', -COMMENT COLUMN proposer_pubkey '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; diff --git a/deploy/migrations/clickhouse/027_blob_txn.up.sql b/deploy/migrations/clickhouse/027_blob_txn.up.sql deleted file mode 100644 index 06183d01c..000000000 --- a/deploy/migrations/clickhouse/027_blob_txn.up.sql +++ /dev/null @@ -1,199 +0,0 @@ -ALTER TABLE mempool_transaction_local on cluster '{cluster}' -ADD COLUMN gas_tip_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER gas, -ADD COLUMN gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER gas_tip_cap, -ADD COLUMN blob_gas Nullable(UInt64) Codec(ZSTD(1)) AFTER call_data_size, -ADD COLUMN blob_gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER blob_gas, -ADD COLUMN blob_hashes Array(String) Codec(ZSTD(1)) AFTER blob_gas_fee_cap, -ADD COLUMN blob_sidecars_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_hashes, -ADD COLUMN blob_sidecars_empty_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_sidecars_size, -COMMENT COLUMN gas_tip_cap 'The priority fee (tip) the user has set for the transaction', -COMMENT COLUMN gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_gas 'The maximum gas provided for the blob transaction execution', -COMMENT COLUMN blob_gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_hashes 'The hashes of the blob commitments for blob transactions', -COMMENT COLUMN blob_sidecars_size 'The total size of the sidecars for blob transactions in bytes', -COMMENT COLUMN blob_sidecars_empty_size 'The total empty size of the sidecars for blob transactions in bytes'; - -ALTER TABLE mempool_transaction on cluster '{cluster}' -ADD COLUMN gas_tip_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER gas, -ADD COLUMN gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER gas_tip_cap, -ADD COLUMN blob_gas Nullable(UInt64) Codec(ZSTD(1)) AFTER call_data_size, -ADD COLUMN blob_gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER blob_gas, -ADD COLUMN blob_hashes Array(String) Codec(ZSTD(1)) AFTER blob_gas_fee_cap, -ADD COLUMN blob_sidecars_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_hashes, -ADD COLUMN blob_sidecars_empty_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_sidecars_size, -COMMENT COLUMN gas_tip_cap 'The priority fee (tip) the user has set for the transaction', -COMMENT COLUMN gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_gas 'The maximum gas provided for the blob transaction execution', -COMMENT COLUMN blob_gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_hashes 'The hashes of the blob commitments for blob transactions', -COMMENT COLUMN blob_sidecars_size 'The total size of the sidecars for blob transactions in bytes', -COMMENT COLUMN blob_sidecars_empty_size 'The total empty size of the sidecars for blob transactions in bytes'; - -ALTER TABLE canonical_beacon_block_execution_transaction_local on cluster '{cluster}' -ADD COLUMN gas_tip_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER gas, -ADD COLUMN gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER gas_tip_cap, -ADD COLUMN blob_gas Nullable(UInt64) Codec(ZSTD(1)) AFTER call_data_size, -ADD COLUMN blob_gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER blob_gas, -ADD COLUMN blob_hashes Array(String) Codec(ZSTD(1)) AFTER blob_gas_fee_cap, -ADD COLUMN blob_sidecars_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_hashes, -ADD COLUMN blob_sidecars_empty_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_sidecars_size, -COMMENT COLUMN gas_tip_cap 'The priority fee (tip) the user has set for the transaction', -COMMENT COLUMN gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_gas 'The maximum gas provided for the blob transaction execution', -COMMENT COLUMN blob_gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_hashes 'The hashes of the blob commitments for blob transactions', -COMMENT COLUMN blob_sidecars_size 'The total size of the sidecars for blob transactions in bytes', -COMMENT COLUMN blob_sidecars_empty_size 'The total empty size of the sidecars for blob transactions in bytes'; - -ALTER TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' -ADD COLUMN gas_tip_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER gas, -ADD COLUMN gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER gas_tip_cap, -ADD COLUMN blob_gas Nullable(UInt64) Codec(ZSTD(1)) AFTER call_data_size, -ADD COLUMN blob_gas_fee_cap Nullable(UInt128) Codec(ZSTD(1)) AFTER blob_gas, -ADD COLUMN blob_hashes Array(String) Codec(ZSTD(1)) AFTER blob_gas_fee_cap, -ADD COLUMN blob_sidecars_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_hashes, -ADD COLUMN blob_sidecars_empty_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_sidecars_size, -COMMENT COLUMN gas_tip_cap 'The priority fee (tip) the user has set for the transaction', -COMMENT COLUMN gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_gas 'The maximum gas provided for the blob transaction execution', -COMMENT COLUMN blob_gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_hashes 'The hashes of the blob commitments for blob transactions', -COMMENT COLUMN blob_sidecars_size 'The total size of the sidecars for blob transactions in bytes', -COMMENT COLUMN blob_sidecars_empty_size 'The total empty size of the sidecars for blob transactions in bytes'; - -ALTER TABLE canonical_beacon_blob_sidecar_local on cluster '{cluster}' -ADD COLUMN blob_empty_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_size, -COMMENT COLUMN blob_empty_size 'The total empty size of the blob in bytes'; - -ALTER TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' -ADD COLUMN blob_empty_size Nullable(UInt32) Codec(ZSTD(1)) AFTER blob_size, -COMMENT COLUMN blob_empty_size 'The total empty size of the blob in bytes'; - -ALTER TABLE block_native_mempool_transaction_local on cluster '{cluster}' -COMMENT COLUMN unique_key 'Unique key for the row', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN detecttime 'Timestamp that the transaction was detected in mempool', -COMMENT COLUMN hash 'Unique identifier hash for a given transaction', -COMMENT COLUMN status 'Status of the transaction', -COMMENT COLUMN region 'The geographic region for the node that detected the transaction', -COMMENT COLUMN reorg 'If there was a reorg, refers to the blockhash of the reorg', -COMMENT COLUMN replace 'If the transaction was replaced (speedup/cancel), the transaction hash of the replacement', -COMMENT COLUMN curblocknumber 'The block number the event was detected in', -COMMENT COLUMN failurereason 'If a transaction failed, this field provides contextual information', -COMMENT COLUMN blockspending 'If a transaction was finalized (confirmed, failed), this refers to the number of blocks that the transaction was waiting to get on-chain', -COMMENT COLUMN timepending 'If a transaction was finalized (confirmed, failed), this refers to the time in milliseconds that the transaction was waiting to get on-chain', -COMMENT COLUMN nonce 'A unique number which counts the number of transactions sent from a given address', -COMMENT COLUMN gas 'The maximum number of gas units allowed for the transaction', -COMMENT COLUMN gasprice 'The price offered to the miner/validator per unit of gas. Denominated in wei', -COMMENT COLUMN value 'The amount of ETH transferred or sent to contract. Denominated in wei', -COMMENT COLUMN toaddress 'The destination of a given transaction', -COMMENT COLUMN fromaddress 'The source/initiator of a given transaction', -COMMENT COLUMN datasize 'The size of the call data of the transaction in bytes', -COMMENT COLUMN data4bytes 'The first 4 bytes of the call data of the transaction', -COMMENT COLUMN network 'The specific Ethereum network used', -COMMENT COLUMN type '"Post EIP-1559, this indicates how the gas parameters are submitted to the network: - type 0 - legacy - type 1 - usage of access lists according to EIP-2930 - type 2 - using maxpriorityfeepergas and maxfeepergas"', -COMMENT COLUMN maxpriorityfeepergas 'The maximum value for a tip offered to the miner/validator per unit of gas. The actual tip paid can be lower if (maxfee - basefee) < maxpriorityfee. Denominated in wei', -COMMENT COLUMN maxfeepergas 'The maximum value for the transaction fee (including basefee and tip) offered to the miner/validator per unit of gas. Denominated in wei', -COMMENT COLUMN basefeepergas 'The fee per unit of gas paid and burned for the curblocknumber. This fee is algorithmically determined. Denominated in wei', -COMMENT COLUMN dropreason 'If the transaction was dropped from the mempool, this describes the contextual reason for the drop', -COMMENT COLUMN rejectionreason 'If the transaction was rejected from the mempool, this describes the contextual reason for the rejection', -COMMENT COLUMN stuck 'A transaction was detected in the queued area of the mempool and is not eligible for inclusion in a block', -COMMENT COLUMN gasused 'If the transaction was published on-chain, this value indicates the amount of gas that was actually consumed. Denominated in wei'; - -ALTER TABLE block_native_mempool_transaction on cluster '{cluster}' -COMMENT COLUMN unique_key 'Unique key for the row', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN detecttime 'Timestamp that the transaction was detected in mempool', -COMMENT COLUMN hash 'Unique identifier hash for a given transaction', -COMMENT COLUMN status 'Status of the transaction', -COMMENT COLUMN region 'The geographic region for the node that detected the transaction', -COMMENT COLUMN reorg 'If there was a reorg, refers to the blockhash of the reorg', -COMMENT COLUMN replace 'If the transaction was replaced (speedup/cancel), the transaction hash of the replacement', -COMMENT COLUMN curblocknumber 'The block number the event was detected in', -COMMENT COLUMN failurereason 'If a transaction failed, this field provides contextual information', -COMMENT COLUMN blockspending 'If a transaction was finalized (confirmed, failed), this refers to the number of blocks that the transaction was waiting to get on-chain', -COMMENT COLUMN timepending 'If a transaction was finalized (confirmed, failed), this refers to the time in milliseconds that the transaction was waiting to get on-chain', -COMMENT COLUMN nonce 'A unique number which counts the number of transactions sent from a given address', -COMMENT COLUMN gas 'The maximum number of gas units allowed for the transaction', -COMMENT COLUMN gasprice 'The price offered to the miner/validator per unit of gas. Denominated in wei', -COMMENT COLUMN value 'The amount of ETH transferred or sent to contract. Denominated in wei', -COMMENT COLUMN toaddress 'The destination of a given transaction', -COMMENT COLUMN fromaddress 'The source/initiator of a given transaction', -COMMENT COLUMN datasize 'The size of the call data of the transaction in bytes', -COMMENT COLUMN data4bytes 'The first 4 bytes of the call data of the transaction', -COMMENT COLUMN network 'The specific Ethereum network used', -COMMENT COLUMN type '"Post EIP-1559, this indicates how the gas parameters are submitted to the network: - type 0 - legacy - type 1 - usage of access lists according to EIP-2930 - type 2 - using maxpriorityfeepergas and maxfeepergas"', -COMMENT COLUMN maxpriorityfeepergas 'The maximum value for a tip offered to the miner/validator per unit of gas. The actual tip paid can be lower if (maxfee - basefee) < maxpriorityfee. Denominated in wei', -COMMENT COLUMN maxfeepergas 'The maximum value for the transaction fee (including basefee and tip) offered to the miner/validator per unit of gas. Denominated in wei', -COMMENT COLUMN basefeepergas 'The fee per unit of gas paid and burned for the curblocknumber. This fee is algorithmically determined. Denominated in wei', -COMMENT COLUMN dropreason 'If the transaction was dropped from the mempool, this describes the contextual reason for the drop', -COMMENT COLUMN rejectionreason 'If the transaction was rejected from the mempool, this describes the contextual reason for the rejection', -COMMENT COLUMN stuck 'A transaction was detected in the queued area of the mempool and is not eligible for inclusion in a block', -COMMENT COLUMN gasused 'If the transaction was published on-chain, this value indicates the amount of gas that was actually consumed. Denominated in wei'; - -ALTER TABLE canonical_beacon_proposer_duty_local on cluster '{cluster}' -COMMENT COLUMN unique_key 'Unique key for the row', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the proposer duty information from a beacon node', -COMMENT COLUMN slot 'The slot number for which the proposer duty is assigned', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number containing the slot', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN proposer_validator_index 'The validator index of the proposer for the slot', -COMMENT COLUMN proposer_pubkey 'The public key of the validator proposer', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the even'; - -ALTER TABLE canonical_beacon_proposer_duty on cluster '{cluster}' -COMMENT COLUMN unique_key 'Unique key for the row', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the proposer duty information from a beacon node', -COMMENT COLUMN slot 'The slot number for which the proposer duty is assigned', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number containing the slot', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN proposer_validator_index 'The validator index of the proposer for the slot', -COMMENT COLUMN proposer_pubkey 'The public key of the validator proposer', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the even'; diff --git a/deploy/migrations/clickhouse/028_comments.down.sql b/deploy/migrations/clickhouse/028_comments.down.sql deleted file mode 100644 index b89fa09cf..000000000 --- a/deploy/migrations/clickhouse/028_comments.down.sql +++ /dev/null @@ -1,75 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN committee_index '', -COMMENT COLUMN validators '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' -MODIFY COMMENT '', -COMMENT COLUMN event_date_time '', -COMMENT COLUMN slot '', -COMMENT COLUMN slot_start_date_time '', -COMMENT COLUMN committee_index '', -COMMENT COLUMN validators '', -COMMENT COLUMN epoch '', -COMMENT COLUMN epoch_start_date_time '', -COMMENT COLUMN meta_client_name '', -COMMENT COLUMN meta_client_id '', -COMMENT COLUMN meta_client_version '', -COMMENT COLUMN meta_client_implementation '', -COMMENT COLUMN meta_client_os '', -COMMENT COLUMN meta_client_ip '', -COMMENT COLUMN meta_client_geo_city '', -COMMENT COLUMN meta_client_geo_country '', -COMMENT COLUMN meta_client_geo_country_code '', -COMMENT COLUMN meta_client_geo_continent_code '', -COMMENT COLUMN meta_client_geo_longitude '', -COMMENT COLUMN meta_client_geo_latitude '', -COMMENT COLUMN meta_client_geo_autonomous_system_number '', -COMMENT COLUMN meta_client_geo_autonomous_system_organization '', -COMMENT COLUMN meta_network_id '', -COMMENT COLUMN meta_network_name '', -COMMENT COLUMN meta_consensus_version '', -COMMENT COLUMN meta_consensus_version_major '', -COMMENT COLUMN meta_consensus_version_minor '', -COMMENT COLUMN meta_consensus_version_patch '', -COMMENT COLUMN meta_consensus_implementation '', -COMMENT COLUMN meta_labels ''; - -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT ''; - -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT ''; - -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' -MODIFY COMMENT ''; - -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' -MODIFY COMMENT ''; diff --git a/deploy/migrations/clickhouse/028_comments.up.sql b/deploy/migrations/clickhouse/028_comments.up.sql deleted file mode 100644 index a2565af07..000000000 --- a/deploy/migrations/clickhouse/028_comments.up.sql +++ /dev/null @@ -1,75 +0,0 @@ -ALTER TABLE default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API committee payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN committee_index 'The committee index in the beacon API committee payload', -COMMENT COLUMN validators 'The validator indices in the beacon API committee payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API committee payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API committee payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN committee_index 'The committee index in the beacon API committee payload', -COMMENT COLUMN validators 'The validator indices in the beacon API committee payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API committee payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.'; - -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.'; - -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/validator/attestation_data data from each sentry client attached to a beacon node.'; - -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/validator/attestation_data data from each sentry client attached to a beacon node.'; diff --git a/deploy/migrations/clickhouse/030_fix_replacing_tables_sharding_keys.down.sql b/deploy/migrations/clickhouse/030_fix_replacing_tables_sharding_keys.down.sql deleted file mode 100644 index a4c3d9a98..000000000 --- a/deploy/migrations/clickhouse/030_fix_replacing_tables_sharding_keys.down.sql +++ /dev/null @@ -1,59 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_block on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block on cluster '{cluster}' AS canonical_beacon_block_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_proposer_slashing on cluster '{cluster}' AS canonical_beacon_block_proposer_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_proposer_slashing_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_attester_slashing on cluster '{cluster}' AS canonical_beacon_block_attester_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_attester_slashing_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' AS canonical_beacon_block_bls_to_execution_change_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_bls_to_execution_change_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' AS canonical_beacon_block_execution_transaction_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_execution_transaction_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_voluntary_exit on cluster '{cluster}' AS canonical_beacon_block_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_voluntary_exit_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_block_deposit on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_deposit on cluster '{cluster}' AS canonical_beacon_block_deposit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_deposit_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_block_withdrawal on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_withdrawal on cluster '{cluster}' AS canonical_beacon_block_withdrawal_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_withdrawal_local, rand()); - -DROP TABLE IF EXISTS beacon_block_classification on cluster '{cluster}' SYNC; -CREATE TABLE beacon_block_classification on cluster '{cluster}' AS beacon_block_classification_local -ENGINE = Distributed('{cluster}', default, beacon_block_classification_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_blob_sidecar on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' AS canonical_beacon_blob_sidecar_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_blob_sidecar_local, rand()); - -DROP TABLE IF EXISTS mempool_dumpster_transaction on cluster '{cluster}' SYNC; -CREATE TABLE mempool_dumpster_transaction on cluster '{cluster}' AS mempool_dumpster_transaction_local -ENGINE = Distributed('{cluster}', default, mempool_dumpster_transaction_local, rand()); - -DROP TABLE IF EXISTS block_native_mempool_transaction on cluster '{cluster}' SYNC; -CREATE TABLE block_native_mempool_transaction on cluster '{cluster}' AS block_native_mempool_transaction_local -ENGINE = Distributed('{cluster}', default, block_native_mempool_transaction_local, rand()); - -DROP TABLE IF EXISTS beacon_p2p_attestation on cluster '{cluster}' SYNC; -CREATE TABLE beacon_p2p_attestation on cluster '{cluster}' AS beacon_p2p_attestation_local -ENGINE = Distributed('{cluster}', default, beacon_p2p_attestation_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_proposer_duty on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_proposer_duty on cluster '{cluster}' AS canonical_beacon_proposer_duty_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_proposer_duty_local, rand()); - -DROP TABLE IF EXISTS canonical_beacon_elaborated_attestation on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_elaborated_attestation on cluster '{cluster}' AS canonical_beacon_elaborated_attestation_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_elaborated_attestation_local, rand()); diff --git a/deploy/migrations/clickhouse/030_fix_replacing_tables_sharding_keys.up.sql b/deploy/migrations/clickhouse/030_fix_replacing_tables_sharding_keys.up.sql deleted file mode 100644 index 5760bf064..000000000 --- a/deploy/migrations/clickhouse/030_fix_replacing_tables_sharding_keys.up.sql +++ /dev/null @@ -1,59 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_block on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block on cluster '{cluster}' AS canonical_beacon_block_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_local, cityHash64(slot_start_date_time, meta_network_name)); - -DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_proposer_slashing on cluster '{cluster}' AS canonical_beacon_block_proposer_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_proposer_slashing_local, unique_key); - -DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_attester_slashing on cluster '{cluster}' AS canonical_beacon_block_attester_slashing_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_attester_slashing_local, unique_key); - -DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' AS canonical_beacon_block_bls_to_execution_change_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_bls_to_execution_change_local, unique_key); - -DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' AS canonical_beacon_block_execution_transaction_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_execution_transaction_local, unique_key); - -DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_voluntary_exit on cluster '{cluster}' AS canonical_beacon_block_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_voluntary_exit_local, unique_key); - -DROP TABLE IF EXISTS canonical_beacon_block_deposit on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_deposit on cluster '{cluster}' AS canonical_beacon_block_deposit_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_deposit_local, unique_key); - -DROP TABLE IF EXISTS canonical_beacon_block_withdrawal on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_block_withdrawal on cluster '{cluster}' AS canonical_beacon_block_withdrawal_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_block_withdrawal_local, unique_key); - -DROP TABLE IF EXISTS beacon_block_classification on cluster '{cluster}' SYNC; -CREATE TABLE beacon_block_classification on cluster '{cluster}' AS beacon_block_classification_local -ENGINE = Distributed('{cluster}', default, beacon_block_classification_local, cityHash64(slot_start_date_time, meta_network_name)); - -DROP TABLE IF EXISTS canonical_beacon_blob_sidecar on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' AS canonical_beacon_blob_sidecar_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_blob_sidecar_local, unique_key); - -DROP TABLE IF EXISTS mempool_dumpster_transaction on cluster '{cluster}' SYNC; -CREATE TABLE mempool_dumpster_transaction on cluster '{cluster}' AS mempool_dumpster_transaction_local -ENGINE = Distributed('{cluster}', default, mempool_dumpster_transaction_local, unique_key); - -DROP TABLE IF EXISTS block_native_mempool_transaction on cluster '{cluster}' SYNC; -CREATE TABLE block_native_mempool_transaction on cluster '{cluster}' AS block_native_mempool_transaction_local -ENGINE = Distributed('{cluster}', default, block_native_mempool_transaction_local, unique_key); - -DROP TABLE IF EXISTS beacon_p2p_attestation on cluster '{cluster}' SYNC; -CREATE TABLE beacon_p2p_attestation on cluster '{cluster}' AS beacon_p2p_attestation_local -ENGINE = Distributed('{cluster}', default, beacon_p2p_attestation_local, unique_key); - -DROP TABLE IF EXISTS canonical_beacon_proposer_duty on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_proposer_duty on cluster '{cluster}' AS canonical_beacon_proposer_duty_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_proposer_duty_local, unique_key); - -DROP TABLE IF EXISTS canonical_beacon_elaborated_attestation on cluster '{cluster}' SYNC; -CREATE TABLE canonical_beacon_elaborated_attestation on cluster '{cluster}' AS canonical_beacon_elaborated_attestation_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_elaborated_attestation_local, unique_key); diff --git a/deploy/migrations/clickhouse/031_v1_proposer_duties.down.sql b/deploy/migrations/clickhouse/031_v1_proposer_duties.down.sql deleted file mode 100644 index ff1e611ea..000000000 --- a/deploy/migrations/clickhouse/031_v1_proposer_duties.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/031_v1_proposer_duties.up.sql b/deploy/migrations/clickhouse/031_v1_proposer_duties.up.sql deleted file mode 100644 index 292116745..000000000 --- a/deploy/migrations/clickhouse/031_v1_proposer_duties.up.sql +++ /dev/null @@ -1,73 +0,0 @@ -CREATE TABLE default.beacon_api_eth_v1_proposer_duty_local on cluster '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - proposer_validator_index UInt32 CODEC(ZSTD(1)), - proposer_pubkey String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name); - -ALTER TABLE default.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a proposer duty from a beacon block.', -COMMENT COLUMN unique_key 'Unique key for the row generated from seahash', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN proposer_validator_index 'The validator index from the proposer duty payload', -COMMENT COLUMN proposer_pubkey 'The BLS public key of the validator from the proposer duty payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v1_proposer_duty on cluster '{cluster}' AS beacon_api_eth_v1_proposer_duty_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_proposer_duty_local, rand()); diff --git a/deploy/migrations/clickhouse/032_libp2p_trace.down.sql b/deploy/migrations/clickhouse/032_libp2p_trace.down.sql deleted file mode 100644 index 48f76d081..000000000 --- a/deploy/migrations/clickhouse/032_libp2p_trace.down.sql +++ /dev/null @@ -1,47 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_recv_rpc ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_recv_rpc_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_send_rpc ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_send_rpc_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_drop_rpc ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_drop_rpc_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_rpc_meta_message ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_rpc_meta_message_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_rpc_meta_subscription ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_ihave ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_iwant ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_graft ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_prune ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_recv_rpc ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_recv_rpc_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_join ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_join_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_add_peer ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_add_peer_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_remove_peer ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_remove_peer_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_connected ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_connected_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_disconnected ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_disconnected_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS default.libp2p_peer ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_peer_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/032_libp2p_trace.up.sql b/deploy/migrations/clickhouse/032_libp2p_trace.up.sql deleted file mode 100644 index ba0b13bfd..000000000 --- a/deploy/migrations/clickhouse/032_libp2p_trace.up.sql +++ /dev/null @@ -1,904 +0,0 @@ --- Creating local and distributed tables for libp2p_peer -CREATE TABLE libp2p_peer_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - peer_id String CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -ORDER BY (unique_key); - -ALTER TABLE libp2p_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the original peer id of a seahashed peer_id + meta_network_name, commonly seen in other tables as the field peer_id_unique_key', -COMMENT COLUMN unique_key 'Unique identifier for each record, seahash of peer_id + meta_network_name', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN peer_id 'Peer ID', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_peer ON CLUSTER '{cluster}' AS libp2p_peer_local -ENGINE = Distributed('{cluster}', default, libp2p_peer_local, unique_key); - --- Creating local and distributed tables for libp2p_add_peer -CREATE TABLE libp2p_add_peer_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - peer_id_unique_key Int64, - protocol LowCardinality(String), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_add_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the peers added to the libp2p client.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer', -COMMENT COLUMN protocol 'Protocol used by the peer', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_add_peer ON CLUSTER '{cluster}' AS libp2p_add_peer_local -ENGINE = Distributed('{cluster}', default, libp2p_add_peer_local, unique_key); - --- Creating local and distributed tables for libp2p_remove_peer -CREATE TABLE libp2p_remove_peer_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_remove_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the peers removed from the libp2p client.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_remove_peer ON CLUSTER '{cluster}' AS libp2p_remove_peer_local -ENGINE = Distributed('{cluster}', default, libp2p_remove_peer_local, unique_key); - --- Creating tables for RPC meta data with ReplicatedReplacingMergeTree and Distributed engines -CREATE TABLE libp2p_rpc_meta_message_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - control_index Int32 CODEC(DoubleDelta, ZSTD(1)), - rpc_meta_unique_key Int64, - message_id String CODEC(ZSTD(1)), - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, control_index, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_rpc_meta_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC meta messages from the peer', -COMMENT COLUMN unique_key 'Unique identifier for each RPC message record', -COMMENT COLUMN event_date_time 'Timestamp of the RPC event', -COMMENT COLUMN updated_date_time 'Timestamp when the RPC message record was last updated', -COMMENT COLUMN control_index 'Position in the RPC meta message array', -COMMENT COLUMN rpc_meta_unique_key 'Unique key associated with the RPC metadata', -COMMENT COLUMN message_id 'Identifier of the message', -COMMENT COLUMN topic_layer 'Layer of the topic', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding of the topic', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer involved in the RPC', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_rpc_meta_message ON CLUSTER '{cluster}' AS libp2p_rpc_meta_message_local -ENGINE = Distributed('{cluster}', default, libp2p_rpc_meta_message_local, unique_key); - -CREATE TABLE libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - control_index Int32 CODEC(DoubleDelta, ZSTD(1)), - rpc_meta_unique_key Int64, - subscribe Bool, - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, control_index, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC subscriptions from the peer.', -COMMENT COLUMN unique_key 'Unique identifier for each RPC subscription record', -COMMENT COLUMN updated_date_time 'Timestamp when the RPC subscription record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the RPC subscription event', -COMMENT COLUMN control_index 'Position in the RPC meta subscription array', -COMMENT COLUMN rpc_meta_unique_key 'Unique key associated with the RPC subscription metadata', -COMMENT COLUMN subscribe 'Boolean indicating if it is a subscription or unsubscription', -COMMENT COLUMN topic_layer 'Layer of the topic', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding of the topic', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer involved in the subscription', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_rpc_meta_subscription ON CLUSTER '{cluster}' AS libp2p_rpc_meta_subscription_local -ENGINE = Distributed('{cluster}', default, libp2p_rpc_meta_subscription_local, unique_key); - -CREATE TABLE libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - rpc_meta_unique_key Int64, - message_index Int32 CODEC(DoubleDelta, ZSTD(1)), - control_index Int32 CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - message_id String CODEC(ZSTD(1)), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, control_index, message_index, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "I have" control messages from the peer.', -COMMENT COLUMN unique_key 'Unique identifier for each "I have" control record', -COMMENT COLUMN updated_date_time 'Timestamp when the "I have" control record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the "I have" control event', -COMMENT COLUMN control_index 'Position in the RPC meta control IWANT array', -COMMENT COLUMN message_index 'Position in the RPC meta control IWANT message_ids array', -COMMENT COLUMN rpc_meta_unique_key 'Unique key associated with the "I have" control metadata', -COMMENT COLUMN topic_layer 'Layer of the topic', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding of the topic', -COMMENT COLUMN message_id 'Identifier of the message associated with the "I have" control', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer involved in the I have control', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_rpc_meta_control_ihave ON CLUSTER '{cluster}' AS libp2p_rpc_meta_control_ihave_local -ENGINE = Distributed('{cluster}', default, libp2p_rpc_meta_control_ihave_local, unique_key); - -CREATE TABLE libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - control_index Int32 CODEC(DoubleDelta, ZSTD(1)), - message_index Int32 CODEC(DoubleDelta, ZSTD(1)), - rpc_meta_unique_key Int64, - message_id String CODEC(ZSTD(1)), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, control_index, message_index, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "I want" control messages from the peer.', -COMMENT COLUMN unique_key 'Unique identifier for each "I want" control record', -COMMENT COLUMN updated_date_time 'Timestamp when the "I want" control record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the "I want" control event', -COMMENT COLUMN message_index 'Position in the RPC meta control IWANT message_ids array', -COMMENT COLUMN control_index 'Position in the RPC meta control IWANT array', -COMMENT COLUMN rpc_meta_unique_key 'Unique key associated with the "I want" control metadata', -COMMENT COLUMN message_id 'Identifier of the message associated with the "I want" control', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer involved in the I want control', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_rpc_meta_control_iwant ON CLUSTER '{cluster}' AS libp2p_rpc_meta_control_iwant_local -ENGINE = Distributed('{cluster}', default, libp2p_rpc_meta_control_iwant_local, unique_key); - -CREATE TABLE libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - control_index Int32 CODEC(DoubleDelta, ZSTD(1)), - rpc_meta_unique_key Int64, - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, control_index, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "Graft" control messages from the peer.', -COMMENT COLUMN unique_key 'Unique identifier for each "Graft" control record', -COMMENT COLUMN updated_date_time 'Timestamp when the "Graft" control record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the "Graft" control event', -COMMENT COLUMN control_index 'Position in the RPC meta control GRAFT array', -COMMENT COLUMN rpc_meta_unique_key 'Unique key associated with the "Graft" control metadata', -COMMENT COLUMN topic_layer 'Layer of the topic', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding of the topic', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer involved in the Graft control', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_rpc_meta_control_graft ON CLUSTER '{cluster}' AS libp2p_rpc_meta_control_graft_local -ENGINE = Distributed('{cluster}', default, libp2p_rpc_meta_control_graft_local, unique_key); - -CREATE TABLE libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - control_index Int32 CODEC(DoubleDelta, ZSTD(1)), - rpc_meta_unique_key Int64, - peer_id_index Int32 CODEC(DoubleDelta, ZSTD(1)), - peer_id_unique_key Int64, - graft_peer_id_unique_key Int64, - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, control_index, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "Prune" control messages from the peer.', -COMMENT COLUMN unique_key 'Unique identifier for each "Prune" control record', -COMMENT COLUMN updated_date_time 'Timestamp when the "Prune" control record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the "Prune" control event', -COMMENT COLUMN control_index 'Position in the RPC meta control PRUNE array', -COMMENT COLUMN rpc_meta_unique_key 'Unique key associated with the "Prune" control metadata', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer involved in the Prune control', -COMMENT COLUMN graft_peer_id_unique_key 'Unique key associated with the identifier of the graft peer involved in the Prune control', -COMMENT COLUMN topic_layer 'Layer of the topic', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding of the topic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_rpc_meta_control_prune ON CLUSTER '{cluster}' AS libp2p_rpc_meta_control_prune_local -ENGINE = Distributed('{cluster}', default, libp2p_rpc_meta_control_prune_local, unique_key); - --- Creating local and distributed tables for libp2p_recv_rpc --- unique_key = seahash(.event.id) --- peer_id_unique_key = seahash(data.meta.peer_id + .meta_network_name) --- --- Control messages (prune, iwant, idontwant, etc) are split off from this message --- and stored in separate tables: --- libp2p_rpc_meta_control_prune_local --- libp2p_rpc_meta_control_iwant_local --- libp2p_rpc_meta_control_idontwant_local --- etc. --- --- These control tables reference: --- rpc_meta_unique_key = libp2p_*_rpc_local.unique_key --- peer_id_unique_key = libp2p_*_rpc_local.peer_id_unique_key -CREATE TABLE libp2p_recv_rpc_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_recv_rpc_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC messages received by the peer.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer sender', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_recv_rpc ON CLUSTER '{cluster}' AS libp2p_recv_rpc_local -ENGINE = Distributed('{cluster}', default, libp2p_recv_rpc_local, unique_key); - --- Creating local and distributed tables for libp2p_send_rpc --- unique_key = seahash(.event.id) --- peer_id_unique_key = seahash(data.meta.peer_id + .meta_network_name) --- --- Control messages (prune, iwant, idontwant, etc) are split off from this message --- and stored in separate tables: --- libp2p_rpc_meta_control_prune_local --- libp2p_rpc_meta_control_iwant_local --- libp2p_rpc_meta_control_idontwant_local --- etc. --- --- These control tables reference: --- rpc_meta_unique_key = libp2p_*_rpc_local.unique_key --- peer_id_unique_key = libp2p_*_rpc_local.peer_id_unique_key -CREATE TABLE libp2p_send_rpc_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_send_rpc_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC messages sent by the peer.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer receiver', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_send_rpc ON CLUSTER '{cluster}' AS libp2p_send_rpc_local -ENGINE = Distributed('{cluster}', default, libp2p_send_rpc_local, unique_key); - --- Creating local and distributed tables for libp2p_join -CREATE TABLE libp2p_join_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - peer_id_unique_key Int64, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_join_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the JOIN events from the libp2p client.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN topic_layer 'Layer of the topic', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding of the topic', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer that joined the topic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_join ON CLUSTER '{cluster}' AS libp2p_join_local -ENGINE = Distributed('{cluster}', default, libp2p_join_local, unique_key); - --- Creating local and distributed tables for libp2p_connected -CREATE TABLE libp2p_connected_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - remote_peer_id_unique_key Int64, - remote_protocol LowCardinality(String), - remote_transport_protocol LowCardinality(String), - remote_port UInt16 CODEC(ZSTD(1)), - remote_ip Nullable(IPv6) CODEC(ZSTD(1)), - remote_geo_city LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_country LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - remote_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - remote_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - remote_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - remote_agent_implementation LowCardinality(String), - remote_agent_version LowCardinality(String), - remote_agent_version_major LowCardinality(String), - remote_agent_version_minor LowCardinality(String), - remote_agent_version_patch LowCardinality(String), - remote_agent_platform LowCardinality(String), - direction LowCardinality(String), - opened DateTime CODEC(DoubleDelta, ZSTD(1)), - transient Bool, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_connected_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the CONNECTED events from the libp2p client.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN remote_peer_id_unique_key 'Unique key associated with the identifier of the remote peer', -COMMENT COLUMN remote_protocol 'Protocol of the remote peer', -COMMENT COLUMN remote_transport_protocol 'Transport protocol of the remote peer', -COMMENT COLUMN remote_port 'Port of the remote peer', -COMMENT COLUMN remote_ip 'IP address of the remote peer that generated the event', -COMMENT COLUMN remote_geo_city 'City of the remote peer that generated the event', -COMMENT COLUMN remote_geo_country 'Country of the remote peer that generated the event', -COMMENT COLUMN remote_geo_country_code 'Country code of the remote peer that generated the event', -COMMENT COLUMN remote_geo_continent_code 'Continent code of the remote peer that generated the event', -COMMENT COLUMN remote_geo_longitude 'Longitude of the remote peer that generated the event', -COMMENT COLUMN remote_geo_latitude 'Latitude of the remote peer that generated the event', -COMMENT COLUMN remote_geo_autonomous_system_number 'Autonomous system number of the remote peer that generated the event', -COMMENT COLUMN remote_geo_autonomous_system_organization 'Autonomous system organization of the remote peer that generated the event', -COMMENT COLUMN remote_agent_implementation 'Implementation of the remote peer', -COMMENT COLUMN remote_agent_version 'Version of the remote peer', -COMMENT COLUMN remote_agent_version_major 'Major version of the remote peer', -COMMENT COLUMN remote_agent_version_minor 'Minor version of the remote peer', -COMMENT COLUMN remote_agent_version_patch 'Patch version of the remote peer', -COMMENT COLUMN remote_agent_platform 'Platform of the remote peer', -COMMENT COLUMN direction 'Connection direction', -COMMENT COLUMN opened 'Timestamp when the connection was opened', -COMMENT COLUMN transient 'Whether the connection is transient', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_connected ON CLUSTER '{cluster}' AS libp2p_connected_local -ENGINE = Distributed('{cluster}', default, libp2p_connected_local, unique_key); - --- Creating local and distributed tables for libp2p_disconnected -CREATE TABLE libp2p_disconnected_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - remote_peer_id_unique_key Int64, - remote_protocol LowCardinality(String), - remote_transport_protocol LowCardinality(String), - remote_port UInt16 CODEC(ZSTD(1)), - remote_ip Nullable(IPv6) CODEC(ZSTD(1)), - remote_geo_city LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_country LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - remote_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - remote_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - remote_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - remote_agent_implementation LowCardinality(String), - remote_agent_version LowCardinality(String), - remote_agent_version_major LowCardinality(String), - remote_agent_version_minor LowCardinality(String), - remote_agent_version_patch LowCardinality(String), - remote_agent_platform LowCardinality(String), - direction LowCardinality(String), - opened DateTime CODEC(DoubleDelta, ZSTD(1)), - transient Bool, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_disconnected_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the DISCONNECTED events from the libp2p client.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN remote_peer_id_unique_key 'Unique key associated with the identifier of the remote peer', -COMMENT COLUMN remote_protocol 'Protocol of the remote peer', -COMMENT COLUMN remote_transport_protocol 'Transport protocol of the remote peer', -COMMENT COLUMN remote_port 'Port of the remote peer', -COMMENT COLUMN remote_ip 'IP address of the remote peer that generated the event', -COMMENT COLUMN remote_geo_city 'City of the remote peer that generated the event', -COMMENT COLUMN remote_geo_country 'Country of the remote peer that generated the event', -COMMENT COLUMN remote_geo_country_code 'Country code of the remote peer that generated the event', -COMMENT COLUMN remote_geo_continent_code 'Continent code of the remote peer that generated the event', -COMMENT COLUMN remote_geo_longitude 'Longitude of the remote peer that generated the event', -COMMENT COLUMN remote_geo_latitude 'Latitude of the remote peer that generated the event', -COMMENT COLUMN remote_geo_autonomous_system_number 'Autonomous system number of the remote peer that generated the event', -COMMENT COLUMN remote_geo_autonomous_system_organization 'Autonomous system organization of the remote peer that generated the event', -COMMENT COLUMN remote_agent_implementation 'Implementation of the remote peer', -COMMENT COLUMN remote_agent_version 'Version of the remote peer', -COMMENT COLUMN remote_agent_version_major 'Major version of the remote peer', -COMMENT COLUMN remote_agent_version_minor 'Minor version of the remote peer', -COMMENT COLUMN remote_agent_version_patch 'Patch version of the remote peer', -COMMENT COLUMN remote_agent_platform 'Platform of the remote peer', -COMMENT COLUMN direction 'Connection direction', -COMMENT COLUMN opened 'Timestamp when the connection was opened', -COMMENT COLUMN transient 'Whether the connection is transient', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_disconnected ON CLUSTER '{cluster}' AS libp2p_disconnected_local -ENGINE = Distributed('{cluster}', default, libp2p_disconnected_local, unique_key); diff --git a/deploy/migrations/clickhouse/033_libp2p_trace_metadata_status.down.sql b/deploy/migrations/clickhouse/033_libp2p_trace_metadata_status.down.sql deleted file mode 100644 index a6546b8a5..000000000 --- a/deploy/migrations/clickhouse/033_libp2p_trace_metadata_status.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -DROP TABLE IF EXISTS libp2p_handle_status ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS libp2p_handle_status_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS libp2p_handle_metadata ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS libp2p_handle_metadata_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/033_libp2p_trace_metadata_status.up.sql b/deploy/migrations/clickhouse/033_libp2p_trace_metadata_status.up.sql deleted file mode 100644 index 1ec29cacc..000000000 --- a/deploy/migrations/clickhouse/033_libp2p_trace_metadata_status.up.sql +++ /dev/null @@ -1,142 +0,0 @@ --- Creating local and distributed tables for libp2p_handle_status -CREATE TABLE libp2p_handle_status_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - peer_id_unique_key Int64, - error Nullable(String) CODEC(ZSTD(1)), - protocol LowCardinality(String), - request_finalized_epoch Nullable(UInt32) CODEC(DoubleDelta, ZSTD(1)), - request_finalized_root Nullable(String), - request_fork_digest LowCardinality(String), - request_head_root Nullable(FixedString(66)) CODEC(ZSTD(1)), - request_head_slot Nullable(UInt32) CODEC(ZSTD(1)), - response_finalized_epoch Nullable(UInt32) CODEC(DoubleDelta, ZSTD(1)), - response_finalized_root Nullable(FixedString(66)) CODEC(ZSTD(1)), - response_fork_digest LowCardinality(String), - response_head_root Nullable(FixedString(66)) CODEC(ZSTD(1)), - response_head_slot Nullable(UInt32) CODEC(DoubleDelta, ZSTD(1)), - latency_milliseconds Decimal(10,3) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_handle_status_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the status handling events for libp2p peers.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN error 'Error message if the status handling failed', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer', -COMMENT COLUMN protocol 'The protocol of the status handling event', -COMMENT COLUMN request_finalized_epoch 'Requested finalized epoch', -COMMENT COLUMN request_finalized_root 'Requested finalized root', -COMMENT COLUMN request_fork_digest 'Requested fork digest', -COMMENT COLUMN request_head_root 'Requested head root', -COMMENT COLUMN request_head_slot 'Requested head slot', -COMMENT COLUMN response_finalized_epoch 'Response finalized epoch', -COMMENT COLUMN response_finalized_root 'Response finalized root', -COMMENT COLUMN response_fork_digest 'Response fork digest', -COMMENT COLUMN response_head_root 'Response head root', -COMMENT COLUMN response_head_slot 'Response head slot', -COMMENT COLUMN latency_milliseconds 'How long it took to handle the status request in milliseconds', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_handle_status ON CLUSTER '{cluster}' AS libp2p_handle_status_local -ENGINE = Distributed('{cluster}', default, libp2p_handle_status_local, unique_key); - -CREATE TABLE libp2p_handle_metadata_local ON CLUSTER '{cluster}' -( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - peer_id_unique_key Int64, - error Nullable(String) CODEC(ZSTD(1)), - protocol LowCardinality(String), - attnets String CODEC(ZSTD(1)), - seq_number UInt64 CODEC(DoubleDelta, ZSTD(1)), - syncnets String CODEC(ZSTD(1)), - latency_milliseconds Decimal(10,3) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_handle_metadata_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the metadata handling events for libp2p peers.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN event_date_time 'Timestamp of the event', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN error 'Error message if the metadata handling failed', -COMMENT COLUMN protocol 'The protocol of the metadata handling event', -COMMENT COLUMN attnets 'Attestation subnets the peer is subscribed to', -COMMENT COLUMN seq_number 'Sequence number of the metadata', -COMMENT COLUMN syncnets 'Sync subnets the peer is subscribed to', -COMMENT COLUMN latency_milliseconds 'How long it took to handle the metadata request in milliseconds', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer involved in the RPC', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_handle_metadata ON CLUSTER '{cluster}' AS libp2p_handle_metadata_local -ENGINE = Distributed('{cluster}', default, libp2p_handle_metadata_local, unique_key); diff --git a/deploy/migrations/clickhouse/034_libp2p_gossipsub_beacon_block.down.sql b/deploy/migrations/clickhouse/034_libp2p_gossipsub_beacon_block.down.sql deleted file mode 100644 index 728ee79f3..000000000 --- a/deploy/migrations/clickhouse/034_libp2p_gossipsub_beacon_block.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/034_libp2p_gossipsub_beacon_block.up.sql b/deploy/migrations/clickhouse/034_libp2p_gossipsub_beacon_block.up.sql deleted file mode 100644 index 8293d9d5b..000000000 --- a/deploy/migrations/clickhouse/034_libp2p_gossipsub_beacon_block.up.sql +++ /dev/null @@ -1,84 +0,0 @@ -CREATE TABLE libp2p_gossipsub_beacon_block_local on cluster '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - wallclock_slot UInt32 Codec(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - wallclock_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - wallclock_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - block FixedString(66) Codec(ZSTD(1)), - proposer_index UInt32 CODEC(ZSTD(1)), - peer_id_unique_key Int64, - message_id String CODEC(ZSTD(1)), - message_size UInt32 Codec(ZSTD(1)), - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub beacon block data.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event with millisecond precision', -COMMENT COLUMN slot 'Slot number associated with the event', -COMMENT COLUMN slot_start_date_time 'Start date and time of the slot', -COMMENT COLUMN epoch 'Epoch number associated with the event', -COMMENT COLUMN epoch_start_date_time 'Start date and time of the epoch', -COMMENT COLUMN wallclock_slot 'Slot number of the wall clock when the event was received', -COMMENT COLUMN wallclock_slot_start_date_time 'Start date and time of the wall clock slot when the event was received', -COMMENT COLUMN wallclock_epoch 'Epoch number of the wall clock when the event was received', -COMMENT COLUMN wallclock_epoch_start_date_time 'Start date and time of the wall clock epoch when the event was received', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slot start time for propagation', -COMMENT COLUMN proposer_index 'The proposer index of the beacon block', -COMMENT COLUMN block 'The beacon block root hash', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer', -COMMENT COLUMN message_id 'Identifier of the message', -COMMENT COLUMN message_size 'Size of the message in bytes', -COMMENT COLUMN topic_layer 'Layer of the topic in the gossipsub protocol', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding used for the topic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Network ID associated with the client', -COMMENT COLUMN meta_network_name 'Name of the network associated with the client'; - -CREATE TABLE libp2p_gossipsub_beacon_block on cluster '{cluster}' AS libp2p_gossipsub_beacon_block_local -ENGINE = Distributed('{cluster}', default, libp2p_gossipsub_beacon_block_local, unique_key); diff --git a/deploy/migrations/clickhouse/035_libp2p_gossipsub_beacon_attestation.down.sql b/deploy/migrations/clickhouse/035_libp2p_gossipsub_beacon_attestation.down.sql deleted file mode 100644 index 63f8a094e..000000000 --- a/deploy/migrations/clickhouse/035_libp2p_gossipsub_beacon_attestation.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/035_libp2p_gossipsub_beacon_attestation.up.sql b/deploy/migrations/clickhouse/035_libp2p_gossipsub_beacon_attestation.up.sql deleted file mode 100644 index 4bb1dd2d2..000000000 --- a/deploy/migrations/clickhouse/035_libp2p_gossipsub_beacon_attestation.up.sql +++ /dev/null @@ -1,102 +0,0 @@ -CREATE TABLE libp2p_gossipsub_beacon_attestation_local on cluster '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - committee_index LowCardinality(String), - attesting_validator_index Nullable(UInt32) Codec(ZSTD(1)), - attesting_validator_committee_index LowCardinality(String), - wallclock_slot UInt32 Codec(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - wallclock_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - wallclock_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - peer_id_unique_key Int64, - message_id String CODEC(ZSTD(1)), - message_size UInt32 Codec(ZSTD(1)), - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - aggregation_bits String Codec(ZSTD(1)), - beacon_block_root FixedString(66) Codec(ZSTD(1)), - source_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - source_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - source_root FixedString(66) Codec(ZSTD(1)), - target_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - target_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - target_root FixedString(66) Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub beacon attestation data.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event with millisecond precision', -COMMENT COLUMN slot 'Slot number associated with the event', -COMMENT COLUMN slot_start_date_time 'Start date and time of the slot', -COMMENT COLUMN wallclock_slot 'Slot number of the wall clock when the event was received', -COMMENT COLUMN wallclock_slot_start_date_time 'Start date and time of the wall clock slot when the event was received', -COMMENT COLUMN wallclock_epoch 'Epoch number of the wall clock when the event was received', -COMMENT COLUMN wallclock_epoch_start_date_time 'Start date and time of the wall clock epoch when the event was received', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slot start time for propagation', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer', -COMMENT COLUMN message_id 'Identifier of the message', -COMMENT COLUMN message_size 'Size of the message in bytes', -COMMENT COLUMN topic_layer 'Layer of the topic in the gossipsub protocol', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding used for the topic', -COMMENT COLUMN aggregation_bits 'The aggregation bits of the event in the attestation', -COMMENT COLUMN beacon_block_root 'The beacon block root hash in the attestation', -COMMENT COLUMN epoch 'The epoch number in the attestation', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN source_epoch 'The source epoch number in the attestation', -COMMENT COLUMN source_epoch_start_date_time 'The wall clock time when the source epoch started', -COMMENT COLUMN source_root 'The source beacon block root hash in the attestation', -COMMENT COLUMN target_epoch 'The target epoch number in the attestation', -COMMENT COLUMN target_epoch_start_date_time 'The wall clock time when the target epoch started', -COMMENT COLUMN target_root 'The target beacon block root hash in the attestation', -COMMENT COLUMN committee_index 'The committee index in the attestation', -COMMENT COLUMN attesting_validator_index 'The index of the validator attesting to the event', -COMMENT COLUMN attesting_validator_committee_index 'The committee index of the attesting validator', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Network ID associated with the client', -COMMENT COLUMN meta_network_name 'Name of the network associated with the client'; - -CREATE TABLE libp2p_gossipsub_beacon_attestation on cluster '{cluster}' AS libp2p_gossipsub_beacon_attestation_local -ENGINE = Distributed('{cluster}', default, libp2p_gossipsub_beacon_attestation_local, unique_key); diff --git a/deploy/migrations/clickhouse/036_replacing_merge_trees.down.sql b/deploy/migrations/clickhouse/036_replacing_merge_trees.down.sql deleted file mode 100644 index af82275aa..000000000 --- a/deploy/migrations/clickhouse/036_replacing_merge_trees.down.sql +++ /dev/null @@ -1,1104 +0,0 @@ --- beacon_api_eth_v1_beacon_committee -CREATE TABLE tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - committee_index LowCardinality(String), - validators Array(UInt32) CODEC(ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API committee payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN committee_index 'The committee index in the beacon API committee payload', -COMMENT COLUMN validators 'The validator indices in the beacon API committee payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API committee payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_beacon_committee_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_beacon_committee_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_beacon_committee -SELECT - toInt64(cityHash64(toString(slot) || committee_index || toString(validators) || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_beacon_committee_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_beacon_committee_local AND tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_beacon_committee_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_beacon_committee_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_blob_sidecar -CREATE TABLE tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 CODEC(ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - blob_index UInt64 CODEC(ZSTD(1)), - kzg_commitment FixedString(98) CODEC(ZSTD(1)), - versioned_hash FixedString(66) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN blob_index 'The index of blob sidecar in the beacon API event stream payload', -COMMENT COLUMN kzg_commitment 'The KZG commitment in the beacon API event stream payload', -COMMENT COLUMN versioned_hash 'The versioned hash in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_blob_sidecar_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_blob_sidecar_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_blob_sidecar -SELECT - toInt64(cityHash64(toString(slot) || toString(blob_index) || block_root || kzg_commitment || versioned_hash || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_blob_sidecar_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_blob_sidecar_local AND tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_blob_sidecar_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_blob_sidecar_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_block -CREATE TABLE tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 CODEC(ZSTD(1)), - block FixedString(66) CODEC(ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN block 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'If the attached beacon node is running in execution optimistic mode', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_block_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_block_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_block -SELECT - toInt64(cityHash64(toString(slot) || block || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_block_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_block_local AND tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_block_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_block_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_chain_reorg -CREATE TABLE tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - slot UInt32, - slot_start_date_time DateTime, - propagation_slot_start_diff UInt32, - depth UInt16, - old_head_block FixedString(66), - new_head_block FixedString(66), - old_head_state FixedString(66), - new_head_state FixedString(66), - epoch UInt32, - epoch_start_date_time DateTime, - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'The slot number of the chain reorg event in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the reorg slot started', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slots between when the reorg occurred and when the sentry received the event', -COMMENT COLUMN depth 'The depth of the chain reorg in the beacon API event stream payload', -COMMENT COLUMN old_head_block 'The old head block root hash in the beacon API event stream payload', -COMMENT COLUMN new_head_block 'The new head block root hash in the beacon API event stream payload', -COMMENT COLUMN old_head_state 'The old head state root hash in the beacon API event stream payload', -COMMENT COLUMN new_head_state 'The new head state root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'Whether the execution of the epoch was optimistic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_chain_reorg_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_chain_reorg_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_chain_reorg -SELECT - toInt64(cityHash64(toString(slot) || toString(depth) || old_head_block || new_head_block || old_head_state || new_head_state || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_chain_reorg_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_chain_reorg_local AND tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_chain_reorg_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_chain_reorg_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_contribution_and_proof -CREATE TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - aggregator_index UInt32, - contribution_slot UInt32, - contribution_slot_start_date_time DateTime, - contribution_propagation_slot_start_diff UInt32, - contribution_beacon_block_root FixedString(66), - contribution_subcommittee_index LowCardinality(String), - contribution_aggregation_bits String, - contribution_signature String, - contribution_epoch UInt32, - contribution_epoch_start_date_time DateTime, - selection_proof String, - signature String, - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(contribution_slot_start_date_time) -ORDER BY (contribution_slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN aggregator_index 'The validator index of the aggregator in the beacon API event stream payload', -COMMENT COLUMN contribution_slot 'The slot number of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_slot_start_date_time 'The wall clock time when the contribution slot started', -COMMENT COLUMN contribution_propagation_slot_start_diff 'Difference in slots between when the contribution occurred and when the sentry received the event', -COMMENT COLUMN contribution_beacon_block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN contribution_subcommittee_index 'The subcommittee index of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_aggregation_bits 'The aggregation bits of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_signature 'The signature of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_epoch 'The epoch number of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_epoch_start_date_time 'The wall clock time when the contribution epoch started', -COMMENT COLUMN selection_proof 'The selection proof in the beacon API event stream payload', -COMMENT COLUMN signature 'The signature in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_contribution_and_proof_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_contribution_and_proof_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_contribution_and_proof -SELECT - toInt64(cityHash64(toString(aggregator_index) || toString(contribution_slot) || contribution_beacon_block_root || contribution_subcommittee_index || contribution_aggregation_bits || contribution_signature || selection_proof || signature || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_contribution_and_proof_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_contribution_and_proof_local AND tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_contribution_and_proof_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_contribution_and_proof_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_finalized_checkpoint -CREATE TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - block FixedString(66) CODEC(ZSTD(1)), - state FixedString(66) CODEC(ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN block 'The finalized block root hash in the beacon API event stream payload', -COMMENT COLUMN state 'The finalized state root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'Whether the execution of the epoch was optimistic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_finalized_checkpoint_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_finalized_checkpoint_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_finalized_checkpoint -SELECT - toInt64(cityHash64(toString(epoch) || block || state || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_finalized_checkpoint_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_finalized_checkpoint_local AND tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_finalized_checkpoint_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_finalized_checkpoint_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_head -CREATE TABLE tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - slot UInt32, - slot_start_date_time DateTime, - propagation_slot_start_diff UInt32, - block FixedString(66), - epoch UInt32, - epoch_start_date_time DateTime, - epoch_transition Bool, - execution_optimistic Bool, - previous_duty_dependent_root FixedString(66), - current_duty_dependent_root FixedString(66), - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN block 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN epoch_transition 'If the event is an epoch transition', -COMMENT COLUMN execution_optimistic 'If the attached beacon node is running in execution optimistic mode', -COMMENT COLUMN previous_duty_dependent_root 'The previous duty dependent root in the beacon API event stream payload', -COMMENT COLUMN current_duty_dependent_root 'The current duty dependent root in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_head_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_head_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_head -SELECT - toInt64(cityHash64(toString(slot) || block || previous_duty_dependent_root || current_duty_dependent_root || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_head_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_head_local AND tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_head_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_head_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_voluntary_exit -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - epoch UInt32, - epoch_start_date_time DateTime, - validator_index UInt32, - signature String, - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN validator_index 'The index of the validator making the voluntary exit', -COMMENT COLUMN signature 'The signature of the voluntary exit in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_voluntary_exit_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_voluntary_exit_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_voluntary_exit -SELECT - toInt64(cityHash64(toString(epoch) || validator_index || signature || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_voluntary_exit_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_voluntary_exit_local AND tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_voluntary_exit_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_validator_attestation_data -CREATE TABLE tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - slot UInt32, - slot_start_date_time DateTime, - committee_index LowCardinality(String), - beacon_block_root FixedString(66), - epoch UInt32, - epoch_start_date_time DateTime, - source_epoch UInt32, - source_epoch_start_date_time DateTime, - source_root FixedString(66), - target_epoch UInt32, - target_epoch_start_date_time DateTime, - target_root FixedString(66), - request_date_time DateTime, - request_duration UInt32, - request_slot_start_diff UInt32, - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API validator attestation data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API validator attestation data payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN committee_index 'The committee index in the beacon API validator attestation data payload', -COMMENT COLUMN beacon_block_root 'The beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN source_epoch 'The source epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN source_epoch_start_date_time 'The wall clock time when the source epoch started', -COMMENT COLUMN source_root 'The source beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN target_epoch 'The target epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN target_epoch_start_date_time 'The wall clock time when the target epoch started', -COMMENT COLUMN target_root 'The target beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN request_date_time 'When the request was sent to the beacon node', -COMMENT COLUMN request_duration 'The request duration in milliseconds', -COMMENT COLUMN request_slot_start_diff 'The difference between the request_date_time and the slot_start_date_time', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_validator_attestation_data_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_validator_attestation_data_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_validator_attestation_data -SELECT - toInt64(cityHash64(toString(slot) || committee_index || beacon_block_root || toString(source_epoch) || source_root || toString(target_epoch) || target_root || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_validator_attestation_data_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_validator_attestation_data_local AND tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_validator_attestation_data_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_validator_attestation_data_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v2_beacon_block -CREATE TABLE tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - slot UInt32, - slot_start_date_time DateTime, - epoch UInt32, - epoch_start_date_time DateTime, - block_root FixedString(66), - block_version LowCardinality(String), - block_total_bytes Nullable(UInt32), - block_total_bytes_compressed Nullable(UInt32), - parent_root FixedString(66), - state_root FixedString(66), - proposer_index UInt32, - eth1_data_block_hash FixedString(66), - eth1_data_deposit_root FixedString(66), - execution_payload_block_hash FixedString(66), - execution_payload_block_number UInt32, - execution_payload_fee_recipient String, - execution_payload_state_root FixedString(66), - execution_payload_parent_hash FixedString(66), - execution_payload_transactions_count Nullable(UInt32), - execution_payload_transactions_total_bytes Nullable(UInt32), - execution_payload_transactions_total_bytes_compressed Nullable(UInt32), - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_execution_fork_id_hash LowCardinality(String), - meta_execution_fork_id_next LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the reorg slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN block_total_bytes 'The total bytes of the beacon block payload', -COMMENT COLUMN block_total_bytes_compressed 'The total bytes of the beacon block payload when compressed using snappy', -COMMENT COLUMN parent_root 'The root hash of the parent beacon block', -COMMENT COLUMN state_root 'The root hash of the beacon state at this block', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN eth1_data_block_hash 'The block hash of the associated execution block', -COMMENT COLUMN eth1_data_deposit_root 'The root of the deposit tree in the associated execution block', -COMMENT COLUMN execution_payload_block_hash 'The block hash of the execution payload', -COMMENT COLUMN execution_payload_block_number 'The block number of the execution payload', -COMMENT COLUMN execution_payload_fee_recipient 'The recipient of the fee for this execution payload', -COMMENT COLUMN execution_payload_state_root 'The state root of the execution payload', -COMMENT COLUMN execution_payload_parent_hash 'The parent hash of the execution payload', -COMMENT COLUMN execution_payload_transactions_count 'The transaction count of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes 'The transaction total bytes of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes_compressed 'The transaction total bytes of the execution payload when compressed using snappy', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_execution_fork_id_hash 'The hash of the fork ID of the current Ethereum network', -COMMENT COLUMN meta_execution_fork_id_next 'The fork ID of the next planned Ethereum network upgrade', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v2_beacon_block_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v2_beacon_block_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v2_beacon_block -SELECT - toInt64(cityHash64(toString(slot)|| block_root || block_version || parent_root || state_root || toString(proposer_index) || eth1_data_block_hash || execution_payload_block_hash || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v2_beacon_block_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; - -ALTER TABLE tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' - DROP COLUMN meta_execution_fork_id_hash, - DROP COLUMN meta_execution_fork_id_next; - -EXCHANGE TABLES default.beacon_api_eth_v2_beacon_block_local AND tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v2_beacon_block_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' SYNC; - --- mempool_transaction -CREATE TABLE tmp.mempool_transaction_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - hash FixedString(66) CODEC(ZSTD(1)), - from FixedString(42) CODEC(ZSTD(1)), - to Nullable(FixedString(42)) CODEC(ZSTD(1)), - nonce UInt64 CODEC(ZSTD(1)), - gas_price UInt128 CODEC(ZSTD(1)), - gas UInt64 CODEC(ZSTD(1)), - gas_tip_cap Nullable(UInt128), - gas_fee_cap Nullable(UInt128), - value UInt128 CODEC(ZSTD(1)), - type Nullable(UInt8), - size UInt32 CODEC(ZSTD(1)), - call_data_size UInt32 CODEC(ZSTD(1)), - blob_gas Nullable(UInt64), - blob_gas_fee_cap Nullable(UInt128), - blob_hashes Array(String), - blob_sidecars_size Nullable(UInt32), - blob_sidecars_empty_size Nullable(UInt32), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_execution_fork_id_hash LowCardinality(String), - meta_execution_fork_id_next LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.mempool_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Each row represents a transaction that was seen in the mempool by a sentry client. Sentries can report the same transaction multiple times if it has been long enough since the last report.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'The time when the sentry saw the transaction in the mempool', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN gas_tip_cap 'The priority fee (tip) the user has set for the transaction', -COMMENT COLUMN gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN type 'The type of the transaction', -COMMENT COLUMN size 'The size of the transaction data in bytes', -COMMENT COLUMN call_data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN blob_gas 'The maximum gas provided for the blob transaction execution', -COMMENT COLUMN blob_gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_hashes 'The hashes of the blob commitments for blob transactions', -COMMENT COLUMN blob_sidecars_size 'The total size of the sidecars for blob transactions in bytes', -COMMENT COLUMN blob_sidecars_empty_size 'The total empty size of the sidecars for blob transactions in bytes', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_execution_fork_id_hash 'The hash of the fork ID of the current Ethereum network', -COMMENT COLUMN meta_execution_fork_id_next 'The fork ID of the next planned Ethereum network upgrade', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.mempool_transaction ON CLUSTER '{cluster}' AS tmp.mempool_transaction_local -ENGINE = Distributed('{cluster}', tmp, mempool_transaction_local, unique_key); - -INSERT INTO tmp.mempool_transaction -SELECT - toInt64(cityHash64(hash || from || to || toString(nonce) || toString(type) || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.mempool_transaction_local; - -DROP TABLE IF EXISTS default.mempool_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.mempool_transaction_local AND tmp.mempool_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.mempool_transaction ON CLUSTER '{cluster}' AS default.mempool_transaction_local -ENGINE = Distributed('{cluster}', default, mempool_transaction_local, unique_key); - -DROP TABLE IF EXISTS tmp.mempool_transaction ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.mempool_transaction_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/036_replacing_merge_trees.up.sql b/deploy/migrations/clickhouse/036_replacing_merge_trees.up.sql deleted file mode 100644 index af82275aa..000000000 --- a/deploy/migrations/clickhouse/036_replacing_merge_trees.up.sql +++ /dev/null @@ -1,1104 +0,0 @@ --- beacon_api_eth_v1_beacon_committee -CREATE TABLE tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - committee_index LowCardinality(String), - validators Array(UInt32) CODEC(ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API committee payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN committee_index 'The committee index in the beacon API committee payload', -COMMENT COLUMN validators 'The validator indices in the beacon API committee payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API committee payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_beacon_committee_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_beacon_committee_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_beacon_committee -SELECT - toInt64(cityHash64(toString(slot) || committee_index || toString(validators) || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_beacon_committee_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_beacon_committee_local AND tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_beacon_committee_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_beacon_committee_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_blob_sidecar -CREATE TABLE tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 CODEC(ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - block_root FixedString(66) CODEC(ZSTD(1)), - blob_index UInt64 CODEC(ZSTD(1)), - kzg_commitment FixedString(98) CODEC(ZSTD(1)), - versioned_hash FixedString(66) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN blob_index 'The index of blob sidecar in the beacon API event stream payload', -COMMENT COLUMN kzg_commitment 'The KZG commitment in the beacon API event stream payload', -COMMENT COLUMN versioned_hash 'The versioned hash in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_blob_sidecar_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_blob_sidecar_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_blob_sidecar -SELECT - toInt64(cityHash64(toString(slot) || toString(blob_index) || block_root || kzg_commitment || versioned_hash || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_blob_sidecar_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_blob_sidecar_local AND tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_blob_sidecar_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_blob_sidecar_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_block -CREATE TABLE tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 CODEC(ZSTD(1)), - block FixedString(66) CODEC(ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN block 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'If the attached beacon node is running in execution optimistic mode', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_block_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_block_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_block -SELECT - toInt64(cityHash64(toString(slot) || block || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_block_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_block_local AND tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_block_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_block_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_chain_reorg -CREATE TABLE tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - slot UInt32, - slot_start_date_time DateTime, - propagation_slot_start_diff UInt32, - depth UInt16, - old_head_block FixedString(66), - new_head_block FixedString(66), - old_head_state FixedString(66), - new_head_state FixedString(66), - epoch UInt32, - epoch_start_date_time DateTime, - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'The slot number of the chain reorg event in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the reorg slot started', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slots between when the reorg occurred and when the sentry received the event', -COMMENT COLUMN depth 'The depth of the chain reorg in the beacon API event stream payload', -COMMENT COLUMN old_head_block 'The old head block root hash in the beacon API event stream payload', -COMMENT COLUMN new_head_block 'The new head block root hash in the beacon API event stream payload', -COMMENT COLUMN old_head_state 'The old head state root hash in the beacon API event stream payload', -COMMENT COLUMN new_head_state 'The new head state root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'Whether the execution of the epoch was optimistic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_chain_reorg_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_chain_reorg_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_chain_reorg -SELECT - toInt64(cityHash64(toString(slot) || toString(depth) || old_head_block || new_head_block || old_head_state || new_head_state || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_chain_reorg_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_chain_reorg_local AND tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_chain_reorg_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_chain_reorg_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_contribution_and_proof -CREATE TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - aggregator_index UInt32, - contribution_slot UInt32, - contribution_slot_start_date_time DateTime, - contribution_propagation_slot_start_diff UInt32, - contribution_beacon_block_root FixedString(66), - contribution_subcommittee_index LowCardinality(String), - contribution_aggregation_bits String, - contribution_signature String, - contribution_epoch UInt32, - contribution_epoch_start_date_time DateTime, - selection_proof String, - signature String, - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(contribution_slot_start_date_time) -ORDER BY (contribution_slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN aggregator_index 'The validator index of the aggregator in the beacon API event stream payload', -COMMENT COLUMN contribution_slot 'The slot number of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_slot_start_date_time 'The wall clock time when the contribution slot started', -COMMENT COLUMN contribution_propagation_slot_start_diff 'Difference in slots between when the contribution occurred and when the sentry received the event', -COMMENT COLUMN contribution_beacon_block_root 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN contribution_subcommittee_index 'The subcommittee index of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_aggregation_bits 'The aggregation bits of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_signature 'The signature of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_epoch 'The epoch number of the contribution in the beacon API event stream payload', -COMMENT COLUMN contribution_epoch_start_date_time 'The wall clock time when the contribution epoch started', -COMMENT COLUMN selection_proof 'The selection proof in the beacon API event stream payload', -COMMENT COLUMN signature 'The signature in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_contribution_and_proof_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_contribution_and_proof_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_contribution_and_proof -SELECT - toInt64(cityHash64(toString(aggregator_index) || toString(contribution_slot) || contribution_beacon_block_root || contribution_subcommittee_index || contribution_aggregation_bits || contribution_signature || selection_proof || signature || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_contribution_and_proof_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_contribution_and_proof_local AND tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_contribution_and_proof_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_contribution_and_proof_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_finalized_checkpoint -CREATE TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - block FixedString(66) CODEC(ZSTD(1)), - state FixedString(66) CODEC(ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - execution_optimistic Bool, - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN block 'The finalized block root hash in the beacon API event stream payload', -COMMENT COLUMN state 'The finalized state root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN execution_optimistic 'Whether the execution of the epoch was optimistic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_finalized_checkpoint_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_finalized_checkpoint_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_finalized_checkpoint -SELECT - toInt64(cityHash64(toString(epoch) || block || state || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_finalized_checkpoint_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_finalized_checkpoint_local AND tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_finalized_checkpoint_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_finalized_checkpoint_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_head -CREATE TABLE tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - slot UInt32, - slot_start_date_time DateTime, - propagation_slot_start_diff UInt32, - block FixedString(66), - epoch UInt32, - epoch_start_date_time DateTime, - epoch_transition Bool, - execution_optimistic Bool, - previous_duty_dependent_root FixedString(66), - current_duty_dependent_root FixedString(66), - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API event stream payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time', -COMMENT COLUMN block 'The beacon block root hash in the beacon API event stream payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN epoch_transition 'If the event is an epoch transition', -COMMENT COLUMN execution_optimistic 'If the attached beacon node is running in execution optimistic mode', -COMMENT COLUMN previous_duty_dependent_root 'The previous duty dependent root in the beacon API event stream payload', -COMMENT COLUMN current_duty_dependent_root 'The current duty dependent root in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_head_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_head_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_head -SELECT - toInt64(cityHash64(toString(slot) || block || previous_duty_dependent_root || current_duty_dependent_root || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_head_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_head_local AND tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_head_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_head_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_voluntary_exit -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - epoch UInt32, - epoch_start_date_time DateTime, - validator_index UInt32, - signature String, - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN epoch 'The epoch number in the beacon API event stream payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN validator_index 'The index of the validator making the voluntary exit', -COMMENT COLUMN signature 'The signature of the voluntary exit in the beacon API event stream payload', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_voluntary_exit_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_events_voluntary_exit_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_events_voluntary_exit -SELECT - toInt64(cityHash64(toString(epoch) || validator_index || signature || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_events_voluntary_exit_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_voluntary_exit_local AND tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_voluntary_exit_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_events_voluntary_exit_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_validator_attestation_data -CREATE TABLE tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - slot UInt32, - slot_start_date_time DateTime, - committee_index LowCardinality(String), - beacon_block_root FixedString(66), - epoch UInt32, - epoch_start_date_time DateTime, - source_epoch UInt32, - source_epoch_start_date_time DateTime, - source_root FixedString(66), - target_epoch UInt32, - target_epoch_start_date_time DateTime, - target_root FixedString(66), - request_date_time DateTime, - request_duration UInt32, - request_slot_start_diff UInt32, - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API validator attestation data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon API validator attestation data payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN committee_index 'The committee index in the beacon API validator attestation data payload', -COMMENT COLUMN beacon_block_root 'The beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN epoch 'The epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN source_epoch 'The source epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN source_epoch_start_date_time 'The wall clock time when the source epoch started', -COMMENT COLUMN source_root 'The source beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN target_epoch 'The target epoch number in the beacon API validator attestation data payload', -COMMENT COLUMN target_epoch_start_date_time 'The wall clock time when the target epoch started', -COMMENT COLUMN target_root 'The target beacon block root hash in the beacon API validator attestation data payload', -COMMENT COLUMN request_date_time 'When the request was sent to the beacon node', -COMMENT COLUMN request_duration 'The request duration in milliseconds', -COMMENT COLUMN request_slot_start_diff 'The difference between the request_date_time and the slot_start_date_time', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_validator_attestation_data_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v1_validator_attestation_data_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v1_validator_attestation_data -SELECT - toInt64(cityHash64(toString(slot) || committee_index || beacon_block_root || toString(source_epoch) || source_root || toString(target_epoch) || target_root || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v1_validator_attestation_data_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_validator_attestation_data_local AND tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_validator_attestation_data_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_validator_attestation_data_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v2_beacon_block -CREATE TABLE tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3), - slot UInt32, - slot_start_date_time DateTime, - epoch UInt32, - epoch_start_date_time DateTime, - block_root FixedString(66), - block_version LowCardinality(String), - block_total_bytes Nullable(UInt32), - block_total_bytes_compressed Nullable(UInt32), - parent_root FixedString(66), - state_root FixedString(66), - proposer_index UInt32, - eth1_data_block_hash FixedString(66), - eth1_data_deposit_root FixedString(66), - execution_payload_block_hash FixedString(66), - execution_payload_block_number UInt32, - execution_payload_fee_recipient String, - execution_payload_state_root FixedString(66), - execution_payload_parent_hash FixedString(66), - execution_payload_transactions_count Nullable(UInt32), - execution_payload_transactions_total_bytes Nullable(UInt32), - execution_payload_transactions_total_bytes_compressed Nullable(UInt32), - meta_client_name LowCardinality(String), - meta_client_id String, - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6), - meta_client_geo_city LowCardinality(String), - meta_client_geo_country LowCardinality(String), - meta_client_geo_country_code LowCardinality(String), - meta_client_geo_continent_code LowCardinality(String), - meta_client_geo_longitude Nullable(Float64), - meta_client_geo_latitude Nullable(Float64), - meta_client_geo_autonomous_system_number Nullable(UInt32), - meta_client_geo_autonomous_system_organization Nullable(String), - meta_network_id Int32, - meta_network_name LowCardinality(String), - meta_execution_fork_id_hash LowCardinality(String), - meta_execution_fork_id_next LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'When the sentry fetched the beacon block from a beacon node', -COMMENT COLUMN slot 'The slot number from beacon block payload', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the reorg slot started', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The root hash of the beacon block', -COMMENT COLUMN block_version 'The version of the beacon block', -COMMENT COLUMN block_total_bytes 'The total bytes of the beacon block payload', -COMMENT COLUMN block_total_bytes_compressed 'The total bytes of the beacon block payload when compressed using snappy', -COMMENT COLUMN parent_root 'The root hash of the parent beacon block', -COMMENT COLUMN state_root 'The root hash of the beacon state at this block', -COMMENT COLUMN proposer_index 'The index of the validator that proposed the beacon block', -COMMENT COLUMN eth1_data_block_hash 'The block hash of the associated execution block', -COMMENT COLUMN eth1_data_deposit_root 'The root of the deposit tree in the associated execution block', -COMMENT COLUMN execution_payload_block_hash 'The block hash of the execution payload', -COMMENT COLUMN execution_payload_block_number 'The block number of the execution payload', -COMMENT COLUMN execution_payload_fee_recipient 'The recipient of the fee for this execution payload', -COMMENT COLUMN execution_payload_state_root 'The state root of the execution payload', -COMMENT COLUMN execution_payload_parent_hash 'The parent hash of the execution payload', -COMMENT COLUMN execution_payload_transactions_count 'The transaction count of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes 'The transaction total bytes of the execution payload', -COMMENT COLUMN execution_payload_transactions_total_bytes_compressed 'The transaction total bytes of the execution payload when compressed using snappy', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_execution_fork_id_hash 'The hash of the fork ID of the current Ethereum network', -COMMENT COLUMN meta_execution_fork_id_next 'The fork ID of the next planned Ethereum network upgrade', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v2_beacon_block_local -ENGINE = Distributed('{cluster}', tmp, beacon_api_eth_v2_beacon_block_local, unique_key); - -INSERT INTO tmp.beacon_api_eth_v2_beacon_block -SELECT - toInt64(cityHash64(toString(slot)|| block_root || block_version || parent_root || state_root || toString(proposer_index) || eth1_data_block_hash || execution_payload_block_hash || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.beacon_api_eth_v2_beacon_block_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; - -ALTER TABLE tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' - DROP COLUMN meta_execution_fork_id_hash, - DROP COLUMN meta_execution_fork_id_next; - -EXCHANGE TABLES default.beacon_api_eth_v2_beacon_block_local AND tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v2_beacon_block_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v2_beacon_block_local, unique_key); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' SYNC; - --- mempool_transaction -CREATE TABLE tmp.mempool_transaction_local ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - hash FixedString(66) CODEC(ZSTD(1)), - from FixedString(42) CODEC(ZSTD(1)), - to Nullable(FixedString(42)) CODEC(ZSTD(1)), - nonce UInt64 CODEC(ZSTD(1)), - gas_price UInt128 CODEC(ZSTD(1)), - gas UInt64 CODEC(ZSTD(1)), - gas_tip_cap Nullable(UInt128), - gas_fee_cap Nullable(UInt128), - value UInt128 CODEC(ZSTD(1)), - type Nullable(UInt8), - size UInt32 CODEC(ZSTD(1)), - call_data_size UInt32 CODEC(ZSTD(1)), - blob_gas Nullable(UInt64), - blob_gas_fee_cap Nullable(UInt128), - blob_hashes Array(String), - blob_sidecars_size Nullable(UInt32), - blob_sidecars_empty_size Nullable(UInt32), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_execution_fork_id_hash LowCardinality(String), - meta_execution_fork_id_next LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE tmp.mempool_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Each row represents a transaction that was seen in the mempool by a sentry client. Sentries can report the same transaction multiple times if it has been long enough since the last report.', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'The time when the sentry saw the transaction in the mempool', -COMMENT COLUMN hash 'The hash of the transaction', -COMMENT COLUMN from 'The address of the account that sent the transaction', -COMMENT COLUMN to 'The address of the account that is the transaction recipient', -COMMENT COLUMN nonce 'The nonce of the sender account at the time of the transaction', -COMMENT COLUMN gas_price 'The gas price of the transaction in wei', -COMMENT COLUMN gas 'The maximum gas provided for the transaction execution', -COMMENT COLUMN gas_tip_cap 'The priority fee (tip) the user has set for the transaction', -COMMENT COLUMN gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN value 'The value transferred with the transaction in wei', -COMMENT COLUMN type 'The type of the transaction', -COMMENT COLUMN size 'The size of the transaction data in bytes', -COMMENT COLUMN call_data_size 'The size of the call data of the transaction in bytes', -COMMENT COLUMN blob_gas 'The maximum gas provided for the blob transaction execution', -COMMENT COLUMN blob_gas_fee_cap 'The max fee the user has set for the transaction', -COMMENT COLUMN blob_hashes 'The hashes of the blob commitments for blob transactions', -COMMENT COLUMN blob_sidecars_size 'The total size of the sidecars for blob transactions in bytes', -COMMENT COLUMN blob_sidecars_empty_size 'The total empty size of the sidecars for blob transactions in bytes', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_execution_fork_id_hash 'The hash of the fork ID of the current Ethereum network', -COMMENT COLUMN meta_execution_fork_id_next 'The fork ID of the next planned Ethereum network upgrade', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE tmp.mempool_transaction ON CLUSTER '{cluster}' AS tmp.mempool_transaction_local -ENGINE = Distributed('{cluster}', tmp, mempool_transaction_local, unique_key); - -INSERT INTO tmp.mempool_transaction -SELECT - toInt64(cityHash64(hash || from || to || toString(nonce) || toString(type) || meta_client_name) - 9223372036854775808), - NOW(), - * -FROM default.mempool_transaction_local; - -DROP TABLE IF EXISTS default.mempool_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.mempool_transaction_local AND tmp.mempool_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.mempool_transaction ON CLUSTER '{cluster}' AS default.mempool_transaction_local -ENGINE = Distributed('{cluster}', default, mempool_transaction_local, unique_key); - -DROP TABLE IF EXISTS tmp.mempool_transaction ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tmp.mempool_transaction_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/037_libp2p_gossipsub_blob_sidecar.down.sql b/deploy/migrations/clickhouse/037_libp2p_gossipsub_blob_sidecar.down.sql deleted file mode 100644 index 14b2d5e9f..000000000 --- a/deploy/migrations/clickhouse/037_libp2p_gossipsub_blob_sidecar.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}'; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/037_libp2p_gossipsub_blob_sidecar.up.sql b/deploy/migrations/clickhouse/037_libp2p_gossipsub_blob_sidecar.up.sql deleted file mode 100644 index 9e277fd42..000000000 --- a/deploy/migrations/clickhouse/037_libp2p_gossipsub_blob_sidecar.up.sql +++ /dev/null @@ -1,88 +0,0 @@ -CREATE TABLE libp2p_gossipsub_blob_sidecar_local -ON CLUSTER '{cluster}' ( - unique_key Int64, - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - wallclock_slot UInt32 Codec(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - wallclock_epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - wallclock_epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 Codec(ZSTD(1)), - proposer_index UInt32 CODEC(ZSTD(1)), - blob_index UInt32 CODEC(ZSTD(1)), - peer_id_unique_key Int64, - message_id String CODEC(ZSTD(1)), - message_size UInt32 Codec(ZSTD(1)), - topic_layer LowCardinality(String), - topic_fork_digest_value LowCardinality(String), - topic_name LowCardinality(String), - topic_encoding LowCardinality(String), - meta_client_name LowCardinality(String), - meta_client_id String Codec(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) Codec(ZSTD(1)), - meta_network_id Int32 Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, unique_key, meta_network_name, meta_client_name); - -ALTER TABLE libp2p_gossipsub_blob_sidecar_local -ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub blob sidecar data', -COMMENT COLUMN unique_key 'Unique identifier for each record', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the event with millisecond precision', -COMMENT COLUMN slot 'Slot number associated with the event', -COMMENT COLUMN slot_start_date_time 'Start date and time of the slot', -COMMENT COLUMN epoch 'Epoch number associated with the event', -COMMENT COLUMN epoch_start_date_time 'Start date and time of the epoch', -COMMENT COLUMN wallclock_slot 'Slot number of the wall clock when the event was received', -COMMENT COLUMN wallclock_slot_start_date_time 'Start date and time of the wall clock slot when the event was received', -COMMENT COLUMN wallclock_epoch 'Epoch number of the wall clock when the event was received', -COMMENT COLUMN wallclock_epoch_start_date_time 'Start date and time of the wall clock epoch when the event was received', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slot start time for propagation', -COMMENT COLUMN proposer_index 'The proposer index of the beacon block', -COMMENT COLUMN blob_index 'Blob index associated with the record', -COMMENT COLUMN peer_id_unique_key 'Unique key associated with the identifier of the peer', -COMMENT COLUMN message_id 'Identifier of the message', -COMMENT COLUMN message_size 'Size of the message in bytes', -COMMENT COLUMN topic_layer 'Layer of the topic in the gossipsub protocol', -COMMENT COLUMN topic_fork_digest_value 'Fork digest value of the topic', -COMMENT COLUMN topic_name 'Name of the topic', -COMMENT COLUMN topic_encoding 'Encoding used for the topic', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Network ID associated with the client', -COMMENT COLUMN meta_network_name 'Name of the network associated with the client'; - -CREATE TABLE libp2p_gossipsub_blob_sidecar -ON CLUSTER '{cluster}' -AS libp2p_gossipsub_blob_sidecar_local -ENGINE = Distributed('{cluster}', default, libp2p_gossipsub_blob_sidecar_local, unique_key); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/038_libp2p_gossipsub_blob_sidecar_block_fields.down.sql b/deploy/migrations/clickhouse/038_libp2p_gossipsub_blob_sidecar_block_fields.down.sql deleted file mode 100644 index adb64a280..000000000 --- a/deploy/migrations/clickhouse/038_libp2p_gossipsub_blob_sidecar_block_fields.down.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}' - DROP COLUMN parent_root; - -ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}' - DROP COLUMN parent_root; - -ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}' - DROP COLUMN state_root; - -ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}' - DROP COLUMN state_root; diff --git a/deploy/migrations/clickhouse/038_libp2p_gossipsub_blob_sidecar_block_fields.up.sql b/deploy/migrations/clickhouse/038_libp2p_gossipsub_blob_sidecar_block_fields.up.sql deleted file mode 100644 index 3418f78c3..000000000 --- a/deploy/migrations/clickhouse/038_libp2p_gossipsub_blob_sidecar_block_fields.up.sql +++ /dev/null @@ -1,23 +0,0 @@ -ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}' -ADD COLUMN parent_root FixedString(66) Codec(ZSTD(1)) AFTER blob_index; - -ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}' -ADD COLUMN parent_root FixedString(66) Codec(ZSTD(1)) AFTER blob_index; - -ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}' -COMMENT COLUMN parent_root 'Parent root of the beacon block'; - -ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}' -COMMENT COLUMN parent_root 'Parent root of the beacon block'; - -ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}' -ADD COLUMN state_root FixedString(66) Codec(ZSTD(1)) AFTER parent_root; - -ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}' -ADD COLUMN state_root FixedString(66) Codec(ZSTD(1)) AFTER parent_root; - -ALTER TABLE libp2p_gossipsub_blob_sidecar_local on cluster '{cluster}' -COMMENT COLUMN state_root 'State root of the beacon block'; - -ALTER TABLE libp2p_gossipsub_blob_sidecar on cluster '{cluster}' -COMMENT COLUMN state_root 'State root of the beacon block'; diff --git a/deploy/migrations/clickhouse/039_canonical_beacon_validators.down.sql b/deploy/migrations/clickhouse/039_canonical_beacon_validators.down.sql deleted file mode 100644 index 9c64079fc..000000000 --- a/deploy/migrations/clickhouse/039_canonical_beacon_validators.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_validators on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_validators_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/039_canonical_beacon_validators.up.sql b/deploy/migrations/clickhouse/039_canonical_beacon_validators.up.sql deleted file mode 100644 index 320671853..000000000 --- a/deploy/migrations/clickhouse/039_canonical_beacon_validators.up.sql +++ /dev/null @@ -1,85 +0,0 @@ -CREATE TABLE default.canonical_beacon_validators_local on cluster '{cluster}' -( - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - `index` UInt32 CODEC(ZSTD(1)), - balance UInt64 CODEC(ZSTD(1)), - `status` LowCardinality(String), - pubkey String CODEC(ZSTD(1)), - withdrawal_credentials String CODEC(ZSTD(1)), - effective_balance UInt64 CODEC(ZSTD(1)), - slashed Bool, - activation_epoch UInt64 CODEC(ZSTD(1)), - activation_eligibility_epoch UInt64 CODEC(ZSTD(1)), - exit_epoch UInt64 CODEC(ZSTD(1)), - withdrawable_epoch UInt64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, index, meta_network_name); - -ALTER TABLE default.canonical_beacon_validators_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a validator state for an epoch.', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN `index` 'The index of the validator', -COMMENT COLUMN `balance` 'The balance of the validator', -COMMENT COLUMN `status` 'The status of the validator', -COMMENT COLUMN pubkey 'The public key of the validator', -COMMENT COLUMN withdrawal_credentials 'The withdrawal credentials of the validator', -COMMENT COLUMN effective_balance 'The effective balance of the validator', -COMMENT COLUMN slashed 'Whether the validator is slashed', -COMMENT COLUMN activation_epoch 'The epoch when the validator was activated', -COMMENT COLUMN activation_eligibility_epoch 'The epoch when the validator was activated', -COMMENT COLUMN exit_epoch 'The epoch when the validator exited', -COMMENT COLUMN withdrawable_epoch 'The epoch when the validator can withdraw', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_validators on cluster '{cluster}' AS canonical_beacon_validators_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_validators_local, cityHash64('epoch_start_date_time', 'index', 'meta_network_name')); diff --git a/deploy/migrations/clickhouse/040_canonical_beacon_validators_split.down.sql b/deploy/migrations/clickhouse/040_canonical_beacon_validators_split.down.sql deleted file mode 100644 index d79fd5236..000000000 --- a/deploy/migrations/clickhouse/040_canonical_beacon_validators_split.down.sql +++ /dev/null @@ -1,94 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_validators on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_validators_local on cluster '{cluster}' SYNC; - -DROP TABLE IF EXISTS canonical_beacon_validators_pubkeys on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_validators_pubkeys_local on cluster '{cluster}' SYNC; - -DROP TABLE IF EXISTS canonical_beacon_validators_withdrawal_credentials on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_validators_withdrawal_credentials_local on cluster '{cluster}' SYNC; - -CREATE TABLE default.canonical_beacon_validators_local on cluster '{cluster}' -( - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - `index` UInt32 CODEC(ZSTD(1)), - balance UInt64 CODEC(ZSTD(1)), - `status` LowCardinality(String), - pubkey String CODEC(ZSTD(1)), - withdrawal_credentials String CODEC(ZSTD(1)), - effective_balance UInt64 CODEC(ZSTD(1)), - slashed Bool, - activation_epoch UInt64 CODEC(ZSTD(1)), - activation_eligibility_epoch UInt64 CODEC(ZSTD(1)), - exit_epoch UInt64 CODEC(ZSTD(1)), - withdrawable_epoch UInt64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, index, meta_network_name); - -ALTER TABLE default.canonical_beacon_validators_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a validator state for an epoch.', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN `index` 'The index of the validator', -COMMENT COLUMN `balance` 'The balance of the validator', -COMMENT COLUMN `status` 'The status of the validator', -COMMENT COLUMN pubkey 'The public key of the validator', -COMMENT COLUMN withdrawal_credentials 'The withdrawal credentials of the validator', -COMMENT COLUMN effective_balance 'The effective balance of the validator', -COMMENT COLUMN slashed 'Whether the validator is slashed', -COMMENT COLUMN activation_epoch 'The epoch when the validator was activated', -COMMENT COLUMN activation_eligibility_epoch 'The epoch when the validator was activated', -COMMENT COLUMN exit_epoch 'The epoch when the validator exited', -COMMENT COLUMN withdrawable_epoch 'The epoch when the validator can withdraw', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_validators on cluster '{cluster}' AS canonical_beacon_validators_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_validators_local, cityHash64(epoch_start_date_time, `index`, meta_network_name)); diff --git a/deploy/migrations/clickhouse/040_canonical_beacon_validators_split.up.sql b/deploy/migrations/clickhouse/040_canonical_beacon_validators_split.up.sql deleted file mode 100644 index d6fbcb0c1..000000000 --- a/deploy/migrations/clickhouse/040_canonical_beacon_validators_split.up.sql +++ /dev/null @@ -1,226 +0,0 @@ -DROP TABLE IF EXISTS canonical_beacon_validators on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS canonical_beacon_validators_local on cluster '{cluster}' SYNC; - -CREATE TABLE default.canonical_beacon_validators_local on cluster '{cluster}' -( - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - `index` UInt32 CODEC(ZSTD(1)), - balance UInt64 CODEC(ZSTD(1)), - `status` LowCardinality(String), - effective_balance UInt64 CODEC(ZSTD(1)), - slashed Bool, - activation_epoch UInt64 CODEC(ZSTD(1)), - activation_eligibility_epoch UInt64 CODEC(ZSTD(1)), - exit_epoch UInt64 CODEC(ZSTD(1)), - withdrawable_epoch UInt64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, index, meta_network_name); - -ALTER TABLE default.canonical_beacon_validators_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a validator state for an epoch.', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN `index` 'The index of the validator', -COMMENT COLUMN balance 'The balance of the validator', -COMMENT COLUMN `status` 'The status of the validator', -COMMENT COLUMN effective_balance 'The effective balance of the validator', -COMMENT COLUMN slashed 'Whether the validator is slashed', -COMMENT COLUMN activation_epoch 'The epoch when the validator was activated', -COMMENT COLUMN activation_eligibility_epoch 'The epoch when the validator was activated', -COMMENT COLUMN exit_epoch 'The epoch when the validator exited', -COMMENT COLUMN withdrawable_epoch 'The epoch when the validator can withdraw', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_validators on cluster '{cluster}' AS canonical_beacon_validators_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_validators_local, cityHash64(epoch_start_date_time, `index`, meta_network_name)); - -CREATE TABLE default.canonical_beacon_validators_pubkeys_local on cluster '{cluster}' -( - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - -- ensure the first epoch the pubkey was seen is in this table - -- 4294967295 = UInt32 max - `version` UInt32 DEFAULT 4294967295 - toUnixTimestamp(epoch_start_date_time) CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - `index` UInt32 CODEC(ZSTD(1)), - pubkey String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', `version`) -ORDER BY (index, pubkey, meta_network_name); - -ALTER TABLE default.canonical_beacon_validators_pubkeys_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a validator state for an epoch.', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN `version` 'Version of this row, to help with de-duplication we want the latest updated_date_time but earliest epoch_start_date_time the pubkey was seen', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN `index` 'The index of the validator', -COMMENT COLUMN pubkey 'The public key of the validator', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_validators_pubkeys on cluster '{cluster}' AS canonical_beacon_validators_pubkeys_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_validators_pubkeys_local, cityHash64(`index`, meta_network_name)); - -CREATE TABLE default.canonical_beacon_validators_withdrawal_credentials_local on cluster '{cluster}' -( - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - -- ensure the first epoch the withdrawal_credentials was seen is in this table - -- 4294967295 = UInt32 max - `version` UInt32 DEFAULT 4294967295 - toUnixTimestamp(epoch_start_date_time) CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - `index` UInt32 CODEC(ZSTD(1)), - withdrawal_credentials String CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', `version`) -ORDER BY (index, withdrawal_credentials, meta_network_name); - -ALTER TABLE default.canonical_beacon_validators_withdrawal_credentials_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a validator state for an epoch.', -COMMENT COLUMN updated_date_time 'When this row was last updated', -COMMENT COLUMN `version` 'Version of this row, to help with de-duplication we want the latest updated_date_time but earliest epoch_start_date_time the withdrawal_credentials was seen', -COMMENT COLUMN event_date_time 'When the client fetched the beacon block from a beacon node', -COMMENT COLUMN epoch 'The epoch number from beacon block payload', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN `index` 'The index of the validator', -COMMENT COLUMN withdrawal_credentials 'The withdrawal credentials of the validator', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE canonical_beacon_validators_withdrawal_credentials on cluster '{cluster}' AS canonical_beacon_validators_withdrawal_credentials_local -ENGINE = Distributed('{cluster}', default, canonical_beacon_validators_withdrawal_credentials_local, cityHash64(`index`, meta_network_name)); diff --git a/deploy/migrations/clickhouse/041_remove_unique_field.down.sql b/deploy/migrations/clickhouse/041_remove_unique_field.down.sql deleted file mode 100644 index c7a2b0329..000000000 --- a/deploy/migrations/clickhouse/041_remove_unique_field.down.sql +++ /dev/null @@ -1,4594 +0,0 @@ --- beacon_api_eth_v1_beacon_committee -CREATE TABLE tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API committee payload', - `validators` Array(UInt32) COMMENT 'The validator indices in the beacon API committee payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_beacon_committee_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_beacon_committee_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_beacon_committee -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - committee_index, - validators, - epoch, - epoch_start_date_time, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_beacon_committee_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_beacon_committee_local -AND tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_beacon_committee_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_beacon_committee_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_blob_sidecar -CREATE TABLE tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `blob_index` UInt64 COMMENT 'The index of blob sidecar in the beacon API event stream payload' CODEC(ZSTD(1)), - `kzg_commitment` FixedString(98) COMMENT 'The KZG commitment in the beacon API event stream payload' CODEC(ZSTD(1)), - `versioned_hash` FixedString(66) COMMENT 'The versioned hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_blob_sidecar_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_blob_sidecar -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - epoch, - epoch_start_date_time, - block_root, - blob_index, - kzg_commitment, - versioned_hash, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_blob_sidecar_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_blob_sidecar_local -AND tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_blob_sidecar_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_block -CREATE TABLE tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `block` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `execution_optimistic` Bool COMMENT 'If the attached beacon node is running in execution optimistic mode', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_block_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_block_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_block -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - block, - epoch, - epoch_start_date_time, - execution_optimistic, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_block_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_block_local -AND tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_block_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_block_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_chain_reorg -CREATE TABLE tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `slot` UInt32 COMMENT 'The slot number of the chain reorg event in the beacon API event stream payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the reorg slot started', - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slots between when the reorg occurred and when the sentry received the event', - `depth` UInt16 COMMENT 'The depth of the chain reorg in the beacon API event stream payload', - `old_head_block` FixedString(66) COMMENT 'The old head block root hash in the beacon API event stream payload', - `new_head_block` FixedString(66) COMMENT 'The new head block root hash in the beacon API event stream payload', - `old_head_state` FixedString(66) COMMENT 'The old head state root hash in the beacon API event stream payload', - `new_head_state` FixedString(66) COMMENT 'The new head state root hash in the beacon API event stream payload', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `execution_optimistic` Bool COMMENT 'Whether the execution of the epoch was optimistic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_chain_reorg_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_chain_reorg_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_chain_reorg -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - old_head_block, - new_head_block - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - depth, - old_head_block, - new_head_block, - old_head_state, - new_head_state, - epoch, - epoch_start_date_time, - execution_optimistic, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_chain_reorg_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_chain_reorg_local -AND tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_chain_reorg_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_chain_reorg_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_contribution_and_proof -CREATE TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `aggregator_index` UInt32 COMMENT 'The validator index of the aggregator in the beacon API event stream payload', - `contribution_slot` UInt32 COMMENT 'The slot number of the contribution in the beacon API event stream payload', - `contribution_slot_start_date_time` DateTime COMMENT 'The wall clock time when the contribution slot started', - `contribution_propagation_slot_start_diff` UInt32 COMMENT 'Difference in slots between when the contribution occurred and when the sentry received the event', - `contribution_beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload', - `contribution_subcommittee_index` LowCardinality(String) COMMENT 'The subcommittee index of the contribution in the beacon API event stream payload', - `contribution_aggregation_bits` String COMMENT 'The aggregation bits of the contribution in the beacon API event stream payload', - `contribution_signature` String COMMENT 'The signature of the contribution in the beacon API event stream payload', - `contribution_epoch` UInt32 COMMENT 'The epoch number of the contribution in the beacon API event stream payload', - `contribution_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the contribution epoch started', - `selection_proof` String COMMENT 'The selection proof in the beacon API event stream payload', - `signature` String COMMENT 'The signature in the beacon API event stream payload', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(contribution_slot_start_date_time) -ORDER BY - ( - contribution_slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_contribution_and_proof_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_contribution_and_proof_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_contribution_and_proof -SELECT - toInt64( - cityHash64( - contribution_slot_start_date_time, - meta_network_name, - meta_client_name, - contribution_beacon_block_root, - contribution_subcommittee_index - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - aggregator_index, - contribution_slot, - contribution_slot_start_date_time, - contribution_propagation_slot_start_diff, - contribution_beacon_block_root, - contribution_subcommittee_index, - contribution_aggregation_bits, - contribution_signature, - contribution_epoch, - contribution_epoch_start_date_time, - selection_proof, - signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_contribution_and_proof_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_contribution_and_proof_local -AND tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_contribution_and_proof_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_contribution_and_proof_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_finalized_checkpoint -CREATE TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `block` FixedString(66) COMMENT 'The finalized block root hash in the beacon API event stream payload', - `state` FixedString(66) COMMENT 'The finalized state root hash in the beacon API event stream payload', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `execution_optimistic` Bool COMMENT 'Whether the execution of the epoch was optimistic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY - ( - epoch_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_finalized_checkpoint_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_finalized_checkpoint -SELECT - toInt64( - cityHash64( - epoch_start_date_time, - meta_network_name, - meta_client_name, - block, - state - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - block, - state, - epoch, - epoch_start_date_time, - execution_optimistic, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_finalized_checkpoint_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_finalized_checkpoint_local -AND tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_finalized_checkpoint_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_finalized_checkpoint_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_head -CREATE TABLE tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time', - `block` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `epoch_transition` Bool COMMENT 'If the event is an epoch transition', - `execution_optimistic` Bool COMMENT 'If the attached beacon node is running in execution optimistic mode', - `previous_duty_dependent_root` FixedString(66) COMMENT 'The previous duty dependent root in the beacon API event stream payload', - `current_duty_dependent_root` FixedString(66) COMMENT 'The current duty dependent root in the beacon API event stream payload', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_head_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_head_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_head -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block, - previous_duty_dependent_root, - current_duty_dependent_root - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - block, - epoch, - epoch_start_date_time, - epoch_transition, - execution_optimistic, - previous_duty_dependent_root, - current_duty_dependent_root, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_head_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_head_local -AND tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_head_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_head_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_voluntary_exit -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `validator_index` UInt32 COMMENT 'The index of the validator making the voluntary exit', - `signature` String COMMENT 'The signature of the voluntary exit in the beacon API event stream payload', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY - ( - epoch_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_voluntary_exit_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_voluntary_exit -SELECT - toInt64( - cityHash64( - epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - epoch, - epoch_start_date_time, - validator_index, - signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_voluntary_exit_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_voluntary_exit_local -AND tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_voluntary_exit_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_proposer_duty -CREATE TABLE tmp.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `proposer_validator_index` UInt32 COMMENT 'The validator index from the proposer duty payload' CODEC(ZSTD(1)), - `proposer_pubkey` String COMMENT 'The BLS public key of the validator from the proposer duty payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains a proposer duty from a beacon block.'; - -CREATE TABLE tmp.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_proposer_duty_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_proposer_duty_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_proposer_duty -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - proposer_validator_index - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - proposer_validator_index, - proposer_pubkey, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_proposer_duty_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_proposer_duty_local -AND tmp.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_proposer_duty_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_proposer_duty_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_validator_attestation_data -CREATE TABLE tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `slot` UInt32 COMMENT 'Slot number in the beacon API validator attestation data payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', - `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API validator attestation data payload', - `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API validator attestation data payload', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API validator attestation data payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `source_epoch` UInt32 COMMENT 'The source epoch number in the beacon API validator attestation data payload', - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started', - `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the beacon API validator attestation data payload', - `target_epoch` UInt32 COMMENT 'The target epoch number in the beacon API validator attestation data payload', - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started', - `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the beacon API validator attestation data payload', - `request_date_time` DateTime COMMENT 'When the request was sent to the beacon node', - `request_duration` UInt32 COMMENT 'The request duration in milliseconds', - `request_slot_start_diff` UInt32 COMMENT 'The difference between the request_date_time and the slot_start_date_time', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API validator attestation data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_validator_attestation_data_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_validator_attestation_data_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v1_validator_attestation_data -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - beacon_block_root, - source_root, - target_root - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - committee_index, - beacon_block_root, - epoch, - epoch_start_date_time, - source_epoch, - source_epoch_start_date_time, - source_root, - target_epoch, - target_epoch_start_date_time, - target_root, - request_date_time, - request_duration, - request_slot_start_diff, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_validator_attestation_data_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_validator_attestation_data_local -AND tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_validator_attestation_data_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_validator_attestation_data_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v2_beacon_block -CREATE TABLE tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry fetched the beacon block from a beacon node', - `slot` UInt32 COMMENT 'The slot number from beacon block payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the reorg slot started', - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block', - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `block_total_bytes` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload', - `block_total_bytes_compressed` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload when compressed using snappy', - `parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block', - `state_root` FixedString(66) COMMENT 'The root hash of the beacon state at this block', - `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block', - `eth1_data_block_hash` FixedString(66) COMMENT 'The block hash of the associated execution block', - `eth1_data_deposit_root` FixedString(66) COMMENT 'The root of the deposit tree in the associated execution block', - `execution_payload_block_hash` FixedString(66) COMMENT 'The block hash of the execution payload', - `execution_payload_block_number` UInt32 COMMENT 'The block number of the execution payload', - `execution_payload_fee_recipient` String COMMENT 'The recipient of the fee for this execution payload', - `execution_payload_state_root` FixedString(66) COMMENT 'The state root of the execution payload', - `execution_payload_parent_hash` FixedString(66) COMMENT 'The parent hash of the execution payload', - `execution_payload_transactions_count` Nullable(UInt32) COMMENT 'The transaction count of the execution payload', - `execution_payload_transactions_total_bytes` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload', - `execution_payload_transactions_total_bytes_compressed` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload when compressed using snappy', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v2_beacon_block_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v2_beacon_block_local, - unique_key -); - -INSERT INTO - tmp.beacon_api_eth_v2_beacon_block -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - parent_root, - state_root - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - block_total_bytes, - block_total_bytes_compressed, - parent_root, - state_root, - proposer_index, - eth1_data_block_hash, - eth1_data_deposit_root, - execution_payload_block_hash, - execution_payload_block_number, - execution_payload_fee_recipient, - execution_payload_state_root, - execution_payload_parent_hash, - execution_payload_transactions_count, - execution_payload_transactions_total_bytes, - execution_payload_transactions_total_bytes_compressed, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v2_beacon_block_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v2_beacon_block_local -AND tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v2_beacon_block_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v2_beacon_block_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' SYNC; - --- beacon_block_classification -CREATE TABLE tmp.beacon_block_classification_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block classification', - `slot` UInt32 COMMENT 'The slot number from beacon block classification', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block classification' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `best_guess_single` LowCardinality(String) COMMENT 'The best guess of the client that generated the beacon block', - `best_guess_multi` LowCardinality(String) COMMENT 'The best guess of the clients that generated the beacon block. This value will typically equal the best_guess_single value, but when multiple clients have high probabilities, this value will have multiple eg. "prysm or lighthouse"', - `client_probability_uncertain` Float32 COMMENT 'The probability that the client that generated the beacon block is uncertain' CODEC(ZSTD(1)), - `client_probability_prysm` Float32 COMMENT 'The probability that the client that generated the beacon block is Prysm' CODEC(ZSTD(1)), - `client_probability_teku` Float32 COMMENT 'The probability that the client that generated the beacon block is Teku' CODEC(ZSTD(1)), - `client_probability_nimbus` Float32 COMMENT 'The probability that the client that generated the beacon block is Nimbus' CODEC(ZSTD(1)), - `client_probability_lodestar` Float32 COMMENT 'The probability that the client that generated the beacon block is Lodestar' CODEC(ZSTD(1)), - `client_probability_grandine` Float32 COMMENT 'The probability that the client that generated the beacon block is Grandine' CODEC(ZSTD(1)), - `client_probability_lighthouse` Float32 COMMENT 'The probability that the client that generated the beacon block is Lighthouse' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon block classification for a given slot. This is a best guess based on the client probabilities of the proposer. This is not guaranteed to be correct.'; - -CREATE TABLE tmp.beacon_block_classification ON CLUSTER '{cluster}' AS tmp.beacon_block_classification_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_block_classification_local, - unique_key -); - -INSERT INTO - tmp.beacon_block_classification -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - proposer_index - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - best_guess_single, - best_guess_multi, - client_probability_uncertain, - client_probability_prysm, - client_probability_teku, - client_probability_nimbus, - client_probability_lodestar, - client_probability_grandine, - client_probability_lighthouse, - proposer_index, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_block_classification_local; - -DROP TABLE IF EXISTS default.beacon_block_classification ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_block_classification_local -AND tmp.beacon_block_classification_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_block_classification ON CLUSTER '{cluster}' AS default.beacon_block_classification_local ENGINE = Distributed( - '{cluster}', - default, - beacon_block_classification_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_block_classification ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_block_classification_local ON CLUSTER '{cluster}' SYNC; - --- beacon_p2p_attestation -CREATE TABLE tmp.beacon_p2p_attestation_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node', - `slot` UInt32 COMMENT 'Slot number in the beacon P2P payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon P2P payload', - `attesting_validator_index` Nullable(UInt32) COMMENT 'The index of the validator attesting to the event' CODEC(ZSTD(1)), - `attesting_validator_committee_index` LowCardinality(String) COMMENT 'The committee index of the attesting validator', - `aggregation_bits` String COMMENT 'The aggregation bits of the event in the beacon P2P payload' CODEC(ZSTD(1)), - `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch` UInt32 COMMENT 'The source epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `target_epoch` UInt32 COMMENT 'The target epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), - `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `attestation_subnet` LowCardinality(String) COMMENT 'The attestation subnet the attestation was gossiped on', - `validated` Bool COMMENT 'Whether the attestation was validated by the client', - `peer_id` String COMMENT 'The originating peer ID for the gossiped data' CODEC(ZSTD(1)), - `peer_latency` UInt32 COMMENT 'The latency of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_version` LowCardinality(String) COMMENT 'Peer client version that gossiped the data', - `peer_version_major` LowCardinality(String) COMMENT 'Peer client major version that gossiped the data', - `peer_version_minor` LowCardinality(String) COMMENT 'Peer client minor version that gossiped the data', - `peer_version_patch` LowCardinality(String) COMMENT 'Peer client patch version that gossiped the data', - `peer_implementation` LowCardinality(String) COMMENT 'Peer client implementation that gossiped the data', - `peer_ip` Nullable(IPv6) COMMENT 'IP address of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_city` LowCardinality(String) COMMENT 'City of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_country` LowCardinality(String) COMMENT 'Country of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_country_code` LowCardinality(String) COMMENT 'Country code of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the peer that gossiped the data' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains beacon chain P2P "attestation" data'; - -CREATE TABLE tmp.beacon_p2p_attestation ON CLUSTER '{cluster}' AS tmp.beacon_p2p_attestation_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_p2p_attestation_local, - unique_key -); - -INSERT INTO - tmp.beacon_p2p_attestation -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - beacon_block_root, - source_root, - target_root, - attestation_subnet, - peer_id - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - committee_index, - attesting_validator_index, - attesting_validator_committee_index, - aggregation_bits, - beacon_block_root, - epoch, - epoch_start_date_time, - source_epoch, - source_epoch_start_date_time, - source_root, - target_epoch, - target_epoch_start_date_time, - target_root, - attestation_subnet, - validated, - peer_id, - peer_latency, - peer_version, - peer_version_major, - peer_version_minor, - peer_version_patch, - peer_implementation, - peer_ip, - peer_geo_city, - peer_geo_country, - peer_geo_country_code, - peer_geo_continent_code, - peer_geo_longitude, - peer_geo_latitude, - peer_geo_autonomous_system_number, - peer_geo_autonomous_system_organization, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_p2p_attestation_local; - -DROP TABLE IF EXISTS default.beacon_p2p_attestation ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_p2p_attestation_local -AND tmp.beacon_p2p_attestation_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_p2p_attestation ON CLUSTER '{cluster}' AS default.beacon_p2p_attestation_local ENGINE = Distributed( - '{cluster}', - default, - beacon_p2p_attestation_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.beacon_p2p_attestation ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_p2p_attestation_local ON CLUSTER '{cluster}' SYNC; - --- block_native_mempool_transaction -CREATE TABLE tmp.block_native_mempool_transaction_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `detecttime` DateTime64(3) COMMENT 'Timestamp that the transaction was detected in mempool' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'Unique identifier hash for a given transaction' CODEC(ZSTD(1)), - `status` LowCardinality(String) COMMENT 'Status of the transaction', - `region` LowCardinality(String) COMMENT 'The geographic region for the node that detected the transaction', - `reorg` Nullable(FixedString(66)) COMMENT 'If there was a reorg, refers to the blockhash of the reorg' CODEC(ZSTD(1)), - `replace` Nullable(FixedString(66)) COMMENT 'If the transaction was replaced (speedup/cancel), the transaction hash of the replacement' CODEC(ZSTD(1)), - `curblocknumber` Nullable(UInt64) COMMENT 'The block number the event was detected in' CODEC(ZSTD(1)), - `failurereason` Nullable(String) COMMENT 'If a transaction failed, this field provides contextual information' CODEC(ZSTD(1)), - `blockspending` Nullable(UInt64) COMMENT 'If a transaction was finalized (confirmed, failed), this refers to the number of blocks that the transaction was waiting to get on-chain' CODEC(ZSTD(1)), - `timepending` Nullable(UInt64) COMMENT 'If a transaction was finalized (confirmed, failed), this refers to the time in milliseconds that the transaction was waiting to get on-chain' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'A unique number which counts the number of transactions sent from a given address' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum number of gas units allowed for the transaction' CODEC(ZSTD(1)), - `gasprice` UInt128 COMMENT 'The price offered to the miner/validator per unit of gas. Denominated in wei' CODEC(ZSTD(1)), - `value` UInt128 COMMENT 'The amount of ETH transferred or sent to contract. Denominated in wei' CODEC(ZSTD(1)), - `toaddress` Nullable(FixedString(42)) COMMENT 'The destination of a given transaction' CODEC(ZSTD(1)), - `fromaddress` FixedString(42) COMMENT 'The source/initiator of a given transaction' CODEC(ZSTD(1)), - `datasize` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `data4bytes` Nullable(FixedString(10)) COMMENT 'The first 4 bytes of the call data of the transaction' CODEC(ZSTD(1)), - `network` LowCardinality(String) COMMENT 'The specific Ethereum network used', - `type` UInt8 COMMENT '"Post EIP-1559, this indicates how the gas parameters are submitted to the network: - type 0 - legacy - type 1 - usage of access lists according to EIP-2930 - type 2 - using maxpriorityfeepergas and maxfeepergas"' CODEC(ZSTD(1)), - `maxpriorityfeepergas` Nullable(UInt128) COMMENT 'The maximum value for a tip offered to the miner/validator per unit of gas. The actual tip paid can be lower if (maxfee - basefee) < maxpriorityfee. Denominated in wei' CODEC(ZSTD(1)), - `maxfeepergas` Nullable(UInt128) COMMENT 'The maximum value for the transaction fee (including basefee and tip) offered to the miner/validator per unit of gas. Denominated in wei' CODEC(ZSTD(1)), - `basefeepergas` Nullable(UInt128) COMMENT 'The fee per unit of gas paid and burned for the curblocknumber. This fee is algorithmically determined. Denominated in wei' CODEC(ZSTD(1)), - `dropreason` Nullable(String) COMMENT 'If the transaction was dropped from the mempool, this describes the contextual reason for the drop' CODEC(ZSTD(1)), - `rejectionreason` Nullable(String) COMMENT 'If the transaction was rejected from the mempool, this describes the contextual reason for the rejection' CODEC(ZSTD(1)), - `stuck` Bool COMMENT 'A transaction was detected in the queued area of the mempool and is not eligible for inclusion in a block' CODEC(ZSTD(1)), - `gasused` Nullable(UInt64) COMMENT 'If the transaction was published on-chain, this value indicates the amount of gas that was actually consumed. Denominated in wei' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(detecttime) -ORDER BY - ( - detecttime, - unique_key, - network - ) COMMENT 'Contains transactions from block native mempool dataset'; - -CREATE TABLE tmp.block_native_mempool_transaction ON CLUSTER '{cluster}' AS tmp.block_native_mempool_transaction_local ENGINE = Distributed( - '{cluster}', - tmp, - block_native_mempool_transaction_local, - unique_key -); - -INSERT INTO - tmp.block_native_mempool_transaction -SELECT - toInt64( - cityHash64( - detecttime, - network, - hash, - fromaddress, - nonce, - gas - ) - 9223372036854775808 - ), - NOW(), - detecttime, - hash, - status, - region, - reorg, - replace, - curblocknumber, - failurereason, - blockspending, - timepending, - nonce, - gas, - gasprice, - value, - toaddress, - fromaddress, - datasize, - data4bytes, - network, - type, - maxpriorityfeepergas, - maxfeepergas, - basefeepergas, - dropreason, - rejectionreason, - stuck, - gasused -FROM - default.block_native_mempool_transaction_local; - -DROP TABLE IF EXISTS default.block_native_mempool_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.block_native_mempool_transaction_local -AND tmp.block_native_mempool_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.block_native_mempool_transaction ON CLUSTER '{cluster}' AS default.block_native_mempool_transaction_local ENGINE = Distributed( - '{cluster}', - default, - block_native_mempool_transaction_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.block_native_mempool_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.block_native_mempool_transaction_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_blob_sidecar -CREATE TABLE tmp.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block' CODEC(ZSTD(1)), - `versioned_hash` FixedString(66) COMMENT 'The versioned hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `kzg_commitment` FixedString(98) COMMENT 'The KZG commitment in the blob sidecar payload' CODEC(ZSTD(1)), - `kzg_proof` FixedString(98) COMMENT 'The KZG proof in the blob sidecar payload' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), - `blob_index` UInt64 COMMENT 'The index of blob sidecar in the blob sidecar payload' CODEC(ZSTD(1)), - `blob_size` UInt32 COMMENT 'The total bytes of the blob' CODEC(ZSTD(1)), - `blob_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the blob in bytes' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains a blob sidecar from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' AS tmp.canonical_beacon_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_blob_sidecar_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_blob_sidecar -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - blob_index - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_parent_root, - versioned_hash, - kzg_commitment, - kzg_proof, - proposer_index, - blob_index, - blob_size, - blob_empty_size, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_blob_sidecar_local; - -DROP TABLE IF EXISTS default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_blob_sidecar_local -AND tmp.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' AS default.canonical_beacon_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_blob_sidecar_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_attester_slashing -CREATE TABLE tmp.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `attestation_1_attesting_indices` Array(UInt32) COMMENT 'The attesting indices from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_signature` String COMMENT 'The signature from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_data_beacon_block_root` FixedString(66) COMMENT 'The beacon block root from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_data_slot` UInt32 COMMENT 'The slot number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_1_data_index` UInt32 COMMENT 'The attestor index from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_data_source_epoch` UInt32 COMMENT 'The source epoch number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_1_data_source_root` FixedString(66) COMMENT 'The source root from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_data_target_epoch` UInt32 COMMENT 'The target epoch number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_1_data_target_root` FixedString(66) COMMENT 'The target root from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_attesting_indices` Array(UInt32) COMMENT 'The attesting indices from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_signature` String COMMENT 'The signature from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_data_beacon_block_root` FixedString(66) COMMENT 'The beacon block root from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_data_slot` UInt32 COMMENT 'The slot number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_2_data_index` UInt32 COMMENT 'The attestor index from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_data_source_epoch` UInt32 COMMENT 'The source epoch number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_2_data_source_root` FixedString(66) COMMENT 'The source root from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_data_target_epoch` UInt32 COMMENT 'The target epoch number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_2_data_target_root` FixedString(66) COMMENT 'The target root from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains attester slashing from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_attester_slashing_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_attester_slashing_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_block_attester_slashing -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - attestation_1_attesting_indices, - attestation_2_attesting_indices, - attestation_1_data_slot, - attestation_2_data_slot, - attestation_1_data_beacon_block_root, - attestation_2_data_beacon_block_root - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - attestation_1_attesting_indices, - attestation_1_signature, - attestation_1_data_beacon_block_root, - attestation_1_data_slot, - attestation_1_data_index, - attestation_1_data_source_epoch, - attestation_1_data_source_root, - attestation_1_data_target_epoch, - attestation_1_data_target_root, - attestation_2_attesting_indices, - attestation_2_signature, - attestation_2_data_beacon_block_root, - attestation_2_data_slot, - attestation_2_data_index, - attestation_2_data_source_epoch, - attestation_2_data_source_root, - attestation_2_data_target_epoch, - attestation_2_data_target_root, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_attester_slashing_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_attester_slashing_local -AND tmp.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' AS default.canonical_beacon_block_attester_slashing_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_attester_slashing_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_bls_to_execution_change -CREATE TABLE tmp.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `exchanging_message_validator_index` UInt32 COMMENT 'The validator index from the exchanging message' CODEC(ZSTD(1)), - `exchanging_message_from_bls_pubkey` String COMMENT 'The BLS public key from the exchanging message' CODEC(ZSTD(1)), - `exchanging_message_to_execution_address` FixedString(42) COMMENT 'The execution address from the exchanging message' CODEC(ZSTD(1)), - `exchanging_signature` String COMMENT 'The signature for the exchanging message' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains bls to execution change from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_bls_to_execution_change_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_bls_to_execution_change_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_block_bls_to_execution_change -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - exchanging_message_validator_index, - exchanging_message_from_bls_pubkey, - exchanging_message_to_execution_address - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - exchanging_message_validator_index, - exchanging_message_from_bls_pubkey, - exchanging_message_to_execution_address, - exchanging_signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_bls_to_execution_change_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_bls_to_execution_change_local -AND tmp.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' AS default.canonical_beacon_block_bls_to_execution_change_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_bls_to_execution_change_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_deposit -CREATE TABLE tmp.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `deposit_proof` Array(String) COMMENT 'The proof of the deposit data' CODEC(ZSTD(1)), - `deposit_data_pubkey` String COMMENT 'The BLS public key of the validator from the deposit data' CODEC(ZSTD(1)), - `deposit_data_withdrawal_credentials` FixedString(66) COMMENT 'The withdrawal credentials of the validator from the deposit data' CODEC(ZSTD(1)), - `deposit_data_amount` UInt128 COMMENT 'The amount of the deposit from the deposit data' CODEC(ZSTD(1)), - `deposit_data_signature` String COMMENT 'The signature of the deposit data' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains a deposit from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_deposit ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_deposit_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_deposit_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_block_deposit -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - deposit_data_pubkey, - deposit_proof - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - deposit_proof, - deposit_data_pubkey, - deposit_data_withdrawal_credentials, - deposit_data_amount, - deposit_data_signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_deposit_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_deposit_local -AND tmp.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' AS default.canonical_beacon_block_deposit_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_deposit_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_deposit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_execution_transaction -CREATE TABLE tmp.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `position` UInt32 COMMENT 'The position of the transaction in the beacon block' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), - `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), - `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), - `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), - `gas_tip_cap` Nullable(UInt128) COMMENT 'The priority fee (tip) the user has set for the transaction' CODEC(ZSTD(1)), - `gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), - `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), - `type` UInt8 COMMENT 'The type of the transaction' CODEC(ZSTD(1)), - `size` UInt32 COMMENT 'The size of the transaction data in bytes' CODEC(ZSTD(1)), - `call_data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `blob_gas` Nullable(UInt64) COMMENT 'The maximum gas provided for the blob transaction execution' CODEC(ZSTD(1)), - `blob_gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), - `blob_hashes` Array(String) COMMENT 'The hashes of the blob commitments for blob transactions' CODEC(ZSTD(1)), - `blob_sidecars_size` Nullable(UInt32) COMMENT 'The total size of the sidecars for blob transactions in bytes' CODEC(ZSTD(1)), - `blob_sidecars_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the sidecars for blob transactions in bytes' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains execution transaction from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_execution_transaction_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_execution_transaction_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_block_execution_transaction -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - position, - hash, - nonce - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - position, - hash, -from -, - to, - nonce, - gas_price, - gas, - gas_tip_cap, - gas_fee_cap, - value, - type, - size, - call_data_size, - blob_gas, - blob_gas_fee_cap, - blob_hashes, - blob_sidecars_size, - blob_sidecars_empty_size, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_execution_transaction_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_execution_transaction_local -AND tmp.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' AS default.canonical_beacon_block_execution_transaction_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_execution_transaction_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block -CREATE TABLE tmp.canonical_beacon_block_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `block_total_bytes` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload' CODEC(ZSTD(1)), - `block_total_bytes_compressed` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload when compressed using snappy' CODEC(ZSTD(1)), - `parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block' CODEC(ZSTD(1)), - `state_root` FixedString(66) COMMENT 'The root hash of the beacon state at this block' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), - `eth1_data_block_hash` FixedString(66) COMMENT 'The block hash of the associated execution block' CODEC(ZSTD(1)), - `eth1_data_deposit_root` FixedString(66) COMMENT 'The root of the deposit tree in the associated execution block' CODEC(ZSTD(1)), - `execution_payload_block_hash` FixedString(66) COMMENT 'The block hash of the execution payload' CODEC(ZSTD(1)), - `execution_payload_block_number` UInt32 COMMENT 'The block number of the execution payload' CODEC(DoubleDelta, ZSTD(1)), - `execution_payload_fee_recipient` String COMMENT 'The recipient of the fee for this execution payload' CODEC(ZSTD(1)), - `execution_payload_state_root` FixedString(66) COMMENT 'The state root of the execution payload' CODEC(ZSTD(1)), - `execution_payload_parent_hash` FixedString(66) COMMENT 'The parent hash of the execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_count` Nullable(UInt32) COMMENT 'The transaction count of the execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_total_bytes` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_total_bytes_compressed` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload when compressed using snappy' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains beacon block from a beacon node.'; - -CREATE TABLE tmp.canonical_beacon_block ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_block -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - block_total_bytes, - block_total_bytes_compressed, - parent_root, - state_root, - proposer_index, - eth1_data_block_hash, - eth1_data_deposit_root, - execution_payload_block_hash, - execution_payload_block_number, - execution_payload_fee_recipient, - execution_payload_state_root, - execution_payload_parent_hash, - execution_payload_transactions_count, - execution_payload_transactions_total_bytes, - execution_payload_transactions_total_bytes_compressed, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_local -AND tmp.canonical_beacon_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block ON CLUSTER '{cluster}' AS default.canonical_beacon_block_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_proposer_slashing -CREATE TABLE tmp.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `signed_header_1_message_slot` UInt32 COMMENT 'The slot number from the first signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `signed_header_1_message_proposer_index` UInt32 COMMENT 'The proposer index from the first signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `signed_header_1_message_body_root` FixedString(66) COMMENT 'The body root from the first signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_1_message_parent_root` FixedString(66) COMMENT 'The parent root from the first signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_1_message_state_root` FixedString(66) COMMENT 'The state root from the first signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_1_signature` String COMMENT 'The signature for the first signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_2_message_slot` UInt32 COMMENT 'The slot number from the second signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `signed_header_2_message_proposer_index` UInt32 COMMENT 'The proposer index from the second signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `signed_header_2_message_body_root` FixedString(66) COMMENT 'The body root from the second signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_2_message_parent_root` FixedString(66) COMMENT 'The parent root from the second signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_2_message_state_root` FixedString(66) COMMENT 'The state root from the second signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_2_signature` String COMMENT 'The signature for the second signed header in the slashing payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains proposer slashing from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_proposer_slashing_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_proposer_slashing_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_block_proposer_slashing -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - signed_header_1_message_slot, - signed_header_2_message_slot, - signed_header_1_message_proposer_index, - signed_header_2_message_proposer_index, - signed_header_1_message_body_root, - signed_header_2_message_body_root - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - signed_header_1_message_slot, - signed_header_1_message_proposer_index, - signed_header_1_message_body_root, - signed_header_1_message_parent_root, - signed_header_1_message_state_root, - signed_header_1_signature, - signed_header_2_message_slot, - signed_header_2_message_proposer_index, - signed_header_2_message_body_root, - signed_header_2_message_parent_root, - signed_header_2_message_state_root, - signed_header_2_signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_proposer_slashing_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_proposer_slashing_local -AND tmp.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' AS default.canonical_beacon_block_proposer_slashing_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_proposer_slashing_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_voluntary_exit -CREATE TABLE tmp.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `voluntary_exit_message_epoch` UInt32 COMMENT 'The epoch number from the exit message' CODEC(DoubleDelta, ZSTD(1)), - `voluntary_exit_message_validator_index` UInt32 COMMENT 'The validator index from the exit message' CODEC(ZSTD(1)), - `voluntary_exit_signature` String COMMENT 'The signature of the exit message' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains a voluntary exit from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_voluntary_exit_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_block_voluntary_exit -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - voluntary_exit_message_epoch, - voluntary_exit_message_validator_index - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - voluntary_exit_message_epoch, - voluntary_exit_message_validator_index, - voluntary_exit_signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_voluntary_exit_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_voluntary_exit_local -AND tmp.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' AS default.canonical_beacon_block_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_voluntary_exit_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_withdrawal -CREATE TABLE tmp.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `withdrawal_index` UInt32 COMMENT 'The index of the withdrawal' CODEC(ZSTD(1)), - `withdrawal_validator_index` UInt32 COMMENT 'The validator index from the withdrawal data' CODEC(ZSTD(1)), - `withdrawal_address` FixedString(42) COMMENT 'The address of the account that is the withdrawal recipient' CODEC(ZSTD(1)), - `withdrawal_amount` UInt128 COMMENT 'The amount of the withdrawal from the withdrawal data' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains a withdrawal from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_withdrawal_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_withdrawal_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_block_withdrawal -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - withdrawal_index, - withdrawal_validator_index - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - withdrawal_index, - withdrawal_validator_index, - withdrawal_address, - withdrawal_amount, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_withdrawal_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_withdrawal_local -AND tmp.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' AS default.canonical_beacon_block_withdrawal_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_withdrawal_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_elaborated_attestation -CREATE TABLE tmp.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the elaborated attestation from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `block_slot` UInt32 COMMENT 'The slot number of the block containing the attestation' CODEC(DoubleDelta, ZSTD(1)), - `block_slot_start_date_time` DateTime COMMENT 'The wall clock time when the block slot started' CODEC(DoubleDelta, ZSTD(1)), - `block_epoch` UInt32 COMMENT 'The epoch number of the block containing the attestation' CODEC(DoubleDelta, ZSTD(1)), - `block_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the block epoch started' CODEC(DoubleDelta, ZSTD(1)), - `position_in_block` UInt32 COMMENT 'The position of the attestation in the block' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root of the block containing the attestation' CODEC(ZSTD(1)), - `validators` Array(UInt32) COMMENT 'Array of validator indices participating in the attestation' CODEC(ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The index of the committee making the attestation', - `beacon_block_root` FixedString(66) COMMENT 'The root of the beacon block being attested to' CODEC(ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number being attested to' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), - `source_epoch` UInt32 COMMENT 'The source epoch referenced in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_root` FixedString(66) COMMENT 'The root of the source checkpoint in the attestation' CODEC(ZSTD(1)), - `target_epoch` UInt32 COMMENT 'The target epoch referenced in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), - `target_root` FixedString(66) COMMENT 'The root of the target checkpoint in the attestation' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains elaborated attestations from beacon blocks.'; - -CREATE TABLE tmp.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' AS tmp.canonical_beacon_elaborated_attestation_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_elaborated_attestation_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_elaborated_attestation -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - block_slot, - position_in_block, - beacon_block_root, - slot, - committee_index, - source_root, - target_root - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - block_slot, - block_slot_start_date_time, - block_epoch, - block_epoch_start_date_time, - position_in_block, - block_root, - validators, - committee_index, - beacon_block_root, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - source_epoch, - source_epoch_start_date_time, - source_root, - target_epoch, - target_epoch_start_date_time, - target_root, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_elaborated_attestation_local; - -DROP TABLE IF EXISTS default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_elaborated_attestation_local -AND tmp.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' AS default.canonical_beacon_elaborated_attestation_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_elaborated_attestation_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_proposer_duty -CREATE TABLE tmp.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the proposer duty information from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number for which the proposer duty is assigned' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number containing the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `proposer_validator_index` UInt32 COMMENT 'The validator index of the proposer for the slot' CODEC(ZSTD(1)), - `proposer_pubkey` String COMMENT 'The public key of the validator proposer' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the even' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name - ) COMMENT 'Contains a proposer duty from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' AS tmp.canonical_beacon_proposer_duty_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_proposer_duty_local, - unique_key -); - -INSERT INTO - tmp.canonical_beacon_proposer_duty -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - proposer_validator_index, - proposer_pubkey - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - proposer_validator_index, - proposer_pubkey, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_proposer_duty_local; - -DROP TABLE IF EXISTS default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_proposer_duty_local -AND tmp.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' AS default.canonical_beacon_proposer_duty_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_proposer_duty_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_add_peer -CREATE TABLE tmp.libp2p_add_peer_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `protocol` LowCardinality(String) COMMENT 'Protocol used by the peer', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains the details of the peers added to the libp2p client.'; - -CREATE TABLE tmp.libp2p_add_peer ON CLUSTER '{cluster}' AS tmp.libp2p_add_peer_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_add_peer_local, - unique_key -); - -INSERT INTO - tmp.libp2p_add_peer -SELECT - toInt64( - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - peer_id_unique_key, - protocol, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_add_peer_local; - -DROP TABLE IF EXISTS default.libp2p_add_peer ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_add_peer_local -AND tmp.libp2p_add_peer_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_add_peer ON CLUSTER '{cluster}' AS default.libp2p_add_peer_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_add_peer_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_add_peer ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_add_peer_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_connected -CREATE TABLE tmp.libp2p_connected_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `remote_peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the remote peer', - `remote_protocol` LowCardinality(String) COMMENT 'Protocol of the remote peer', - `remote_transport_protocol` LowCardinality(String) COMMENT 'Transport protocol of the remote peer', - `remote_port` UInt16 COMMENT 'Port of the remote peer' CODEC(ZSTD(1)), - `remote_ip` Nullable(IPv6) COMMENT 'IP address of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_city` LowCardinality(String) COMMENT 'City of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_country` LowCardinality(String) COMMENT 'Country of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_country_code` LowCardinality(String) COMMENT 'Country code of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_agent_implementation` LowCardinality(String) COMMENT 'Implementation of the remote peer', - `remote_agent_version` LowCardinality(String) COMMENT 'Version of the remote peer', - `remote_agent_version_major` LowCardinality(String) COMMENT 'Major version of the remote peer', - `remote_agent_version_minor` LowCardinality(String) COMMENT 'Minor version of the remote peer', - `remote_agent_version_patch` LowCardinality(String) COMMENT 'Patch version of the remote peer', - `remote_agent_platform` LowCardinality(String) COMMENT 'Platform of the remote peer', - `direction` LowCardinality(String) COMMENT 'Connection direction', - `opened` DateTime COMMENT 'Timestamp when the connection was opened' CODEC(DoubleDelta, ZSTD(1)), - `transient` Bool COMMENT 'Whether the connection is transient', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains the details of the CONNECTED events from the libp2p client.'; - -CREATE TABLE tmp.libp2p_connected ON CLUSTER '{cluster}' AS tmp.libp2p_connected_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_connected_local, - unique_key -); - -INSERT INTO - tmp.libp2p_connected -SELECT - toInt64( - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - direction, - opened - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - remote_peer_id_unique_key, - remote_protocol, - remote_transport_protocol, - remote_port, - remote_ip, - remote_geo_city, - remote_geo_country, - remote_geo_country_code, - remote_geo_continent_code, - remote_geo_longitude, - remote_geo_latitude, - remote_geo_autonomous_system_number, - remote_geo_autonomous_system_organization, - remote_agent_implementation, - remote_agent_version, - remote_agent_version_major, - remote_agent_version_minor, - remote_agent_version_patch, - remote_agent_platform, - direction, - opened, - transient, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_connected_local; - -DROP TABLE IF EXISTS default.libp2p_connected ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_connected_local -AND tmp.libp2p_connected_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_connected ON CLUSTER '{cluster}' AS default.libp2p_connected_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_connected_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_connected ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_connected_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_disconnected -CREATE TABLE tmp.libp2p_disconnected_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `remote_peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the remote peer', - `remote_protocol` LowCardinality(String) COMMENT 'Protocol of the remote peer', - `remote_transport_protocol` LowCardinality(String) COMMENT 'Transport protocol of the remote peer', - `remote_port` UInt16 COMMENT 'Port of the remote peer' CODEC(ZSTD(1)), - `remote_ip` Nullable(IPv6) COMMENT 'IP address of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_city` LowCardinality(String) COMMENT 'City of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_country` LowCardinality(String) COMMENT 'Country of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_country_code` LowCardinality(String) COMMENT 'Country code of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_agent_implementation` LowCardinality(String) COMMENT 'Implementation of the remote peer', - `remote_agent_version` LowCardinality(String) COMMENT 'Version of the remote peer', - `remote_agent_version_major` LowCardinality(String) COMMENT 'Major version of the remote peer', - `remote_agent_version_minor` LowCardinality(String) COMMENT 'Minor version of the remote peer', - `remote_agent_version_patch` LowCardinality(String) COMMENT 'Patch version of the remote peer', - `remote_agent_platform` LowCardinality(String) COMMENT 'Platform of the remote peer', - `direction` LowCardinality(String) COMMENT 'Connection direction', - `opened` DateTime COMMENT 'Timestamp when the connection was opened' CODEC(DoubleDelta, ZSTD(1)), - `transient` Bool COMMENT 'Whether the connection is transient', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains the details of the DISCONNECTED events from the libp2p client.'; - -CREATE TABLE tmp.libp2p_disconnected ON CLUSTER '{cluster}' AS tmp.libp2p_disconnected_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_disconnected_local, - unique_key -); - -INSERT INTO - tmp.libp2p_disconnected -SELECT - toInt64( - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - direction, - opened - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - remote_peer_id_unique_key, - remote_protocol, - remote_transport_protocol, - remote_port, - remote_ip, - remote_geo_city, - remote_geo_country, - remote_geo_country_code, - remote_geo_continent_code, - remote_geo_longitude, - remote_geo_latitude, - remote_geo_autonomous_system_number, - remote_geo_autonomous_system_organization, - remote_agent_implementation, - remote_agent_version, - remote_agent_version_major, - remote_agent_version_minor, - remote_agent_version_patch, - remote_agent_platform, - direction, - opened, - transient, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_disconnected_local; - -DROP TABLE IF EXISTS default.libp2p_disconnected ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_disconnected_local -AND tmp.libp2p_disconnected_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_disconnected ON CLUSTER '{cluster}' AS default.libp2p_disconnected_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_disconnected_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_disconnected ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_disconnected_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_gossipsub_beacon_attestation -CREATE TABLE tmp.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The committee index in the attestation', - `attesting_validator_index` Nullable(UInt32) COMMENT 'The index of the validator attesting to the event' CODEC(ZSTD(1)), - `attesting_validator_committee_index` LowCardinality(String) COMMENT 'The committee index of the attesting validator', - `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', - `aggregation_bits` String COMMENT 'The aggregation bits of the event in the attestation' CODEC(ZSTD(1)), - `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the attestation' CODEC(ZSTD(1)), - `source_epoch` UInt32 COMMENT 'The source epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the attestation' CODEC(ZSTD(1)), - `target_epoch` UInt32 COMMENT 'The target epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), - `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the attestation' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Network ID associated with the client' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Table for libp2p gossipsub beacon attestation data.'; - -CREATE TABLE tmp.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' AS tmp.libp2p_gossipsub_beacon_attestation_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_gossipsub_beacon_attestation_local, - unique_key -); - -INSERT INTO - tmp.libp2p_gossipsub_beacon_attestation -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - committee_index, - attesting_validator_index, - attesting_validator_committee_index, - wallclock_slot, - wallclock_slot_start_date_time, - wallclock_epoch, - wallclock_epoch_start_date_time, - propagation_slot_start_diff, - peer_id_unique_key, - message_id, - message_size, - topic_layer, - topic_fork_digest_value, - topic_name, - topic_encoding, - aggregation_bits, - beacon_block_root, - source_epoch, - source_epoch_start_date_time, - source_root, - target_epoch, - target_epoch_start_date_time, - target_root, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_gossipsub_beacon_attestation_local; - -DROP TABLE IF EXISTS default.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_gossipsub_beacon_attestation_local -AND tmp.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' AS default.libp2p_gossipsub_beacon_attestation_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_gossipsub_beacon_attestation_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_gossipsub_beacon_block -CREATE TABLE tmp.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), - `block` FixedString(66) COMMENT 'The beacon block root hash' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The proposer index of the beacon block' CODEC(ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Network ID associated with the client' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Table for libp2p gossipsub beacon block data.'; - -CREATE TABLE tmp.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' AS tmp.libp2p_gossipsub_beacon_block_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_gossipsub_beacon_block_local, - unique_key -); - -INSERT INTO - tmp.libp2p_gossipsub_beacon_block -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - wallclock_slot, - wallclock_slot_start_date_time, - wallclock_epoch, - wallclock_epoch_start_date_time, - propagation_slot_start_diff, - block, - proposer_index, - peer_id_unique_key, - message_id, - message_size, - topic_layer, - topic_fork_digest_value, - topic_name, - topic_encoding, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_gossipsub_beacon_block_local; - -DROP TABLE IF EXISTS default.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_gossipsub_beacon_block_local -AND tmp.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' AS default.libp2p_gossipsub_beacon_block_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_gossipsub_beacon_block_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_gossipsub_blob_sidecar -CREATE TABLE tmp.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The proposer index of the beacon block' CODEC(ZSTD(1)), - `blob_index` UInt32 COMMENT 'Blob index associated with the record' CODEC(ZSTD(1)), - `parent_root` FixedString(66) COMMENT 'Parent root of the beacon block' CODEC(ZSTD(1)), - `state_root` FixedString(66) COMMENT 'State root of the beacon block' CODEC(ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Network ID associated with the client' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Table for libp2p gossipsub blob sidecar data'; - -CREATE TABLE tmp.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' AS tmp.libp2p_gossipsub_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_gossipsub_blob_sidecar_local, - unique_key -); - -INSERT INTO - tmp.libp2p_gossipsub_blob_sidecar -SELECT - toInt64( - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - wallclock_slot, - wallclock_slot_start_date_time, - wallclock_epoch, - wallclock_epoch_start_date_time, - propagation_slot_start_diff, - proposer_index, - blob_index, - parent_root, - state_root, - peer_id_unique_key, - message_id, - message_size, - topic_layer, - topic_fork_digest_value, - topic_name, - topic_encoding, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_gossipsub_blob_sidecar_local; - -DROP TABLE IF EXISTS default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_gossipsub_blob_sidecar_local -AND tmp.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' AS default.libp2p_gossipsub_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_gossipsub_blob_sidecar_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_handle_metadata -CREATE TABLE tmp.libp2p_handle_metadata_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the RPC', - `error` Nullable(String) COMMENT 'Error message if the metadata handling failed' CODEC(ZSTD(1)), - `protocol` LowCardinality(String) COMMENT 'The protocol of the metadata handling event', - `attnets` String COMMENT 'Attestation subnets the peer is subscribed to' CODEC(ZSTD(1)), - `seq_number` UInt64 COMMENT 'Sequence number of the metadata' CODEC(DoubleDelta, ZSTD(1)), - `syncnets` String COMMENT 'Sync subnets the peer is subscribed to' CODEC(ZSTD(1)), - `latency_milliseconds` Decimal(10, 3) COMMENT 'How long it took to handle the metadata request in milliseconds' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains the metadata handling events for libp2p peers.'; - -CREATE TABLE tmp.libp2p_handle_metadata ON CLUSTER '{cluster}' AS tmp.libp2p_handle_metadata_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_handle_metadata_local, - unique_key -); - -INSERT INTO - tmp.libp2p_handle_metadata -SELECT - toInt64( - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - seq_number - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - peer_id_unique_key, - error, - protocol, - attnets, - seq_number, - syncnets, - latency_milliseconds, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_handle_metadata_local; - -DROP TABLE IF EXISTS default.libp2p_handle_metadata ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_handle_metadata_local -AND tmp.libp2p_handle_metadata_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_handle_metadata ON CLUSTER '{cluster}' AS default.libp2p_handle_metadata_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_handle_metadata_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_handle_metadata ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_handle_metadata_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_handle_status -CREATE TABLE tmp.libp2p_handle_status_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `error` Nullable(String) COMMENT 'Error message if the status handling failed' CODEC(ZSTD(1)), - `protocol` LowCardinality(String) COMMENT 'The protocol of the status handling event', - `request_finalized_epoch` Nullable(UInt32) COMMENT 'Requested finalized epoch' CODEC(DoubleDelta, ZSTD(1)), - `request_finalized_root` Nullable(String) COMMENT 'Requested finalized root', - `request_fork_digest` LowCardinality(String) COMMENT 'Requested fork digest', - `request_head_root` Nullable(FixedString(66)) COMMENT 'Requested head root' CODEC(ZSTD(1)), - `request_head_slot` Nullable(UInt32) COMMENT 'Requested head slot' CODEC(ZSTD(1)), - `response_finalized_epoch` Nullable(UInt32) COMMENT 'Response finalized epoch' CODEC(DoubleDelta, ZSTD(1)), - `response_finalized_root` Nullable(FixedString(66)) COMMENT 'Response finalized root' CODEC(ZSTD(1)), - `response_fork_digest` LowCardinality(String) COMMENT 'Response fork digest', - `response_head_root` Nullable(FixedString(66)) COMMENT 'Response head root' CODEC(ZSTD(1)), - `response_head_slot` Nullable(UInt32) COMMENT 'Response head slot' CODEC(DoubleDelta, ZSTD(1)), - `latency_milliseconds` Decimal(10, 3) COMMENT 'How long it took to handle the status request in milliseconds' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(event_date_time) -ORDER BY - ( - event_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains the status handling events for libp2p peers.'; - -CREATE TABLE tmp.libp2p_handle_status ON CLUSTER '{cluster}' AS tmp.libp2p_handle_status_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_handle_status_local, - unique_key -); - -INSERT INTO - tmp.libp2p_handle_status -SELECT - toInt64( - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - peer_id_unique_key, - error, - protocol, - request_finalized_epoch, - request_finalized_root, - request_fork_digest, - request_head_root, - request_head_slot, - response_finalized_epoch, - response_finalized_root, - response_fork_digest, - response_head_root, - response_head_slot, - latency_milliseconds, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_handle_status_local; - -DROP TABLE IF EXISTS default.libp2p_handle_status ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_handle_status_local -AND tmp.libp2p_handle_status_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_handle_status ON CLUSTER '{cluster}' AS default.libp2p_handle_status_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_handle_status_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_handle_status ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_handle_status_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_join -CREATE TABLE tmp.libp2p_join_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer that joined the topic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains the details of the JOIN events from the libp2p client.'; - -CREATE TABLE tmp.libp2p_join ON CLUSTER '{cluster}' AS tmp.libp2p_join_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_join_local, - unique_key -); - -INSERT INTO - tmp.libp2p_join -SELECT - toInt64( - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - topic_layer, - topic_fork_digest_value, - topic_name, - topic_encoding, - peer_id_unique_key, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_join_local; - -DROP TABLE IF EXISTS default.libp2p_join ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_join_local -AND tmp.libp2p_join_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_join ON CLUSTER '{cluster}' AS default.libp2p_join_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_join_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_join ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_join_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_remove_peer -CREATE TABLE tmp.libp2p_remove_peer_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Contains the details of the peers removed from the libp2p client.'; - -CREATE TABLE tmp.libp2p_remove_peer ON CLUSTER '{cluster}' AS tmp.libp2p_remove_peer_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_remove_peer_local, - unique_key -); - -INSERT INTO - tmp.libp2p_remove_peer -SELECT - toInt64( - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - peer_id_unique_key, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_remove_peer_local; - -DROP TABLE IF EXISTS default.libp2p_remove_peer ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_remove_peer_local -AND tmp.libp2p_remove_peer_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_remove_peer ON CLUSTER '{cluster}' AS default.libp2p_remove_peer_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_remove_peer_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.libp2p_remove_peer ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_remove_peer_local ON CLUSTER '{cluster}' SYNC; - --- mempool_dumpster_transaction -CREATE TABLE tmp.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'When this row was last updated, this is outside the source data and used for deduplication' CODEC(DoubleDelta, ZSTD(1)), - `timestamp` DateTime64(3) COMMENT 'Timestamp of the transaction' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), - `chain_id` UInt32 COMMENT 'The chain id of the transaction' CODEC(ZSTD(1)), - `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), - `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), - `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), - `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), - `gas_tip_cap` Nullable(UInt128) COMMENT 'The gas tip cap of the transaction in wei' CODEC(ZSTD(1)), - `gas_fee_cap` Nullable(UInt128) COMMENT 'The gas fee cap of the transaction in wei' CODEC(ZSTD(1)), - `data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `data_4bytes` Nullable(FixedString(10)) COMMENT 'The first 4 bytes of the call data of the transaction' CODEC(ZSTD(1)), - `sources` Array(LowCardinality(String)) COMMENT 'The sources that saw this transaction in their mempool', - `included_at_block_height` Nullable(UInt64) COMMENT 'The block height at which this transaction was included' CODEC(ZSTD(1)), - `included_block_timestamp` Nullable(DateTime64(3)) COMMENT 'The timestamp of the block at which this transaction was included' CODEC(DoubleDelta, ZSTD(1)), - `inclusion_delay_ms` Nullable(Int64) COMMENT 'The delay between the transaction timestamp and the block timestamp' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(timestamp) -ORDER BY - ( - timestamp, - unique_key, - chain_id - ) COMMENT 'Contains transactions from mempool dumpster dataset. Following the parquet schema with some additions'; - -CREATE TABLE tmp.mempool_dumpster_transaction ON CLUSTER '{cluster}' AS tmp.mempool_dumpster_transaction_local ENGINE = Distributed( - '{cluster}', - tmp, - mempool_dumpster_transaction_local, - unique_key -); - -INSERT INTO - tmp.mempool_dumpster_transaction -SELECT - toInt64( - cityHash64( - timestamp, - chain_id, - `from`, - nonce, - gas - ) - 9223372036854775808 - ), - NOW(), - timestamp, - hash, - chain_id, - `from`, - to, - value, - nonce, - gas, - gas_price, - gas_tip_cap, - gas_fee_cap, - data_size, - data_4bytes, - sources, - included_at_block_height, - included_block_timestamp, - inclusion_delay_ms -FROM - default.mempool_dumpster_transaction_local; - -DROP TABLE IF EXISTS default.mempool_dumpster_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.mempool_dumpster_transaction_local -AND tmp.mempool_dumpster_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.mempool_dumpster_transaction ON CLUSTER '{cluster}' AS default.mempool_dumpster_transaction_local ENGINE = Distributed( - '{cluster}', - default, - mempool_dumpster_transaction_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.mempool_dumpster_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' SYNC; - --- mempool_transaction -CREATE TABLE tmp.mempool_transaction_local ON CLUSTER '{cluster}' ( - `unique_key` Int64 COMMENT 'Unique identifier for each record', - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'The time when the sentry saw the transaction in the mempool' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), - `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), - `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), - `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), - `gas_tip_cap` Nullable(UInt128) COMMENT 'The priority fee (tip) the user has set for the transaction', - `gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction', - `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), - `type` Nullable(UInt8) COMMENT 'The type of the transaction', - `size` UInt32 COMMENT 'The size of the transaction data in bytes' CODEC(ZSTD(1)), - `call_data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `blob_gas` Nullable(UInt64) COMMENT 'The maximum gas provided for the blob transaction execution', - `blob_gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction', - `blob_hashes` Array(String) COMMENT 'The hashes of the blob commitments for blob transactions', - `blob_sidecars_size` Nullable(UInt32) COMMENT 'The total size of the sidecars for blob transactions in bytes', - `blob_sidecars_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the sidecars for blob transactions in bytes', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_execution_fork_id_hash` LowCardinality(String) COMMENT 'The hash of the fork ID of the current Ethereum network', - `meta_execution_fork_id_next` LowCardinality(String) COMMENT 'The fork ID of the next planned Ethereum network upgrade', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(event_date_time) -ORDER BY - ( - event_date_time, - unique_key, - meta_network_name, - meta_client_name - ) COMMENT 'Each row represents a transaction that was seen in the mempool by a sentry client. Sentries can report the same transaction multiple times if it has been long enough since the last report.'; - -CREATE TABLE tmp.mempool_transaction ON CLUSTER '{cluster}' AS tmp.mempool_transaction_local ENGINE = Distributed( - '{cluster}', - tmp, - mempool_transaction_local, - unique_key -); - -INSERT INTO - tmp.mempool_transaction -SELECT - toInt64( - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - hash, - `from`, - nonce, - gas - ) - 9223372036854775808 - ), - NOW(), - event_date_time, - hash, - `from`, - to, - nonce, - gas_price, - gas, - gas_tip_cap, - gas_fee_cap, - value, - type, - size, - call_data_size, - blob_gas, - blob_gas_fee_cap, - blob_hashes, - blob_sidecars_size, - blob_sidecars_empty_size, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_execution_fork_id_hash, - meta_execution_fork_id_next, - meta_labels -FROM - default.mempool_transaction_local; - -DROP TABLE IF EXISTS default.mempool_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.mempool_transaction_local -AND tmp.mempool_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.mempool_transaction ON CLUSTER '{cluster}' AS default.mempool_transaction_local ENGINE = Distributed( - '{cluster}', - default, - mempool_transaction_local, - unique_key -); - -DROP TABLE IF EXISTS tmp.mempool_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.mempool_transaction_local ON CLUSTER '{cluster}' SYNC; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/041_remove_unique_field.up.sql b/deploy/migrations/clickhouse/041_remove_unique_field.up.sql deleted file mode 100644 index 62cff2a1c..000000000 --- a/deploy/migrations/clickhouse/041_remove_unique_field.up.sql +++ /dev/null @@ -1,4780 +0,0 @@ --- beacon_api_eth_v1_beacon_committee -CREATE TABLE tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API committee payload', - `validators` Array(UInt32) COMMENT 'The validator indices in the beacon API committee payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - ) COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_beacon_committee_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_beacon_committee_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_beacon_committee -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - committee_index, - validators, - epoch, - epoch_start_date_time, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_beacon_committee_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_beacon_committee_local -AND tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_beacon_committee_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_beacon_committee_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_blob_sidecar -CREATE TABLE tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `blob_index` UInt64 COMMENT 'The index of blob sidecar in the beacon API event stream payload' CODEC(ZSTD(1)), - `kzg_commitment` FixedString(98) COMMENT 'The KZG commitment in the beacon API event stream payload' CODEC(ZSTD(1)), - `versioned_hash` FixedString(66) COMMENT 'The versioned hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - blob_index - ) COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_blob_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - blob_index - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_blob_sidecar -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - epoch, - epoch_start_date_time, - block_root, - blob_index, - kzg_commitment, - versioned_hash, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_blob_sidecar_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_blob_sidecar_local -AND tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_blob_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - blob_index - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_block -CREATE TABLE tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `block` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `execution_optimistic` Bool COMMENT 'If the attached beacon node is running in execution optimistic mode', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - block - ) COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_block_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_block_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_block -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - block, - epoch, - epoch_start_date_time, - execution_optimistic, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_block_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_block_local -AND tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_block_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_block_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_chain_reorg -CREATE TABLE tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `slot` UInt32 COMMENT 'The slot number of the chain reorg event in the beacon API event stream payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the reorg slot started', - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slots between when the reorg occurred and when the sentry received the event', - `depth` UInt16 COMMENT 'The depth of the chain reorg in the beacon API event stream payload', - `old_head_block` FixedString(66) COMMENT 'The old head block root hash in the beacon API event stream payload', - `new_head_block` FixedString(66) COMMENT 'The new head block root hash in the beacon API event stream payload', - `old_head_state` FixedString(66) COMMENT 'The old head state root hash in the beacon API event stream payload', - `new_head_state` FixedString(66) COMMENT 'The new head state root hash in the beacon API event stream payload', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `execution_optimistic` Bool COMMENT 'Whether the execution of the epoch was optimistic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - old_head_block, - new_head_block - ) COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_chain_reorg_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_chain_reorg_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - old_head_block, - new_head_block - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_chain_reorg -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - depth, - old_head_block, - new_head_block, - old_head_state, - new_head_state, - epoch, - epoch_start_date_time, - execution_optimistic, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_chain_reorg_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_chain_reorg_local -AND tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_chain_reorg_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_chain_reorg_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - old_head_block, - new_head_block - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_contribution_and_proof -CREATE TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `aggregator_index` UInt32 COMMENT 'The validator index of the aggregator in the beacon API event stream payload', - `contribution_slot` UInt32 COMMENT 'The slot number of the contribution in the beacon API event stream payload', - `contribution_slot_start_date_time` DateTime COMMENT 'The wall clock time when the contribution slot started', - `contribution_propagation_slot_start_diff` UInt32 COMMENT 'Difference in slots between when the contribution occurred and when the sentry received the event', - `contribution_beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload', - `contribution_subcommittee_index` LowCardinality(String) COMMENT 'The subcommittee index of the contribution in the beacon API event stream payload', - `contribution_aggregation_bits` String COMMENT 'The aggregation bits of the contribution in the beacon API event stream payload', - `contribution_signature` String COMMENT 'The signature of the contribution in the beacon API event stream payload', - `contribution_epoch` UInt32 COMMENT 'The epoch number of the contribution in the beacon API event stream payload', - `contribution_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the contribution epoch started', - `selection_proof` String COMMENT 'The selection proof in the beacon API event stream payload', - `signature` String COMMENT 'The signature in the beacon API event stream payload', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(contribution_slot_start_date_time) -ORDER BY - ( - contribution_slot_start_date_time, - meta_network_name, - meta_client_name, - contribution_beacon_block_root, - contribution_subcommittee_index, - signature - ) COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_contribution_and_proof_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_contribution_and_proof_local, - cityHash64( - contribution_slot_start_date_time, - meta_network_name, - meta_client_name, - contribution_beacon_block_root, - contribution_subcommittee_index, - signature - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_contribution_and_proof -SELECT - NOW(), - event_date_time, - aggregator_index, - contribution_slot, - contribution_slot_start_date_time, - contribution_propagation_slot_start_diff, - contribution_beacon_block_root, - contribution_subcommittee_index, - contribution_aggregation_bits, - contribution_signature, - contribution_epoch, - contribution_epoch_start_date_time, - selection_proof, - signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_contribution_and_proof_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_contribution_and_proof_local -AND tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_contribution_and_proof_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_contribution_and_proof_local, - cityHash64( - contribution_slot_start_date_time, - meta_network_name, - meta_client_name, - contribution_beacon_block_root, - contribution_subcommittee_index, - signature - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_finalized_checkpoint -CREATE TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `block` FixedString(66) COMMENT 'The finalized block root hash in the beacon API event stream payload', - `state` FixedString(66) COMMENT 'The finalized state root hash in the beacon API event stream payload', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `execution_optimistic` Bool COMMENT 'Whether the execution of the epoch was optimistic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY - ( - epoch_start_date_time, - meta_network_name, - meta_client_name, - block, - state - ) COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_finalized_checkpoint_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - meta_client_name, - block, - state - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_finalized_checkpoint -SELECT - NOW(), - event_date_time, - block, - state, - epoch, - epoch_start_date_time, - execution_optimistic, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_finalized_checkpoint_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_finalized_checkpoint_local -AND tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_finalized_checkpoint_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_finalized_checkpoint_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - meta_client_name, - block, - state - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_head -CREATE TABLE tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time', - `block` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `epoch_transition` Bool COMMENT 'If the event is an epoch transition', - `execution_optimistic` Bool COMMENT 'If the attached beacon node is running in execution optimistic mode', - `previous_duty_dependent_root` FixedString(66) COMMENT 'The previous duty dependent root in the beacon API event stream payload', - `current_duty_dependent_root` FixedString(66) COMMENT 'The current duty dependent root in the beacon API event stream payload', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - block, - previous_duty_dependent_root, - current_duty_dependent_root - ) COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_head_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_head_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block, - previous_duty_dependent_root, - current_duty_dependent_root - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_head -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - block, - epoch, - epoch_start_date_time, - epoch_transition, - execution_optimistic, - previous_duty_dependent_root, - current_duty_dependent_root, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_head_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_head_local -AND tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_head_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_head_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block, - previous_duty_dependent_root, - current_duty_dependent_root - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_events_voluntary_exit -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `validator_index` UInt32 COMMENT 'The index of the validator making the voluntary exit', - `signature` String COMMENT 'The signature of the voluntary exit in the beacon API event stream payload', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY - ( - epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_voluntary_exit_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_voluntary_exit -SELECT - NOW(), - event_date_time, - epoch, - epoch_start_date_time, - validator_index, - signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_voluntary_exit_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_voluntary_exit_local -AND tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_voluntary_exit_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_proposer_duty -CREATE TABLE tmp.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `proposer_validator_index` UInt32 COMMENT 'The validator index from the proposer duty payload' CODEC(ZSTD(1)), - `proposer_pubkey` String COMMENT 'The BLS public key of the validator from the proposer duty payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - proposer_validator_index - ) COMMENT 'Contains a proposer duty from a beacon block.'; - -CREATE TABLE tmp.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_proposer_duty_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_proposer_duty_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - proposer_validator_index - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_proposer_duty -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - proposer_validator_index, - proposer_pubkey, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_proposer_duty_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_proposer_duty_local -AND tmp.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_proposer_duty_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_proposer_duty_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - proposer_validator_index - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v1_validator_attestation_data -CREATE TABLE tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `slot` UInt32 COMMENT 'Slot number in the beacon API validator attestation data payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', - `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API validator attestation data payload', - `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API validator attestation data payload', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API validator attestation data payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `source_epoch` UInt32 COMMENT 'The source epoch number in the beacon API validator attestation data payload', - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started', - `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the beacon API validator attestation data payload', - `target_epoch` UInt32 COMMENT 'The target epoch number in the beacon API validator attestation data payload', - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started', - `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the beacon API validator attestation data payload', - `request_date_time` DateTime COMMENT 'When the request was sent to the beacon node', - `request_duration` UInt32 COMMENT 'The request duration in milliseconds', - `request_slot_start_diff` UInt32 COMMENT 'The difference between the request_date_time and the slot_start_date_time', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - beacon_block_root, - source_root, - target_root - ) COMMENT 'Contains beacon API validator attestation data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_validator_attestation_data_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_validator_attestation_data_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - beacon_block_root, - source_root, - target_root - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_validator_attestation_data -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - committee_index, - beacon_block_root, - epoch, - epoch_start_date_time, - source_epoch, - source_epoch_start_date_time, - source_root, - target_epoch, - target_epoch_start_date_time, - target_root, - request_date_time, - request_duration, - request_slot_start_diff, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_validator_attestation_data_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_validator_attestation_data_local -AND tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_validator_attestation_data_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_validator_attestation_data_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - beacon_block_root, - source_root, - target_root - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' SYNC; - --- beacon_api_eth_v2_beacon_block -CREATE TABLE tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry fetched the beacon block from a beacon node', - `slot` UInt32 COMMENT 'The slot number from beacon block payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the reorg slot started', - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block', - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `block_total_bytes` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload', - `block_total_bytes_compressed` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload when compressed using snappy', - `parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block', - `state_root` FixedString(66) COMMENT 'The root hash of the beacon state at this block', - `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block', - `eth1_data_block_hash` FixedString(66) COMMENT 'The block hash of the associated execution block', - `eth1_data_deposit_root` FixedString(66) COMMENT 'The root of the deposit tree in the associated execution block', - `execution_payload_block_hash` FixedString(66) COMMENT 'The block hash of the execution payload', - `execution_payload_block_number` UInt32 COMMENT 'The block number of the execution payload', - `execution_payload_fee_recipient` String COMMENT 'The recipient of the fee for this execution payload', - `execution_payload_state_root` FixedString(66) COMMENT 'The state root of the execution payload', - `execution_payload_parent_hash` FixedString(66) COMMENT 'The parent hash of the execution payload', - `execution_payload_transactions_count` Nullable(UInt32) COMMENT 'The transaction count of the execution payload', - `execution_payload_transactions_total_bytes` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload', - `execution_payload_transactions_total_bytes_compressed` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload when compressed using snappy', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - parent_root, - state_root - ) COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v2_beacon_block_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v2_beacon_block_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - parent_root, - state_root - ) -); - -INSERT INTO - tmp.beacon_api_eth_v2_beacon_block -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - block_total_bytes, - block_total_bytes_compressed, - parent_root, - state_root, - proposer_index, - eth1_data_block_hash, - eth1_data_deposit_root, - execution_payload_block_hash, - execution_payload_block_number, - execution_payload_fee_recipient, - execution_payload_state_root, - execution_payload_parent_hash, - execution_payload_transactions_count, - execution_payload_transactions_total_bytes, - execution_payload_transactions_total_bytes_compressed, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v2_beacon_block_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v2_beacon_block_local -AND tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v2_beacon_block_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v2_beacon_block_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - parent_root, - state_root - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' SYNC; - --- beacon_block_classification -CREATE TABLE tmp.beacon_block_classification_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block classification', - `slot` UInt32 COMMENT 'The slot number from beacon block classification', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block classification' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `best_guess_single` LowCardinality(String) COMMENT 'The best guess of the client that generated the beacon block', - `best_guess_multi` LowCardinality(String) COMMENT 'The best guess of the clients that generated the beacon block. This value will typically equal the best_guess_single value, but when multiple clients have high probabilities, this value will have multiple eg. "prysm or lighthouse"', - `client_probability_uncertain` Float32 COMMENT 'The probability that the client that generated the beacon block is uncertain' CODEC(ZSTD(1)), - `client_probability_prysm` Float32 COMMENT 'The probability that the client that generated the beacon block is Prysm' CODEC(ZSTD(1)), - `client_probability_teku` Float32 COMMENT 'The probability that the client that generated the beacon block is Teku' CODEC(ZSTD(1)), - `client_probability_nimbus` Float32 COMMENT 'The probability that the client that generated the beacon block is Nimbus' CODEC(ZSTD(1)), - `client_probability_lodestar` Float32 COMMENT 'The probability that the client that generated the beacon block is Lodestar' CODEC(ZSTD(1)), - `client_probability_grandine` Float32 COMMENT 'The probability that the client that generated the beacon block is Grandine' CODEC(ZSTD(1)), - `client_probability_lighthouse` Float32 COMMENT 'The probability that the client that generated the beacon block is Lighthouse' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - proposer_index - ) COMMENT 'Contains beacon block classification for a given slot. This is a best guess based on the client probabilities of the proposer. This is not guaranteed to be correct.'; - -CREATE TABLE tmp.beacon_block_classification ON CLUSTER '{cluster}' AS tmp.beacon_block_classification_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_block_classification_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - proposer_index - ) -); - -INSERT INTO - tmp.beacon_block_classification -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - best_guess_single, - best_guess_multi, - client_probability_uncertain, - client_probability_prysm, - client_probability_teku, - client_probability_nimbus, - client_probability_lodestar, - client_probability_grandine, - client_probability_lighthouse, - proposer_index, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_block_classification_local; - -DROP TABLE IF EXISTS default.beacon_block_classification ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_block_classification_local -AND tmp.beacon_block_classification_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_block_classification ON CLUSTER '{cluster}' AS default.beacon_block_classification_local ENGINE = Distributed( - '{cluster}', - default, - beacon_block_classification_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - proposer_index - ) -); - -DROP TABLE IF EXISTS tmp.beacon_block_classification ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_block_classification_local ON CLUSTER '{cluster}' SYNC; - --- beacon_p2p_attestation -CREATE TABLE tmp.beacon_p2p_attestation_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node', - `slot` UInt32 COMMENT 'Slot number in the beacon P2P payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon P2P payload', - `attesting_validator_index` Nullable(UInt32) COMMENT 'The index of the validator attesting to the event' CODEC(ZSTD(1)), - `attesting_validator_committee_index` LowCardinality(String) COMMENT 'The committee index of the attesting validator', - `aggregation_bits` String COMMENT 'The aggregation bits of the event in the beacon P2P payload' CODEC(ZSTD(1)), - `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch` UInt32 COMMENT 'The source epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `target_epoch` UInt32 COMMENT 'The target epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), - `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `attestation_subnet` LowCardinality(String) COMMENT 'The attestation subnet the attestation was gossiped on', - `validated` Bool COMMENT 'Whether the attestation was validated by the client', - `peer_id` String COMMENT 'The originating peer ID for the gossiped data' CODEC(ZSTD(1)), - `peer_latency` UInt32 COMMENT 'The latency of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_version` LowCardinality(String) COMMENT 'Peer client version that gossiped the data', - `peer_version_major` LowCardinality(String) COMMENT 'Peer client major version that gossiped the data', - `peer_version_minor` LowCardinality(String) COMMENT 'Peer client minor version that gossiped the data', - `peer_version_patch` LowCardinality(String) COMMENT 'Peer client patch version that gossiped the data', - `peer_implementation` LowCardinality(String) COMMENT 'Peer client implementation that gossiped the data', - `peer_ip` Nullable(IPv6) COMMENT 'IP address of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_city` LowCardinality(String) COMMENT 'City of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_country` LowCardinality(String) COMMENT 'Country of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_country_code` LowCardinality(String) COMMENT 'Country code of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the peer that gossiped the data' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - aggregation_bits, - beacon_block_root, - source_root, - target_root, - attestation_subnet, - peer_id - ) COMMENT 'Contains beacon chain P2P "attestation" data'; - -CREATE TABLE tmp.beacon_p2p_attestation ON CLUSTER '{cluster}' AS tmp.beacon_p2p_attestation_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_p2p_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - aggregation_bits, - beacon_block_root, - source_root, - target_root, - attestation_subnet, - peer_id - ) -); - -INSERT INTO - tmp.beacon_p2p_attestation -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - propagation_slot_start_diff, - committee_index, - attesting_validator_index, - attesting_validator_committee_index, - aggregation_bits, - beacon_block_root, - epoch, - epoch_start_date_time, - source_epoch, - source_epoch_start_date_time, - source_root, - target_epoch, - target_epoch_start_date_time, - target_root, - attestation_subnet, - validated, - peer_id, - peer_latency, - peer_version, - peer_version_major, - peer_version_minor, - peer_version_patch, - peer_implementation, - peer_ip, - peer_geo_city, - peer_geo_country, - peer_geo_country_code, - peer_geo_continent_code, - peer_geo_longitude, - peer_geo_latitude, - peer_geo_autonomous_system_number, - peer_geo_autonomous_system_organization, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_p2p_attestation_local; - -DROP TABLE IF EXISTS default.beacon_p2p_attestation ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_p2p_attestation_local -AND tmp.beacon_p2p_attestation_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_p2p_attestation ON CLUSTER '{cluster}' AS default.beacon_p2p_attestation_local ENGINE = Distributed( - '{cluster}', - default, - beacon_p2p_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - aggregation_bits, - beacon_block_root, - source_root, - target_root, - attestation_subnet, - peer_id - ) -); - -DROP TABLE IF EXISTS tmp.beacon_p2p_attestation ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_p2p_attestation_local ON CLUSTER '{cluster}' SYNC; - --- block_native_mempool_transaction -CREATE TABLE tmp.block_native_mempool_transaction_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `detecttime` DateTime64(3) COMMENT 'Timestamp that the transaction was detected in mempool' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'Unique identifier hash for a given transaction' CODEC(ZSTD(1)), - `status` LowCardinality(String) COMMENT 'Status of the transaction', - `region` LowCardinality(String) COMMENT 'The geographic region for the node that detected the transaction', - `reorg` Nullable(FixedString(66)) COMMENT 'If there was a reorg, refers to the blockhash of the reorg' CODEC(ZSTD(1)), - `replace` Nullable(FixedString(66)) COMMENT 'If the transaction was replaced (speedup/cancel), the transaction hash of the replacement' CODEC(ZSTD(1)), - `curblocknumber` Nullable(UInt64) COMMENT 'The block number the event was detected in' CODEC(ZSTD(1)), - `failurereason` Nullable(String) COMMENT 'If a transaction failed, this field provides contextual information' CODEC(ZSTD(1)), - `blockspending` Nullable(UInt64) COMMENT 'If a transaction was finalized (confirmed, failed), this refers to the number of blocks that the transaction was waiting to get on-chain' CODEC(ZSTD(1)), - `timepending` Nullable(UInt64) COMMENT 'If a transaction was finalized (confirmed, failed), this refers to the time in milliseconds that the transaction was waiting to get on-chain' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'A unique number which counts the number of transactions sent from a given address' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum number of gas units allowed for the transaction' CODEC(ZSTD(1)), - `gasprice` UInt128 COMMENT 'The price offered to the miner/validator per unit of gas. Denominated in wei' CODEC(ZSTD(1)), - `value` UInt128 COMMENT 'The amount of ETH transferred or sent to contract. Denominated in wei' CODEC(ZSTD(1)), - `toaddress` Nullable(FixedString(42)) COMMENT 'The destination of a given transaction' CODEC(ZSTD(1)), - `fromaddress` FixedString(42) COMMENT 'The source/initiator of a given transaction' CODEC(ZSTD(1)), - `datasize` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `data4bytes` Nullable(FixedString(10)) COMMENT 'The first 4 bytes of the call data of the transaction' CODEC(ZSTD(1)), - `network` LowCardinality(String) COMMENT 'The specific Ethereum network used', - `type` UInt8 COMMENT '"Post EIP-1559, this indicates how the gas parameters are submitted to the network: - type 0 - legacy - type 1 - usage of access lists according to EIP-2930 - type 2 - using maxpriorityfeepergas and maxfeepergas"' CODEC(ZSTD(1)), - `maxpriorityfeepergas` Nullable(UInt128) COMMENT 'The maximum value for a tip offered to the miner/validator per unit of gas. The actual tip paid can be lower if (maxfee - basefee) < maxpriorityfee. Denominated in wei' CODEC(ZSTD(1)), - `maxfeepergas` Nullable(UInt128) COMMENT 'The maximum value for the transaction fee (including basefee and tip) offered to the miner/validator per unit of gas. Denominated in wei' CODEC(ZSTD(1)), - `basefeepergas` Nullable(UInt128) COMMENT 'The fee per unit of gas paid and burned for the curblocknumber. This fee is algorithmically determined. Denominated in wei' CODEC(ZSTD(1)), - `dropreason` Nullable(String) COMMENT 'If the transaction was dropped from the mempool, this describes the contextual reason for the drop' CODEC(ZSTD(1)), - `rejectionreason` Nullable(String) COMMENT 'If the transaction was rejected from the mempool, this describes the contextual reason for the rejection' CODEC(ZSTD(1)), - `stuck` Bool COMMENT 'A transaction was detected in the queued area of the mempool and is not eligible for inclusion in a block' CODEC(ZSTD(1)), - `gasused` Nullable(UInt64) COMMENT 'If the transaction was published on-chain, this value indicates the amount of gas that was actually consumed. Denominated in wei' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(detecttime) -ORDER BY - ( - detecttime, - network, - hash, - fromaddress, - nonce, - gas - ) COMMENT 'Contains transactions from block native mempool dataset'; - -CREATE TABLE tmp.block_native_mempool_transaction ON CLUSTER '{cluster}' AS tmp.block_native_mempool_transaction_local ENGINE = Distributed( - '{cluster}', - tmp, - block_native_mempool_transaction_local, - cityHash64( - detecttime, - network, - hash, - fromaddress, - nonce, - gas - ) -); - -INSERT INTO - tmp.block_native_mempool_transaction -SELECT - NOW(), - detecttime, - hash, - status, - region, - reorg, - replace, - curblocknumber, - failurereason, - blockspending, - timepending, - nonce, - gas, - gasprice, - value, - toaddress, - fromaddress, - datasize, - data4bytes, - network, - type, - maxpriorityfeepergas, - maxfeepergas, - basefeepergas, - dropreason, - rejectionreason, - stuck, - gasused -FROM - default.block_native_mempool_transaction_local; - -DROP TABLE IF EXISTS default.block_native_mempool_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.block_native_mempool_transaction_local -AND tmp.block_native_mempool_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.block_native_mempool_transaction ON CLUSTER '{cluster}' AS default.block_native_mempool_transaction_local ENGINE = Distributed( - '{cluster}', - default, - block_native_mempool_transaction_local, - cityHash64( - detecttime, - network, - hash, - fromaddress, - nonce, - gas - ) -); - -DROP TABLE IF EXISTS tmp.block_native_mempool_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.block_native_mempool_transaction_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_blob_sidecar -CREATE TABLE tmp.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block' CODEC(ZSTD(1)), - `versioned_hash` FixedString(66) COMMENT 'The versioned hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `kzg_commitment` FixedString(98) COMMENT 'The KZG commitment in the blob sidecar payload' CODEC(ZSTD(1)), - `kzg_proof` FixedString(98) COMMENT 'The KZG proof in the blob sidecar payload' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), - `blob_index` UInt64 COMMENT 'The index of blob sidecar in the blob sidecar payload' CODEC(ZSTD(1)), - `blob_size` UInt32 COMMENT 'The total bytes of the blob' CODEC(ZSTD(1)), - `blob_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the blob in bytes' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - blob_index - ) COMMENT 'Contains a blob sidecar from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' AS tmp.canonical_beacon_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_blob_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - blob_index - ) -); - -INSERT INTO - tmp.canonical_beacon_blob_sidecar -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_parent_root, - versioned_hash, - kzg_commitment, - kzg_proof, - proposer_index, - blob_index, - blob_size, - blob_empty_size, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_blob_sidecar_local; - -DROP TABLE IF EXISTS default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_blob_sidecar_local -AND tmp.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' AS default.canonical_beacon_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_blob_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - blob_index - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_attester_slashing -CREATE TABLE tmp.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `attestation_1_attesting_indices` Array(UInt32) COMMENT 'The attesting indices from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_signature` String COMMENT 'The signature from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_data_beacon_block_root` FixedString(66) COMMENT 'The beacon block root from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_data_slot` UInt32 COMMENT 'The slot number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_1_data_index` UInt32 COMMENT 'The attestor index from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_data_source_epoch` UInt32 COMMENT 'The source epoch number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_1_data_source_root` FixedString(66) COMMENT 'The source root from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_1_data_target_epoch` UInt32 COMMENT 'The target epoch number from the first attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_1_data_target_root` FixedString(66) COMMENT 'The target root from the first attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_attesting_indices` Array(UInt32) COMMENT 'The attesting indices from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_signature` String COMMENT 'The signature from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_data_beacon_block_root` FixedString(66) COMMENT 'The beacon block root from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_data_slot` UInt32 COMMENT 'The slot number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_2_data_index` UInt32 COMMENT 'The attestor index from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_data_source_epoch` UInt32 COMMENT 'The source epoch number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_2_data_source_root` FixedString(66) COMMENT 'The source root from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `attestation_2_data_target_epoch` UInt32 COMMENT 'The target epoch number from the second attestation in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `attestation_2_data_target_root` FixedString(66) COMMENT 'The target root from the second attestation in the slashing payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - attestation_1_attesting_indices, - attestation_2_attesting_indices, - attestation_1_data_slot, - attestation_2_data_slot, - attestation_1_data_beacon_block_root, - attestation_2_data_beacon_block_root - ) COMMENT 'Contains attester slashing from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_attester_slashing_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_attester_slashing_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - attestation_1_attesting_indices, - attestation_2_attesting_indices, - attestation_1_data_slot, - attestation_2_data_slot, - attestation_1_data_beacon_block_root, - attestation_2_data_beacon_block_root - ) -); - -INSERT INTO - tmp.canonical_beacon_block_attester_slashing -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - attestation_1_attesting_indices, - attestation_1_signature, - attestation_1_data_beacon_block_root, - attestation_1_data_slot, - attestation_1_data_index, - attestation_1_data_source_epoch, - attestation_1_data_source_root, - attestation_1_data_target_epoch, - attestation_1_data_target_root, - attestation_2_attesting_indices, - attestation_2_signature, - attestation_2_data_beacon_block_root, - attestation_2_data_slot, - attestation_2_data_index, - attestation_2_data_source_epoch, - attestation_2_data_source_root, - attestation_2_data_target_epoch, - attestation_2_data_target_root, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_attester_slashing_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_attester_slashing_local -AND tmp.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' AS default.canonical_beacon_block_attester_slashing_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_attester_slashing_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - attestation_1_attesting_indices, - attestation_2_attesting_indices, - attestation_1_data_slot, - attestation_2_data_slot, - attestation_1_data_beacon_block_root, - attestation_2_data_beacon_block_root - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_bls_to_execution_change -CREATE TABLE tmp.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `exchanging_message_validator_index` UInt32 COMMENT 'The validator index from the exchanging message' CODEC(ZSTD(1)), - `exchanging_message_from_bls_pubkey` String COMMENT 'The BLS public key from the exchanging message' CODEC(ZSTD(1)), - `exchanging_message_to_execution_address` FixedString(42) COMMENT 'The execution address from the exchanging message' CODEC(ZSTD(1)), - `exchanging_signature` String COMMENT 'The signature for the exchanging message' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - exchanging_message_validator_index, - exchanging_message_from_bls_pubkey, - exchanging_message_to_execution_address - ) COMMENT 'Contains bls to execution change from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_bls_to_execution_change_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_bls_to_execution_change_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - exchanging_message_validator_index, - exchanging_message_from_bls_pubkey, - exchanging_message_to_execution_address - ) -); - -INSERT INTO - tmp.canonical_beacon_block_bls_to_execution_change -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - exchanging_message_validator_index, - exchanging_message_from_bls_pubkey, - exchanging_message_to_execution_address, - exchanging_signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_bls_to_execution_change_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_bls_to_execution_change_local -AND tmp.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' AS default.canonical_beacon_block_bls_to_execution_change_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_bls_to_execution_change_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - exchanging_message_validator_index, - exchanging_message_from_bls_pubkey, - exchanging_message_to_execution_address - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_deposit -CREATE TABLE tmp.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `deposit_proof` Array(String) COMMENT 'The proof of the deposit data' CODEC(ZSTD(1)), - `deposit_data_pubkey` String COMMENT 'The BLS public key of the validator from the deposit data' CODEC(ZSTD(1)), - `deposit_data_withdrawal_credentials` FixedString(66) COMMENT 'The withdrawal credentials of the validator from the deposit data' CODEC(ZSTD(1)), - `deposit_data_amount` UInt128 COMMENT 'The amount of the deposit from the deposit data' CODEC(ZSTD(1)), - `deposit_data_signature` String COMMENT 'The signature of the deposit data' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - deposit_data_pubkey, - deposit_proof - ) COMMENT 'Contains a deposit from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_deposit ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_deposit_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_deposit_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - deposit_data_pubkey, - deposit_proof - ) -); - -INSERT INTO - tmp.canonical_beacon_block_deposit -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - deposit_proof, - deposit_data_pubkey, - deposit_data_withdrawal_credentials, - deposit_data_amount, - deposit_data_signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_deposit_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_deposit_local -AND tmp.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' AS default.canonical_beacon_block_deposit_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_deposit_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - deposit_data_pubkey, - deposit_proof - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_deposit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_execution_transaction -CREATE TABLE tmp.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `position` UInt32 COMMENT 'The position of the transaction in the beacon block' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), - `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), - `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), - `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), - `gas_tip_cap` Nullable(UInt128) COMMENT 'The priority fee (tip) the user has set for the transaction' CODEC(ZSTD(1)), - `gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), - `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), - `type` UInt8 COMMENT 'The type of the transaction' CODEC(ZSTD(1)), - `size` UInt32 COMMENT 'The size of the transaction data in bytes' CODEC(ZSTD(1)), - `call_data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `blob_gas` Nullable(UInt64) COMMENT 'The maximum gas provided for the blob transaction execution' CODEC(ZSTD(1)), - `blob_gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), - `blob_hashes` Array(String) COMMENT 'The hashes of the blob commitments for blob transactions' CODEC(ZSTD(1)), - `blob_sidecars_size` Nullable(UInt32) COMMENT 'The total size of the sidecars for blob transactions in bytes' CODEC(ZSTD(1)), - `blob_sidecars_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the sidecars for blob transactions in bytes' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - position, - hash, - nonce - ) COMMENT 'Contains execution transaction from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_execution_transaction_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_execution_transaction_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - position, - hash, - nonce - ) -); - -INSERT INTO - tmp.canonical_beacon_block_execution_transaction -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - position, - hash, - `from`, - to, - nonce, - gas_price, - gas, - gas_tip_cap, - gas_fee_cap, - value, - type, - size, - call_data_size, - blob_gas, - blob_gas_fee_cap, - blob_hashes, - blob_sidecars_size, - blob_sidecars_empty_size, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_execution_transaction_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_execution_transaction_local -AND tmp.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' AS default.canonical_beacon_block_execution_transaction_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_execution_transaction_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - position, - hash, - nonce - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block -CREATE TABLE tmp.canonical_beacon_block_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `block_total_bytes` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload' CODEC(ZSTD(1)), - `block_total_bytes_compressed` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload when compressed using snappy' CODEC(ZSTD(1)), - `parent_root` FixedString(66) COMMENT 'The root hash of the parent beacon block' CODEC(ZSTD(1)), - `state_root` FixedString(66) COMMENT 'The root hash of the beacon state at this block' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The index of the validator that proposed the beacon block' CODEC(ZSTD(1)), - `eth1_data_block_hash` FixedString(66) COMMENT 'The block hash of the associated execution block' CODEC(ZSTD(1)), - `eth1_data_deposit_root` FixedString(66) COMMENT 'The root of the deposit tree in the associated execution block' CODEC(ZSTD(1)), - `execution_payload_block_hash` FixedString(66) COMMENT 'The block hash of the execution payload' CODEC(ZSTD(1)), - `execution_payload_block_number` UInt32 COMMENT 'The block number of the execution payload' CODEC(DoubleDelta, ZSTD(1)), - `execution_payload_fee_recipient` String COMMENT 'The recipient of the fee for this execution payload' CODEC(ZSTD(1)), - `execution_payload_state_root` FixedString(66) COMMENT 'The state root of the execution payload' CODEC(ZSTD(1)), - `execution_payload_parent_hash` FixedString(66) COMMENT 'The parent hash of the execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_count` Nullable(UInt32) COMMENT 'The transaction count of the execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_total_bytes` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_total_bytes_compressed` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload when compressed using snappy' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - (slot_start_date_time, meta_network_name) COMMENT 'Contains beacon block from a beacon node.'; - -CREATE TABLE tmp.canonical_beacon_block ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_local, - cityHash64( - slot_start_date_time, - meta_network_name - ) -); - -INSERT INTO - tmp.canonical_beacon_block -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - block_total_bytes, - block_total_bytes_compressed, - parent_root, - state_root, - proposer_index, - eth1_data_block_hash, - eth1_data_deposit_root, - execution_payload_block_hash, - execution_payload_block_number, - execution_payload_fee_recipient, - execution_payload_state_root, - execution_payload_parent_hash, - execution_payload_transactions_count, - execution_payload_transactions_total_bytes, - execution_payload_transactions_total_bytes_compressed, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_local -AND tmp.canonical_beacon_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block ON CLUSTER '{cluster}' AS default.canonical_beacon_block_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_local, - cityHash64( - slot_start_date_time, - meta_network_name - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_proposer_slashing -CREATE TABLE tmp.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `signed_header_1_message_slot` UInt32 COMMENT 'The slot number from the first signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `signed_header_1_message_proposer_index` UInt32 COMMENT 'The proposer index from the first signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `signed_header_1_message_body_root` FixedString(66) COMMENT 'The body root from the first signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_1_message_parent_root` FixedString(66) COMMENT 'The parent root from the first signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_1_message_state_root` FixedString(66) COMMENT 'The state root from the first signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_1_signature` String COMMENT 'The signature for the first signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_2_message_slot` UInt32 COMMENT 'The slot number from the second signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `signed_header_2_message_proposer_index` UInt32 COMMENT 'The proposer index from the second signed header in the slashing payload' CODEC(DoubleDelta, ZSTD(1)), - `signed_header_2_message_body_root` FixedString(66) COMMENT 'The body root from the second signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_2_message_parent_root` FixedString(66) COMMENT 'The parent root from the second signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_2_message_state_root` FixedString(66) COMMENT 'The state root from the second signed header in the slashing payload' CODEC(ZSTD(1)), - `signed_header_2_signature` String COMMENT 'The signature for the second signed header in the slashing payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - signed_header_1_message_slot, - signed_header_2_message_slot, - signed_header_1_message_proposer_index, - signed_header_2_message_proposer_index, - signed_header_1_message_body_root, - signed_header_2_message_body_root - ) COMMENT 'Contains proposer slashing from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_proposer_slashing_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_proposer_slashing_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - signed_header_1_message_slot, - signed_header_2_message_slot, - signed_header_1_message_proposer_index, - signed_header_2_message_proposer_index, - signed_header_1_message_body_root, - signed_header_2_message_body_root - ) -); - -INSERT INTO - tmp.canonical_beacon_block_proposer_slashing -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - signed_header_1_message_slot, - signed_header_1_message_proposer_index, - signed_header_1_message_body_root, - signed_header_1_message_parent_root, - signed_header_1_message_state_root, - signed_header_1_signature, - signed_header_2_message_slot, - signed_header_2_message_proposer_index, - signed_header_2_message_body_root, - signed_header_2_message_parent_root, - signed_header_2_message_state_root, - signed_header_2_signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_proposer_slashing_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_proposer_slashing_local -AND tmp.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' AS default.canonical_beacon_block_proposer_slashing_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_proposer_slashing_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - signed_header_1_message_slot, - signed_header_2_message_slot, - signed_header_1_message_proposer_index, - signed_header_2_message_proposer_index, - signed_header_1_message_body_root, - signed_header_2_message_body_root - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_voluntary_exit -CREATE TABLE tmp.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `voluntary_exit_message_epoch` UInt32 COMMENT 'The epoch number from the exit message' CODEC(DoubleDelta, ZSTD(1)), - `voluntary_exit_message_validator_index` UInt32 COMMENT 'The validator index from the exit message' CODEC(ZSTD(1)), - `voluntary_exit_signature` String COMMENT 'The signature of the exit message' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - voluntary_exit_message_epoch, - voluntary_exit_message_validator_index - ) COMMENT 'Contains a voluntary exit from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_voluntary_exit_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - voluntary_exit_message_epoch, - voluntary_exit_message_validator_index - ) -); - -INSERT INTO - tmp.canonical_beacon_block_voluntary_exit -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - voluntary_exit_message_epoch, - voluntary_exit_message_validator_index, - voluntary_exit_signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_voluntary_exit_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_voluntary_exit_local -AND tmp.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' AS default.canonical_beacon_block_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_voluntary_exit_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - voluntary_exit_message_epoch, - voluntary_exit_message_validator_index - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_block_withdrawal -CREATE TABLE tmp.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `withdrawal_index` UInt32 COMMENT 'The index of the withdrawal' CODEC(ZSTD(1)), - `withdrawal_validator_index` UInt32 COMMENT 'The validator index from the withdrawal data' CODEC(ZSTD(1)), - `withdrawal_address` FixedString(42) COMMENT 'The address of the account that is the withdrawal recipient' CODEC(ZSTD(1)), - `withdrawal_amount` UInt128 COMMENT 'The amount of the withdrawal from the withdrawal data' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - withdrawal_index, - withdrawal_validator_index - ) COMMENT 'Contains a withdrawal from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' AS tmp.canonical_beacon_block_withdrawal_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_block_withdrawal_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - withdrawal_index, - withdrawal_validator_index - ) -); - -INSERT INTO - tmp.canonical_beacon_block_withdrawal -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - block_root, - block_version, - withdrawal_index, - withdrawal_validator_index, - withdrawal_address, - withdrawal_amount, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_block_withdrawal_local; - -DROP TABLE IF EXISTS default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_block_withdrawal_local -AND tmp.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' AS default.canonical_beacon_block_withdrawal_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_withdrawal_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - withdrawal_index, - withdrawal_validator_index - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_elaborated_attestation -CREATE TABLE tmp.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the elaborated attestation from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `block_slot` UInt32 COMMENT 'The slot number of the block containing the attestation' CODEC(DoubleDelta, ZSTD(1)), - `block_slot_start_date_time` DateTime COMMENT 'The wall clock time when the block slot started' CODEC(DoubleDelta, ZSTD(1)), - `block_epoch` UInt32 COMMENT 'The epoch number of the block containing the attestation' CODEC(DoubleDelta, ZSTD(1)), - `block_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the block epoch started' CODEC(DoubleDelta, ZSTD(1)), - `position_in_block` UInt32 COMMENT 'The position of the attestation in the block' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root of the block containing the attestation' CODEC(ZSTD(1)), - `validators` Array(UInt32) COMMENT 'Array of validator indices participating in the attestation' CODEC(ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The index of the committee making the attestation', - `beacon_block_root` FixedString(66) COMMENT 'The root of the beacon block being attested to' CODEC(ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number being attested to' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), - `source_epoch` UInt32 COMMENT 'The source epoch referenced in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_root` FixedString(66) COMMENT 'The root of the source checkpoint in the attestation' CODEC(ZSTD(1)), - `target_epoch` UInt32 COMMENT 'The target epoch referenced in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), - `target_root` FixedString(66) COMMENT 'The root of the target checkpoint in the attestation' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - block_root, - block_slot, - position_in_block, - beacon_block_root, - slot, - committee_index, - source_root, - target_root - ) COMMENT 'Contains elaborated attestations from beacon blocks.'; - -CREATE TABLE tmp.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' AS tmp.canonical_beacon_elaborated_attestation_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_elaborated_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - block_slot, - position_in_block, - beacon_block_root, - slot, - committee_index, - source_root, - target_root - ) -); - -INSERT INTO - tmp.canonical_beacon_elaborated_attestation -SELECT - NOW(), - event_date_time, - block_slot, - block_slot_start_date_time, - block_epoch, - block_epoch_start_date_time, - position_in_block, - block_root, - validators, - committee_index, - beacon_block_root, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - source_epoch, - source_epoch_start_date_time, - source_root, - target_epoch, - target_epoch_start_date_time, - target_root, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_elaborated_attestation_local; - -DROP TABLE IF EXISTS default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_elaborated_attestation_local -AND tmp.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' AS default.canonical_beacon_elaborated_attestation_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_elaborated_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - block_slot, - position_in_block, - beacon_block_root, - slot, - committee_index, - source_root, - target_root - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' SYNC; - --- canonical_beacon_proposer_duty -CREATE TABLE tmp.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the proposer duty information from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'The slot number for which the proposer duty is assigned' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number containing the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `proposer_validator_index` UInt32 COMMENT 'The validator index of the proposer for the slot' CODEC(ZSTD(1)), - `proposer_pubkey` String COMMENT 'The public key of the validator proposer' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the even' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - proposer_validator_index, - proposer_pubkey - ) COMMENT 'Contains a proposer duty from a beacon block.'; - -CREATE TABLE tmp.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' AS tmp.canonical_beacon_proposer_duty_local ENGINE = Distributed( - '{cluster}', - tmp, - canonical_beacon_proposer_duty_local, - cityHash64( - slot_start_date_time, - meta_network_name, - proposer_validator_index, - proposer_pubkey - ) -); - -INSERT INTO - tmp.canonical_beacon_proposer_duty -SELECT - NOW(), - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - proposer_validator_index, - proposer_pubkey, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.canonical_beacon_proposer_duty_local; - -DROP TABLE IF EXISTS default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.canonical_beacon_proposer_duty_local -AND tmp.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' AS default.canonical_beacon_proposer_duty_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_proposer_duty_local, - cityHash64( - slot_start_date_time, - meta_network_name, - proposer_validator_index, - proposer_pubkey - ) -); - -DROP TABLE IF EXISTS tmp.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_add_peer -CREATE TABLE tmp.libp2p_add_peer_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `protocol` LowCardinality(String) COMMENT 'Protocol used by the peer', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) COMMENT 'Contains the details of the peers added to the libp2p client.'; - -CREATE TABLE tmp.libp2p_add_peer ON CLUSTER '{cluster}' AS tmp.libp2p_add_peer_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_add_peer_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) -); - -INSERT INTO - tmp.libp2p_add_peer -SELECT - NOW(), - event_date_time, - peer_id_unique_key, - protocol, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_add_peer_local; - -DROP TABLE IF EXISTS default.libp2p_add_peer ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_add_peer_local -AND tmp.libp2p_add_peer_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_add_peer ON CLUSTER '{cluster}' AS default.libp2p_add_peer_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_add_peer_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_add_peer ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_add_peer_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_connected -CREATE TABLE tmp.libp2p_connected_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `remote_peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the remote peer', - `remote_protocol` LowCardinality(String) COMMENT 'Protocol of the remote peer', - `remote_transport_protocol` LowCardinality(String) COMMENT 'Transport protocol of the remote peer', - `remote_port` UInt16 COMMENT 'Port of the remote peer' CODEC(ZSTD(1)), - `remote_ip` Nullable(IPv6) COMMENT 'IP address of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_city` LowCardinality(String) COMMENT 'City of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_country` LowCardinality(String) COMMENT 'Country of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_country_code` LowCardinality(String) COMMENT 'Country code of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_agent_implementation` LowCardinality(String) COMMENT 'Implementation of the remote peer', - `remote_agent_version` LowCardinality(String) COMMENT 'Version of the remote peer', - `remote_agent_version_major` LowCardinality(String) COMMENT 'Major version of the remote peer', - `remote_agent_version_minor` LowCardinality(String) COMMENT 'Minor version of the remote peer', - `remote_agent_version_patch` LowCardinality(String) COMMENT 'Patch version of the remote peer', - `remote_agent_platform` LowCardinality(String) COMMENT 'Platform of the remote peer', - `direction` LowCardinality(String) COMMENT 'Connection direction', - `opened` DateTime COMMENT 'Timestamp when the connection was opened' CODEC(DoubleDelta, ZSTD(1)), - `transient` Bool COMMENT 'Whether the connection is transient', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - direction, - opened - ) COMMENT 'Contains the details of the CONNECTED events from the libp2p client.'; - -CREATE TABLE tmp.libp2p_connected ON CLUSTER '{cluster}' AS tmp.libp2p_connected_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_connected_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - direction, - opened - ) -); - -INSERT INTO - tmp.libp2p_connected -SELECT - NOW(), - event_date_time, - remote_peer_id_unique_key, - remote_protocol, - remote_transport_protocol, - remote_port, - remote_ip, - remote_geo_city, - remote_geo_country, - remote_geo_country_code, - remote_geo_continent_code, - remote_geo_longitude, - remote_geo_latitude, - remote_geo_autonomous_system_number, - remote_geo_autonomous_system_organization, - remote_agent_implementation, - remote_agent_version, - remote_agent_version_major, - remote_agent_version_minor, - remote_agent_version_patch, - remote_agent_platform, - direction, - opened, - transient, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_connected_local; - -DROP TABLE IF EXISTS default.libp2p_connected ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_connected_local -AND tmp.libp2p_connected_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_connected ON CLUSTER '{cluster}' AS default.libp2p_connected_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_connected_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - direction, - opened - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_connected ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_connected_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_disconnected -CREATE TABLE tmp.libp2p_disconnected_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `remote_peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the remote peer', - `remote_protocol` LowCardinality(String) COMMENT 'Protocol of the remote peer', - `remote_transport_protocol` LowCardinality(String) COMMENT 'Transport protocol of the remote peer', - `remote_port` UInt16 COMMENT 'Port of the remote peer' CODEC(ZSTD(1)), - `remote_ip` Nullable(IPv6) COMMENT 'IP address of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_city` LowCardinality(String) COMMENT 'City of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_country` LowCardinality(String) COMMENT 'Country of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_country_code` LowCardinality(String) COMMENT 'Country code of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the remote peer that generated the event' CODEC(ZSTD(1)), - `remote_agent_implementation` LowCardinality(String) COMMENT 'Implementation of the remote peer', - `remote_agent_version` LowCardinality(String) COMMENT 'Version of the remote peer', - `remote_agent_version_major` LowCardinality(String) COMMENT 'Major version of the remote peer', - `remote_agent_version_minor` LowCardinality(String) COMMENT 'Minor version of the remote peer', - `remote_agent_version_patch` LowCardinality(String) COMMENT 'Patch version of the remote peer', - `remote_agent_platform` LowCardinality(String) COMMENT 'Platform of the remote peer', - `direction` LowCardinality(String) COMMENT 'Connection direction', - `opened` DateTime COMMENT 'Timestamp when the connection was opened' CODEC(DoubleDelta, ZSTD(1)), - `transient` Bool COMMENT 'Whether the connection is transient', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - direction, - opened - ) COMMENT 'Contains the details of the DISCONNECTED events from the libp2p client.'; - -CREATE TABLE tmp.libp2p_disconnected ON CLUSTER '{cluster}' AS tmp.libp2p_disconnected_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_disconnected_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - direction, - opened - ) -); - -INSERT INTO - tmp.libp2p_disconnected -SELECT - NOW(), - event_date_time, - remote_peer_id_unique_key, - remote_protocol, - remote_transport_protocol, - remote_port, - remote_ip, - remote_geo_city, - remote_geo_country, - remote_geo_country_code, - remote_geo_continent_code, - remote_geo_longitude, - remote_geo_latitude, - remote_geo_autonomous_system_number, - remote_geo_autonomous_system_organization, - remote_agent_implementation, - remote_agent_version, - remote_agent_version_major, - remote_agent_version_minor, - remote_agent_version_patch, - remote_agent_platform, - direction, - opened, - transient, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_disconnected_local; - -DROP TABLE IF EXISTS default.libp2p_disconnected ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_disconnected_local -AND tmp.libp2p_disconnected_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_disconnected ON CLUSTER '{cluster}' AS default.libp2p_disconnected_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_disconnected_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - direction, - opened - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_disconnected ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_disconnected_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_gossipsub_beacon_attestation -CREATE TABLE tmp.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - -- ensure the first time this attestation was seen by a peer is in this table - -- 4294967295 = UInt32 max - `version` UInt32 DEFAULT 4294967295 - propagation_slot_start_diff COMMENT 'Version of this row, to help with de-duplication we want the latest updated_date_time but lowest propagation_slot_start_diff time' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The committee index in the attestation', - `attesting_validator_index` Nullable(UInt32) COMMENT 'The index of the validator attesting to the event' CODEC(ZSTD(1)), - `attesting_validator_committee_index` LowCardinality(String) COMMENT 'The committee index of the attesting validator', - `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', - `aggregation_bits` String COMMENT 'The aggregation bits of the event in the attestation' CODEC(ZSTD(1)), - `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the attestation' CODEC(ZSTD(1)), - `source_epoch` UInt32 COMMENT 'The source epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the attestation' CODEC(ZSTD(1)), - `target_epoch` UInt32 COMMENT 'The target epoch number in the attestation' CODEC(DoubleDelta, ZSTD(1)), - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), - `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the attestation' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Network ID associated with the client' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - `version` -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) COMMENT 'Table for libp2p gossipsub beacon attestation data.'; - -CREATE TABLE tmp.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' AS tmp.libp2p_gossipsub_beacon_attestation_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_gossipsub_beacon_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) -); - -INSERT INTO - tmp.libp2p_gossipsub_beacon_attestation -SELECT - NOW(), - NULL, - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - committee_index, - attesting_validator_index, - attesting_validator_committee_index, - wallclock_slot, - wallclock_slot_start_date_time, - wallclock_epoch, - wallclock_epoch_start_date_time, - propagation_slot_start_diff, - peer_id_unique_key, - message_id, - message_size, - topic_layer, - topic_fork_digest_value, - topic_name, - topic_encoding, - aggregation_bits, - beacon_block_root, - source_epoch, - source_epoch_start_date_time, - source_root, - target_epoch, - target_epoch_start_date_time, - target_root, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_gossipsub_beacon_attestation_local; - -DROP TABLE IF EXISTS default.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_gossipsub_beacon_attestation_local -AND tmp.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' AS default.libp2p_gossipsub_beacon_attestation_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_gossipsub_beacon_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_gossipsub_beacon_block -CREATE TABLE tmp.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - -- ensure the first time this block was seen by a peer is in this table - -- 4294967295 = UInt32 max - `version` UInt32 DEFAULT 4294967295 - propagation_slot_start_diff COMMENT 'Version of this row, to help with de-duplication we want the latest updated_date_time but lowest propagation_slot_start_diff time' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), - `block` FixedString(66) COMMENT 'The beacon block root hash' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The proposer index of the beacon block' CODEC(ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Network ID associated with the client' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - `version` -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) COMMENT 'Table for libp2p gossipsub beacon block data.'; - -CREATE TABLE tmp.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' AS tmp.libp2p_gossipsub_beacon_block_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_gossipsub_beacon_block_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) -); - -INSERT INTO - tmp.libp2p_gossipsub_beacon_block -SELECT - NOW(), - NULL, - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - wallclock_slot, - wallclock_slot_start_date_time, - wallclock_epoch, - wallclock_epoch_start_date_time, - propagation_slot_start_diff, - block, - proposer_index, - peer_id_unique_key, - message_id, - message_size, - topic_layer, - topic_fork_digest_value, - topic_name, - topic_encoding, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_gossipsub_beacon_block_local; - -DROP TABLE IF EXISTS default.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_gossipsub_beacon_block_local -AND tmp.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' AS default.libp2p_gossipsub_beacon_block_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_gossipsub_beacon_block_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_gossipsub_blob_sidecar -CREATE TABLE tmp.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - -- ensure the first time this blob sidecar was seen by a peer is in this table - -- 4294967295 = UInt32 max - `version` UInt32 DEFAULT 4294967295 - propagation_slot_start_diff COMMENT 'Version of this row, to help with de-duplication we want the latest updated_date_time but lowest propagation_slot_start_diff time' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The proposer index of the beacon block' CODEC(ZSTD(1)), - `blob_index` UInt32 COMMENT 'Blob index associated with the record' CODEC(ZSTD(1)), - `parent_root` FixedString(66) COMMENT 'Parent root of the beacon block' CODEC(ZSTD(1)), - `state_root` FixedString(66) COMMENT 'State root of the beacon block' CODEC(ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Network ID associated with the client' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - `version` -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) COMMENT 'Table for libp2p gossipsub blob sidecar data'; - -CREATE TABLE tmp.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' AS tmp.libp2p_gossipsub_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_gossipsub_blob_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) -); - -INSERT INTO - tmp.libp2p_gossipsub_blob_sidecar -SELECT - NOW(), - NULL, - event_date_time, - slot, - slot_start_date_time, - epoch, - epoch_start_date_time, - wallclock_slot, - wallclock_slot_start_date_time, - wallclock_epoch, - wallclock_epoch_start_date_time, - propagation_slot_start_diff, - proposer_index, - blob_index, - parent_root, - state_root, - peer_id_unique_key, - message_id, - message_size, - topic_layer, - topic_fork_digest_value, - topic_name, - topic_encoding, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_gossipsub_blob_sidecar_local; - -DROP TABLE IF EXISTS default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_gossipsub_blob_sidecar_local -AND tmp.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' AS default.libp2p_gossipsub_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_gossipsub_blob_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_handle_metadata -CREATE TABLE tmp.libp2p_handle_metadata_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the RPC', - `error` Nullable(String) COMMENT 'Error message if the metadata handling failed' CODEC(ZSTD(1)), - `protocol` LowCardinality(String) COMMENT 'The protocol of the metadata handling event', - `attnets` String COMMENT 'Attestation subnets the peer is subscribed to' CODEC(ZSTD(1)), - `seq_number` UInt64 COMMENT 'Sequence number of the metadata' CODEC(DoubleDelta, ZSTD(1)), - `syncnets` String COMMENT 'Sync subnets the peer is subscribed to' CODEC(ZSTD(1)), - `latency_milliseconds` Decimal(10, 3) COMMENT 'How long it took to handle the metadata request in milliseconds' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - attnets, - seq_number, - syncnets, - latency_milliseconds - ) COMMENT 'Contains the metadata handling events for libp2p peers.'; - -CREATE TABLE tmp.libp2p_handle_metadata ON CLUSTER '{cluster}' AS tmp.libp2p_handle_metadata_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_handle_metadata_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - attnets, - seq_number, - syncnets, - latency_milliseconds - ) -); - -INSERT INTO - tmp.libp2p_handle_metadata -SELECT - NOW(), - event_date_time, - peer_id_unique_key, - error, - protocol, - attnets, - seq_number, - syncnets, - latency_milliseconds, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_handle_metadata_local; - -DROP TABLE IF EXISTS default.libp2p_handle_metadata ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_handle_metadata_local -AND tmp.libp2p_handle_metadata_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_handle_metadata ON CLUSTER '{cluster}' AS default.libp2p_handle_metadata_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_handle_metadata_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - attnets, - seq_number, - syncnets, - latency_milliseconds - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_handle_metadata ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_handle_metadata_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_handle_status -CREATE TABLE tmp.libp2p_handle_status_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `error` Nullable(String) COMMENT 'Error message if the status handling failed' CODEC(ZSTD(1)), - `protocol` LowCardinality(String) COMMENT 'The protocol of the status handling event', - `request_finalized_epoch` Nullable(UInt32) COMMENT 'Requested finalized epoch' CODEC(DoubleDelta, ZSTD(1)), - `request_finalized_root` Nullable(String) COMMENT 'Requested finalized root', - `request_fork_digest` LowCardinality(String) COMMENT 'Requested fork digest', - `request_head_root` Nullable(FixedString(66)) COMMENT 'Requested head root' CODEC(ZSTD(1)), - `request_head_slot` Nullable(UInt32) COMMENT 'Requested head slot' CODEC(ZSTD(1)), - `response_finalized_epoch` Nullable(UInt32) COMMENT 'Response finalized epoch' CODEC(DoubleDelta, ZSTD(1)), - `response_finalized_root` Nullable(FixedString(66)) COMMENT 'Response finalized root' CODEC(ZSTD(1)), - `response_fork_digest` LowCardinality(String) COMMENT 'Response fork digest', - `response_head_root` Nullable(FixedString(66)) COMMENT 'Response head root' CODEC(ZSTD(1)), - `response_head_slot` Nullable(UInt32) COMMENT 'Response head slot' CODEC(DoubleDelta, ZSTD(1)), - `latency_milliseconds` Decimal(10, 3) COMMENT 'How long it took to handle the status request in milliseconds' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - latency_milliseconds - ) COMMENT 'Contains the status handling events for libp2p peers.'; - -CREATE TABLE tmp.libp2p_handle_status ON CLUSTER '{cluster}' AS tmp.libp2p_handle_status_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_handle_status_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - latency_milliseconds - ) -); - -INSERT INTO - tmp.libp2p_handle_status -SELECT - NOW(), - event_date_time, - peer_id_unique_key, - error, - protocol, - request_finalized_epoch, - request_finalized_root, - request_fork_digest, - request_head_root, - request_head_slot, - response_finalized_epoch, - response_finalized_root, - response_fork_digest, - response_head_root, - response_head_slot, - latency_milliseconds, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_handle_status_local; - -DROP TABLE IF EXISTS default.libp2p_handle_status ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_handle_status_local -AND tmp.libp2p_handle_status_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_handle_status ON CLUSTER '{cluster}' AS default.libp2p_handle_status_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_handle_status_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - latency_milliseconds - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_handle_status ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_handle_status_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_join -CREATE TABLE tmp.libp2p_join_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding of the topic', - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer that joined the topic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) COMMENT 'Contains the details of the JOIN events from the libp2p client.'; - -CREATE TABLE tmp.libp2p_join ON CLUSTER '{cluster}' AS tmp.libp2p_join_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_join_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) -); - -INSERT INTO - tmp.libp2p_join -SELECT - NOW(), - event_date_time, - topic_layer, - topic_fork_digest_value, - topic_name, - topic_encoding, - peer_id_unique_key, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_join_local; - -DROP TABLE IF EXISTS default.libp2p_join ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_join_local -AND tmp.libp2p_join_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_join ON CLUSTER '{cluster}' AS default.libp2p_join_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_join_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_join ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_join_local ON CLUSTER '{cluster}' SYNC; - --- libp2p_remove_peer -CREATE TABLE tmp.libp2p_remove_peer_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) COMMENT 'Contains the details of the peers removed from the libp2p client.'; - -CREATE TABLE tmp.libp2p_remove_peer ON CLUSTER '{cluster}' AS tmp.libp2p_remove_peer_local ENGINE = Distributed( - '{cluster}', - tmp, - libp2p_remove_peer_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) -); - -INSERT INTO - tmp.libp2p_remove_peer -SELECT - NOW(), - event_date_time, - peer_id_unique_key, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name -FROM - default.libp2p_remove_peer_local; - -DROP TABLE IF EXISTS default.libp2p_remove_peer ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.libp2p_remove_peer_local -AND tmp.libp2p_remove_peer_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.libp2p_remove_peer ON CLUSTER '{cluster}' AS default.libp2p_remove_peer_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_remove_peer_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key - ) -); - -DROP TABLE IF EXISTS tmp.libp2p_remove_peer ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.libp2p_remove_peer_local ON CLUSTER '{cluster}' SYNC; - --- mempool_dumpster_transaction -CREATE TABLE tmp.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated, this is outside the source data and used for deduplication' CODEC(DoubleDelta, ZSTD(1)), - `timestamp` DateTime64(3) COMMENT 'Timestamp of the transaction' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), - `chain_id` UInt32 COMMENT 'The chain id of the transaction' CODEC(ZSTD(1)), - `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), - `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), - `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), - `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), - `gas_tip_cap` Nullable(UInt128) COMMENT 'The gas tip cap of the transaction in wei' CODEC(ZSTD(1)), - `gas_fee_cap` Nullable(UInt128) COMMENT 'The gas fee cap of the transaction in wei' CODEC(ZSTD(1)), - `data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `data_4bytes` Nullable(FixedString(10)) COMMENT 'The first 4 bytes of the call data of the transaction' CODEC(ZSTD(1)), - `sources` Array(LowCardinality(String)) COMMENT 'The sources that saw this transaction in their mempool', - `included_at_block_height` Nullable(UInt64) COMMENT 'The block height at which this transaction was included' CODEC(ZSTD(1)), - `included_block_timestamp` Nullable(DateTime64(3)) COMMENT 'The timestamp of the block at which this transaction was included' CODEC(DoubleDelta, ZSTD(1)), - `inclusion_delay_ms` Nullable(Int64) COMMENT 'The delay between the transaction timestamp and the block timestamp' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(timestamp) -ORDER BY - ( - timestamp, - chain_id, - hash, - `from`, - nonce, - gas - ) COMMENT 'Contains transactions from mempool dumpster dataset. Following the parquet schema with some additions'; - -CREATE TABLE tmp.mempool_dumpster_transaction ON CLUSTER '{cluster}' AS tmp.mempool_dumpster_transaction_local ENGINE = Distributed( - '{cluster}', - tmp, - mempool_dumpster_transaction_local, - cityHash64( - timestamp, - chain_id, - hash, - `from`, - nonce, - gas - ) -); - -INSERT INTO - tmp.mempool_dumpster_transaction -SELECT - NOW(), - timestamp, - hash, - chain_id, - `from`, - to, - value, - nonce, - gas, - gas_price, - gas_tip_cap, - gas_fee_cap, - data_size, - data_4bytes, - sources, - included_at_block_height, - included_block_timestamp, - inclusion_delay_ms -FROM - default.mempool_dumpster_transaction_local; - -DROP TABLE IF EXISTS default.mempool_dumpster_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.mempool_dumpster_transaction_local -AND tmp.mempool_dumpster_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.mempool_dumpster_transaction ON CLUSTER '{cluster}' AS default.mempool_dumpster_transaction_local ENGINE = Distributed( - '{cluster}', - default, - mempool_dumpster_transaction_local, - cityHash64( - timestamp, - chain_id, - hash, - `from`, - nonce, - gas - ) -); - -DROP TABLE IF EXISTS tmp.mempool_dumpster_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' SYNC; - --- mempool_transaction -CREATE TABLE tmp.mempool_transaction_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'The time when the sentry saw the transaction in the mempool' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), - `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), - `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), - `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), - `gas_tip_cap` Nullable(UInt128) COMMENT 'The priority fee (tip) the user has set for the transaction', - `gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction', - `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), - `type` Nullable(UInt8) COMMENT 'The type of the transaction', - `size` UInt32 COMMENT 'The size of the transaction data in bytes' CODEC(ZSTD(1)), - `call_data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `blob_gas` Nullable(UInt64) COMMENT 'The maximum gas provided for the blob transaction execution', - `blob_gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction', - `blob_hashes` Array(String) COMMENT 'The hashes of the blob commitments for blob transactions', - `blob_sidecars_size` Nullable(UInt32) COMMENT 'The total size of the sidecars for blob transactions in bytes', - `blob_sidecars_empty_size` Nullable(UInt32) COMMENT 'The total empty size of the sidecars for blob transactions in bytes', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_execution_fork_id_hash` LowCardinality(String) COMMENT 'The hash of the fork ID of the current Ethereum network', - `meta_execution_fork_id_next` LowCardinality(String) COMMENT 'The fork ID of the next planned Ethereum network upgrade', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - hash, - `from`, - nonce, - gas - ) COMMENT 'Each row represents a transaction that was seen in the mempool by a sentry client. Sentries can report the same transaction multiple times if it has been long enough since the last report.'; - -CREATE TABLE tmp.mempool_transaction ON CLUSTER '{cluster}' AS tmp.mempool_transaction_local ENGINE = Distributed( - '{cluster}', - tmp, - mempool_transaction_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - hash, - `from`, - nonce, - gas - ) -); - -INSERT INTO - tmp.mempool_transaction -SELECT - NOW(), - event_date_time, - hash, - `from`, - to, - nonce, - gas_price, - gas, - gas_tip_cap, - gas_fee_cap, - value, - type, - size, - call_data_size, - blob_gas, - blob_gas_fee_cap, - blob_hashes, - blob_sidecars_size, - blob_sidecars_empty_size, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_execution_fork_id_hash, - meta_execution_fork_id_next, - meta_labels -FROM - default.mempool_transaction_local; - -DROP TABLE IF EXISTS default.mempool_transaction ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.mempool_transaction_local -AND tmp.mempool_transaction_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.mempool_transaction ON CLUSTER '{cluster}' AS default.mempool_transaction_local ENGINE = Distributed( - '{cluster}', - default, - mempool_transaction_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - hash, - `from`, - nonce, - gas - ) -); - -DROP TABLE IF EXISTS tmp.mempool_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.mempool_transaction_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/042_delete_beacon_p2p_attestation.down.sql b/deploy/migrations/clickhouse/042_delete_beacon_p2p_attestation.down.sql deleted file mode 100644 index 39dfb7ca1..000000000 --- a/deploy/migrations/clickhouse/042_delete_beacon_p2p_attestation.down.sql +++ /dev/null @@ -1,95 +0,0 @@ -CREATE TABLE default.beacon_p2p_attestation_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node', - `slot` UInt32 COMMENT 'Slot number in the beacon P2P payload', - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started', - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon P2P payload', - `attesting_validator_index` Nullable(UInt32) COMMENT 'The index of the validator attesting to the event' CODEC(ZSTD(1)), - `attesting_validator_committee_index` LowCardinality(String) COMMENT 'The committee index of the attesting validator', - `aggregation_bits` String COMMENT 'The aggregation bits of the event in the beacon P2P payload' CODEC(ZSTD(1)), - `beacon_block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch` UInt32 COMMENT 'The source epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `source_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the source epoch started' CODEC(DoubleDelta, ZSTD(1)), - `source_root` FixedString(66) COMMENT 'The source beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `target_epoch` UInt32 COMMENT 'The target epoch number in the beacon P2P payload' CODEC(DoubleDelta, ZSTD(1)), - `target_epoch_start_date_time` DateTime COMMENT 'The wall clock time when the target epoch started' CODEC(DoubleDelta, ZSTD(1)), - `target_root` FixedString(66) COMMENT 'The target beacon block root hash in the beacon P2P payload' CODEC(ZSTD(1)), - `attestation_subnet` LowCardinality(String) COMMENT 'The attestation subnet the attestation was gossiped on', - `validated` Bool COMMENT 'Whether the attestation was validated by the client', - `peer_id` String COMMENT 'The originating peer ID for the gossiped data' CODEC(ZSTD(1)), - `peer_latency` UInt32 COMMENT 'The latency of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_version` LowCardinality(String) COMMENT 'Peer client version that gossiped the data', - `peer_version_major` LowCardinality(String) COMMENT 'Peer client major version that gossiped the data', - `peer_version_minor` LowCardinality(String) COMMENT 'Peer client minor version that gossiped the data', - `peer_version_patch` LowCardinality(String) COMMENT 'Peer client patch version that gossiped the data', - `peer_implementation` LowCardinality(String) COMMENT 'Peer client implementation that gossiped the data', - `peer_ip` Nullable(IPv6) COMMENT 'IP address of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_city` LowCardinality(String) COMMENT 'City of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_country` LowCardinality(String) COMMENT 'Country of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_country_code` LowCardinality(String) COMMENT 'Country code of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the peer that gossiped the data' CODEC(ZSTD(1)), - `peer_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the peer that gossiped the data' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - aggregation_bits, - beacon_block_root, - source_root, - target_root, - attestation_subnet, - peer_id - ) COMMENT 'Contains beacon chain P2P "attestation" data'; - -CREATE TABLE default.beacon_p2p_attestation ON CLUSTER '{cluster}' AS default.beacon_p2p_attestation_local ENGINE = Distributed( - '{cluster}', - default, - beacon_p2p_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - committee_index, - aggregation_bits, - beacon_block_root, - source_root, - target_root, - attestation_subnet, - peer_id - ) -); diff --git a/deploy/migrations/clickhouse/042_delete_beacon_p2p_attestation.up.sql b/deploy/migrations/clickhouse/042_delete_beacon_p2p_attestation.up.sql deleted file mode 100644 index 8ddc60a7b..000000000 --- a/deploy/migrations/clickhouse/042_delete_beacon_p2p_attestation.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.beacon_p2p_attestation on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS default.beacon_p2p_attestation_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/043_canonical_beacon_validators_tweaks.down.sql b/deploy/migrations/clickhouse/043_canonical_beacon_validators_tweaks.down.sql deleted file mode 100644 index dbe0a8e4e..000000000 --- a/deploy/migrations/clickhouse/043_canonical_beacon_validators_tweaks.down.sql +++ /dev/null @@ -1,56 +0,0 @@ -DROP TABLE IF EXISTS default.canonical_beacon_validators on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_beacon_validators_local on cluster '{cluster}' SYNC; - -CREATE TABLE default.canonical_beacon_validators_local -( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `index` UInt32 COMMENT 'The index of the validator' CODEC(ZSTD(1)), - `balance` UInt64 COMMENT 'The balance of the validator' CODEC(ZSTD(1)), - `status` LowCardinality(String) COMMENT 'The status of the validator', - `effective_balance` UInt64 COMMENT 'The effective balance of the validator' CODEC(ZSTD(1)), - `slashed` Bool COMMENT 'Whether the validator is slashed', - `activation_epoch` UInt64 COMMENT 'The epoch when the validator was activated' CODEC(ZSTD(1)), - `activation_eligibility_epoch` UInt64 COMMENT 'The epoch when the validator was activated' CODEC(ZSTD(1)), - `exit_epoch` UInt64 COMMENT 'The epoch when the validator exited' CODEC(ZSTD(1)), - `withdrawable_epoch` UInt64 COMMENT 'The epoch when the validator can withdraw' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) -ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY (epoch_start_date_time, `index`, meta_network_name) -COMMENT 'Contains a validator state for an epoch.' - -CREATE TABLE default.canonical_beacon_validators ON CLUSTER '{cluster}' AS default.canonical_beacon_validators_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_validators_local, - cityHash64( - epoch_start_date_time, - `index`, - meta_network_name - ) -); diff --git a/deploy/migrations/clickhouse/043_canonical_beacon_validators_tweaks.up.sql b/deploy/migrations/clickhouse/043_canonical_beacon_validators_tweaks.up.sql deleted file mode 100644 index fd47e7717..000000000 --- a/deploy/migrations/clickhouse/043_canonical_beacon_validators_tweaks.up.sql +++ /dev/null @@ -1,68 +0,0 @@ -DROP TABLE IF EXISTS default.canonical_beacon_validators on cluster '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_validators_local on cluster '{cluster}' SYNC; - -TRUNCATE TABLE canonical_beacon_validators_pubkeys_local ON CLUSTER '{cluster}'; - -TRUNCATE TABLE canonical_beacon_validators_withdrawal_credentials_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.canonical_beacon_validators_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'When this row was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number from beacon block payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `index` UInt32 COMMENT 'The index of the validator' CODEC(DoubleDelta, ZSTD(1)), - `balance` Nullable(UInt64) COMMENT 'The balance of the validator' CODEC(T64, ZSTD(1)), - `status` LowCardinality(String) COMMENT 'The status of the validator', - `effective_balance` Nullable(UInt64) COMMENT 'The effective balance of the validator' CODEC(ZSTD(1)), - `slashed` Bool COMMENT 'Whether the validator is slashed', - `activation_epoch` Nullable(UInt64) COMMENT 'The epoch when the validator was activated' CODEC(ZSTD(1)), - `activation_eligibility_epoch` Nullable(UInt64) COMMENT 'The epoch when the validator was activated' CODEC(ZSTD(1)), - `exit_epoch` Nullable(UInt64) COMMENT 'The epoch when the validator exited' CODEC(ZSTD(1)), - `withdrawable_epoch` Nullable(UInt64) COMMENT 'The epoch when the validator can withdraw' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY - ( - epoch_start_date_time, - meta_network_name, - `index`, - `status` - ) COMMENT 'Contains a validator state for an epoch.'; - -CREATE TABLE default.canonical_beacon_validators ON CLUSTER '{cluster}' AS default.canonical_beacon_validators_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_validators_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - `index`, - `status` - ) -); diff --git a/deploy/migrations/clickhouse/044_events_voluntary_exit_wallclock.down.sql b/deploy/migrations/clickhouse/044_events_voluntary_exit_wallclock.down.sql deleted file mode 100644 index 16cf02386..000000000 --- a/deploy/migrations/clickhouse/044_events_voluntary_exit_wallclock.down.sql +++ /dev/null @@ -1,108 +0,0 @@ -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `validator_index` UInt32 COMMENT 'The index of the validator making the voluntary exit', - `signature` String COMMENT 'The signature of the voluntary exit in the beacon API event stream payload', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY - ( - epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_voluntary_exit_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_voluntary_exit -SELECT - NOW(), - event_date_time, - epoch, - epoch_start_date_time, - validator_index, - signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_voluntary_exit_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_voluntary_exit_local -AND tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_voluntary_exit_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/044_events_voluntary_exit_wallclock.up.sql b/deploy/migrations/clickhouse/044_events_voluntary_exit_wallclock.up.sql deleted file mode 100644 index 061127cfb..000000000 --- a/deploy/migrations/clickhouse/044_events_voluntary_exit_wallclock.up.sql +++ /dev/null @@ -1,124 +0,0 @@ -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload', - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started', - `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `validator_index` UInt32 COMMENT 'The index of the validator making the voluntary exit', - `signature` String COMMENT 'The signature of the voluntary exit in the beacon API event stream payload', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event', - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event', - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event', - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event', - `meta_network_id` Int32 COMMENT 'Ethereum network ID', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tmp/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(wallclock_epoch_start_date_time) -ORDER BY - ( - wallclock_epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.'; - -CREATE TABLE tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS tmp.beacon_api_eth_v1_events_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - tmp, - beacon_api_eth_v1_events_voluntary_exit_local, - cityHash64( - wallclock_epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) -); - -INSERT INTO - tmp.beacon_api_eth_v1_events_voluntary_exit -WITH - (CASE - WHEN meta_network_name = 'mainnet' THEN 1606824023 - WHEN meta_network_name = 'sepolia' THEN 1655733600 - WHEN meta_network_name = 'holesky' THEN 1695902400 - WHEN meta_network_name = 'dencun-msf-1' THEN 1708607100 - ELSE 0 - END) AS genesis_time -SELECT - NOW(), - event_date_time, - epoch, - toDateTime(genesis_time + (epoch * 12 * 32)) AS epoch_start_date_time, - floor((toUnixTimestamp(event_date_time) - genesis_time) / 12) AS wallclock_slot, - toDateTime(genesis_time + (floor((toUnixTimestamp(event_date_time) - genesis_time) / 12) * 12)) AS wallclock_slot_start_date_time, - floor((toUnixTimestamp(event_date_time) - genesis_time) / 12 / 32) AS wallclock_epoch, - toDateTime(genesis_time + (floor((toUnixTimestamp(event_date_time) - genesis_time) / 12 / 32) * 12 * 32)) AS wallclock_epoch_start_date_time, - validator_index, - signature, - meta_client_name, - meta_client_id, - meta_client_version, - meta_client_implementation, - meta_client_os, - meta_client_ip, - meta_client_geo_city, - meta_client_geo_country, - meta_client_geo_country_code, - meta_client_geo_continent_code, - meta_client_geo_longitude, - meta_client_geo_latitude, - meta_client_geo_autonomous_system_number, - meta_client_geo_autonomous_system_organization, - meta_network_id, - meta_network_name, - meta_consensus_version, - meta_consensus_version_major, - meta_consensus_version_minor, - meta_consensus_version_patch, - meta_consensus_implementation, - meta_labels -FROM - default.beacon_api_eth_v1_events_voluntary_exit_local; - -DROP TABLE IF EXISTS default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -EXCHANGE TABLES default.beacon_api_eth_v1_events_voluntary_exit_local -AND tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}'; - -CREATE TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_voluntary_exit_local, - cityHash64( - wallclock_epoch_start_date_time, - meta_network_name, - meta_client_name, - validator_index - ) -); - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS tmp.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/045_canonical_beacon_committee.down.sql b/deploy/migrations/clickhouse/045_canonical_beacon_committee.down.sql deleted file mode 100644 index 9a6824433..000000000 --- a/deploy/migrations/clickhouse/045_canonical_beacon_committee.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.canonical_beacon_committee ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_beacon_committee_local ON cluster '{cluster}' SYNC; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/045_canonical_beacon_committee.up.sql b/deploy/migrations/clickhouse/045_canonical_beacon_committee.up.sql deleted file mode 100644 index f41c5c450..000000000 --- a/deploy/migrations/clickhouse/045_canonical_beacon_committee.up.sql +++ /dev/null @@ -1,53 +0,0 @@ -CREATE TABLE default.canonical_beacon_committee_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `committee_index` LowCardinality(String) COMMENT 'The committee index in the beacon API committee payload', - `validators` Array(UInt32) COMMENT 'The validator indices in the beacon API committee payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API committee payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - committee_index, - ) COMMENT 'Contains canonical beacon API /eth/v1/beacon/committees data.'; - -CREATE TABLE default.canonical_beacon_committee ON CLUSTER '{cluster}' AS default.canonical_beacon_committee_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_committee_local, - cityHash64( - slot_start_date_time, - meta_network_name, - committee_index - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/046_remove_canonical_event_time.down.sql b/deploy/migrations/clickhouse/046_remove_canonical_event_time.down.sql deleted file mode 100644 index 77244a815..000000000 --- a/deploy/migrations/clickhouse/046_remove_canonical_event_time.down.sql +++ /dev/null @@ -1,294 +0,0 @@ -DROP TABLE IF EXISTS default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_validators ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_validators_pubkeys ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_validators_withdrawal_credentials ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_committee ON CLUSTER '{cluster}' SYNC; - -ALTER TABLE - default.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_block_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_validators_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_validators_pubkeys_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_validators_withdrawal_credentials_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE - default.canonical_beacon_committee_local ON CLUSTER '{cluster}' -ADD - COLUMN event_date_time DateTime64(3) COMMENT 'When the client fetched the data from the beacon node' CODEC(DoubleDelta, ZSTD(1)); - -CREATE TABLE default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' AS default.canonical_beacon_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_blob_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - blob_index - ) -); - -CREATE TABLE default.canonical_beacon_block ON CLUSTER '{cluster}' AS default.canonical_beacon_block_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_local, - cityHash64( - slot_start_date_time, - meta_network_name - ) -); - -CREATE TABLE default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' AS default.canonical_beacon_block_attester_slashing_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_attester_slashing_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - attestation_1_attesting_indices, - attestation_2_attesting_indices, - attestation_1_data_slot, - attestation_2_data_slot, - attestation_1_data_beacon_block_root, - attestation_2_data_beacon_block_root - ) -); - -CREATE TABLE default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' AS default.canonical_beacon_block_bls_to_execution_change_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_bls_to_execution_change_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - exchanging_message_validator_index, - exchanging_message_from_bls_pubkey, - exchanging_message_to_execution_address - ) -); - -CREATE TABLE default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' AS default.canonical_beacon_block_deposit_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_deposit_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - deposit_data_pubkey, - deposit_proof - ) -); - -CREATE TABLE default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' AS default.canonical_beacon_block_execution_transaction_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_execution_transaction_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - position, - hash, - nonce - ) -); - -CREATE TABLE default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' AS default.canonical_beacon_block_proposer_slashing_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_proposer_slashing_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - signed_header_1_message_slot, - signed_header_2_message_slot, - signed_header_1_message_proposer_index, - signed_header_2_message_proposer_index, - signed_header_1_message_body_root, - signed_header_2_message_body_root - ) -); - -CREATE TABLE default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' AS default.canonical_beacon_block_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_voluntary_exit_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - voluntary_exit_message_epoch, - voluntary_exit_message_validator_index - ) -); - -CREATE TABLE default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' AS default.canonical_beacon_block_withdrawal_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_withdrawal_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - withdrawal_index, - withdrawal_validator_index - ) -); - -CREATE TABLE default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' AS default.canonical_beacon_elaborated_attestation_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_elaborated_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - block_slot, - position_in_block, - beacon_block_root, - slot, - committee_index, - source_root, - target_root - ) -); - -CREATE TABLE default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' AS default.canonical_beacon_proposer_duty_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_proposer_duty_local, - cityHash64( - slot_start_date_time, - meta_network_name, - proposer_validator_index, - proposer_pubkey - ) -); - -CREATE TABLE default.canonical_beacon_validators ON CLUSTER '{cluster}' AS default.canonical_beacon_validators_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_validators_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - `index`, - `status` - ) -); - -CREATE TABLE default.canonical_beacon_validators_pubkeys on cluster '{cluster}' AS default.canonical_beacon_validators_pubkeys_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_validators_pubkeys_local, - cityHash64(`index`, meta_network_name) -); - -CREATE TABLE default.canonical_beacon_validators_withdrawal_credentials on cluster '{cluster}' AS default.canonical_beacon_validators_withdrawal_credentials_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_validators_withdrawal_credentials_local, - cityHash64(`index`, meta_network_name) -); - -CREATE TABLE default.canonical_beacon_committee ON CLUSTER '{cluster}' AS default.canonical_beacon_committee_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_committee_local, - cityHash64( - slot_start_date_time, - meta_network_name, - committee_index - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/046_remove_canonical_event_time.up.sql b/deploy/migrations/clickhouse/046_remove_canonical_event_time.up.sql deleted file mode 100644 index 0fadf7792..000000000 --- a/deploy/migrations/clickhouse/046_remove_canonical_event_time.up.sql +++ /dev/null @@ -1,264 +0,0 @@ -DROP TABLE IF EXISTS default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_validators ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_validators_pubkeys ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_validators_withdrawal_credentials ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_beacon_committee ON CLUSTER '{cluster}' SYNC; - -ALTER TABLE - default.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_block_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_block_bls_to_execution_change_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_block_proposer_slashing_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_validators_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_validators_pubkeys_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_validators_withdrawal_credentials_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -ALTER TABLE - default.canonical_beacon_committee_local ON CLUSTER '{cluster}' DROP COLUMN event_date_time; - -CREATE TABLE default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' AS default.canonical_beacon_blob_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_blob_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - blob_index - ) -) COMMENT 'Contains a blob sidecar from a beacon block.'; - -CREATE TABLE default.canonical_beacon_block ON CLUSTER '{cluster}' AS default.canonical_beacon_block_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_local, - cityHash64( - slot_start_date_time, - meta_network_name - ) -) COMMENT 'Contains beacon block from a beacon node.'; - -CREATE TABLE default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' AS default.canonical_beacon_block_attester_slashing_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_attester_slashing_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - attestation_1_attesting_indices, - attestation_2_attesting_indices, - attestation_1_data_slot, - attestation_2_data_slot, - attestation_1_data_beacon_block_root, - attestation_2_data_beacon_block_root - ) -) COMMENT 'Contains attester slashing from a beacon block.'; - -CREATE TABLE default.canonical_beacon_block_bls_to_execution_change ON CLUSTER '{cluster}' AS default.canonical_beacon_block_bls_to_execution_change_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_bls_to_execution_change_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - exchanging_message_validator_index, - exchanging_message_from_bls_pubkey, - exchanging_message_to_execution_address - ) -) COMMENT 'Contains bls to execution change from a beacon block.'; - -CREATE TABLE default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' AS default.canonical_beacon_block_deposit_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_deposit_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - deposit_data_pubkey, - deposit_proof - ) -) COMMENT 'Contains a deposit from a beacon block.'; - -CREATE TABLE default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' AS default.canonical_beacon_block_execution_transaction_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_execution_transaction_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - position, - hash, - nonce - ) -) COMMENT 'Contains execution transaction from a beacon block.'; - -CREATE TABLE default.canonical_beacon_block_proposer_slashing ON CLUSTER '{cluster}' AS default.canonical_beacon_block_proposer_slashing_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_proposer_slashing_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - signed_header_1_message_slot, - signed_header_2_message_slot, - signed_header_1_message_proposer_index, - signed_header_2_message_proposer_index, - signed_header_1_message_body_root, - signed_header_2_message_body_root - ) -) COMMENT 'Contains proposer slashing from a beacon block.'; - -CREATE TABLE default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' AS default.canonical_beacon_block_voluntary_exit_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_voluntary_exit_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - voluntary_exit_message_epoch, - voluntary_exit_message_validator_index - ) -) COMMENT 'Contains a voluntary exit from a beacon block.'; - -CREATE TABLE default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' AS default.canonical_beacon_block_withdrawal_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_withdrawal_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - withdrawal_index, - withdrawal_validator_index - ) -) COMMENT 'Contains a withdrawal from a beacon block.'; - -CREATE TABLE default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' AS default.canonical_beacon_elaborated_attestation_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_elaborated_attestation_local, - cityHash64( - slot_start_date_time, - meta_network_name, - block_root, - block_slot, - position_in_block, - beacon_block_root, - slot, - committee_index, - source_root, - target_root - ) -) COMMENT 'Contains elaborated attestations from beacon blocks.'; - -CREATE TABLE default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' AS default.canonical_beacon_proposer_duty_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_proposer_duty_local, - cityHash64( - slot_start_date_time, - meta_network_name, - proposer_validator_index, - proposer_pubkey - ) -) COMMENT 'Contains a proposer duty from a beacon block.'; - -CREATE TABLE default.canonical_beacon_validators ON CLUSTER '{cluster}' AS default.canonical_beacon_validators_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_validators_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - `index`, - `status` - ) -) COMMENT 'Contains a validator state for an epoch.'; - -CREATE TABLE default.canonical_beacon_validators_pubkeys on cluster '{cluster}' AS default.canonical_beacon_validators_pubkeys_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_validators_pubkeys_local, - cityHash64(`index`, meta_network_name) -) COMMENT 'Contains a validator pubkeys for an epoch.'; - -CREATE TABLE default.canonical_beacon_validators_withdrawal_credentials on cluster '{cluster}' AS default.canonical_beacon_validators_withdrawal_credentials_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_validators_withdrawal_credentials_local, - cityHash64(`index`, meta_network_name) -) COMMENT 'Contains a validator withdrawal credentials for an epoch.'; - -CREATE TABLE default.canonical_beacon_committee ON CLUSTER '{cluster}' AS default.canonical_beacon_committee_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_committee_local, - cityHash64( - slot_start_date_time, - meta_network_name, - committee_index - ) -) COMMENT 'Contains canonical beacon API /eth/v1/beacon/committees data.'; diff --git a/deploy/migrations/clickhouse/047_block_execution_payloads.down.sql b/deploy/migrations/clickhouse/047_block_execution_payloads.down.sql deleted file mode 100644 index 9aaff2b43..000000000 --- a/deploy/migrations/clickhouse/047_block_execution_payloads.down.sql +++ /dev/null @@ -1,27 +0,0 @@ -ALTER TABLE canonical_beacon_block ON CLUSTER '{cluster}' - DROP COLUMN execution_payload_base_fee_per_gas, - DROP COLUMN execution_payload_blob_gas_used, - DROP COLUMN execution_payload_excess_blob_gas, - DROP COLUMN execution_payload_gas_limit, - DROP COLUMN execution_payload_gas_used; - -ALTER TABLE canonical_beacon_block_local ON CLUSTER '{cluster}' - DROP COLUMN execution_payload_base_fee_per_gas, - DROP COLUMN execution_payload_blob_gas_used, - DROP COLUMN execution_payload_excess_blob_gas, - DROP COLUMN execution_payload_gas_limit, - DROP COLUMN execution_payload_gas_used; - -ALTER TABLE beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' - DROP COLUMN execution_payload_base_fee_per_gas, - DROP COLUMN execution_payload_blob_gas_used, - DROP COLUMN execution_payload_excess_blob_gas, - DROP COLUMN execution_payload_gas_limit, - DROP COLUMN execution_payload_gas_used; - -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' - DROP COLUMN execution_payload_base_fee_per_gas, - DROP COLUMN execution_payload_blob_gas_used, - DROP COLUMN execution_payload_excess_blob_gas, - DROP COLUMN execution_payload_gas_limit, - DROP COLUMN execution_payload_gas_used; diff --git a/deploy/migrations/clickhouse/047_block_execution_payloads.up.sql b/deploy/migrations/clickhouse/047_block_execution_payloads.up.sql deleted file mode 100644 index e1f6afd56..000000000 --- a/deploy/migrations/clickhouse/047_block_execution_payloads.up.sql +++ /dev/null @@ -1,27 +0,0 @@ -ALTER TABLE canonical_beacon_block_local ON CLUSTER '{cluster}' - ADD COLUMN execution_payload_base_fee_per_gas Nullable(UInt128) COMMENT 'Base fee per gas for execution payload' CODEC(ZSTD(1)) AFTER execution_payload_fee_recipient, - ADD COLUMN execution_payload_blob_gas_used Nullable(UInt64) COMMENT 'Gas used for blobs in execution payload' CODEC(ZSTD(1)) AFTER execution_payload_base_fee_per_gas, - ADD COLUMN execution_payload_excess_blob_gas Nullable(UInt64) COMMENT 'Excess gas used for blobs in execution payload' CODEC(ZSTD(1)) AFTER execution_payload_blob_gas_used, - ADD COLUMN execution_payload_gas_limit Nullable(UInt64) COMMENT 'Gas limit for execution payload' CODEC(DoubleDelta, ZSTD(1)) AFTER execution_payload_excess_blob_gas, - ADD COLUMN execution_payload_gas_used Nullable(UInt64) COMMENT 'Gas used for execution payload' CODEC(ZSTD(1)) AFTER execution_payload_gas_limit; - -ALTER TABLE canonical_beacon_block ON CLUSTER '{cluster}' - ADD COLUMN execution_payload_base_fee_per_gas Nullable(UInt128) COMMENT 'Base fee per gas for execution payload' CODEC(ZSTD(1)) AFTER execution_payload_fee_recipient, - ADD COLUMN execution_payload_blob_gas_used Nullable(UInt64) COMMENT 'Gas used for blobs in execution payload' CODEC(ZSTD(1)) AFTER execution_payload_base_fee_per_gas, - ADD COLUMN execution_payload_excess_blob_gas Nullable(UInt64) COMMENT 'Excess gas used for blobs in execution payload' CODEC(ZSTD(1)) AFTER execution_payload_blob_gas_used, - ADD COLUMN execution_payload_gas_limit Nullable(UInt64) COMMENT 'Gas limit for execution payload' CODEC(DoubleDelta, ZSTD(1)) AFTER execution_payload_excess_blob_gas, - ADD COLUMN execution_payload_gas_used Nullable(UInt64) COMMENT 'Gas used for execution payload' CODEC(ZSTD(1)) AFTER execution_payload_gas_limit; - -ALTER TABLE beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' - ADD COLUMN execution_payload_base_fee_per_gas Nullable(UInt128) COMMENT 'Base fee per gas for execution payload' CODEC(ZSTD(1)) AFTER execution_payload_fee_recipient, - ADD COLUMN execution_payload_blob_gas_used Nullable(UInt64) COMMENT 'Gas used for blobs in execution payload' CODEC(ZSTD(1)) AFTER execution_payload_base_fee_per_gas, - ADD COLUMN execution_payload_excess_blob_gas Nullable(UInt64) COMMENT 'Excess gas used for blobs in execution payload' CODEC(ZSTD(1)) AFTER execution_payload_blob_gas_used, - ADD COLUMN execution_payload_gas_limit Nullable(UInt64) COMMENT 'Gas limit for execution payload' CODEC(DoubleDelta, ZSTD(1)) AFTER execution_payload_excess_blob_gas, - ADD COLUMN execution_payload_gas_used Nullable(UInt64) COMMENT 'Gas used for execution payload' CODEC(ZSTD(1)) AFTER execution_payload_gas_limit; - -ALTER TABLE beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' - ADD COLUMN execution_payload_base_fee_per_gas Nullable(UInt128) COMMENT 'Base fee per gas for execution payload' CODEC(ZSTD(1)) AFTER execution_payload_fee_recipient, - ADD COLUMN execution_payload_blob_gas_used Nullable(UInt64) COMMENT 'Gas used for blobs in execution payload' CODEC(ZSTD(1)) AFTER execution_payload_base_fee_per_gas, - ADD COLUMN execution_payload_excess_blob_gas Nullable(UInt64) COMMENT 'Excess gas used for blobs in execution payload' CODEC(ZSTD(1)) AFTER execution_payload_blob_gas_used, - ADD COLUMN execution_payload_gas_limit Nullable(UInt64) COMMENT 'Gas limit for execution payload' CODEC(DoubleDelta, ZSTD(1)) AFTER execution_payload_excess_blob_gas, - ADD COLUMN execution_payload_gas_used Nullable(UInt64) COMMENT 'Gas used for execution payload' CODEC(ZSTD(1)) AFTER execution_payload_gas_limit; diff --git a/deploy/migrations/clickhouse/048_nullable_canonical_beacon_block_execution.down.sql b/deploy/migrations/clickhouse/048_nullable_canonical_beacon_block_execution.down.sql deleted file mode 100644 index 92da6f21d..000000000 --- a/deploy/migrations/clickhouse/048_nullable_canonical_beacon_block_execution.down.sql +++ /dev/null @@ -1,13 +0,0 @@ -ALTER TABLE default.canonical_beacon_block ON CLUSTER '{cluster}' - MODIFY COLUMN `execution_payload_block_hash` FixedString(66) COMMENT 'The block hash of the execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_block_number` UInt32 COMMENT 'The block number of the execution payload' CODEC(DoubleDelta, ZSTD(1)), - MODIFY COLUMN `execution_payload_fee_recipient` String COMMENT 'The recipient of the fee for this execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_state_root` FixedString(66) COMMENT 'The state root of the execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_parent_hash` FixedString(66) COMMENT 'The parent hash of the execution payload' CODEC(ZSTD(1)); - -ALTER TABLE default.canonical_beacon_block_local ON CLUSTER '{cluster}' - MODIFY COLUMN `execution_payload_block_hash` FixedString(66) COMMENT 'The block hash of the execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_block_number` UInt32 COMMENT 'The block number of the execution payload' CODEC(DoubleDelta, ZSTD(1)), - MODIFY COLUMN `execution_payload_fee_recipient` String COMMENT 'The recipient of the fee for this execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_state_root` FixedString(66) COMMENT 'The state root of the execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_parent_hash` FixedString(66) COMMENT 'The parent hash of the execution payload' CODEC(ZSTD(1)); diff --git a/deploy/migrations/clickhouse/048_nullable_canonical_beacon_block_execution.up.sql b/deploy/migrations/clickhouse/048_nullable_canonical_beacon_block_execution.up.sql deleted file mode 100644 index 37455d25b..000000000 --- a/deploy/migrations/clickhouse/048_nullable_canonical_beacon_block_execution.up.sql +++ /dev/null @@ -1,13 +0,0 @@ -ALTER TABLE default.canonical_beacon_block_local ON CLUSTER '{cluster}' - MODIFY COLUMN `execution_payload_block_hash` Nullable(FixedString(66)) COMMENT 'The block hash of the execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_block_number` Nullable(UInt32) COMMENT 'The block number of the execution payload' CODEC(DoubleDelta, ZSTD(1)), - MODIFY COLUMN `execution_payload_fee_recipient` Nullable(String) COMMENT 'The recipient of the fee for this execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_state_root` Nullable(FixedString(66)) COMMENT 'The state root of the execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_parent_hash` Nullable(FixedString(66)) COMMENT 'The parent hash of the execution payload' CODEC(ZSTD(1)); - -ALTER TABLE default.canonical_beacon_block ON CLUSTER '{cluster}' - MODIFY COLUMN `execution_payload_block_hash` Nullable(FixedString(66)) COMMENT 'The block hash of the execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_block_number` Nullable(UInt32) COMMENT 'The block number of the execution payload' CODEC(DoubleDelta, ZSTD(1)), - MODIFY COLUMN `execution_payload_fee_recipient` Nullable(String) COMMENT 'The recipient of the fee for this execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_state_root` Nullable(FixedString(66)) COMMENT 'The state root of the execution payload' CODEC(ZSTD(1)), - MODIFY COLUMN `execution_payload_parent_hash` Nullable(FixedString(66)) COMMENT 'The parent hash of the execution payload' CODEC(ZSTD(1)); diff --git a/deploy/migrations/clickhouse/049_canonical_execution.down.sql b/deploy/migrations/clickhouse/049_canonical_execution.down.sql deleted file mode 100644 index 3e0a9e7ce..000000000 --- a/deploy/migrations/clickhouse/049_canonical_execution.down.sql +++ /dev/null @@ -1,34 +0,0 @@ -DROP TABLE IF EXISTS default.canonical_execution_block ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_block_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_transaction ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_transaction_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_balance_diffs ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_balance_diffs_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_balance_reads ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_balance_reads_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_four_byte_counts ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_four_byte_counts_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_erc20_transfers ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_erc20_transfers_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_erc721_transfers ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_erc721_transfers_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_native_transfers ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_native_transfers_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_nonce_diffs ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_nonce_diffs_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_nonce_reads ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_nonce_reads_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_address_appearances ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_address_appearances_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_contracts ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_contracts_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_traces ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_traces_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_logs ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_logs_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_storage_diffs ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_storage_diffs_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_storage_reads ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_storage_reads_local ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS admin.cryo ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS admin.cryo_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/049_canonical_execution.up.sql b/deploy/migrations/clickhouse/049_canonical_execution.up.sql deleted file mode 100644 index 2e963b58a..000000000 --- a/deploy/migrations/clickhouse/049_canonical_execution.up.sql +++ /dev/null @@ -1,634 +0,0 @@ -CREATE DATABASE IF NOT EXISTS `admin` ON CLUSTER '{cluster}'; - -CREATE TABLE admin.cryo_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), - `dataset` LowCardinality(String), - `mode` LowCardinality(String), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) -ORDER BY - ( - dataset, - mode, - meta_network_name - ); - -CREATE TABLE admin.cryo ON CLUSTER '{cluster}' AS admin.cryo_local ENGINE = Distributed( - '{cluster}', - admin, - cryo_local, - cityHash64( - dataset, - mode, - meta_network_name - ) -); - -CREATE TABLE default.canonical_execution_block_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_date_time` DateTime64(3) COMMENT 'The block timestamp' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `block_hash` FixedString(66) COMMENT 'The block hash' CODEC(ZSTD(1)), - `author` Nullable(String) COMMENT 'The block author' CODEC(ZSTD(1)), - `gas_used` Nullable(UInt64) COMMENT 'The block gas used' CODEC(DoubleDelta, ZSTD(1)), - `extra_data` Nullable(String) COMMENT 'The block extra data in hex' CODEC(ZSTD(1)), - `extra_data_string` Nullable(String) COMMENT 'The block extra data in UTF-8 string' CODEC(ZSTD(1)), - `base_fee_per_gas` Nullable(UInt64) COMMENT 'The block base fee per gas' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - ) COMMENT 'Contains canonical execution block data.'; - -CREATE TABLE default.canonical_execution_block ON CLUSTER '{cluster}' AS default.canonical_execution_block_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_block_local, - cityHash64( - block_number, - meta_network_name - ) -); - -CREATE TABLE default.canonical_execution_transaction_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The transaction nonce' CODEC(ZSTD(1)), - `from_address` String COMMENT 'The transaction from address' CODEC(ZSTD(1)), - `to_address` Nullable(String) COMMENT 'The transaction to address' CODEC(ZSTD(1)), - `value` UInt256 COMMENT 'The transaction value in float64' CODEC(ZSTD(1)), - `input` Nullable(String) COMMENT 'The transaction input in hex' CODEC(ZSTD(1)), - `gas_limit` UInt64 COMMENT 'The transaction gas limit' CODEC(ZSTD(1)), - `gas_used` UInt64 COMMENT 'The transaction gas used' CODEC(ZSTD(1)), - `gas_price` UInt64 COMMENT 'The transaction gas price' CODEC(ZSTD(1)), - `transaction_type` UInt32 COMMENT 'The transaction type' CODEC(ZSTD(1)), - `max_priority_fee_per_gas` UInt64 COMMENT 'The transaction max priority fee per gas' CODEC(ZSTD(1)), - `max_fee_per_gas` UInt64 COMMENT 'The transaction max fee per gas' CODEC(ZSTD(1)), - `success` Bool COMMENT 'The transaction success' CODEC(ZSTD(1)), - `n_input_bytes` UInt32 COMMENT 'The transaction input bytes' CODEC(ZSTD(1)), - `n_input_zero_bytes` UInt32 COMMENT 'The transaction input zero bytes' CODEC(ZSTD(1)), - `n_input_nonzero_bytes` UInt32 COMMENT 'The transaction input nonzero bytes' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash - ) COMMENT 'Contains canonical execution transaction data.'; - -CREATE TABLE default.canonical_execution_transaction ON CLUSTER '{cluster}' AS default.canonical_execution_transaction_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_transaction_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash - ) -); - -CREATE TABLE default.canonical_execution_balance_diffs_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the balance diff' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the balance diff within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `address` String COMMENT 'The address of the balance diff' CODEC(ZSTD(1)), - `from_value` UInt256 COMMENT 'The from value of the balance diff' CODEC(ZSTD(1)), - `to_value` UInt256 COMMENT 'The to value of the balance diff' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution balance diff data.'; - -CREATE TABLE default.canonical_execution_balance_diffs ON CLUSTER '{cluster}' AS default.canonical_execution_balance_diffs_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_balance_diffs_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_balance_reads_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the balance read' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the balance read within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `address` String COMMENT 'The address of the balance read' CODEC(ZSTD(1)), - `balance` UInt256 COMMENT 'The balance that was read' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution balance read data.'; - -CREATE TABLE default.canonical_execution_balance_reads ON CLUSTER '{cluster}' AS default.canonical_execution_balance_reads_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_balance_reads_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_four_byte_counts_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), - `signature` String COMMENT 'The signature of the four byte count' CODEC(ZSTD(1)), - `size` UInt64 COMMENT 'The size of the four byte count' CODEC(ZSTD(1)), - `count` UInt64 COMMENT 'The count of the four byte count' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash - ) COMMENT 'Contains canonical execution four byte count data.'; - -CREATE TABLE default.canonical_execution_four_byte_counts ON CLUSTER '{cluster}' AS default.canonical_execution_four_byte_counts_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_four_byte_counts_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash - ) -); - -CREATE TABLE default.canonical_execution_erc20_transfers_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the transfer within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `log_index` UInt64 COMMENT 'The log index in the block' CODEC(DoubleDelta, ZSTD(1)), - `erc20` String COMMENT 'The erc20 address' CODEC(ZSTD(1)), - `from_address` String COMMENT 'The from address' CODEC(ZSTD(1)), - `to_address` String COMMENT 'The to address' CODEC(ZSTD(1)), - `value` UInt256 COMMENT 'The value of the transfer' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution erc20 transfer data.'; - -CREATE TABLE default.canonical_execution_erc20_transfers ON CLUSTER '{cluster}' AS default.canonical_execution_erc20_transfers_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_erc20_transfers_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_erc721_transfers_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the transfer within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `log_index` UInt64 COMMENT 'The log index in the block' CODEC(DoubleDelta, ZSTD(1)), - `erc20` String COMMENT 'The erc20 address' CODEC(ZSTD(1)), - `from_address` String COMMENT 'The from address' CODEC(ZSTD(1)), - `to_address` String COMMENT 'The to address' CODEC(ZSTD(1)), - `token` UInt256 COMMENT 'The token id' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution erc721 transfer data.'; - -CREATE TABLE default.canonical_execution_erc721_transfers ON CLUSTER '{cluster}' AS default.canonical_execution_erc721_transfers_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_erc721_transfers_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_native_transfers_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the transfer within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `transfer_index` UInt64 COMMENT 'The transfer index' CODEC(DoubleDelta, ZSTD(1)), - `from_address` String COMMENT 'The from address' CODEC(ZSTD(1)), - `to_address` String COMMENT 'The to address' CODEC(ZSTD(1)), - `value` UInt256 COMMENT 'The value of the approval' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution native transfer data.'; - -CREATE TABLE default.canonical_execution_native_transfers ON CLUSTER '{cluster}' AS default.canonical_execution_native_transfers_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_native_transfers_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_nonce_diffs_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the nonce diff' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the nonce diff within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `address` String COMMENT 'The address of the nonce diff' CODEC(ZSTD(1)), - `from_value` UInt64 COMMENT 'The from value of the nonce diff' CODEC(ZSTD(1)), - `to_value` UInt64 COMMENT 'The to value of the nonce diff' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution nonce diff data.'; - -CREATE TABLE default.canonical_execution_nonce_diffs ON CLUSTER '{cluster}' AS default.canonical_execution_nonce_diffs_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_nonce_diffs_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_nonce_reads_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt64 COMMENT 'The transaction index in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the nonce read' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the nonce read within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `address` String COMMENT 'The address of the nonce read' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The nonce that was read' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution nonce read data.'; - -CREATE TABLE default.canonical_execution_nonce_reads ON CLUSTER '{cluster}' AS default.canonical_execution_nonce_reads_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_nonce_reads_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_address_appearances_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash that caused the address appearance' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the address appearance within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `address` String COMMENT 'The address of the address appearance' CODEC(ZSTD(1)), - `relationship` LowCardinality(String) COMMENT 'The relationship of the address to the transaction', - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution address appearance data.'; - -CREATE TABLE default.canonical_execution_address_appearances ON CLUSTER '{cluster}' AS default.canonical_execution_address_appearances_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_address_appearances_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_contracts_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt32 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash that created the contract' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the contract creation within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `create_index` UInt32 COMMENT 'The create index' CODEC(DoubleDelta, ZSTD(1)), - `contract_address` String COMMENT 'The contract address' CODEC(ZSTD(1)), - `deployer` String COMMENT 'The address of the contract deployer' CODEC(ZSTD(1)), - `factory` String COMMENT 'The address of the factory that deployed the contract' CODEC(ZSTD(1)), - `init_code` String COMMENT 'The initialization code of the contract' CODEC(ZSTD(1)), - `code` Nullable(String) COMMENT 'The code of the contract' CODEC(ZSTD(1)), - `init_code_hash` String COMMENT 'The hash of the initialization code' CODEC(ZSTD(1)), - `n_init_code_bytes` UInt32 COMMENT 'Number of bytes in the initialization code' CODEC(DoubleDelta, ZSTD(1)), - `n_code_bytes` UInt32 COMMENT 'Number of bytes in the contract code' CODEC(DoubleDelta, ZSTD(1)), - `code_hash` String COMMENT 'The hash of the contract code' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution contract data.'; - -CREATE TABLE default.canonical_execution_contracts ON CLUSTER '{cluster}' AS default.canonical_execution_contracts_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_contracts_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_traces_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt32 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt32 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the trace within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `action_from` String COMMENT 'The from address of the action' CODEC(ZSTD(1)), - `action_to` Nullable(String) COMMENT 'The to address of the action' CODEC(ZSTD(1)), - `action_value` String COMMENT 'The value of the action' CODEC(ZSTD(1)), - `action_gas` UInt32 COMMENT 'The gas provided for the action' CODEC(DoubleDelta, ZSTD(1)), - `action_input` Nullable(String) COMMENT 'The input data for the action' CODEC(ZSTD(1)), - `action_call_type` LowCardinality(String) COMMENT 'The call type of the action' CODEC(ZSTD(1)), - `action_init` Nullable(String) COMMENT 'The initialization code for the action' CODEC(ZSTD(1)), - `action_reward_type` String COMMENT 'The reward type for the action' CODEC(ZSTD(1)), - `action_type` LowCardinality(String) COMMENT 'The type of the action' CODEC(ZSTD(1)), - `result_gas_used` UInt32 COMMENT 'The gas used in the result' CODEC(DoubleDelta, ZSTD(1)), - `result_output` Nullable(String) COMMENT 'The output of the result' CODEC(ZSTD(1)), - `result_code` Nullable(String) COMMENT 'The code returned in the result' CODEC(ZSTD(1)), - `result_address` Nullable(String) COMMENT 'The address returned in the result' CODEC(ZSTD(1)), - `trace_address` Nullable(String) COMMENT 'The trace address' CODEC(ZSTD(1)), - `subtraces` UInt32 COMMENT 'The number of subtraces' CODEC(DoubleDelta, ZSTD(1)), - `error` Nullable(String) COMMENT 'The error, if any, in the trace' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution traces data.'; - -CREATE TABLE default.canonical_execution_traces ON CLUSTER '{cluster}' AS default.canonical_execution_traces_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_traces_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_logs_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt32 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt32 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash associated with the log' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the log within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `log_index` UInt32 COMMENT 'The log index within the block' CODEC(DoubleDelta, ZSTD(1)), - `address` String COMMENT 'The address associated with the log' CODEC(ZSTD(1)), - `topic0` String COMMENT 'The first topic of the log' CODEC(ZSTD(1)), - `topic1` Nullable(String) COMMENT 'The second topic of the log' CODEC(ZSTD(1)), - `topic2` Nullable(String) COMMENT 'The third topic of the log' CODEC(ZSTD(1)), - `topic3` Nullable(String) COMMENT 'The fourth topic of the log' CODEC(ZSTD(1)), - `data` Nullable(String) COMMENT 'The data associated with the log' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution logs data.'; - -CREATE TABLE default.canonical_execution_logs ON CLUSTER '{cluster}' AS default.canonical_execution_logs_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_logs_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_storage_diffs_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt32 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt32 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash associated with the storage diff' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the storage diff within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `address` String COMMENT 'The address associated with the storage diff' CODEC(ZSTD(1)), - `slot` String COMMENT 'The storage slot key' CODEC(ZSTD(1)), - `from_value` String COMMENT 'The original value before the storage diff' CODEC(ZSTD(1)), - `to_value` String COMMENT 'The new value after the storage diff' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution storage diffs data.'; - -CREATE TABLE default.canonical_execution_storage_diffs ON CLUSTER '{cluster}' AS default.canonical_execution_storage_diffs_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_storage_diffs_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); - -CREATE TABLE default.canonical_execution_storage_reads_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt32 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_index` UInt32 COMMENT 'The transaction index' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash associated with the storage read' CODEC(ZSTD(1)), - `internal_index` UInt32 COMMENT 'The internal index of the storage read within the transaction' CODEC(DoubleDelta, ZSTD(1)), - `contract_address` String COMMENT 'The contract address associated with the storage read' CODEC(ZSTD(1)), - `slot` String COMMENT 'The storage slot key' CODEC(ZSTD(1)), - `value` String COMMENT 'The value read from the storage slot' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) COMMENT 'Contains canonical execution storage reads data.'; - -CREATE TABLE default.canonical_execution_storage_reads ON CLUSTER '{cluster}' AS default.canonical_execution_storage_reads_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_storage_reads_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - internal_index - ) -); diff --git a/deploy/migrations/clickhouse/050_ethseer_validator_entity.down.sql b/deploy/migrations/clickhouse/050_ethseer_validator_entity.down.sql deleted file mode 100644 index ad2ffc9bd..000000000 --- a/deploy/migrations/clickhouse/050_ethseer_validator_entity.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.ethseer_validator_entity ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.ethseer_validator_entity_local ON CLUSTER '{cluster}'; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/050_ethseer_validator_entity.up.sql b/deploy/migrations/clickhouse/050_ethseer_validator_entity.up.sql deleted file mode 100644 index 9da730826..000000000 --- a/deploy/migrations/clickhouse/050_ethseer_validator_entity.up.sql +++ /dev/null @@ -1,21 +0,0 @@ -CREATE TABLE default.ethseer_validator_entity_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the client fetched the beacon block from ethseer.io' CODEC(DoubleDelta, ZSTD(1)), - `index` UInt32 COMMENT 'The index of the validator' CODEC(DoubleDelta, ZSTD(1)), - `pubkey` String COMMENT 'The public key of the validator' CODEC(ZSTD(1)), - `entity` String COMMENT 'The entity of the validator' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) -ORDER BY - (index, pubkey, meta_network_name) COMMENT 'Contains a mapping of validators to entities'; - -CREATE TABLE default.ethseer_validator_entity ON CLUSTER '{cluster}' AS default.ethseer_validator_entity_local ENGINE = Distributed( - '{cluster}', - default, - ethseer_validator_entity_local, - cityHash64(`index`, pubkey, meta_network_name) -); diff --git a/deploy/migrations/clickhouse/051_mev_relay_block_bids.down.sql b/deploy/migrations/clickhouse/051_mev_relay_block_bids.down.sql deleted file mode 100644 index 02e1cb162..000000000 --- a/deploy/migrations/clickhouse/051_mev_relay_block_bids.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS mev_relay_bid_trace on cluster '{cluster}' SYNC; -DROP TABLE IF EXISTS mev_relay_bid_trace_local on cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/051_mev_relay_block_bids.up.sql b/deploy/migrations/clickhouse/051_mev_relay_block_bids.up.sql deleted file mode 100644 index f88dfc918..000000000 --- a/deploy/migrations/clickhouse/051_mev_relay_block_bids.up.sql +++ /dev/null @@ -1,68 +0,0 @@ -CREATE TABLE default.mev_relay_bid_trace_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the bid was fetched' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number within the block bid' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The start time for the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number derived from the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The start time for the epoch that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_request_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_request_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_request_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_request_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `requested_at_slot_time` UInt32 COMMENT 'The time in the slot when the request was sent' CODEC(ZSTD(1)), - `response_at_slot_time` UInt32 COMMENT 'The time in the slot when the response was received' CODEC(ZSTD(1)), - `relay_name` String COMMENT 'The relay that the bid was fetched from' CODEC(ZSTD(1)), - `parent_hash` FixedString(66) COMMENT 'The parent hash of the bid' CODEC(ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number of the bid' CODEC(DoubleDelta, ZSTD(1)), - `block_hash` FixedString(66) COMMENT 'The block hash of the bid' CODEC(ZSTD(1)), - `builder_pubkey` String COMMENT 'The builder pubkey of the bid' CODEC(ZSTD(1)), - `proposer_pubkey` String COMMENT 'The proposer pubkey of the bid' CODEC(ZSTD(1)), - `proposer_fee_recipient` FixedString(42) COMMENT 'The proposer fee recipient of the bid' CODEC(ZSTD(1)), - `gas_limit` UInt64 COMMENT 'The gas limit of the bid' CODEC(DoubleDelta, ZSTD(1)), - `gas_used` UInt64 COMMENT 'The gas used of the bid' CODEC(DoubleDelta, ZSTD(1)), - `value` UInt256 COMMENT 'The transaction value in float64' CODEC(ZSTD(1)), - `num_tx` UInt32 COMMENT 'The number of transactions in the bid' CODEC(DoubleDelta, ZSTD(1)), - `timestamp` Int64 COMMENT 'The timestamp of the bid' CODEC(DoubleDelta, ZSTD(1)), - `timestamp_ms` Int64 COMMENT 'The timestamp of the bid in milliseconds' CODEC(DoubleDelta, ZSTD(1)), - `optimistic_submission` Bool COMMENT 'Whether the bid was optimistic' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - slot, - block_hash, - meta_client_name, - builder_pubkey, - proposer_pubkey - ) COMMENT 'Contains MEV relay block bids data.'; - -CREATE TABLE default.mev_relay_bid_trace ON CLUSTER '{cluster}' AS default.mev_relay_bid_trace_local ENGINE = Distributed( - '{cluster}', - default, - mev_relay_bid_trace_local, - cityHash64( - slot, - meta_network_name - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/052_mev_relay_proposer_payload_delivered.down.sql b/deploy/migrations/clickhouse/052_mev_relay_proposer_payload_delivered.down.sql deleted file mode 100644 index 2119eb9cb..000000000 --- a/deploy/migrations/clickhouse/052_mev_relay_proposer_payload_delivered.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS mev_relay_proposer_payload_delivered ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS mev_relay_proposer_payload_delivered_local ON CLUSTER '{cluster}' SYNC; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/052_mev_relay_proposer_payload_delivered.up.sql b/deploy/migrations/clickhouse/052_mev_relay_proposer_payload_delivered.up.sql deleted file mode 100644 index 6d235fc5e..000000000 --- a/deploy/migrations/clickhouse/052_mev_relay_proposer_payload_delivered.up.sql +++ /dev/null @@ -1,61 +0,0 @@ -CREATE TABLE default.mev_relay_proposer_payload_delivered_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the payload was delivered' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number within the payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The start time for the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number derived from the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The start time for the epoch that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number of the payload' CODEC(DoubleDelta, ZSTD(1)), - `relay_name` String COMMENT 'The relay that delivered the payload' CODEC(ZSTD(1)), - `block_hash` FixedString(66) COMMENT 'The block hash associated with the payload' CODEC(ZSTD(1)), - `proposer_pubkey` String COMMENT 'The proposer pubkey that received the payload' CODEC(ZSTD(1)), - `builder_pubkey` String COMMENT 'The builder pubkey that sent the payload' CODEC(ZSTD(1)), - `proposer_fee_recipient` FixedString(42) COMMENT 'The proposer fee recipient of the payload' CODEC(ZSTD(1)), - `gas_limit` UInt64 COMMENT 'The gas limit of the payload' CODEC(DoubleDelta, ZSTD(1)), - `gas_used` UInt64 COMMENT 'The gas used by the payload' CODEC(DoubleDelta, ZSTD(1)), - `num_tx` UInt32 COMMENT 'The number of transactions in the payload' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - relay_name, - block_hash, - meta_client_name, - builder_pubkey, - proposer_pubkey, - ) COMMENT 'Contains MEV relay proposer payload delivered data.'; - -CREATE TABLE default.mev_relay_proposer_payload_delivered ON CLUSTER '{cluster}' AS default.mev_relay_proposer_payload_delivered_local ENGINE = Distributed( - '{cluster}', - default, - mev_relay_proposer_payload_delivered_local, - cityHash64( - slot, - meta_network_name - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/053_add_bid_trace_relay_name_unique.down.sql b/deploy/migrations/clickhouse/053_add_bid_trace_relay_name_unique.down.sql deleted file mode 100644 index faa7c6bc3..000000000 --- a/deploy/migrations/clickhouse/053_add_bid_trace_relay_name_unique.down.sql +++ /dev/null @@ -1,5 +0,0 @@ --- Drop the distributed table -DROP TABLE IF EXISTS default.mev_relay_bid_trace ON CLUSTER '{cluster}' SYNC; - --- Drop the local table -DROP TABLE IF EXISTS default.mev_relay_bid_trace_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/053_add_bid_trace_relay_name_unique.up.sql b/deploy/migrations/clickhouse/053_add_bid_trace_relay_name_unique.up.sql deleted file mode 100644 index 0271dcc06..000000000 --- a/deploy/migrations/clickhouse/053_add_bid_trace_relay_name_unique.up.sql +++ /dev/null @@ -1,72 +0,0 @@ --- Step 1: Drop the existing tables -DROP TABLE IF EXISTS default.mev_relay_bid_trace ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.mev_relay_bid_trace_local ON CLUSTER '{cluster}' SYNC; - --- Step 2: Create the new table with updated ORDER BY key -CREATE TABLE default.mev_relay_bid_trace_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the bid was fetched' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number within the block bid' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The start time for the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number derived from the slot that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The start time for the epoch that the bid is for' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_request_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_request_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_request_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_request_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `requested_at_slot_time` UInt32 COMMENT 'The time in the slot when the request was sent' CODEC(ZSTD(1)), - `response_at_slot_time` UInt32 COMMENT 'The time in the slot when the response was received' CODEC(ZSTD(1)), - `relay_name` String COMMENT 'The relay that the bid was fetched from' CODEC(ZSTD(1)), - `parent_hash` FixedString(66) COMMENT 'The parent hash of the bid' CODEC(ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number of the bid' CODEC(DoubleDelta, ZSTD(1)), - `block_hash` FixedString(66) COMMENT 'The block hash of the bid' CODEC(ZSTD(1)), - `builder_pubkey` String COMMENT 'The builder pubkey of the bid' CODEC(ZSTD(1)), - `proposer_pubkey` String COMMENT 'The proposer pubkey of the bid' CODEC(ZSTD(1)), - `proposer_fee_recipient` FixedString(42) COMMENT 'The proposer fee recipient of the bid' CODEC(ZSTD(1)), - `gas_limit` UInt64 COMMENT 'The gas limit of the bid' CODEC(DoubleDelta, ZSTD(1)), - `gas_used` UInt64 COMMENT 'The gas used of the bid' CODEC(DoubleDelta, ZSTD(1)), - `value` UInt256 COMMENT 'The transaction value in float64' CODEC(ZSTD(1)), - `num_tx` UInt32 COMMENT 'The number of transactions in the bid' CODEC(DoubleDelta, ZSTD(1)), - `timestamp` Int64 COMMENT 'The timestamp of the bid' CODEC(DoubleDelta, ZSTD(1)), - `timestamp_ms` Int64 COMMENT 'The timestamp of the bid in milliseconds' CODEC(DoubleDelta, ZSTD(1)), - `optimistic_submission` Bool COMMENT 'Whether the bid was optimistic' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - relay_name, -- Add relay_name to the ORDER BY key since the same block can be offered through multiple relays - block_hash, - meta_client_name, - builder_pubkey, - proposer_pubkey - ) COMMENT 'Contains MEV relay block bids data.'; - --- Step 3: Create the new distributed table -CREATE TABLE default.mev_relay_bid_trace ON CLUSTER '{cluster}' AS default.mev_relay_bid_trace_local ENGINE = Distributed( - '{cluster}', - default, - mev_relay_bid_trace_local, - cityHash64(slot, meta_network_name) -); diff --git a/deploy/migrations/clickhouse/054_validator_block.down.sql b/deploy/migrations/clickhouse/054_validator_block.down.sql deleted file mode 100644 index 7971d5fb0..000000000 --- a/deploy/migrations/clickhouse/054_validator_block.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v3_validator_block ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v3_validator_block_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/054_validator_block.up.sql b/deploy/migrations/clickhouse/054_validator_block.up.sql deleted file mode 100644 index 3028a9ab1..000000000 --- a/deploy/migrations/clickhouse/054_validator_block.up.sql +++ /dev/null @@ -1,70 +0,0 @@ --- Step 1: Create the new table. -CREATE TABLE default.beacon_api_eth_v3_validator_block_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number within the payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the reorg slot started', - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `block_total_bytes` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload' CODEC(ZSTD(1)), - `block_total_bytes_compressed` Nullable(UInt32) COMMENT 'The total bytes of the beacon block payload when compressed using snappy' CODEC(ZSTD(1)), - `consensus_payload_value` Nullable(UInt64) COMMENT 'Consensus rewards paid to the proposer for this block, in Wei. Use to determine relative value of consensus blocks.' CODEC(ZSTD(1)), - `execution_payload_value` Nullable(UInt64) COMMENT 'Execution payload value in Wei. Use to determine relative value of execution payload.' CODEC(ZSTD(1)), - `execution_payload_block_number` UInt32 COMMENT 'The block number of the execution payload', - `execution_payload_base_fee_per_gas` Nullable(UInt128) COMMENT 'Base fee per gas for execution payload' CODEC(ZSTD(1)), - `execution_payload_blob_gas_used` Nullable(UInt64) COMMENT 'Gas used for blobs in execution payload' CODEC(ZSTD(1)), - `execution_payload_excess_blob_gas` Nullable(UInt64) COMMENT 'Excess gas used for blobs in execution payload' CODEC(ZSTD(1)), - `execution_payload_gas_limit` Nullable(UInt64) COMMENT 'Gas limit for execution payload' CODEC(DoubleDelta, ZSTD(1)), - `execution_payload_gas_used` Nullable(UInt64) COMMENT 'Gas used for execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_count` Nullable(UInt32) COMMENT 'The transaction count of the execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_total_bytes` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload' CODEC(ZSTD(1)), - `execution_payload_transactions_total_bytes_compressed` Nullable(UInt32) COMMENT 'The transaction total bytes of the execution payload when compressed using snappy' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event', - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event', - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event', - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event', - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event', - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY -( - slot_start_date_time, - meta_network_name, - meta_client_name, - event_date_time -) -COMMENT 'Contains beacon API /eth/v3/validator/blocks/{slot} data from each sentry client attached to a beacon node.'; - --- Step 2: Create the distributed table. -CREATE TABLE default.beacon_api_eth_v3_validator_block ON CLUSTER '{cluster}' AS default.beacon_api_eth_v3_validator_block_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v3_validator_block_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - event_date_time - ) -); diff --git a/deploy/migrations/clickhouse/055_mev_relay_validator_registrations.down.sql b/deploy/migrations/clickhouse/055_mev_relay_validator_registrations.down.sql deleted file mode 100644 index 6df73beca..000000000 --- a/deploy/migrations/clickhouse/055_mev_relay_validator_registrations.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS mev_relay_validator_registration ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS mev_relay_validator_registration_local ON CLUSTER '{cluster}' SYNC; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/055_mev_relay_validator_registrations.up.sql b/deploy/migrations/clickhouse/055_mev_relay_validator_registrations.up.sql deleted file mode 100644 index f69411b69..000000000 --- a/deploy/migrations/clickhouse/055_mev_relay_validator_registrations.up.sql +++ /dev/null @@ -1,56 +0,0 @@ -CREATE TABLE default.mev_relay_validator_registration_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the bid was fetched' CODEC(DoubleDelta, ZSTD(1)), - `timestamp` Int64 COMMENT 'The timestamp of the bid' CODEC(DoubleDelta, ZSTD(1)), - `relay_name` String COMMENT 'The relay that the bid was fetched from' CODEC(ZSTD(1)), - `validator_index` UInt32 COMMENT 'The validator index of the validator registration' CODEC(ZSTD(1)), - `gas_limit` UInt64 COMMENT 'The gas limit of the validator registration' CODEC(DoubleDelta, ZSTD(1)), - `fee_recipient` String COMMENT 'The fee recipient of the validator registration' CODEC(ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The slot start time derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The epoch start time derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - relay_name, - validator_index, - timestamp - ) COMMENT 'Contains MEV relay validator registrations data.'; - -CREATE TABLE default.mev_relay_validator_registration ON CLUSTER '{cluster}' AS default.mev_relay_validator_registration_local ENGINE = Distributed( - '{cluster}', - default, - mev_relay_validator_registration_local, - cityHash64( - slot, - meta_network_name - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/056_event_timestamp_ordered_validator_registrations.down.sql b/deploy/migrations/clickhouse/056_event_timestamp_ordered_validator_registrations.down.sql deleted file mode 100644 index fcd29e401..000000000 --- a/deploy/migrations/clickhouse/056_event_timestamp_ordered_validator_registrations.down.sql +++ /dev/null @@ -1,59 +0,0 @@ -DROP TABLE IF EXISTS mev_relay_validator_registration ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS mev_relay_validator_registration_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE default.mev_relay_validator_registration_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the bid was fetched' CODEC(DoubleDelta, ZSTD(1)), - `timestamp` Int64 COMMENT 'The timestamp of the bid' CODEC(DoubleDelta, ZSTD(1)), - `relay_name` String COMMENT 'The relay that the bid was fetched from' CODEC(ZSTD(1)), - `validator_index` UInt32 COMMENT 'The validator index of the validator registration' CODEC(ZSTD(1)), - `gas_limit` UInt64 COMMENT 'The gas limit of the validator registration' CODEC(DoubleDelta, ZSTD(1)), - `fee_recipient` String COMMENT 'The fee recipient of the validator registration' CODEC(ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The slot start time derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The epoch start time derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - relay_name, - validator_index, - timestamp - ) COMMENT 'Contains MEV relay validator registrations data.'; - -CREATE TABLE default.mev_relay_validator_registration ON CLUSTER '{cluster}' AS default.mev_relay_validator_registration_local ENGINE = Distributed( - '{cluster}', - default, - mev_relay_validator_registration_local, - cityHash64( - slot, - meta_network_name - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/056_event_timestamp_ordered_validator_registrations.up.sql b/deploy/migrations/clickhouse/056_event_timestamp_ordered_validator_registrations.up.sql deleted file mode 100644 index 04b14e24b..000000000 --- a/deploy/migrations/clickhouse/056_event_timestamp_ordered_validator_registrations.up.sql +++ /dev/null @@ -1,59 +0,0 @@ -DROP TABLE IF EXISTS mev_relay_validator_registration ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS mev_relay_validator_registration_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE IF NOT EXISTS mev_relay_validator_registration_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the registration was fetched' CODEC(DoubleDelta, ZSTD(1)), - `timestamp` Int64 COMMENT 'The timestamp of the registration' CODEC(DoubleDelta, ZSTD(1)), - `relay_name` String COMMENT 'The relay that the registration was fetched from' CODEC(ZSTD(1)), - `validator_index` UInt32 COMMENT 'The validator index of the validator registration' CODEC(ZSTD(1)), - `gas_limit` UInt64 COMMENT 'The gas limit of the validator registration' CODEC(DoubleDelta, ZSTD(1)), - `fee_recipient` String COMMENT 'The fee recipient of the validator registration' CODEC(ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The slot start time derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The epoch start time derived from the validator registration `timestamp` field' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - relay_name, - validator_index, - timestamp - ) COMMENT 'Contains MEV relay validator registrations data.'; - -CREATE TABLE mev_relay_validator_registration ON CLUSTER '{cluster}' AS mev_relay_validator_registration_local ENGINE = Distributed( - '{cluster}', - default, - mev_relay_validator_registration_local, - cityHash64( - slot, - meta_network_name - ) -); diff --git a/deploy/migrations/clickhouse/057_block_gossip.down.sql b/deploy/migrations/clickhouse/057_block_gossip.down.sql deleted file mode 100644 index 70b796077..000000000 --- a/deploy/migrations/clickhouse/057_block_gossip.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_events_block_gossip ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_events_block_gossip_local ON CLUSTER '{cluster}' SYNC; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/057_block_gossip.up.sql b/deploy/migrations/clickhouse/057_block_gossip.up.sql deleted file mode 100644 index 93427cfc7..000000000 --- a/deploy/migrations/clickhouse/057_block_gossip.up.sql +++ /dev/null @@ -1,55 +0,0 @@ -CREATE TABLE default.beacon_api_eth_v1_events_block_gossip_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `block` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - block - ) COMMENT 'Contains beacon API eventstream "block_gossip" data from each sentry client attached to a beacon node.'; - -CREATE TABLE default.beacon_api_eth_v1_events_block_gossip ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_block_gossip_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_block_gossip_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block - ) -); diff --git a/deploy/migrations/clickhouse/058_libp2p_drop_rpc.down.sql b/deploy/migrations/clickhouse/058_libp2p_drop_rpc.down.sql deleted file mode 100644 index 67820d902..000000000 --- a/deploy/migrations/clickhouse/058_libp2p_drop_rpc.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS libp2p_drop_rpc ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS libp2p_drop_rpc_local ON CLUSTER '{cluster}' SYNC; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/058_libp2p_drop_rpc.up.sql b/deploy/migrations/clickhouse/058_libp2p_drop_rpc.up.sql deleted file mode 100644 index d7e3e7e4f..000000000 --- a/deploy/migrations/clickhouse/058_libp2p_drop_rpc.up.sql +++ /dev/null @@ -1,43 +0,0 @@ --- libp2p_drop_rpc_local --- unique_key = seahash(.event.id) --- peer_id_unique_key = seahash(data.meta.peer_id + .meta_network_name) --- --- Control messages (prune, iwant, idontwant, etc) are split off from this message --- and stored in separate tables: --- libp2p_rpc_meta_control_prune_local --- libp2p_rpc_meta_control_iwant_local --- libp2p_rpc_meta_control_idontwant_local --- etc. --- --- These control tables reference: --- rpc_meta_unique_key = libp2p_*_rpc_local.unique_key --- peer_id_unique_key = libp2p_*_rpc_local.peer_id_unique_key -CREATE TABLE libp2p_drop_rpc_local ON CLUSTER '{cluster}' -( - unique_key Int64 COMMENT 'Unique identifier for each record', - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - peer_id_unique_key Int64 COMMENT 'Unique key associated with the identifier of the peer receiver', - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, meta_network_name, meta_client_name) -COMMENT 'Contains the details of the RPC messages dropped by the peer.'; - -CREATE TABLE libp2p_drop_rpc ON CLUSTER '{cluster}' AS libp2p_drop_rpc_local -ENGINE = Distributed('{cluster}', default, libp2p_drop_rpc_local, unique_key); diff --git a/deploy/migrations/clickhouse/059_libp2p_trace_leave.down.sql b/deploy/migrations/clickhouse/059_libp2p_trace_leave.down.sql deleted file mode 100644 index 41901422d..000000000 --- a/deploy/migrations/clickhouse/059_libp2p_trace_leave.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_leave ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.libp2p_leave_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/059_libp2p_trace_leave.up.sql b/deploy/migrations/clickhouse/059_libp2p_trace_leave.up.sql deleted file mode 100644 index 05f209ffb..000000000 --- a/deploy/migrations/clickhouse/059_libp2p_trace_leave.up.sql +++ /dev/null @@ -1,53 +0,0 @@ -CREATE TABLE libp2p_leave_local ON CLUSTER '{cluster}' -( - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String) COMMENT 'Layer of the topic', - topic_fork_digest_value LowCardinality(String) COMMENT 'Fork digest value of the topic', - topic_name LowCardinality(String) COMMENT 'Name of the topic', - topic_encoding LowCardinality(String) COMMENT 'Encoding of the topic', - peer_id_unique_key Int64 COMMENT 'Unique key associated with the identifier of the peer that left the topic', - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) COMMENT 'Contains the details of the LEAVE events from the libp2p client.'; - -CREATE TABLE libp2p_leave ON CLUSTER '{cluster}' AS libp2p_leave_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_leave_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/060_libp2p_trace_graft.down.sql b/deploy/migrations/clickhouse/060_libp2p_trace_graft.down.sql deleted file mode 100644 index 90ab73492..000000000 --- a/deploy/migrations/clickhouse/060_libp2p_trace_graft.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_graft ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.libp2p_graft_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/060_libp2p_trace_graft.up.sql b/deploy/migrations/clickhouse/060_libp2p_trace_graft.up.sql deleted file mode 100644 index f4387cf2f..000000000 --- a/deploy/migrations/clickhouse/060_libp2p_trace_graft.up.sql +++ /dev/null @@ -1,53 +0,0 @@ -CREATE TABLE libp2p_graft_local ON CLUSTER '{cluster}' -( - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String) COMMENT 'Layer of the topic', - topic_fork_digest_value LowCardinality(String) COMMENT 'Fork digest value of the topic', - topic_name LowCardinality(String) COMMENT 'Name of the topic', - topic_encoding LowCardinality(String) COMMENT 'Encoding of the topic', - peer_id_unique_key Int64 COMMENT 'Unique key for the peer that initiated the GRAFT (eg joined the mesh for this topic) identifies mesh membership changes per peer.', - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) COMMENT 'Contains the details of the GRAFT events from the libp2p client.'; - -CREATE TABLE libp2p_graft ON CLUSTER '{cluster}' AS libp2p_graft_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_graft_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/061_libp2p_trace_prune.down.sql b/deploy/migrations/clickhouse/061_libp2p_trace_prune.down.sql deleted file mode 100644 index 9175ba7eb..000000000 --- a/deploy/migrations/clickhouse/061_libp2p_trace_prune.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_prune ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.libp2p_prune_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/061_libp2p_trace_prune.up.sql b/deploy/migrations/clickhouse/061_libp2p_trace_prune.up.sql deleted file mode 100644 index 94dd85736..000000000 --- a/deploy/migrations/clickhouse/061_libp2p_trace_prune.up.sql +++ /dev/null @@ -1,53 +0,0 @@ -CREATE TABLE libp2p_prune_local ON CLUSTER '{cluster}' -( - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String) COMMENT 'Layer of the topic', - topic_fork_digest_value LowCardinality(String) COMMENT 'Fork digest value of the topic', - topic_name LowCardinality(String) COMMENT 'Name of the topic', - topic_encoding LowCardinality(String) COMMENT 'Encoding of the topic', - peer_id_unique_key Int64 COMMENT 'Unique key for the peer that was PRUNED (eg removed from the mesh for this topic) identifies mesh membership changes per peer.', - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) COMMENT 'Contains the details of the PRUNE events from the libp2p client.'; - -CREATE TABLE libp2p_prune ON CLUSTER '{cluster}' AS libp2p_prune_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_prune_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/062_libp2p_trace_deliver_message.down.sql b/deploy/migrations/clickhouse/062_libp2p_trace_deliver_message.down.sql deleted file mode 100644 index ee1a7cb73..000000000 --- a/deploy/migrations/clickhouse/062_libp2p_trace_deliver_message.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_deliver_message ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.libp2p_deliver_message_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/062_libp2p_trace_deliver_message.up.sql b/deploy/migrations/clickhouse/062_libp2p_trace_deliver_message.up.sql deleted file mode 100644 index ed99691db..000000000 --- a/deploy/migrations/clickhouse/062_libp2p_trace_deliver_message.up.sql +++ /dev/null @@ -1,61 +0,0 @@ -CREATE TABLE libp2p_deliver_message_local ON CLUSTER '{cluster}' -( - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String) COMMENT 'Layer of the topic', - topic_fork_digest_value LowCardinality(String) COMMENT 'Fork digest value of the topic', - topic_name LowCardinality(String) COMMENT 'Name of the topic', - topic_encoding LowCardinality(String) COMMENT 'Encoding of the topic', - seq_number UInt64 COMMENT 'A linearly increasing number that is unique among messages originating from the given peer' CODEC(DoubleDelta, ZSTD(1)), - local_delivery Bool COMMENT 'Indicates if the message was delivered to in-process subscribers only', - peer_id_unique_key Int64 COMMENT 'Unique key for the peer that delivered the message', - message_id String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - message_size UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name, - message_id, - seq_number - ) COMMENT 'Contains the details of the DELIVER_MESSAGE events from the libp2p client.'; - -CREATE TABLE libp2p_deliver_message ON CLUSTER '{cluster}' AS libp2p_deliver_message_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_deliver_message_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name, - message_id, - seq_number - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/063_libp2p_trace_reject_message.down.sql b/deploy/migrations/clickhouse/063_libp2p_trace_reject_message.down.sql deleted file mode 100644 index 2fdbb6080..000000000 --- a/deploy/migrations/clickhouse/063_libp2p_trace_reject_message.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_reject_message ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.libp2p_reject_message_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/063_libp2p_trace_reject_message.up.sql b/deploy/migrations/clickhouse/063_libp2p_trace_reject_message.up.sql deleted file mode 100644 index d2885bab6..000000000 --- a/deploy/migrations/clickhouse/063_libp2p_trace_reject_message.up.sql +++ /dev/null @@ -1,62 +0,0 @@ -CREATE TABLE libp2p_reject_message_local ON CLUSTER '{cluster}' -( - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String) COMMENT 'Layer of the topic', - topic_fork_digest_value LowCardinality(String) COMMENT 'Fork digest value of the topic', - topic_name LowCardinality(String) COMMENT 'Name of the topic', - topic_encoding LowCardinality(String) COMMENT 'Encoding of the topic', - seq_number UInt64 COMMENT 'A linearly increasing number that is unique among messages originating from the given peer' CODEC(DoubleDelta, ZSTD(1)), - local_delivery Bool COMMENT 'Indicates if the message was rejected by local subscriber', - peer_id_unique_key Int64 COMMENT 'Unique key for the peer that rejected the message', - message_id String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - message_size UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - reason String COMMENT 'Reason for message rejection' CODEC(ZSTD(1)), - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name, - message_id, - seq_number - ) COMMENT 'Contains the details of the REJECT_MESSAGE events from the libp2p client.'; - -CREATE TABLE libp2p_reject_message ON CLUSTER '{cluster}' AS libp2p_reject_message_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_reject_message_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name, - message_id, - seq_number - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/064_libp2p_trace_publish_message.down.sql b/deploy/migrations/clickhouse/064_libp2p_trace_publish_message.down.sql deleted file mode 100644 index 17843101b..000000000 --- a/deploy/migrations/clickhouse/064_libp2p_trace_publish_message.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_publish_message ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.libp2p_publish_message_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/064_libp2p_trace_publish_message.up.sql b/deploy/migrations/clickhouse/064_libp2p_trace_publish_message.up.sql deleted file mode 100644 index d054ae654..000000000 --- a/deploy/migrations/clickhouse/064_libp2p_trace_publish_message.up.sql +++ /dev/null @@ -1,53 +0,0 @@ -CREATE TABLE libp2p_publish_message_local ON CLUSTER '{cluster}' -( - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String) COMMENT 'Layer of the topic', - topic_fork_digest_value LowCardinality(String) COMMENT 'Fork digest value of the topic', - topic_name LowCardinality(String) COMMENT 'Name of the topic', - topic_encoding LowCardinality(String) COMMENT 'Encoding of the topic', - message_id String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - topic_fork_digest_value, - topic_name, - message_id - ) COMMENT 'Contains the details of the PUBLISH_MESSAGE events from the libp2p client.'; - -CREATE TABLE libp2p_publish_message ON CLUSTER '{cluster}' AS libp2p_publish_message_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_publish_message_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - topic_fork_digest_value, - topic_name, - message_id - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/065_libp2p_trace_duplicate_message.down.sql b/deploy/migrations/clickhouse/065_libp2p_trace_duplicate_message.down.sql deleted file mode 100644 index 15fe1bba2..000000000 --- a/deploy/migrations/clickhouse/065_libp2p_trace_duplicate_message.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_duplicate_message ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.libp2p_duplicate_message_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/065_libp2p_trace_duplicate_message.up.sql b/deploy/migrations/clickhouse/065_libp2p_trace_duplicate_message.up.sql deleted file mode 100644 index 01bf043c2..000000000 --- a/deploy/migrations/clickhouse/065_libp2p_trace_duplicate_message.up.sql +++ /dev/null @@ -1,61 +0,0 @@ -CREATE TABLE libp2p_duplicate_message_local ON CLUSTER '{cluster}' -( - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event' CODEC(DoubleDelta, ZSTD(1)), - topic_layer LowCardinality(String) COMMENT 'Layer of the topic', - topic_fork_digest_value LowCardinality(String) COMMENT 'Fork digest value of the topic', - topic_name LowCardinality(String) COMMENT 'Name of the topic', - topic_encoding LowCardinality(String) COMMENT 'Encoding of the topic', - seq_number UInt64 COMMENT 'A linearly increasing number that is unique among messages originating from the given peer' CODEC(DoubleDelta, ZSTD(1)), - local_delivery Bool COMMENT 'Indicates if the message was duplicated locally', - peer_id_unique_key Int64 COMMENT 'Unique key for the peer that sent the duplicate message', - message_id String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - message_size UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name, - message_id, - seq_number - ) COMMENT 'Contains the details of the DUPLICATE_MESSAGE events from the libp2p client.'; - -CREATE TABLE libp2p_duplicate_message ON CLUSTER '{cluster}' AS libp2p_duplicate_message_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_duplicate_message_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - topic_fork_digest_value, - topic_name, - message_id, - seq_number - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/066_libp2p_rpc_meta_control_idontwant.down.sql b/deploy/migrations/clickhouse/066_libp2p_rpc_meta_control_idontwant.down.sql deleted file mode 100644 index 6181105a5..000000000 --- a/deploy/migrations/clickhouse/066_libp2p_rpc_meta_control_idontwant.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_idontwant ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.libp2p_rpc_meta_control_idontwant_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/066_libp2p_rpc_meta_control_idontwant.up.sql b/deploy/migrations/clickhouse/066_libp2p_rpc_meta_control_idontwant.up.sql deleted file mode 100644 index 69b54d40b..000000000 --- a/deploy/migrations/clickhouse/066_libp2p_rpc_meta_control_idontwant.up.sql +++ /dev/null @@ -1,33 +0,0 @@ -CREATE TABLE libp2p_rpc_meta_control_idontwant_local ON CLUSTER '{cluster}' -( - unique_key Int64 COMMENT 'Unique identifier for each IDONTWANT control record', - updated_date_time DateTime COMMENT 'Timestamp when the IDONTWANT control record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the IDONTWANT control event' CODEC(DoubleDelta, ZSTD(1)), - control_index Int32 COMMENT 'Position in the RPC meta control idontwant array' CODEC(DoubleDelta, ZSTD(1)), - message_index Int32 COMMENT 'Position in the RPC meta control idontwant message_ids array' CODEC(DoubleDelta, ZSTD(1)), - rpc_meta_unique_key Int64 COMMENT 'Unique key associated with the IDONTWANT control metadata', - message_id String COMMENT 'Identifier of the message associated with the IDONTWANT control' CODEC(ZSTD(1)), - peer_id_unique_key Int64 COMMENT 'Unique key associated with the identifier of the peer involved in the IDONTWANT control', - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) Engine = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, unique_key, control_index, peer_id_unique_key, message_id, message_index, meta_network_name, meta_client_name) -COMMENT 'Contains the details of the IDONTWANT control messages from the peer.'; - -CREATE TABLE libp2p_rpc_meta_control_idontwant ON CLUSTER '{cluster}' AS libp2p_rpc_meta_control_idontwant_local -ENGINE = Distributed('{cluster}', default, libp2p_rpc_meta_control_idontwant_local, unique_key); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/067_transactions_structlog.down.sql b/deploy/migrations/clickhouse/067_transactions_structlog.down.sql deleted file mode 100644 index 6e1e47cb4..000000000 --- a/deploy/migrations/clickhouse/067_transactions_structlog.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -DROP TABLE IF EXISTS admin.execution_block ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS admin.execution_block_local ON CLUSTER '{cluster}' SYNC; - -DROP TABLE IF EXISTS default.canonical_execution_transaction_structlog ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/067_transactions_structlog.up.sql b/deploy/migrations/clickhouse/067_transactions_structlog.up.sql deleted file mode 100644 index 645e95744..000000000 --- a/deploy/migrations/clickhouse/067_transactions_structlog.up.sql +++ /dev/null @@ -1,73 +0,0 @@ -CREATE DATABASE IF NOT EXISTS `admin` ON CLUSTER '{cluster}'; - -CREATE TABLE admin.execution_block_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime(3) CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `processor` LowCardinality(String) COMMENT 'The type of processor that processed the block', - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) -ORDER BY - ( - block_number, - processor, - meta_network_name - ); - -CREATE TABLE admin.execution_block ON CLUSTER '{cluster}' AS admin.execution_block_local ENGINE = Distributed( - '{cluster}', - admin, - execution_block_local, - cityHash64( - block_number, - processor, - meta_network_name - ) -); - -CREATE TABLE default.canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), - `transaction_index` UInt32 COMMENT 'The transaction position in the block' CODEC(DoubleDelta, ZSTD(1)), - `transaction_gas` UInt64 COMMENT 'The transaction gas' CODEC(DoubleDelta, ZSTD(1)), - `transaction_failed` Bool COMMENT 'The transaction failed' CODEC(ZSTD(1)), - `transaction_return_value` Nullable(String) COMMENT 'The transaction return value' CODEC(ZSTD(1)), - `index` UInt32 COMMENT 'The index of this structlog in this transaction' CODEC(DoubleDelta, ZSTD(1)), - `program_counter` UInt32 COMMENT 'The program counter' CODEC(Delta, ZSTD(1)), - `operation` LowCardinality(String) COMMENT 'The operation', - `gas` UInt64 COMMENT 'The gas' CODEC(Delta, ZSTD(1)), - `gas_cost` UInt64 COMMENT 'The gas cost' CODEC(DoubleDelta, ZSTD(1)), - `depth` UInt64 COMMENT 'The depth' CODEC(DoubleDelta, ZSTD(1)), - `return_data` Nullable(String) COMMENT 'The return data' CODEC(ZSTD(1)), - `refund` Nullable(UInt64) COMMENT 'The refund' CODEC(ZSTD(1)), - `error` Nullable(String) COMMENT 'The error' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 201600) -- roughly 1 month of blocks -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - `index` - ) COMMENT 'Contains canonical execution transaction structlog data.'; - -CREATE TABLE default.canonical_execution_transaction_structlog ON CLUSTER '{cluster}' AS default.canonical_execution_transaction_structlog_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_transaction_structlog_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - `index` - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/068_nullable_libp2p_rpc_meta_prune.down.sql b/deploy/migrations/clickhouse/068_nullable_libp2p_rpc_meta_prune.down.sql deleted file mode 100644 index c16624194..000000000 --- a/deploy/migrations/clickhouse/068_nullable_libp2p_rpc_meta_prune.down.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE default.libp2p_rpc_meta_control_prune ON CLUSTER '{cluster}' - MODIFY COLUMN `graft_peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the graft peer involved in the Prune control'; - -ALTER TABLE default.libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}' - MODIFY COLUMN `graft_peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the graft peer involved in the Prune control'; - diff --git a/deploy/migrations/clickhouse/068_nullable_libp2p_rpc_meta_prune.up.sql b/deploy/migrations/clickhouse/068_nullable_libp2p_rpc_meta_prune.up.sql deleted file mode 100644 index 2f4c49421..000000000 --- a/deploy/migrations/clickhouse/068_nullable_libp2p_rpc_meta_prune.up.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE default.libp2p_rpc_meta_control_prune ON CLUSTER '{cluster}' - MODIFY COLUMN `graft_peer_id_unique_key` Nullable(Int64) COMMENT 'Unique key associated with the identifier of the graft peer involved in the Prune control'; - -ALTER TABLE default.libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}' - MODIFY COLUMN `graft_peer_id_unique_key` Nullable(Int64) COMMENT 'Unique key associated with the identifier of the graft peer involved in the Prune control'; - diff --git a/deploy/migrations/clickhouse/069_transactions_structlog_call_to.down.sql b/deploy/migrations/clickhouse/069_transactions_structlog_call_to.down.sql deleted file mode 100644 index f87b60569..000000000 --- a/deploy/migrations/clickhouse/069_transactions_structlog_call_to.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE canonical_execution_transaction_structlog on cluster '{cluster}' - DROP COLUMN call_to_address; - -ALTER TABLE canonical_execution_transaction_structlog_local on cluster '{cluster}' - DROP COLUMN call_to_address; diff --git a/deploy/migrations/clickhouse/069_transactions_structlog_call_to.up.sql b/deploy/migrations/clickhouse/069_transactions_structlog_call_to.up.sql deleted file mode 100644 index 114ef4527..000000000 --- a/deploy/migrations/clickhouse/069_transactions_structlog_call_to.up.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - ADD COLUMN call_to_address Nullable(String) COMMENT 'Address of a CALL operation' CODEC(ZSTD(1)) AFTER error; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - ADD COLUMN call_to_address Nullable(String) COMMENT 'Address of a CALL operation' CODEC(ZSTD(1)) AFTER error; diff --git a/deploy/migrations/clickhouse/070_libp2p_gossipsub_aggregate_and_proof.down.sql b/deploy/migrations/clickhouse/070_libp2p_gossipsub_aggregate_and_proof.down.sql deleted file mode 100644 index 4bcbbfe27..000000000 --- a/deploy/migrations/clickhouse/070_libp2p_gossipsub_aggregate_and_proof.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS libp2p_gossipsub_aggregate_and_proof ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS libp2p_gossipsub_aggregate_and_proof_local ON CLUSTER '{cluster}'; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/070_libp2p_gossipsub_aggregate_and_proof.up.sql b/deploy/migrations/clickhouse/070_libp2p_gossipsub_aggregate_and_proof.up.sql deleted file mode 100644 index c49584147..000000000 --- a/deploy/migrations/clickhouse/070_libp2p_gossipsub_aggregate_and_proof.up.sql +++ /dev/null @@ -1,77 +0,0 @@ -CREATE TABLE libp2p_gossipsub_aggregate_and_proof_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - -- ensure the first time this aggregate was seen by a peer is in this table - -- 4294967295 = UInt32 max - version UInt32 DEFAULT 4294967295 - propagation_slot_start_diff COMMENT 'Version of this row, to help with de-duplication we want the latest updated_date_time but lowest propagation_slot_start_diff time' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), - slot UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - wallclock_epoch UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - wallclock_epoch_start_date_time DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - propagation_slot_start_diff UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), - peer_id_unique_key Int64 COMMENT 'Unique key associated with the identifier of the peer', - message_id String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - message_size UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - topic_layer LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', - topic_fork_digest_value LowCardinality(String) COMMENT 'Fork digest value of the topic', - topic_name LowCardinality(String) COMMENT 'Name of the topic', - topic_encoding LowCardinality(String) COMMENT 'Encoding used for the topic', - -- Aggregator specific fields - aggregator_index UInt32 COMMENT 'Index of the validator who created this aggregate' CODEC(DoubleDelta, ZSTD(1)), - -- Embedded attestation fields - committee_index LowCardinality(String) COMMENT 'Committee index from the attestation', - aggregation_bits String COMMENT 'Bitfield of aggregated attestation' CODEC(ZSTD(1)), - beacon_block_root FixedString(66) COMMENT 'Root of the beacon block being attested to' CODEC(ZSTD(1)), - source_epoch UInt32 COMMENT 'Source epoch from the attestation' CODEC(DoubleDelta, ZSTD(1)), - source_root FixedString(66) COMMENT 'Source root from the attestation' CODEC(ZSTD(1)), - target_epoch UInt32 COMMENT 'Target epoch from the attestation' CODEC(DoubleDelta, ZSTD(1)), - target_root FixedString(66) COMMENT 'Target root from the attestation' CODEC(ZSTD(1)), - -- Standard metadata fields - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Network ID associated with the client' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Name of the network associated with the client' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - version -) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY ( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id -) COMMENT 'Table for libp2p gossipsub aggregate and proof data.'; - --- Create distributed table -CREATE TABLE libp2p_gossipsub_aggregate_and_proof ON CLUSTER '{cluster}' AS libp2p_gossipsub_aggregate_and_proof_local -ENGINE = Distributed( - '{cluster}', - default, - libp2p_gossipsub_aggregate_and_proof_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/071_data_column_sidecar.down.sql b/deploy/migrations/clickhouse/071_data_column_sidecar.down.sql deleted file mode 100644 index ecb984c88..000000000 --- a/deploy/migrations/clickhouse/071_data_column_sidecar.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_events_data_column_sidecar on cluster '{cluster}'; - -DROP TABLE IF EXISTS beacon_api_eth_v1_events_data_column_sidecar_local on cluster '{cluster}'; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/071_data_column_sidecar.up.sql b/deploy/migrations/clickhouse/071_data_column_sidecar.up.sql deleted file mode 100644 index 14d0f81ba..000000000 --- a/deploy/migrations/clickhouse/071_data_column_sidecar.up.sql +++ /dev/null @@ -1,59 +0,0 @@ -CREATE TABLE beacon_api_eth_v1_events_data_column_sidecar_local on cluster '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'The difference between the event_date_time and the slot_start_date_time' CODEC(ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon API event stream payload' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The beacon block root hash in the beacon API event stream payload' CODEC(ZSTD(1)), - `column_index` UInt64 COMMENT 'The index of column in the beacon API event stream payload' CODEC(ZSTD(1)), - `kzg_commitments` Array(FixedString(98)) COMMENT 'The KZG commitments in the beacon API event stream payload' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - column_index - ) COMMENT 'Contains beacon API eventstream "data_column_sidecar" data from each sentry client attached to a beacon node.'; - -CREATE TABLE default.beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_data_column_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_data_column_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - column_index - ) -); diff --git a/deploy/migrations/clickhouse/072_node_record_execution.down.sql b/deploy/migrations/clickhouse/072_node_record_execution.down.sql deleted file mode 100644 index 3b579e345..000000000 --- a/deploy/migrations/clickhouse/072_node_record_execution.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.node_record_execution ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.node_record_execution_local ON CLUSTER '{cluster}' SYNC; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/072_node_record_execution.up.sql b/deploy/migrations/clickhouse/072_node_record_execution.up.sql deleted file mode 100644 index ee4fe8e17..000000000 --- a/deploy/migrations/clickhouse/072_node_record_execution.up.sql +++ /dev/null @@ -1,71 +0,0 @@ -CREATE TABLE default.node_record_execution_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the event was generated' CODEC(DoubleDelta, ZSTD(1)), - `enr` String COMMENT 'Ethereum Node Record as text' CODEC(ZSTD(1)), - `name` String COMMENT 'Execution client name' CODEC(ZSTD(1)), - `version` LowCardinality(String) COMMENT 'Execution client version' CODEC(ZSTD(1)), - `version_major` LowCardinality(String) COMMENT 'Execution client major version' CODEC(ZSTD(1)), - `version_minor` LowCardinality(String) COMMENT 'Execution client minor version' CODEC(ZSTD(1)), - `version_patch` LowCardinality(String) COMMENT 'Execution client patch version' CODEC(ZSTD(1)), - `implementation` LowCardinality(String) COMMENT 'Execution client implementation' CODEC(ZSTD(1)), - `capabilities` Array(String) COMMENT 'List of capabilities (e.g., eth/65,eth/66)' CODEC(ZSTD(1)), - `protocol_version` String COMMENT 'Protocol version' CODEC(ZSTD(1)), - `total_difficulty` String COMMENT 'Total difficulty of the chain' CODEC(ZSTD(1)), - `head` String COMMENT 'Head block hash' CODEC(ZSTD(1)), - `genesis` String COMMENT 'Genesis block hash' CODEC(ZSTD(1)), - `fork_id_hash` String COMMENT 'Fork ID hash' CODEC(ZSTD(1)), - `fork_id_next` String COMMENT 'Fork ID next block' CODEC(ZSTD(1)), - `node_id` String COMMENT 'Node ID from ENR' CODEC(ZSTD(1)), - `ip` Nullable(IPv6) COMMENT 'IP address of the execution node' CODEC(ZSTD(1)), - `tcp` Nullable(UInt16) COMMENT 'TCP port from ENR' CODEC(DoubleDelta, ZSTD(1)), - `udp` Nullable(UInt16) COMMENT 'UDP port from ENR' CODEC(DoubleDelta, ZSTD(1)), - `has_ipv6` Bool COMMENT 'Whether the execution node has an IPv6 address' CODEC(ZSTD(1)), - `geo_city` LowCardinality(String) COMMENT 'City of the execution node' CODEC(ZSTD(1)), - `geo_country` LowCardinality(String) COMMENT 'Country of the execution node' CODEC(ZSTD(1)), - `geo_country_code` LowCardinality(String) COMMENT 'Country code of the execution node' CODEC(ZSTD(1)), - `geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the execution node' CODEC(ZSTD(1)), - `geo_longitude` Nullable(Float64) COMMENT 'Longitude of the execution node' CODEC(ZSTD(1)), - `geo_latitude` Nullable(Float64) COMMENT 'Latitude of the execution node' CODEC(ZSTD(1)), - `geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the execution node' CODEC(ZSTD(1)), - `geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the execution node' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - node_id, - meta_client_name - ) COMMENT 'Contains execution node records discovered by the Xatu discovery module.'; - -CREATE TABLE default.node_record_execution ON CLUSTER '{cluster}' AS default.node_record_execution_local ENGINE = Distributed( - '{cluster}', - default, - node_record_execution_local, - cityHash64( - event_date_time, - meta_network_name, - node_id, - meta_client_name - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/073_node_record_consensus.down.sql b/deploy/migrations/clickhouse/073_node_record_consensus.down.sql deleted file mode 100644 index 621817552..000000000 --- a/deploy/migrations/clickhouse/073_node_record_consensus.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.node_record_consensus ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.node_record_consensus_local ON CLUSTER '{cluster}'; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/073_node_record_consensus.up.sql b/deploy/migrations/clickhouse/073_node_record_consensus.up.sql deleted file mode 100644 index c72d30fd5..000000000 --- a/deploy/migrations/clickhouse/073_node_record_consensus.up.sql +++ /dev/null @@ -1,76 +0,0 @@ -CREATE TABLE default.node_record_consensus_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the discovery module found the node' CODEC(DoubleDelta, ZSTD(1)), - `enr` String COMMENT 'Ethereum Node Record as text' CODEC(ZSTD(1)), - `node_id` Nullable(String) COMMENT 'ID of the Ethereum Node Record' CODEC(ZSTD(1)), - `peer_id_unique_key` Nullable(Int64) COMMENT 'Unique key associated with the identifier of the peer', - `timestamp` Int64 COMMENT 'Event timestamp in unix time' CODEC(DoubleDelta, ZSTD(1)), - `name` String COMMENT 'Consensus client name' CODEC(ZSTD(1)), - `version` LowCardinality(String) COMMENT 'Consensus client version' CODEC(ZSTD(1)), - `version_major` LowCardinality(String) COMMENT 'Consensus client major version' CODEC(ZSTD(1)), - `version_minor` LowCardinality(String) COMMENT 'Consensus client minor version' CODEC(ZSTD(1)), - `version_patch` LowCardinality(String) COMMENT 'Consensus client patch version' CODEC(ZSTD(1)), - `implementation` LowCardinality(String) COMMENT 'Consensus client implementation' CODEC(ZSTD(1)), - `fork_digest` String COMMENT 'Fork digest value' CODEC(ZSTD(1)), - `next_fork_digest` Nullable(String) COMMENT 'Next fork digest of the next scheduled fork' CODEC(ZSTD(1)), - `finalized_root` String COMMENT 'Finalized beacon block root' CODEC(ZSTD(1)), - `finalized_epoch` UInt64 COMMENT 'Finalized epoch number' CODEC(DoubleDelta, ZSTD(1)), - `head_root` String COMMENT 'Head beacon block root' CODEC(ZSTD(1)), - `head_slot` UInt64 COMMENT 'Head slot number' CODEC(DoubleDelta, ZSTD(1)), - `cgc` Nullable(String) COMMENT 'Represents the nodes custody group count' CODEC(ZSTD(1)), - `finalized_epoch_start_date_time` Nullable(DateTime) COMMENT 'Finalized epoch start time' CODEC(DoubleDelta, ZSTD(1)), - `head_slot_start_date_time` Nullable(DateTime) COMMENT 'Head slot start time' CODEC(DoubleDelta, ZSTD(1)), - `ip` Nullable(IPv6) COMMENT 'IP address of the consensus node' CODEC(ZSTD(1)), - `tcp` Nullable(UInt16) COMMENT 'TCP port from ENR' CODEC(DoubleDelta, ZSTD(1)), - `udp` Nullable(UInt16) COMMENT 'UDP port from ENR' CODEC(DoubleDelta, ZSTD(1)), - `quic` Nullable(UInt16) COMMENT 'QUIC port from ENR' CODEC(DoubleDelta, ZSTD(1)), - `has_ipv6` Bool COMMENT 'Whether the consensus node has an IPv6 address' CODEC(ZSTD(1)), - `geo_city` LowCardinality(String) COMMENT 'City of the consensus node' CODEC(ZSTD(1)), - `geo_country` LowCardinality(String) COMMENT 'Country of the consensus node' CODEC(ZSTD(1)), - `geo_country_code` LowCardinality(String) COMMENT 'Country code of the consensus node' CODEC(ZSTD(1)), - `geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the consensus node' CODEC(ZSTD(1)), - `geo_longitude` Nullable(Float64) COMMENT 'Longitude of the consensus node' CODEC(ZSTD(1)), - `geo_latitude` Nullable(Float64) COMMENT 'Latitude of the consensus node' CODEC(ZSTD(1)), - `geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the consensus node' CODEC(ZSTD(1)), - `geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the consensus node' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(event_date_time) -ORDER BY - ( - event_date_time, - meta_network_name, - enr, - meta_client_name - ) COMMENT 'Contains consensus node records discovered by the Xatu discovery module.'; - -CREATE TABLE default.node_record_consensus ON CLUSTER '{cluster}' AS default.node_record_consensus_local ENGINE = Distributed( - '{cluster}', - default, - node_record_consensus_local, - cityHash64( - event_date_time, - meta_network_name, - enr, - meta_client_name - ) -); diff --git a/deploy/migrations/clickhouse/074_libp2p_gossipsub_data_column_sidecar.down.sql b/deploy/migrations/clickhouse/074_libp2p_gossipsub_data_column_sidecar.down.sql deleted file mode 100644 index 091ecdbea..000000000 --- a/deploy/migrations/clickhouse/074_libp2p_gossipsub_data_column_sidecar.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_gossipsub_data_column_sidecar ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_gossipsub_data_column_sidecar_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/074_libp2p_gossipsub_data_column_sidecar.up.sql b/deploy/migrations/clickhouse/074_libp2p_gossipsub_data_column_sidecar.up.sql deleted file mode 100644 index d7c7a0181..000000000 --- a/deploy/migrations/clickhouse/074_libp2p_gossipsub_data_column_sidecar.up.sql +++ /dev/null @@ -1,68 +0,0 @@ -CREATE TABLE libp2p_gossipsub_data_column_sidecar_local ON CLUSTER '{cluster}' -( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `version` UInt32 DEFAULT 4294967295 - propagation_slot_start_diff COMMENT 'Version of this row, to help with de-duplication we want the latest updated_date_time but lowest propagation_slot_start_diff time' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'Timestamp of the event with millisecond precision' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'Start date and time of the slot' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'Epoch number associated with the event' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'Start date and time of the epoch' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot` UInt32 COMMENT 'Slot number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_slot_start_date_time` DateTime COMMENT 'Start date and time of the wall clock slot when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch` UInt32 COMMENT 'Epoch number of the wall clock when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `wallclock_epoch_start_date_time` DateTime COMMENT 'Start date and time of the wall clock epoch when the event was received' CODEC(DoubleDelta, ZSTD(1)), - `propagation_slot_start_diff` UInt32 COMMENT 'Difference in slot start time for propagation' CODEC(ZSTD(1)), - `proposer_index` UInt32 COMMENT 'The proposer index of the beacon block' CODEC(ZSTD(1)), - `column_index` UInt64 COMMENT 'Column index associated with the record' CODEC(ZSTD(1)), - `kzg_commitments_count` UInt32 COMMENT 'Number of KZG commitments associated with the record' CODEC(ZSTD(1)), - `parent_root` FixedString(66) COMMENT 'Parent root of the beacon block' CODEC(ZSTD(1)), - `state_root` FixedString(66) COMMENT 'State root of the beacon block' CODEC(ZSTD(1)), - `peer_id_unique_key` Int64 COMMENT 'Unique key associated with the identifier of the peer', - `message_id` String COMMENT 'Identifier of the message' CODEC(ZSTD(1)), - `message_size` UInt32 COMMENT 'Size of the message in bytes' CODEC(ZSTD(1)), - `topic_layer` LowCardinality(String) COMMENT 'Layer of the topic in the gossipsub protocol', - `topic_fork_digest_value` LowCardinality(String) COMMENT 'Fork digest value of the topic', - `topic_name` LowCardinality(String) COMMENT 'Name of the topic', - `topic_encoding` LowCardinality(String) COMMENT 'Encoding used for the topic', - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Network ID associated with the client' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Name of the network associated with the client' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toYYYYMM(event_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) COMMENT 'Table for libp2p gossipsub data column sidecar data'; - -CREATE TABLE libp2p_gossipsub_data_column_sidecar ON CLUSTER '{cluster}' AS libp2p_gossipsub_data_column_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - libp2p_gossipsub_data_column_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - message_id - ) -); diff --git a/deploy/migrations/clickhouse/075_libp2p_synthetic_heartbeat.down.sql b/deploy/migrations/clickhouse/075_libp2p_synthetic_heartbeat.down.sql deleted file mode 100644 index 87cb3c807..000000000 --- a/deploy/migrations/clickhouse/075_libp2p_synthetic_heartbeat.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.libp2p_synthetic_heartbeat ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.libp2p_synthetic_heartbeat_local ON CLUSTER '{cluster}'; \ No newline at end of file diff --git a/deploy/migrations/clickhouse/075_libp2p_synthetic_heartbeat.up.sql b/deploy/migrations/clickhouse/075_libp2p_synthetic_heartbeat.up.sql deleted file mode 100644 index 982222440..000000000 --- a/deploy/migrations/clickhouse/075_libp2p_synthetic_heartbeat.up.sql +++ /dev/null @@ -1,113 +0,0 @@ --- Creating local and distributed tables for libp2p_synthetic_heartbeat -CREATE TABLE libp2p_synthetic_heartbeat_local ON CLUSTER '{cluster}' -( - updated_date_time DateTime CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - remote_peer_id_unique_key Int64, - remote_maddrs String CODEC(ZSTD(1)), - latency_ms Nullable(Int64) CODEC(ZSTD(1)), - direction LowCardinality(String), - protocols Array(String) CODEC(ZSTD(1)), - connection_age_ms Nullable(Int64) CODEC(ZSTD(1)), - remote_agent_implementation LowCardinality(String), - remote_agent_version LowCardinality(String), - remote_agent_version_major LowCardinality(String), - remote_agent_version_minor LowCardinality(String), - remote_agent_version_patch LowCardinality(String), - remote_agent_platform LowCardinality(String), - remote_ip Nullable(IPv6) CODEC(ZSTD(1)), - remote_port Nullable(UInt16) CODEC(ZSTD(1)), - remote_geo_city LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_country LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - remote_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - remote_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - remote_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - remote_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) -) Engine = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY ( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - updated_date_time -); - -ALTER TABLE libp2p_synthetic_heartbeat_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains heartbeat events from libp2p peers', -COMMENT COLUMN updated_date_time 'Timestamp when the record was last updated', -COMMENT COLUMN event_date_time 'Timestamp of the heartbeat event', -COMMENT COLUMN remote_peer_id_unique_key 'Unique key of the remote peer', -COMMENT COLUMN remote_maddrs 'Multiaddress of the remote peer', -COMMENT COLUMN latency_ms 'EWMA latency in milliseconds (0 if unavailable)', -COMMENT COLUMN direction 'Connection direction (Unknown/Inbound/Outbound)', -COMMENT COLUMN protocols 'List of supported protocols', -COMMENT COLUMN connection_age_ms 'Connection age in milliseconds', -COMMENT COLUMN remote_agent_implementation 'Implementation of the remote peer', -COMMENT COLUMN remote_agent_version 'Version of the remote peer', -COMMENT COLUMN remote_agent_version_major 'Major version of the remote peer', -COMMENT COLUMN remote_agent_version_minor 'Minor version of the remote peer', -COMMENT COLUMN remote_agent_version_patch 'Patch version of the remote peer', -COMMENT COLUMN remote_agent_platform 'Platform of the remote peer', -COMMENT COLUMN remote_ip 'IP address of the remote peer', -COMMENT COLUMN remote_port 'Port of the remote peer', -COMMENT COLUMN remote_geo_city 'City of the remote peer', -COMMENT COLUMN remote_geo_country 'Country of the remote peer', -COMMENT COLUMN remote_geo_country_code 'Country code of the remote peer', -COMMENT COLUMN remote_geo_continent_code 'Continent code of the remote peer', -COMMENT COLUMN remote_geo_longitude 'Longitude of the remote peer', -COMMENT COLUMN remote_geo_latitude 'Latitude of the remote peer', -COMMENT COLUMN remote_geo_autonomous_system_number 'ASN of the remote peer', -COMMENT COLUMN remote_geo_autonomous_system_organization 'AS organization of the remote peer', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client', -COMMENT COLUMN meta_client_version 'Version of the client', -COMMENT COLUMN meta_client_implementation 'Implementation of the client', -COMMENT COLUMN meta_client_os 'Operating system of the client', -COMMENT COLUMN meta_client_ip 'IP address of the client', -COMMENT COLUMN meta_client_geo_city 'City of the client', -COMMENT COLUMN meta_client_geo_country 'Country of the client', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'ASN of the client', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'AS organization of the client', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name'; - -CREATE TABLE libp2p_synthetic_heartbeat ON CLUSTER '{cluster}' AS libp2p_synthetic_heartbeat_local -ENGINE = Distributed( - '{cluster}', - default, - libp2p_synthetic_heartbeat_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - remote_peer_id_unique_key, - updated_date_time - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/076_block_root_libp2p.down.sql b/deploy/migrations/clickhouse/076_block_root_libp2p.down.sql deleted file mode 100644 index 1f931b6ef..000000000 --- a/deploy/migrations/clickhouse/076_block_root_libp2p.down.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' -DROP COLUMN beacon_block_root; - -ALTER TABLE default.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' -DROP COLUMN beacon_block_root; - -ALTER TABLE default.libp2p_gossipsub_data_column_sidecar ON CLUSTER '{cluster}' -DROP COLUMN beacon_block_root; - -ALTER TABLE default.libp2p_gossipsub_data_column_sidecar_local ON CLUSTER '{cluster}' -DROP COLUMN beacon_block_root; diff --git a/deploy/migrations/clickhouse/076_block_root_libp2p.up.sql b/deploy/migrations/clickhouse/076_block_root_libp2p.up.sql deleted file mode 100644 index 410225e1c..000000000 --- a/deploy/migrations/clickhouse/076_block_root_libp2p.up.sql +++ /dev/null @@ -1,12 +0,0 @@ - -ALTER TABLE default.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' -ADD COLUMN beacon_block_root FixedString(66) Codec(ZSTD(1)) AFTER blob_index; - -ALTER TABLE default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' -ADD COLUMN beacon_block_root FixedString(66) Codec(ZSTD(1)) AFTER blob_index; - -ALTER TABLE default.libp2p_gossipsub_data_column_sidecar_local ON CLUSTER '{cluster}' -ADD COLUMN beacon_block_root FixedString(66) Codec(ZSTD(1)) AFTER kzg_commitments_count; - -ALTER TABLE default.libp2p_gossipsub_data_column_sidecar ON CLUSTER '{cluster}' -ADD COLUMN beacon_block_root FixedString(66) Codec(ZSTD(1)) AFTER kzg_commitments_count; diff --git a/deploy/migrations/clickhouse/077_data_column_sidecar_kzg_commitments_count.down.sql b/deploy/migrations/clickhouse/077_data_column_sidecar_kzg_commitments_count.down.sql deleted file mode 100644 index 9ed2a92cf..000000000 --- a/deploy/migrations/clickhouse/077_data_column_sidecar_kzg_commitments_count.down.sql +++ /dev/null @@ -1,20 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}'; - -ALTER TABLE beacon_api_eth_v1_events_data_column_sidecar_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS kzg_commitments_count; - -ALTER TABLE beacon_api_eth_v1_events_data_column_sidecar_local ON CLUSTER '{cluster}' - ADD COLUMN kzg_commitments Array(FixedString(98)) COMMENT 'The KZG commitments in the beacon API event stream payload' CODEC(ZSTD(1)) AFTER column_index; - -CREATE TABLE default.beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_data_column_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_data_column_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - column_index - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/077_data_column_sidecar_kzg_commitments_count.up.sql b/deploy/migrations/clickhouse/077_data_column_sidecar_kzg_commitments_count.up.sql deleted file mode 100644 index 9d0e32e9c..000000000 --- a/deploy/migrations/clickhouse/077_data_column_sidecar_kzg_commitments_count.up.sql +++ /dev/null @@ -1,20 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}' SYNC; - -ALTER TABLE beacon_api_eth_v1_events_data_column_sidecar_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS kzg_commitments; - -ALTER TABLE beacon_api_eth_v1_events_data_column_sidecar_local ON CLUSTER '{cluster}' - ADD COLUMN kzg_commitments_count UInt32 COMMENT 'Number of KZG commitments associated with the record' CODEC(ZSTD(1)) AFTER column_index; - -CREATE TABLE default.beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}' AS default.beacon_api_eth_v1_events_data_column_sidecar_local ENGINE = Distributed( - '{cluster}', - default, - beacon_api_eth_v1_events_data_column_sidecar_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - column_index - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/078_add_peerdas_rpc_columns.down.sql b/deploy/migrations/clickhouse/078_add_peerdas_rpc_columns.down.sql deleted file mode 100644 index 045d32f6e..000000000 --- a/deploy/migrations/clickhouse/078_add_peerdas_rpc_columns.down.sql +++ /dev/null @@ -1,48 +0,0 @@ --- Remove Direction column from distributed tables first -DROP TABLE IF EXISTS libp2p_handle_status ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS libp2p_handle_metadata ON CLUSTER '{cluster}' SYNC; - --- Remove Direction column from local tables -ALTER TABLE libp2p_handle_status_local ON CLUSTER '{cluster}' -DROP COLUMN IF EXISTS direction; - -ALTER TABLE libp2p_handle_status_local ON CLUSTER '{cluster}' -DROP COLUMN IF EXISTS request_earliest_available_slot; - -ALTER TABLE libp2p_handle_status_local ON CLUSTER '{cluster}' -DROP COLUMN IF EXISTS response_earliest_available_slot; - -ALTER TABLE libp2p_handle_metadata_local ON CLUSTER '{cluster}' -DROP COLUMN IF EXISTS direction; - -ALTER TABLE libp2p_handle_metadata_local ON CLUSTER '{cluster}' -DROP COLUMN IF EXISTS custody_group_count; - --- Recreate distributed tables -CREATE TABLE libp2p_handle_status ON CLUSTER '{cluster}' AS libp2p_handle_status_local -ENGINE = Distributed( - '{cluster}', - default, - libp2p_handle_status_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - latency_milliseconds - ) -); - -CREATE TABLE libp2p_handle_metadata ON CLUSTER '{cluster}' AS libp2p_handle_metadata_local -ENGINE = Distributed( - '{cluster}', - default, - libp2p_handle_metadata_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - latency_milliseconds - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/078_add_peerdas_rpc_columns.up.sql b/deploy/migrations/clickhouse/078_add_peerdas_rpc_columns.up.sql deleted file mode 100644 index ba159a926..000000000 --- a/deploy/migrations/clickhouse/078_add_peerdas_rpc_columns.up.sql +++ /dev/null @@ -1,57 +0,0 @@ --- Drop distributed tables -DROP TABLE IF EXISTS libp2p_handle_status ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS libp2p_handle_metadata ON CLUSTER '{cluster}' SYNC; - --- Add Direction column to libp2p_handle_status_local -ALTER TABLE libp2p_handle_status_local ON CLUSTER '{cluster}' -ADD COLUMN IF NOT EXISTS direction LowCardinality(Nullable(String)) COMMENT 'Direction of the RPC request (inbound or outbound)' CODEC(ZSTD(1)) -AFTER protocol; - --- Add request_earliest_available_slot column to libp2p_handle_status_local -ALTER TABLE libp2p_handle_status_local ON CLUSTER '{cluster}' -ADD COLUMN IF NOT EXISTS request_earliest_available_slot Nullable(UInt32) COMMENT 'Requested earliest available slot' CODEC(ZSTD(1)) -AFTER request_head_slot; - --- Add response_earliest_available_slot column to libp2p_handle_status_local -ALTER TABLE libp2p_handle_status_local ON CLUSTER '{cluster}' -ADD COLUMN IF NOT EXISTS response_earliest_available_slot Nullable(UInt32) COMMENT 'Response earliest available slot' CODEC(ZSTD(1)) -AFTER response_head_slot; - --- Add Direction column to libp2p_handle_metadata_local -ALTER TABLE libp2p_handle_metadata_local ON CLUSTER '{cluster}' -ADD COLUMN IF NOT EXISTS direction LowCardinality(Nullable(String)) COMMENT 'Direction of the RPC request (inbound or outbound)' CODEC(ZSTD(1)) -AFTER protocol; - --- Add custody_group_count column to libp2p_handle_metadata_local -ALTER TABLE libp2p_handle_metadata_local ON CLUSTER '{cluster}' -ADD COLUMN IF NOT EXISTS custody_group_count Nullable(UInt8) COMMENT 'Number of custody groups (0-127)' CODEC(ZSTD(1)) -AFTER syncnets; - --- Recreate distributed tables -CREATE TABLE libp2p_handle_status ON CLUSTER '{cluster}' AS libp2p_handle_status_local -ENGINE = Distributed( - '{cluster}', - default, - libp2p_handle_status_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - latency_milliseconds - ) -); - -CREATE TABLE libp2p_handle_metadata ON CLUSTER '{cluster}' AS libp2p_handle_metadata_local -ENGINE = Distributed( - '{cluster}', - default, - libp2p_handle_metadata_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - latency_milliseconds - ) -); \ No newline at end of file diff --git a/deploy/migrations/clickhouse/079_custody_probe.down.sql b/deploy/migrations/clickhouse/079_custody_probe.down.sql deleted file mode 100644 index f1ca4ef64..000000000 --- a/deploy/migrations/clickhouse/079_custody_probe.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS libp2p_rpc_data_column_custody_probe ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS libp2p_rpc_data_column_custody_probe_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/079_custody_probe.up.sql b/deploy/migrations/clickhouse/079_custody_probe.up.sql deleted file mode 100644 index b2b779557..000000000 --- a/deploy/migrations/clickhouse/079_custody_probe.up.sql +++ /dev/null @@ -1,80 +0,0 @@ --- Create local table (actual storage) -CREATE TABLE IF NOT EXISTS libp2p_rpc_data_column_custody_probe_local ON CLUSTER '{cluster}' ( - -- Timestamps - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'When the probe was executed' CODEC(DoubleDelta, ZSTD(1)), - - -- Probe identifiers - slot UInt32 COMMENT 'Slot number being probed' CODEC(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - epoch UInt32 COMMENT 'Epoch number of the slot being probed' CODEC(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - - wallclock_request_slot UInt32 COMMENT 'The wallclock slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - wallclock_request_slot_start_date_time DateTime COMMENT 'The start time for the slot when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - wallclock_request_epoch UInt32 COMMENT 'The wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - wallclock_request_epoch_start_date_time DateTime COMMENT 'The start time for the wallclock epoch when the request was sent' CODEC(DoubleDelta, ZSTD(1)), - - -- Column information - column_index UInt64 COMMENT 'Column index being probed' CODEC(ZSTD(1)), - column_rows_count UInt16 COMMENT 'Number of rows in the column' CODEC(ZSTD(1)), - beacon_block_root FixedString(66) COMMENT 'Root of the beacon block' CODEC(ZSTD(1)), - - -- Peer information - peer_id_unique_key Int64 COMMENT 'Unique key associated with the identifier of the peer', - - -- Probe results - result LowCardinality(String) COMMENT 'Result of the probe' CODEC(ZSTD(1)), - response_time_ms Int32 COMMENT 'Response time in milliseconds' CODEC(ZSTD(1)), - error Nullable(String) COMMENT 'Error message if probe failed' CODEC(ZSTD(1)), - - -- Standard metadata fields - meta_client_name LowCardinality(String) COMMENT 'Name of the client that executed the probe', - meta_client_id String COMMENT 'Unique Session ID of the client' CODEC(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client' CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client' CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client' CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client' CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client' CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client' CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client' CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client' CODEC(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name', - meta_labels Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(event_date_time) -ORDER BY ( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - slot, - column_index -) -COMMENT 'Contains custody probe events for data column availability verification'; - --- Create distributed table (query interface) -CREATE TABLE IF NOT EXISTS libp2p_rpc_data_column_custody_probe ON CLUSTER '{cluster}' -AS libp2p_rpc_data_column_custody_probe_local -ENGINE = Distributed( - '{cluster}', - default, - libp2p_rpc_data_column_custody_probe_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name, - peer_id_unique_key, - slot, - column_index - ) -); diff --git a/deploy/migrations/clickhouse/080_destroy_dbt.down.sql b/deploy/migrations/clickhouse/080_destroy_dbt.down.sql deleted file mode 100644 index e229b8c3e..000000000 --- a/deploy/migrations/clickhouse/080_destroy_dbt.down.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE DATABASE IF NOT EXISTS dbt ON CLUSTER '{cluster}' diff --git a/deploy/migrations/clickhouse/080_destroy_dbt.up.sql b/deploy/migrations/clickhouse/080_destroy_dbt.up.sql deleted file mode 100644 index 13b5f5e93..000000000 --- a/deploy/migrations/clickhouse/080_destroy_dbt.up.sql +++ /dev/null @@ -1 +0,0 @@ -DROP DATABASE dbt ON CLUSTER '{cluster}' SYNC diff --git a/deploy/migrations/clickhouse/081_execution_state_size.down.sql b/deploy/migrations/clickhouse/081_execution_state_size.down.sql deleted file mode 100644 index 8f1f5cde4..000000000 --- a/deploy/migrations/clickhouse/081_execution_state_size.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS execution_state_size ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS execution_state_size_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/081_execution_state_size.up.sql b/deploy/migrations/clickhouse/081_execution_state_size.up.sql deleted file mode 100644 index 29a56f0a7..000000000 --- a/deploy/migrations/clickhouse/081_execution_state_size.up.sql +++ /dev/null @@ -1,65 +0,0 @@ -CREATE TABLE execution_state_size_local ON CLUSTER '{cluster}' ( - -- Timestamps - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' Codec(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'When the state size measurement was taken' Codec(DoubleDelta, ZSTD(1)), - - -- Block information - block_number UInt64 COMMENT 'Block number at which the state size was measured' Codec(DoubleDelta, ZSTD(1)), - state_root FixedString(66) COMMENT 'State root hash of the execution layer at this block' Codec(ZSTD(1)), - - -- Account state size metrics - accounts UInt64 COMMENT 'Total number of accounts in the state' Codec(ZSTD(1)), - account_bytes UInt64 COMMENT 'Total bytes used by account data' Codec(ZSTD(1)), - account_trienodes UInt64 COMMENT 'Number of trie nodes in the account trie' Codec(ZSTD(1)), - account_trienode_bytes UInt64 COMMENT 'Total bytes used by account trie nodes' Codec(ZSTD(1)), - - -- Contract code size metrics - contract_codes UInt64 COMMENT 'Total number of contract codes stored' Codec(ZSTD(1)), - contract_code_bytes UInt64 COMMENT 'Total bytes used by contract code' Codec(ZSTD(1)), - - -- Storage size metrics - storages UInt64 COMMENT 'Total number of storage slots in the state' Codec(ZSTD(1)), - storage_bytes UInt64 COMMENT 'Total bytes used by storage data' Codec(ZSTD(1)), - storage_trienodes UInt64 COMMENT 'Number of trie nodes in the storage trie' Codec(ZSTD(1)), - storage_trienode_bytes UInt64 COMMENT 'Total bytes used by storage trie nodes' Codec(ZSTD(1)), - - -- Standard metadata fields - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' Codec(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' Codec(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name', - meta_execution_version LowCardinality(String) COMMENT 'Execution client version that generated the event', - meta_execution_version_major LowCardinality(String) COMMENT 'Execution client major version that generated the event', - meta_execution_version_minor LowCardinality(String) COMMENT 'Execution client minor version that generated the event', - meta_execution_version_patch LowCardinality(String) COMMENT 'Execution client patch version that generated the event', - meta_execution_implementation LowCardinality(String) COMMENT 'Execution client implementation that generated the event', - meta_labels Map(String, String) COMMENT 'Labels associated with the event' Codec(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY intDiv(block_number, 5000000) -ORDER BY (block_number, meta_network_name, meta_client_name, state_root, event_date_time) COMMENT 'Contains execution layer state size metrics including account, contract code, and storage data measurements at specific block heights.'; - -CREATE TABLE execution_state_size ON CLUSTER '{cluster}' AS execution_state_size_local -ENGINE = Distributed( - '{cluster}', - default, - execution_state_size_local, - cityHash64( - block_number, - meta_network_name, - meta_client_name, - state_root, - event_date_time - ) -); diff --git a/deploy/migrations/clickhouse/082_execution_transaction.down.sql b/deploy/migrations/clickhouse/082_execution_transaction.down.sql deleted file mode 100644 index fca1743ed..000000000 --- a/deploy/migrations/clickhouse/082_execution_transaction.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS execution_transaction ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS execution_transaction_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/082_execution_transaction.up.sql b/deploy/migrations/clickhouse/082_execution_transaction.up.sql deleted file mode 100644 index 41e6b77e9..000000000 --- a/deploy/migrations/clickhouse/082_execution_transaction.up.sql +++ /dev/null @@ -1,51 +0,0 @@ -CREATE TABLE default.execution_transaction_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `block_hash` FixedString(66) COMMENT 'The block hash' CODEC(ZSTD(1)), - `parent_hash` FixedString(66) COMMENT 'The parent block hash' CODEC(ZSTD(1)), - `position` UInt32 COMMENT 'The position of the transaction in the beacon block' CODEC(DoubleDelta, ZSTD(1)), - `hash` FixedString(66) COMMENT 'The hash of the transaction' CODEC(ZSTD(1)), - `from` FixedString(42) COMMENT 'The address of the account that sent the transaction' CODEC(ZSTD(1)), - `to` Nullable(FixedString(42)) COMMENT 'The address of the account that is the transaction recipient' CODEC(ZSTD(1)), - `nonce` UInt64 COMMENT 'The nonce of the sender account at the time of the transaction' CODEC(ZSTD(1)), - `gas_price` UInt128 COMMENT 'The gas price of the transaction in wei' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'The maximum gas provided for the transaction execution' CODEC(ZSTD(1)), - `gas_tip_cap` Nullable(UInt128) COMMENT 'The priority fee (tip) the user has set for the transaction' CODEC(ZSTD(1)), - `gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), - `value` UInt128 COMMENT 'The value transferred with the transaction in wei' CODEC(ZSTD(1)), - `type` UInt8 COMMENT 'The type of the transaction' CODEC(ZSTD(1)), - `size` UInt32 COMMENT 'The size of the transaction data in bytes' CODEC(ZSTD(1)), - `call_data_size` UInt32 COMMENT 'The size of the call data of the transaction in bytes' CODEC(ZSTD(1)), - `blob_gas` Nullable(UInt64) COMMENT 'The maximum gas provided for the blob transaction execution' CODEC(ZSTD(1)), - `blob_gas_fee_cap` Nullable(UInt128) COMMENT 'The max fee the user has set for the transaction' CODEC(ZSTD(1)), - `blob_hashes` Array(String) COMMENT 'The hashes of the blob commitments for blob transactions' CODEC(ZSTD(1)), - `success` Bool COMMENT 'The transaction success' CODEC(ZSTD(1)), - `n_input_bytes` UInt32 COMMENT 'The transaction input bytes' CODEC(ZSTD(1)), - `n_input_zero_bytes` UInt32 COMMENT 'The transaction input zero bytes' CODEC(ZSTD(1)), - `n_input_nonzero_bytes` UInt32 COMMENT 'The transaction input nonzero bytes' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 5000000) -ORDER BY - ( - block_number, - meta_network_name, - block_hash, - position - ) COMMENT 'Contains execution transaction data that may not be canonical.'; - -CREATE TABLE default.execution_transaction ON CLUSTER '{cluster}' AS default.execution_transaction_local ENGINE = Distributed( - '{cluster}', - default, - execution_transaction_local, - cityHash64( - block_number, - meta_network_name, - block_hash, - position - ) -); diff --git a/deploy/migrations/clickhouse/083_blob_submitter.down.sql b/deploy/migrations/clickhouse/083_blob_submitter.down.sql deleted file mode 100644 index e8a144611..000000000 --- a/deploy/migrations/clickhouse/083_blob_submitter.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.blob_submitter ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.blob_submitter_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/083_blob_submitter.up.sql b/deploy/migrations/clickhouse/083_blob_submitter.up.sql deleted file mode 100644 index 97c55488d..000000000 --- a/deploy/migrations/clickhouse/083_blob_submitter.up.sql +++ /dev/null @@ -1,25 +0,0 @@ -CREATE TABLE default.blob_submitter_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `address` FixedString(66) COMMENT 'Ethereum address of the blob submitter' CODEC(ZSTD(1)), - `name` String COMMENT 'Name of the blob submitter' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) -ORDER BY - ( - address, - meta_network_name - ) COMMENT 'Contains blob submitter address to name mappings.'; - -CREATE TABLE default.blob_submitter ON CLUSTER '{cluster}' AS default.blob_submitter_local ENGINE = Distributed( - '{cluster}', - default, - blob_submitter_local, - cityHash64( - address, - meta_network_name - ) -); diff --git a/deploy/migrations/clickhouse/084_consensus_engine_api_new_payload.down.sql b/deploy/migrations/clickhouse/084_consensus_engine_api_new_payload.down.sql deleted file mode 100644 index 2998d8856..000000000 --- a/deploy/migrations/clickhouse/084_consensus_engine_api_new_payload.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS consensus_engine_api_new_payload ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS consensus_engine_api_new_payload_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/084_consensus_engine_api_new_payload.up.sql b/deploy/migrations/clickhouse/084_consensus_engine_api_new_payload.up.sql deleted file mode 100644 index 2d80bf635..000000000 --- a/deploy/migrations/clickhouse/084_consensus_engine_api_new_payload.up.sql +++ /dev/null @@ -1,69 +0,0 @@ -CREATE TABLE consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' ( - -- Timestamps - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' Codec(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'When the sentry received the event' Codec(DoubleDelta, ZSTD(1)), - requested_date_time DateTime64(3) COMMENT 'Timestamp when the engine_newPayload call was initiated' Codec(DoubleDelta, ZSTD(1)), - - -- Timing - duration_ms UInt64 COMMENT 'How long the engine_newPayload call took in milliseconds' Codec(ZSTD(1)), - - -- Beacon context - slot UInt32 COMMENT 'Slot number of the beacon block containing the payload' Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime COMMENT 'The wall clock time when the slot started' Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 COMMENT 'Epoch number derived from the slot' Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime COMMENT 'The wall clock time when the epoch started' Codec(DoubleDelta, ZSTD(1)), - block_root FixedString(66) COMMENT 'Root of the beacon block (hex encoded with 0x prefix)' Codec(ZSTD(1)), - parent_block_root FixedString(66) COMMENT 'Root of the parent beacon block (hex encoded with 0x prefix)' Codec(ZSTD(1)), - proposer_index UInt32 COMMENT 'Validator index of the block proposer' Codec(ZSTD(1)), - - -- Execution payload details - block_number UInt64 COMMENT 'Execution block number' Codec(DoubleDelta, ZSTD(1)), - block_hash FixedString(66) COMMENT 'Execution block hash (hex encoded with 0x prefix)' Codec(ZSTD(1)), - parent_hash FixedString(66) COMMENT 'Parent execution block hash (hex encoded with 0x prefix)' Codec(ZSTD(1)), - gas_used UInt64 COMMENT 'Total gas used by all transactions in the block' Codec(ZSTD(1)), - gas_limit UInt64 COMMENT 'Gas limit of the block' Codec(ZSTD(1)), - tx_count UInt32 COMMENT 'Number of transactions in the block' Codec(ZSTD(1)), - blob_count UInt32 COMMENT 'Number of blobs in the block' Codec(ZSTD(1)), - - -- Response from EL - status LowCardinality(String) COMMENT 'Payload status returned by EL (VALID, INVALID, SYNCING, ACCEPTED, INVALID_BLOCK_HASH)', - latest_valid_hash Nullable(FixedString(66)) COMMENT 'Latest valid hash when status is INVALID (hex encoded with 0x prefix)' Codec(ZSTD(1)), - validation_error Nullable(String) COMMENT 'Error message when validation fails' Codec(ZSTD(1)), - - -- Meta - method_version LowCardinality(String) COMMENT 'Version of the engine_newPayload method (e.g., V3, V4)', - - -- Standard metadata fields - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' Codec(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' Codec(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name, block_hash, event_date_time) COMMENT 'Contains timing and instrumentation data for engine_newPayload calls between the consensus and execution layer.'; - -CREATE TABLE consensus_engine_api_new_payload ON CLUSTER '{cluster}' AS consensus_engine_api_new_payload_local -ENGINE = Distributed( - '{cluster}', - default, - consensus_engine_api_new_payload_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_hash, - event_date_time - ) -); diff --git a/deploy/migrations/clickhouse/085_consensus_engine_api_new_payload_execution_version.down.sql b/deploy/migrations/clickhouse/085_consensus_engine_api_new_payload_execution_version.down.sql deleted file mode 100644 index 1b518f098..000000000 --- a/deploy/migrations/clickhouse/085_consensus_engine_api_new_payload_execution_version.down.sql +++ /dev/null @@ -1,31 +0,0 @@ --- Remove execution client version columns from consensus_engine_api_new_payload table - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_version_patch; - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_version_minor; - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_version_major; - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_implementation; - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_version; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_version_patch; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_version_minor; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_version_major; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_implementation; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -DROP COLUMN meta_execution_version; diff --git a/deploy/migrations/clickhouse/085_consensus_engine_api_new_payload_execution_version.up.sql b/deploy/migrations/clickhouse/085_consensus_engine_api_new_payload_execution_version.up.sql deleted file mode 100644 index 64803d9b9..000000000 --- a/deploy/migrations/clickhouse/085_consensus_engine_api_new_payload_execution_version.up.sql +++ /dev/null @@ -1,32 +0,0 @@ --- Add execution client version columns to consensus_engine_api_new_payload table - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_version LowCardinality(String) DEFAULT '' COMMENT 'Full execution client version string from web3_clientVersion RPC' AFTER method_version; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_implementation LowCardinality(String) DEFAULT '' COMMENT 'Execution client implementation name (e.g., Geth, Nethermind, Besu, Reth, Erigon)' AFTER meta_execution_version; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_version_major LowCardinality(String) DEFAULT '' COMMENT 'Execution client major version number' AFTER meta_execution_implementation; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_version_minor LowCardinality(String) DEFAULT '' COMMENT 'Execution client minor version number' AFTER meta_execution_version_major; - -ALTER TABLE default.consensus_engine_api_new_payload_local ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_version_patch LowCardinality(String) DEFAULT '' COMMENT 'Execution client patch version number' AFTER meta_execution_version_minor; - --- Add to distributed table -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_version LowCardinality(String) DEFAULT '' COMMENT 'Full execution client version string from web3_clientVersion RPC' AFTER method_version; - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_implementation LowCardinality(String) DEFAULT '' COMMENT 'Execution client implementation name (e.g., Geth, Nethermind, Besu, Reth, Erigon)' AFTER meta_execution_version; - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_version_major LowCardinality(String) DEFAULT '' COMMENT 'Execution client major version number' AFTER meta_execution_implementation; - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_version_minor LowCardinality(String) DEFAULT '' COMMENT 'Execution client minor version number' AFTER meta_execution_version_major; - -ALTER TABLE default.consensus_engine_api_new_payload ON CLUSTER '{cluster}' -ADD COLUMN meta_execution_version_patch LowCardinality(String) DEFAULT '' COMMENT 'Execution client patch version number' AFTER meta_execution_version_minor; diff --git a/deploy/migrations/clickhouse/086_consensus_engine_api_get_blobs.down.sql b/deploy/migrations/clickhouse/086_consensus_engine_api_get_blobs.down.sql deleted file mode 100644 index 7090963a4..000000000 --- a/deploy/migrations/clickhouse/086_consensus_engine_api_get_blobs.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS consensus_engine_api_get_blobs ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS consensus_engine_api_get_blobs_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/086_consensus_engine_api_get_blobs.up.sql b/deploy/migrations/clickhouse/086_consensus_engine_api_get_blobs.up.sql deleted file mode 100644 index efc831fa2..000000000 --- a/deploy/migrations/clickhouse/086_consensus_engine_api_get_blobs.up.sql +++ /dev/null @@ -1,70 +0,0 @@ -CREATE TABLE consensus_engine_api_get_blobs_local ON CLUSTER '{cluster}' ( - -- Timestamps - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' Codec(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'When the sentry received the event' Codec(DoubleDelta, ZSTD(1)), - requested_date_time DateTime64(3) COMMENT 'Timestamp when the engine_getBlobs call was initiated' Codec(DoubleDelta, ZSTD(1)), - - -- Timing - duration_ms UInt64 COMMENT 'How long the engine_getBlobs call took in milliseconds' Codec(ZSTD(1)), - - -- Beacon context - slot UInt32 COMMENT 'Slot number of the beacon block being reconstructed' Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime COMMENT 'The wall clock time when the slot started' Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 COMMENT 'Epoch number derived from the slot' Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime COMMENT 'The wall clock time when the epoch started' Codec(DoubleDelta, ZSTD(1)), - block_root FixedString(66) COMMENT 'Root of the beacon block (hex encoded with 0x prefix)' Codec(ZSTD(1)), - parent_block_root FixedString(66) COMMENT 'Root of the parent beacon block (hex encoded with 0x prefix)' Codec(ZSTD(1)), - - -- Request details - requested_count UInt32 COMMENT 'Number of versioned hashes requested' Codec(ZSTD(1)), - versioned_hashes Array(FixedString(66)) COMMENT 'List of versioned hashes requested (derived from KZG commitments)' Codec(ZSTD(1)), - - -- Response from EL - returned_count UInt32 COMMENT 'Number of non-null blobs returned' Codec(ZSTD(1)), - status LowCardinality(String) COMMENT 'Result status (SUCCESS, PARTIAL, EMPTY, UNSUPPORTED, ERROR)', - error_message Nullable(String) COMMENT 'Error details if status is ERROR or UNSUPPORTED' Codec(ZSTD(1)), - - -- Meta - method_version LowCardinality(String) COMMENT 'Version of the engine_getBlobs method (e.g., V1, V2)', - - -- Execution client metadata - meta_execution_version LowCardinality(String) COMMENT 'Full execution client version string from web3_clientVersion RPC', - meta_execution_implementation LowCardinality(String) COMMENT 'Execution client implementation name (e.g., Geth, Nethermind, Besu, Reth, Erigon)', - meta_execution_version_major LowCardinality(String) COMMENT 'Execution client major version number', - meta_execution_version_minor LowCardinality(String) COMMENT 'Execution client minor version number', - meta_execution_version_patch LowCardinality(String) COMMENT 'Execution client patch version number', - - -- Standard metadata fields - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' Codec(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' Codec(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name, block_root, event_date_time) COMMENT 'Contains timing and instrumentation data for engine_getBlobs calls between the consensus and execution layer.'; - -CREATE TABLE consensus_engine_api_get_blobs ON CLUSTER '{cluster}' AS consensus_engine_api_get_blobs_local -ENGINE = Distributed( - '{cluster}', - default, - consensus_engine_api_get_blobs_local, - cityHash64( - slot_start_date_time, - meta_network_name, - meta_client_name, - block_root, - event_date_time - ) -); diff --git a/deploy/migrations/clickhouse/087_mev_relay_proposer_payload_delivered_value.down.sql b/deploy/migrations/clickhouse/087_mev_relay_proposer_payload_delivered_value.down.sql deleted file mode 100644 index 65b8b65e6..000000000 --- a/deploy/migrations/clickhouse/087_mev_relay_proposer_payload_delivered_value.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE default.mev_relay_proposer_payload_delivered_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS `value`; - -ALTER TABLE default.mev_relay_proposer_payload_delivered ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS `value`; diff --git a/deploy/migrations/clickhouse/087_mev_relay_proposer_payload_delivered_value.up.sql b/deploy/migrations/clickhouse/087_mev_relay_proposer_payload_delivered_value.up.sql deleted file mode 100644 index d1789d75b..000000000 --- a/deploy/migrations/clickhouse/087_mev_relay_proposer_payload_delivered_value.up.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE default.mev_relay_proposer_payload_delivered_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS `value` UInt256 COMMENT 'The bid value in wei' CODEC(ZSTD(1)) AFTER `gas_used`; - -ALTER TABLE default.mev_relay_proposer_payload_delivered ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS `value` UInt256 COMMENT 'The bid value in wei' CODEC(ZSTD(1)) AFTER `gas_used`; diff --git a/deploy/migrations/clickhouse/088_transactions_structlog_call_to.down.sql b/deploy/migrations/clickhouse/088_transactions_structlog_call_to.down.sql deleted file mode 100644 index 0e4a3cf8a..000000000 --- a/deploy/migrations/clickhouse/088_transactions_structlog_call_to.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - DROP COLUMN gas_used; - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - DROP COLUMN gas_used; diff --git a/deploy/migrations/clickhouse/088_transactions_structlog_call_to.up.sql b/deploy/migrations/clickhouse/088_transactions_structlog_call_to.up.sql deleted file mode 100644 index b307b7afd..000000000 --- a/deploy/migrations/clickhouse/088_transactions_structlog_call_to.up.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - ADD COLUMN gas_used UInt64 DEFAULT 0 COMMENT 'Actual gas consumed (computed from consecutive gas values)' CODEC(ZSTD(1)) AFTER gas_cost; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - ADD COLUMN gas_used UInt64 DEFAULT 0 COMMENT 'Actual gas consumed (computed from consecutive gas values)' CODEC(ZSTD(1)) AFTER gas_cost; diff --git a/deploy/migrations/clickhouse/089_table_comments.down.sql b/deploy/migrations/clickhouse/089_table_comments.down.sql deleted file mode 100644 index 0090bf56d..000000000 --- a/deploy/migrations/clickhouse/089_table_comments.down.sql +++ /dev/null @@ -1,629 +0,0 @@ --- Rollback: Restore original comments for all tables --- This reverses the comprehensive table comment improvements - --- ============================================================================ --- Rollback: beacon_api_eth_v1_events_* tables --- ============================================================================ - --- beacon_api_eth_v1_events_head -ALTER TABLE default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - -ALTER TABLE default.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "head" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - --- beacon_api_eth_v1_events_block -ALTER TABLE default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - -ALTER TABLE default.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "block" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - --- beacon_api_eth_v1_events_attestation -ALTER TABLE default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "attestation" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - -ALTER TABLE default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "attestation" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - --- beacon_api_eth_v1_events_voluntary_exit -ALTER TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "voluntary exit" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- beacon_api_eth_v1_events_finalized_checkpoint -ALTER TABLE default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "finalized checkpoint" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- beacon_api_eth_v1_events_chain_reorg -ALTER TABLE default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slots between when the reorg occurred and when the sentry received the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "chain reorg" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'Difference in slots between when the reorg occurred and when the sentry received the event'; - --- beacon_api_eth_v1_events_contribution_and_proof -ALTER TABLE default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN contribution_propagation_slot_start_diff 'Difference in slots between when the contribution occurred and when the sentry received the event'; - -ALTER TABLE default.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "contribution and proof" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN contribution_propagation_slot_start_diff 'Difference in slots between when the contribution occurred and when the sentry received the event'; - --- beacon_api_eth_v1_events_blob_sidecar -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "blob_sidecar" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - --- beacon_api_eth_v1_events_data_column_sidecar -ALTER TABLE default.beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "data_column_sidecar" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - -ALTER TABLE default.beacon_api_eth_v1_events_data_column_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "data_column_sidecar" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - --- beacon_api_eth_v1_events_block_gossip -ALTER TABLE default.beacon_api_eth_v1_events_block_gossip ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "block_gossip" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; - -ALTER TABLE default.beacon_api_eth_v1_events_block_gossip_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API eventstream "block_gossip" data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN propagation_slot_start_diff 'The difference between the event_date_time and the slot_start_date_time'; --- Rollback: Restore original comments for beacon_api_eth_v1_* and beacon_api_eth_v2_* tables (non-event-stream) - --- beacon_api_eth_v1_beacon_committee -ALTER TABLE default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/beacon/states/{state_id}/committees data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- beacon_api_eth_v1_validator_attestation_data -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/validator/attestation_data data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN request_duration 'The duration of the request', -COMMENT COLUMN request_slot_start_diff 'The difference between the request time and the slot start time'; - -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v1/validator/attestation_data data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN request_duration 'The duration of the request', -COMMENT COLUMN request_slot_start_diff 'The difference between the request time and the slot start time'; - --- beacon_api_eth_v1_proposer_duty -ALTER TABLE default.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a proposer duty from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a proposer duty from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- beacon_api_eth_v2_beacon_block -ALTER TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v2/beacon/blocks/{block_id} data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- beacon_api_eth_v3_validator_block -ALTER TABLE default.beacon_api_eth_v3_validator_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v3/validator/blocks/{slot} data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.beacon_api_eth_v3_validator_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API /eth/v3/validator/blocks/{slot} data from each sentry client attached to a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; --- Rollback: Restore original comments for canonical_beacon_block* tables - --- canonical_beacon_block -ALTER TABLE default.canonical_beacon_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon block from a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon block from a beacon node.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_block_attester_slashing -ALTER TABLE default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains attester slashing from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains attester slashing from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_block_deposit -ALTER TABLE default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a deposit from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a deposit from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_block_execution_transaction -ALTER TABLE default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution transaction from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution transaction from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_block_voluntary_exit -ALTER TABLE default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a voluntary exit from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a voluntary exit from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_block_withdrawal -ALTER TABLE default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a withdrawal from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a withdrawal from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; --- Rollback: Restore original comments for canonical_beacon_* remaining tables - --- canonical_beacon_validators -ALTER TABLE default.canonical_beacon_validators ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a validator state for an epoch.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_validators_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a validator state for an epoch.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_committee -ALTER TABLE default.canonical_beacon_committee ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains canonical beacon API /eth/v1/beacon/states/{state_id}/committees data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_committee_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains canonical beacon API /eth/v1/beacon/states/{state_id}/committees data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_proposer_duty -ALTER TABLE default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a proposer duty from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a proposer duty from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_elaborated_attestation -ALTER TABLE default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains elaborated attestations from beacon blocks.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains elaborated attestations from beacon blocks.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- canonical_beacon_blob_sidecar -ALTER TABLE default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a blob sidecar from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a blob sidecar from a beacon block.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- Rollback: Restore original comments for libp2p_gossipsub_* tables - --- libp2p_gossipsub_beacon_block -ALTER TABLE default.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub beacon block data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub beacon block data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_gossipsub_beacon_attestation -ALTER TABLE default.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub beacon attestation data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub beacon attestation data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_gossipsub_blob_sidecar -ALTER TABLE default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub blob sidecar data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub blob sidecar data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_gossipsub_data_column_sidecar -ALTER TABLE default.libp2p_gossipsub_data_column_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub data column sidecar data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_gossipsub_data_column_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub data column sidecar data', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_gossipsub_aggregate_and_proof -ALTER TABLE default.libp2p_gossipsub_aggregate_and_proof ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub aggregate and proof data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_gossipsub_aggregate_and_proof_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Table for libp2p gossipsub aggregate and proof data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- Rollback: Restore original comments for libp2p peer/connection tables - --- libp2p_peer -ALTER TABLE default.libp2p_peer ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the original peer id of a seahashed peer_id + meta_network_name, commonly seen in other tables as the field peer_id_unique_key'; - -ALTER TABLE default.libp2p_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the original peer id of a seahashed peer_id + meta_network_name, commonly seen in other tables as the field peer_id_unique_key'; - --- libp2p_add_peer -ALTER TABLE default.libp2p_add_peer ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the peers added to the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_add_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the peers added to the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_remove_peer -ALTER TABLE default.libp2p_remove_peer ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the peers removed from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_remove_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the peers removed from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_connected -ALTER TABLE default.libp2p_connected ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the CONNECTED events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_connected_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the CONNECTED events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_disconnected -ALTER TABLE default.libp2p_disconnected ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the DISCONNECTED events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_disconnected_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the DISCONNECTED events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_handle_status -ALTER TABLE default.libp2p_handle_status ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the status handling events for libp2p peers.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_handle_status_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the status handling events for libp2p peers.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_handle_metadata -ALTER TABLE default.libp2p_handle_metadata ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the metadata handling events for libp2p peers.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_handle_metadata_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the metadata handling events for libp2p peers.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_synthetic_heartbeat -ALTER TABLE default.libp2p_synthetic_heartbeat ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains heartbeat events from libp2p peers', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_synthetic_heartbeat_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains heartbeat events from libp2p peers', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- Rollback: Restore original comments for libp2p RPC tables - --- libp2p_recv_rpc -ALTER TABLE default.libp2p_recv_rpc ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC messages received by the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_recv_rpc_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC messages received by the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_send_rpc -ALTER TABLE default.libp2p_send_rpc ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC messages sent by the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_send_rpc_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC messages sent by the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_drop_rpc -ALTER TABLE default.libp2p_drop_rpc ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC messages dropped by the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_drop_rpc_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC messages dropped by the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_rpc_meta_message -ALTER TABLE default.libp2p_rpc_meta_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC meta messages from the peer', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_rpc_meta_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC meta messages from the peer', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_rpc_meta_subscription -ALTER TABLE default.libp2p_rpc_meta_subscription ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC subscriptions from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the RPC subscriptions from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_rpc_meta_control_ihave -ALTER TABLE default.libp2p_rpc_meta_control_ihave ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "I have" control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "I have" control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_rpc_meta_control_iwant -ALTER TABLE default.libp2p_rpc_meta_control_iwant ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "I want" control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "I want" control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_rpc_meta_control_graft -ALTER TABLE default.libp2p_rpc_meta_control_graft ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "Graft" control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "Graft" control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_rpc_meta_control_prune -ALTER TABLE default.libp2p_rpc_meta_control_prune ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "Prune" control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the "Prune" control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_rpc_meta_control_idontwant -ALTER TABLE default.libp2p_rpc_meta_control_idontwant ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the IDONTWANT control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_rpc_meta_control_idontwant_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the IDONTWANT control messages from the peer.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- Rollback: Restore original comments for libp2p topic/message event tables - --- libp2p_join -ALTER TABLE default.libp2p_join ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the JOIN events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_join_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the JOIN events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_leave -ALTER TABLE default.libp2p_leave ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the LEAVE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_leave_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the LEAVE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_graft -ALTER TABLE default.libp2p_graft ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the GRAFT events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_graft_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the GRAFT events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_prune -ALTER TABLE default.libp2p_prune ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the PRUNE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_prune_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the PRUNE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_deliver_message -ALTER TABLE default.libp2p_deliver_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the DELIVER_MESSAGE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_deliver_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the DELIVER_MESSAGE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_publish_message -ALTER TABLE default.libp2p_publish_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the PUBLISH_MESSAGE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_publish_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the PUBLISH_MESSAGE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_duplicate_message -ALTER TABLE default.libp2p_duplicate_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the DUPLICATE_MESSAGE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_duplicate_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the DUPLICATE_MESSAGE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- libp2p_reject_message -ALTER TABLE default.libp2p_reject_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the REJECT_MESSAGE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.libp2p_reject_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains the details of the REJECT_MESSAGE events from the libp2p client.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- Rollback: Restore original comments for mempool_*, mev_relay_*, node_record_* tables - --- mempool_transaction (no original COMMENT) --- Leaving unchanged as there was no original table comment - --- mempool_dumpster_transaction -ALTER TABLE default.mempool_dumpster_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions from mempool dumpster dataset. Following the parquet schema with some additions'; - -ALTER TABLE default.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions from mempool dumpster dataset. Following the parquet schema with some additions'; - --- block_native_mempool_transaction -ALTER TABLE default.block_native_mempool_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions from block native mempool dataset'; - -ALTER TABLE default.block_native_mempool_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions from block native mempool dataset'; - --- mev_relay_bid_trace -ALTER TABLE default.mev_relay_bid_trace ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains MEV relay block bids data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.mev_relay_bid_trace_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains MEV relay block bids data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- mev_relay_proposer_payload_delivered -ALTER TABLE default.mev_relay_proposer_payload_delivered ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains MEV relay proposer payload delivered data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.mev_relay_proposer_payload_delivered_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains MEV relay proposer payload delivered data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- mev_relay_validator_registration -ALTER TABLE default.mev_relay_validator_registration ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains MEV relay validator registrations data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.mev_relay_validator_registration_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains MEV relay validator registrations data.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- node_record_execution -ALTER TABLE default.node_record_execution ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution node records discovered by the Xatu discovery module.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.node_record_execution_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution node records discovered by the Xatu discovery module.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- node_record_consensus -ALTER TABLE default.node_record_consensus ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains consensus node records discovered by the Xatu discovery module.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - -ALTER TABLE default.node_record_consensus_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains consensus node records discovered by the Xatu discovery module.', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event'; - --- Rollback: Restore original comments for remaining tables - --- blob_submitter -ALTER TABLE default.blob_submitter ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains blob submitter address to name mappings.'; - -ALTER TABLE default.blob_submitter_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains blob submitter address to name mappings.'; - --- ethseer_validator_entity -ALTER TABLE default.ethseer_validator_entity ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a mapping of validators to entities'; - -ALTER TABLE default.ethseer_validator_entity_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains a mapping of validators to entities'; - diff --git a/deploy/migrations/clickhouse/089_table_comments.up.sql b/deploy/migrations/clickhouse/089_table_comments.up.sql deleted file mode 100644 index d7253f52f..000000000 --- a/deploy/migrations/clickhouse/089_table_comments.up.sql +++ /dev/null @@ -1,643 +0,0 @@ --- Comprehensive table comment improvements across all Xatu ClickHouse tables --- Improves table and column comments for succinctness, correctness, and partition key awareness --- Covers: beacon_api_*, canonical_beacon_*, libp2p_*, mempool_*, mev_relay_*, node_record_*, and reference tables - --- ============================================================================ --- Batch 1: beacon_api_eth_v1_events_* table comments --- ============================================================================ - --- beacon_api_eth_v1_events_head -ALTER TABLE default.beacon_api_eth_v1_events_head ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures head events. Each row represents a `head` event from the Beacon API `/eth/v1/events?topics=head`, indicating the chain''s canonical head has been updated. Sentry adds client metadata and propagation timing. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - -ALTER TABLE default.beacon_api_eth_v1_events_head_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures head events. Each row represents a `head` event from the Beacon API `/eth/v1/events?topics=head`, indicating the chain''s canonical head has been updated. Sentry adds client metadata and propagation timing. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - --- beacon_api_eth_v1_events_block -ALTER TABLE default.beacon_api_eth_v1_events_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures block events. Each row represents a `block` event from the Beacon API `/eth/v1/events?topics=block`, indicating a new block has been imported. Sentry adds client metadata and propagation timing. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - -ALTER TABLE default.beacon_api_eth_v1_events_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures block events. Each row represents a `block` event from the Beacon API `/eth/v1/events?topics=block`, indicating a new block has been imported. Sentry adds client metadata and propagation timing. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - --- beacon_api_eth_v1_events_attestation -ALTER TABLE default.beacon_api_eth_v1_events_attestation ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures attestation events. Each row represents an `attestation` event from the Beacon API `/eth/v1/events?topics=attestation`. High-volume table - filter by `slot_start_date_time` and `meta_network_name` to avoid full scans. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - -ALTER TABLE default.beacon_api_eth_v1_events_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures attestation events. Each row represents an `attestation` event from the Beacon API `/eth/v1/events?topics=attestation`. High-volume table - filter by `slot_start_date_time` and `meta_network_name` to avoid full scans. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - --- beacon_api_eth_v1_events_voluntary_exit -ALTER TABLE default.beacon_api_eth_v1_events_voluntary_exit ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures voluntary exit events. Each row represents a `voluntary_exit` event from the Beacon API `/eth/v1/events?topics=voluntary_exit`, when a validator initiates an exit. Partition: monthly by `wallclock_epoch_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients'; - -ALTER TABLE default.beacon_api_eth_v1_events_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures voluntary exit events. Each row represents a `voluntary_exit` event from the Beacon API `/eth/v1/events?topics=voluntary_exit`, when a validator initiates an exit. Partition: monthly by `wallclock_epoch_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients'; - --- beacon_api_eth_v1_events_finalized_checkpoint -ALTER TABLE default.beacon_api_eth_v1_events_finalized_checkpoint ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures finalized checkpoint events. Each row represents a `finalized_checkpoint` event from the Beacon API `/eth/v1/events?topics=finalized_checkpoint`, when the chain finalizes a new epoch. Partition: monthly by `epoch_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients'; - -ALTER TABLE default.beacon_api_eth_v1_events_finalized_checkpoint_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures finalized checkpoint events. Each row represents a `finalized_checkpoint` event from the Beacon API `/eth/v1/events?topics=finalized_checkpoint`, when the chain finalizes a new epoch. Partition: monthly by `epoch_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients'; - --- beacon_api_eth_v1_events_chain_reorg -ALTER TABLE default.beacon_api_eth_v1_events_chain_reorg ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures chain reorg events. Each row represents a `chain_reorg` event from the Beacon API `/eth/v1/events?topics=chain_reorg`, when the beacon node detects a chain reorganization. Includes depth and old/new head info. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - -ALTER TABLE default.beacon_api_eth_v1_events_chain_reorg_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures chain reorg events. Each row represents a `chain_reorg` event from the Beacon API `/eth/v1/events?topics=chain_reorg`, when the beacon node detects a chain reorganization. Includes depth and old/new head info. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - --- beacon_api_eth_v1_events_contribution_and_proof -ALTER TABLE default.beacon_api_eth_v1_events_contribution_and_proof ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures sync committee contribution events. Each row represents a `contribution_and_proof` event from the Beacon API `/eth/v1/events?topics=contribution_and_proof`. Partition: monthly by `contribution_slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN contribution_propagation_slot_start_diff 'Time in milliseconds since the start of the contribution slot when the Sentry received this event'; - -ALTER TABLE default.beacon_api_eth_v1_events_contribution_and_proof_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures sync committee contribution events. Each row represents a `contribution_and_proof` event from the Beacon API `/eth/v1/events?topics=contribution_and_proof`. Partition: monthly by `contribution_slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN contribution_propagation_slot_start_diff 'Time in milliseconds since the start of the contribution slot when the Sentry received this event'; - --- beacon_api_eth_v1_events_blob_sidecar -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures blob sidecar events. Each row represents a `blob_sidecar` event from the Beacon API `/eth/v1/events?topics=blob_sidecar` (EIP-4844) with KZG commitment data. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - -ALTER TABLE default.beacon_api_eth_v1_events_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures blob sidecar events. Each row represents a `blob_sidecar` event from the Beacon API `/eth/v1/events?topics=blob_sidecar` (EIP-4844) with KZG commitment data. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - --- beacon_api_eth_v1_events_data_column_sidecar -ALTER TABLE default.beacon_api_eth_v1_events_data_column_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures data column sidecar events. Each row represents a `data_column_sidecar` event from the Beacon API `/eth/v1/events?topics=data_column_sidecar` (PeerDAS) with data availability sampling info. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - -ALTER TABLE default.beacon_api_eth_v1_events_data_column_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures data column sidecar events. Each row represents a `data_column_sidecar` event from the Beacon API `/eth/v1/events?topics=data_column_sidecar` (PeerDAS) with data availability sampling info. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - --- beacon_api_eth_v1_events_block_gossip -ALTER TABLE default.beacon_api_eth_v1_events_block_gossip ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures block gossip events. Each row represents a `block_gossip` event from the Beacon API `/eth/v1/events?topics=block_gossip` used for measuring block propagation timing across the network. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; - -ALTER TABLE default.beacon_api_eth_v1_events_block_gossip_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry subscribes to a beacon node''s Beacon API event-stream and captures block gossip events. Each row represents a `block_gossip` event from the Beacon API `/eth/v1/events?topics=block_gossip` used for measuring block propagation timing across the network. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the event. The table contains data from multiple Sentry clients', -COMMENT COLUMN propagation_slot_start_diff 'Time in milliseconds since the start of the slot when the Sentry received this event'; --- Batch 2: beacon_api_eth_v1_* and beacon_api_eth_v2_* table comments (non-event-stream tables) --- Improves table and column comments for succinctness, correctness, and partition key awareness - --- beacon_api_eth_v1_beacon_committee -ALTER TABLE default.beacon_api_eth_v1_beacon_committee ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry calls the Beacon API `/eth/v1/beacon/states/{state_id}/committees` endpoint to fetch committee assignments. Each row contains validator committee assignments for a slot. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients'; - -ALTER TABLE default.beacon_api_eth_v1_beacon_committee_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry calls the Beacon API `/eth/v1/beacon/states/{state_id}/committees` endpoint to fetch committee assignments. Each row contains validator committee assignments for a slot. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients'; - --- beacon_api_eth_v1_validator_attestation_data -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry calls the Beacon API `/eth/v1/validator/attestation_data` endpoint to fetch attestation data. Each row contains attestation data with request timing metrics. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients', -COMMENT COLUMN request_duration 'Time in milliseconds for the Beacon API request to complete', -COMMENT COLUMN request_slot_start_diff 'Time in milliseconds since the start of the slot when the request was made'; - -ALTER TABLE default.beacon_api_eth_v1_validator_attestation_data_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry calls the Beacon API `/eth/v1/validator/attestation_data` endpoint to fetch attestation data. Each row contains attestation data with request timing metrics. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients', -COMMENT COLUMN request_duration 'Time in milliseconds for the Beacon API request to complete', -COMMENT COLUMN request_slot_start_diff 'Time in milliseconds since the start of the slot when the request was made'; - --- beacon_api_eth_v1_proposer_duty -ALTER TABLE default.beacon_api_eth_v1_proposer_duty ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry fetches proposer duties from the Beacon API `/eth/v1/validator/duties/proposer/{epoch}` endpoint. Each row contains which validator is scheduled to propose a block for a given slot. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients'; - -ALTER TABLE default.beacon_api_eth_v1_proposer_duty_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry fetches proposer duties from the Beacon API `/eth/v1/validator/duties/proposer/{epoch}` endpoint. Each row contains which validator is scheduled to propose a block for a given slot. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients'; - --- beacon_api_eth_v2_beacon_block -ALTER TABLE default.beacon_api_eth_v2_beacon_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry calls the Beacon API `/eth/v2/beacon/blocks/{block_id}` endpoint to fetch beacon blocks. Each row contains full beacon block data including execution payload. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients'; - -ALTER TABLE default.beacon_api_eth_v2_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry calls the Beacon API `/eth/v2/beacon/blocks/{block_id}` endpoint to fetch beacon blocks. Each row contains full beacon block data including execution payload. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients'; - --- beacon_api_eth_v3_validator_block -ALTER TABLE default.beacon_api_eth_v3_validator_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry calls the Beacon API `/eth/v3/validator/blocks/{slot}` endpoint. Contains UNSIGNED simulated blocks - what the beacon node would have built if asked to propose at that slot. NOT actual proposed blocks. Useful for MEV research and block building analysis. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients'; - -ALTER TABLE default.beacon_api_eth_v3_validator_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Xatu Sentry calls the Beacon API `/eth/v3/validator/blocks/{slot}` endpoint. Contains UNSIGNED simulated blocks - what the beacon node would have built if asked to propose at that slot. NOT actual proposed blocks. Useful for MEV research and block building analysis. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the Sentry client that collected the data. The table contains data from multiple Sentry clients'; --- Batch 3: canonical_beacon_block* table comments --- Improves table and column comments for succinctness, correctness, and partition key awareness - --- canonical_beacon_block -ALTER TABLE default.canonical_beacon_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains finalized beacon block data. Each row represents a canonical block. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains finalized beacon block data. Each row represents a canonical block. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_block_attester_slashing -ALTER TABLE default.canonical_beacon_block_attester_slashing ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains attester slashings from finalized beacon blocks. Each row represents two conflicting attestations from a slashed validator. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_block_attester_slashing_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains attester slashings from finalized beacon blocks. Each row represents two conflicting attestations from a slashed validator. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_block_deposit -ALTER TABLE default.canonical_beacon_block_deposit ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains validator deposits from finalized beacon blocks. Each row represents a deposit with pubkey, withdrawal credentials, and amount. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_block_deposit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains validator deposits from finalized beacon blocks. Each row represents a deposit with pubkey, withdrawal credentials, and amount. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_block_execution_transaction -ALTER TABLE default.canonical_beacon_block_execution_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution layer transactions from finalized beacon blocks. Each row represents a transaction from the execution payload. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_block_execution_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution layer transactions from finalized beacon blocks. Each row represents a transaction from the execution payload. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_block_voluntary_exit -ALTER TABLE default.canonical_beacon_block_voluntary_exit ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains voluntary exits from finalized beacon blocks. Each row represents a validator initiating an exit. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_block_voluntary_exit_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains voluntary exits from finalized beacon blocks. Each row represents a validator initiating an exit. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_block_withdrawal -ALTER TABLE default.canonical_beacon_block_withdrawal ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains withdrawals from finalized beacon blocks. Each row represents a validator withdrawal with recipient address and amount. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_block_withdrawal_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains withdrawals from finalized beacon blocks. Each row represents a validator withdrawal with recipient address and amount. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; --- Batch 4: canonical_beacon_* remaining table comments --- Improves table and column comments for succinctness, correctness, and partition key awareness - --- canonical_beacon_validators -ALTER TABLE default.canonical_beacon_validators ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains finalized validator state snapshots. Each row represents a validator''s status, balance, and lifecycle epochs at a specific epoch. Partition: monthly by `epoch_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_validators_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains finalized validator state snapshots. Each row represents a validator''s status, balance, and lifecycle epochs at a specific epoch. Partition: monthly by `epoch_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_committee -ALTER TABLE default.canonical_beacon_committee ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains finalized beacon committee assignments. Each row represents a committee with its validator indices for a given slot. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_committee_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains finalized beacon committee assignments. Each row represents a committee with its validator indices for a given slot. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_proposer_duty -ALTER TABLE default.canonical_beacon_proposer_duty ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains finalized proposer duty assignments. Each row represents which validator was scheduled to propose a block for a given slot. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_proposer_duty_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains finalized proposer duty assignments. Each row represents which validator was scheduled to propose a block for a given slot. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_elaborated_attestation -ALTER TABLE default.canonical_beacon_elaborated_attestation ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains elaborated attestations from finalized beacon blocks. Aggregation bits are expanded to actual validator indices. Each row represents an attestation with its participating validators, source/target checkpoints, and position in the block. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_elaborated_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains elaborated attestations from finalized beacon blocks. Aggregation bits are expanded to actual validator indices. Each row represents an attestation with its participating validators, source/target checkpoints, and position in the block. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- canonical_beacon_blob_sidecar -ALTER TABLE default.canonical_beacon_blob_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains blob sidecars from finalized beacon blocks. Each row represents a blob with its KZG commitment, proof, and versioned hash. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.canonical_beacon_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains blob sidecars from finalized beacon blocks. Each row represents a blob with its KZG commitment, proof, and versioned hash. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- Batch 5a: libp2p_gossipsub_* table comments --- Tables populated from deep instrumentation within consensus layer clients (forked Prysm/Lighthouse maintained by ethPandaOps) - --- libp2p_gossipsub_beacon_block -ALTER TABLE default.libp2p_gossipsub_beacon_block ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon block messages received via libp2p gossipsub. Collected from deep instrumentation within forked consensus layer clients (Prysm/Lighthouse). Each row represents a block gossiped on the p2p network with timing and peer metadata. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_gossipsub_beacon_block_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon block messages received via libp2p gossipsub. Collected from deep instrumentation within forked consensus layer clients (Prysm/Lighthouse). Each row represents a block gossiped on the p2p network with timing and peer metadata. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_gossipsub_beacon_attestation -ALTER TABLE default.libp2p_gossipsub_beacon_attestation ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon attestation messages received via libp2p gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents an attestation gossiped on the p2p network with timing and peer metadata. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_gossipsub_beacon_attestation_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon attestation messages received via libp2p gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents an attestation gossiped on the p2p network with timing and peer metadata. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_gossipsub_blob_sidecar -ALTER TABLE default.libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains blob sidecar messages received via libp2p gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents a blob gossiped on the p2p network with timing and peer metadata. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains blob sidecar messages received via libp2p gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents a blob gossiped on the p2p network with timing and peer metadata. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_gossipsub_data_column_sidecar -ALTER TABLE default.libp2p_gossipsub_data_column_sidecar ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains data column sidecar messages received via libp2p gossipsub (PeerDAS). Collected from deep instrumentation within forked consensus layer clients. Each row represents a data column gossiped on the p2p network. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_gossipsub_data_column_sidecar_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains data column sidecar messages received via libp2p gossipsub (PeerDAS). Collected from deep instrumentation within forked consensus layer clients. Each row represents a data column gossiped on the p2p network. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_gossipsub_aggregate_and_proof -ALTER TABLE default.libp2p_gossipsub_aggregate_and_proof ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains aggregate and proof messages received via libp2p gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents an aggregated attestation with its proof. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_gossipsub_aggregate_and_proof_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains aggregate and proof messages received via libp2p gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents an aggregated attestation with its proof. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- Batch 5b: libp2p peer/connection table comments --- Tables populated from deep instrumentation within consensus layer clients (forked Prysm/Lighthouse maintained by ethPandaOps) - --- libp2p_peer -ALTER TABLE default.libp2p_peer ON CLUSTER '{cluster}' -MODIFY COMMENT 'Lookup table mapping seahashed peer_id + network to original peer ID. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.'; - -ALTER TABLE default.libp2p_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Lookup table mapping seahashed peer_id + network to original peer ID. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.'; - --- libp2p_add_peer -ALTER TABLE default.libp2p_add_peer ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains ADD_PEER events when peers are added to the libp2p peer store. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_add_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains ADD_PEER events when peers are added to the libp2p peer store. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_remove_peer -ALTER TABLE default.libp2p_remove_peer ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains REMOVE_PEER events when peers are removed from the libp2p peer store. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_remove_peer_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains REMOVE_PEER events when peers are removed from the libp2p peer store. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_connected -ALTER TABLE default.libp2p_connected ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains CONNECTED events when connections are established to remote peers. Collected from deep instrumentation within forked consensus layer clients. Each row includes remote peer agent info and geolocation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_connected_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains CONNECTED events when connections are established to remote peers. Collected from deep instrumentation within forked consensus layer clients. Each row includes remote peer agent info and geolocation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_disconnected -ALTER TABLE default.libp2p_disconnected ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains DISCONNECTED events when connections to remote peers are closed. Collected from deep instrumentation within forked consensus layer clients. Each row includes remote peer agent info and geolocation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_disconnected_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains DISCONNECTED events when connections to remote peers are closed. Collected from deep instrumentation within forked consensus layer clients. Each row includes remote peer agent info and geolocation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_handle_status -ALTER TABLE default.libp2p_handle_status ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains status protocol handling events (req/resp). Collected from deep instrumentation within forked consensus layer clients. Each row represents a status exchange with a peer including their head and finalized info. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_handle_status_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains status protocol handling events (req/resp). Collected from deep instrumentation within forked consensus layer clients. Each row represents a status exchange with a peer including their head and finalized info. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_handle_metadata -ALTER TABLE default.libp2p_handle_metadata ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains metadata protocol handling events (req/resp). Collected from deep instrumentation within forked consensus layer clients. Each row represents a metadata exchange with a peer including their attnets and syncnets. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_handle_metadata_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains metadata protocol handling events (req/resp). Collected from deep instrumentation within forked consensus layer clients. Each row represents a metadata exchange with a peer including their attnets and syncnets. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_synthetic_heartbeat -ALTER TABLE default.libp2p_synthetic_heartbeat ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains periodic heartbeat snapshots of libp2p peer state. Collected from deep instrumentation within forked consensus layer clients. Each row contains mesh/peer counts and topic subscriptions at that moment. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_synthetic_heartbeat_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains periodic heartbeat snapshots of libp2p peer state. Collected from deep instrumentation within forked consensus layer clients. Each row contains mesh/peer counts and topic subscriptions at that moment. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- Batch 5c: libp2p RPC table comments --- Tables populated from deep instrumentation within consensus layer clients (forked Prysm/Lighthouse maintained by ethPandaOps) - --- libp2p_recv_rpc -ALTER TABLE default.libp2p_recv_rpc ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC messages received from peers. Collected from deep instrumentation within forked consensus layer clients. Control messages are split into separate tables referencing this via rpc_meta_unique_key. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_recv_rpc_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC messages received from peers. Collected from deep instrumentation within forked consensus layer clients. Control messages are split into separate tables referencing this via rpc_meta_unique_key. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_send_rpc -ALTER TABLE default.libp2p_send_rpc ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC messages sent to peers. Collected from deep instrumentation within forked consensus layer clients. Control messages are split into separate tables referencing this via rpc_meta_unique_key. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_send_rpc_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC messages sent to peers. Collected from deep instrumentation within forked consensus layer clients. Control messages are split into separate tables referencing this via rpc_meta_unique_key. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_drop_rpc -ALTER TABLE default.libp2p_drop_rpc ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC messages dropped (not processed) by the peer. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_drop_rpc_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC messages dropped (not processed) by the peer. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_rpc_meta_message -ALTER TABLE default.libp2p_rpc_meta_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC message metadata from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents a message within an RPC with topic and message ID. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_rpc_meta_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC message metadata from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents a message within an RPC with topic and message ID. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_rpc_meta_subscription -ALTER TABLE default.libp2p_rpc_meta_subscription ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC subscription changes from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents a subscribe/unsubscribe action for a topic. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_rpc_meta_subscription_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains RPC subscription changes from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Each row represents a subscribe/unsubscribe action for a topic. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_rpc_meta_control_ihave -ALTER TABLE default.libp2p_rpc_meta_control_ihave ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains IHAVE control messages from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Peers advertise message IDs they have available. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_rpc_meta_control_ihave_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains IHAVE control messages from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Peers advertise message IDs they have available. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_rpc_meta_control_iwant -ALTER TABLE default.libp2p_rpc_meta_control_iwant ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains IWANT control messages from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Peers request specific message IDs. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_rpc_meta_control_iwant_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains IWANT control messages from gossipsub. Collected from deep instrumentation within forked consensus layer clients. Peers request specific message IDs. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_rpc_meta_control_graft -ALTER TABLE default.libp2p_rpc_meta_control_graft ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains GRAFT control messages from gossipsub RPC. Collected from deep instrumentation within forked consensus layer clients. Peers request to join the mesh for a topic. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_rpc_meta_control_graft_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains GRAFT control messages from gossipsub RPC. Collected from deep instrumentation within forked consensus layer clients. Peers request to join the mesh for a topic. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_rpc_meta_control_prune -ALTER TABLE default.libp2p_rpc_meta_control_prune ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains PRUNE control messages from gossipsub RPC. Collected from deep instrumentation within forked consensus layer clients. Peers are removed from the mesh for a topic. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_rpc_meta_control_prune_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains PRUNE control messages from gossipsub RPC. Collected from deep instrumentation within forked consensus layer clients. Peers are removed from the mesh for a topic. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_rpc_meta_control_idontwant -ALTER TABLE default.libp2p_rpc_meta_control_idontwant ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains IDONTWANT control messages from gossipsub RPC. Collected from deep instrumentation within forked consensus layer clients. Peers indicate they do not want certain messages. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_rpc_meta_control_idontwant_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains IDONTWANT control messages from gossipsub RPC. Collected from deep instrumentation within forked consensus layer clients. Peers indicate they do not want certain messages. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- Batch 5d: libp2p topic/message event table comments --- Tables populated from deep instrumentation within consensus layer clients (forked Prysm/Lighthouse maintained by ethPandaOps) - --- libp2p_join -ALTER TABLE default.libp2p_join ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains JOIN events when the local node joins a gossipsub topic. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_join_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains JOIN events when the local node joins a gossipsub topic. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_leave -ALTER TABLE default.libp2p_leave ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains LEAVE events when the local node leaves a gossipsub topic. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_leave_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains LEAVE events when the local node leaves a gossipsub topic. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_graft -ALTER TABLE default.libp2p_graft ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains GRAFT events when a peer joins the mesh for a topic. Collected from deep instrumentation within forked consensus layer clients. Tracks mesh membership changes. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_graft_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains GRAFT events when a peer joins the mesh for a topic. Collected from deep instrumentation within forked consensus layer clients. Tracks mesh membership changes. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_prune -ALTER TABLE default.libp2p_prune ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains PRUNE events when a peer is removed from the mesh for a topic. Collected from deep instrumentation within forked consensus layer clients. Tracks mesh membership changes. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_prune_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains PRUNE events when a peer is removed from the mesh for a topic. Collected from deep instrumentation within forked consensus layer clients. Tracks mesh membership changes. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_deliver_message -ALTER TABLE default.libp2p_deliver_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains DELIVER_MESSAGE events when messages are delivered to local subscribers. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_deliver_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains DELIVER_MESSAGE events when messages are delivered to local subscribers. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_publish_message -ALTER TABLE default.libp2p_publish_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains PUBLISH_MESSAGE events when the local node publishes messages to gossipsub. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_publish_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains PUBLISH_MESSAGE events when the local node publishes messages to gossipsub. Collected from deep instrumentation within forked consensus layer clients. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_duplicate_message -ALTER TABLE default.libp2p_duplicate_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains DUPLICATE_MESSAGE events when a message is received that was already seen. Collected from deep instrumentation within forked consensus layer clients. Useful for analyzing message propagation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_duplicate_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains DUPLICATE_MESSAGE events when a message is received that was already seen. Collected from deep instrumentation within forked consensus layer clients. Useful for analyzing message propagation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- libp2p_reject_message -ALTER TABLE default.libp2p_reject_message ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains REJECT_MESSAGE events when messages fail validation and are rejected. Collected from deep instrumentation within forked consensus layer clients. Includes rejection reason. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.libp2p_reject_message_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains REJECT_MESSAGE events when messages fail validation and are rejected. Collected from deep instrumentation within forked consensus layer clients. Includes rejection reason. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- Batch 6: mempool_*, mev_relay_*, node_record_* table comments - --- mempool_transaction -ALTER TABLE default.mempool_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains pending transactions observed in the mempool. Each row represents a transaction first seen at a specific time with its gas parameters. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.mempool_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains pending transactions observed in the mempool. Each row represents a transaction first seen at a specific time with its gas parameters. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- mempool_dumpster_transaction -ALTER TABLE default.mempool_dumpster_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions imported from the external Mempool Dumpster dataset. Historical mempool data following the parquet schema with additions. Partition: monthly by `event_date_time`.'; - -ALTER TABLE default.mempool_dumpster_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions imported from the external Mempool Dumpster dataset. Historical mempool data following the parquet schema with additions. Partition: monthly by `event_date_time`.'; - --- block_native_mempool_transaction -ALTER TABLE default.block_native_mempool_transaction ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions imported from the external Blocknative mempool dataset. Partition: monthly by `event_date_time`.'; - -ALTER TABLE default.block_native_mempool_transaction_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains transactions imported from the external Blocknative mempool dataset. Partition: monthly by `event_date_time`.'; - --- mev_relay_bid_trace -ALTER TABLE default.mev_relay_bid_trace ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains block bids collected by polling MEV relay data APIs. Each row represents a bid from a builder to a relay with value and block details. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.mev_relay_bid_trace_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains block bids collected by polling MEV relay data APIs. Each row represents a bid from a builder to a relay with value and block details. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- mev_relay_proposer_payload_delivered -ALTER TABLE default.mev_relay_proposer_payload_delivered ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains delivered payloads collected by polling MEV relay data APIs. Each row represents a payload that was delivered to a proposer. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.mev_relay_proposer_payload_delivered_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains delivered payloads collected by polling MEV relay data APIs. Each row represents a payload that was delivered to a proposer. Partition: monthly by `slot_start_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- mev_relay_validator_registration -ALTER TABLE default.mev_relay_validator_registration ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains validator registrations collected by polling MEV relay data APIs. Each row represents a validator registering their fee recipient and gas limit preferences. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.mev_relay_validator_registration_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains validator registrations collected by polling MEV relay data APIs. Each row represents a validator registering their fee recipient and gas limit preferences. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- node_record_execution -ALTER TABLE default.node_record_execution ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution layer node records discovered via discv5 network crawling. Each row represents a discovered node with its ENR, client info, and geolocation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.node_record_execution_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains execution layer node records discovered via discv5 network crawling. Each row represents a discovered node with its ENR, client info, and geolocation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- node_record_consensus -ALTER TABLE default.node_record_consensus ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains consensus layer node records discovered via discv5 network crawling. Each row represents a discovered node with its ENR, client info, and geolocation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - -ALTER TABLE default.node_record_consensus_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains consensus layer node records discovered via discv5 network crawling. Each row represents a discovered node with its ENR, client info, and geolocation. Partition: monthly by `event_date_time`.', -COMMENT COLUMN meta_client_name 'Name of the client that collected the data. The table contains data from multiple clients'; - --- Batch 7: Remaining table comments - --- blob_submitter -ALTER TABLE default.blob_submitter ON CLUSTER '{cluster}' -MODIFY COMMENT 'Lookup table mapping blob submitter addresses to names. Typically used to identify L2 sequencers and rollups submitting blobs to Ethereum. Partition: none (reference table).'; - -ALTER TABLE default.blob_submitter_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Lookup table mapping blob submitter addresses to names. Typically used to identify L2 sequencers and rollups submitting blobs to Ethereum. Partition: none (reference table).'; - --- ethseer_validator_entity -ALTER TABLE default.ethseer_validator_entity ON CLUSTER '{cluster}' -MODIFY COMMENT 'Lookup table mapping validators to entities, imported from Ethseer. Used to label validators by their staking provider or operator. Partition: none (reference table).'; - -ALTER TABLE default.ethseer_validator_entity_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Lookup table mapping validators to entities, imported from Ethseer. Used to label validators by their staking provider or operator. Partition: none (reference table).'; - diff --git a/deploy/migrations/clickhouse/090_execution_engine_events.down.sql b/deploy/migrations/clickhouse/090_execution_engine_events.down.sql deleted file mode 100644 index 6d317e584..000000000 --- a/deploy/migrations/clickhouse/090_execution_engine_events.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE IF EXISTS execution_engine_new_payload ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS execution_engine_new_payload_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS execution_engine_get_blobs ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS execution_engine_get_blobs_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/090_execution_engine_events.up.sql b/deploy/migrations/clickhouse/090_execution_engine_events.up.sql deleted file mode 100644 index 1387601cf..000000000 --- a/deploy/migrations/clickhouse/090_execution_engine_events.up.sql +++ /dev/null @@ -1,134 +0,0 @@ -CREATE TABLE execution_engine_new_payload_local ON CLUSTER '{cluster}' ( - -- Timestamps - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' Codec(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'When the event was received' Codec(DoubleDelta, ZSTD(1)), - requested_date_time DateTime64(3) COMMENT 'Timestamp when the engine_newPayload call was received' Codec(DoubleDelta, ZSTD(1)), - - -- Timing - duration_ms UInt32 COMMENT 'How long the engine_newPayload call took in milliseconds' Codec(ZSTD(1)), - - -- Source - source LowCardinality(String) COMMENT 'Source of the event (SNOOPER, EXECUTION_CLIENT)', - - -- Execution payload details - block_number UInt64 COMMENT 'Execution block number' Codec(DoubleDelta, ZSTD(1)), - block_hash FixedString(66) COMMENT 'Execution block hash (hex encoded with 0x prefix)' Codec(ZSTD(1)), - parent_hash FixedString(66) COMMENT 'Parent execution block hash (hex encoded with 0x prefix)' Codec(ZSTD(1)), - gas_used UInt64 COMMENT 'Total gas used by all transactions in the block' Codec(ZSTD(1)), - gas_limit UInt64 COMMENT 'Gas limit of the block' Codec(ZSTD(1)), - tx_count UInt32 COMMENT 'Number of transactions in the block' Codec(ZSTD(1)), - blob_count UInt32 COMMENT 'Number of blobs in the block' Codec(ZSTD(1)), - - -- Response from EL - status LowCardinality(String) COMMENT 'Payload status returned (VALID, INVALID, SYNCING, ACCEPTED, INVALID_BLOCK_HASH)', - latest_valid_hash Nullable(FixedString(66)) COMMENT 'Latest valid hash when status is INVALID (hex encoded with 0x prefix)' Codec(ZSTD(1)), - validation_error Nullable(String) COMMENT 'Error message when validation fails' Codec(ZSTD(1)), - - -- Meta - method_version LowCardinality(String) COMMENT 'Version of the engine_newPayload method (e.g., V3, V4)', - - -- Execution client metadata - meta_execution_implementation LowCardinality(String) COMMENT 'Implementation of the execution client (e.g., go-ethereum, reth, nethermind)', - meta_execution_version LowCardinality(String) COMMENT 'Version of the execution client', - meta_execution_version_major LowCardinality(String) COMMENT 'Major version number of the execution client', - meta_execution_version_minor LowCardinality(String) COMMENT 'Minor version number of the execution client', - meta_execution_version_patch LowCardinality(String) COMMENT 'Patch version number of the execution client', - - -- Standard metadata fields - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' Codec(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' Codec(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY intDiv(block_number, 5000000) -ORDER BY (block_number, meta_network_name, meta_client_name, block_hash, event_date_time) COMMENT 'Contains timing and instrumentation data for engine_newPayload calls from the execution layer perspective.'; - -CREATE TABLE execution_engine_new_payload ON CLUSTER '{cluster}' AS execution_engine_new_payload_local -ENGINE = Distributed( - '{cluster}', - default, - execution_engine_new_payload_local, - cityHash64( - block_number, - meta_network_name, - meta_client_name, - block_hash, - event_date_time - ) -); - -CREATE TABLE execution_engine_get_blobs_local ON CLUSTER '{cluster}' ( - -- Timestamps - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' Codec(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'When the event was received' Codec(DoubleDelta, ZSTD(1)), - requested_date_time DateTime64(3) COMMENT 'Timestamp when the engine_getBlobs call was received' Codec(DoubleDelta, ZSTD(1)), - - -- Timing - duration_ms UInt32 COMMENT 'How long the engine_getBlobs call took in milliseconds' Codec(ZSTD(1)), - - -- Source - source LowCardinality(String) COMMENT 'Source of the event (SNOOPER, EXECUTION_CLIENT)', - - -- Request details - requested_count UInt32 COMMENT 'Number of versioned hashes requested' Codec(ZSTD(1)), - versioned_hashes Array(FixedString(66)) COMMENT 'List of versioned hashes requested (hex encoded)' Codec(ZSTD(1)), - - -- Response from EL - returned_count UInt32 COMMENT 'Number of non-null blobs returned' Codec(ZSTD(1)), - status LowCardinality(String) COMMENT 'Result status (SUCCESS, PARTIAL, EMPTY, UNSUPPORTED, ERROR)', - error_message Nullable(String) COMMENT 'Error details if status is ERROR or UNSUPPORTED' Codec(ZSTD(1)), - - -- Meta - method_version LowCardinality(String) COMMENT 'Version of the engine_getBlobs method (e.g., V1, V2)', - - -- Execution client metadata - meta_execution_implementation LowCardinality(String) COMMENT 'Implementation of the execution client (e.g., go-ethereum, reth, nethermind)', - meta_execution_version LowCardinality(String) COMMENT 'Version of the execution client', - meta_execution_version_major LowCardinality(String) COMMENT 'Major version number of the execution client', - meta_execution_version_minor LowCardinality(String) COMMENT 'Minor version number of the execution client', - meta_execution_version_patch LowCardinality(String) COMMENT 'Patch version number of the execution client', - - -- Standard metadata fields - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' Codec(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' Codec(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}', updated_date_time) -PARTITION BY toStartOfMonth(event_date_time) -ORDER BY (event_date_time, meta_network_name, meta_client_name) COMMENT 'Contains timing and instrumentation data for engine_getBlobs calls from the execution layer perspective.'; - -CREATE TABLE execution_engine_get_blobs ON CLUSTER '{cluster}' AS execution_engine_get_blobs_local -ENGINE = Distributed( - '{cluster}', - default, - execution_engine_get_blobs_local, - cityHash64( - event_date_time, - meta_network_name, - meta_client_name - ) -); diff --git a/deploy/migrations/clickhouse/091_canonical_execution_block_gas_limit.down.sql b/deploy/migrations/clickhouse/091_canonical_execution_block_gas_limit.down.sql deleted file mode 100644 index dc578e961..000000000 --- a/deploy/migrations/clickhouse/091_canonical_execution_block_gas_limit.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE default.canonical_execution_block ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS `gas_limit`; - -ALTER TABLE default.canonical_execution_block_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS `gas_limit`; diff --git a/deploy/migrations/clickhouse/091_canonical_execution_block_gas_limit.up.sql b/deploy/migrations/clickhouse/091_canonical_execution_block_gas_limit.up.sql deleted file mode 100644 index a01e0146a..000000000 --- a/deploy/migrations/clickhouse/091_canonical_execution_block_gas_limit.up.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE default.canonical_execution_block_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS `gas_limit` UInt64 COMMENT 'The block gas limit' CODEC(DoubleDelta, ZSTD(1)) AFTER `gas_used`; - -ALTER TABLE default.canonical_execution_block ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS `gas_limit` UInt64 COMMENT 'The block gas limit' CODEC(DoubleDelta, ZSTD(1)) AFTER `gas_used`; diff --git a/deploy/migrations/clickhouse/092_engine_get_blobs_returned_indexes.down.sql b/deploy/migrations/clickhouse/092_engine_get_blobs_returned_indexes.down.sql deleted file mode 100644 index 78cdfa605..000000000 --- a/deploy/migrations/clickhouse/092_engine_get_blobs_returned_indexes.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE execution_engine_get_blobs ON CLUSTER '{cluster}' -DROP COLUMN IF EXISTS returned_blob_indexes; - -ALTER TABLE execution_engine_get_blobs_local ON CLUSTER '{cluster}' -DROP COLUMN IF EXISTS returned_blob_indexes; diff --git a/deploy/migrations/clickhouse/092_engine_get_blobs_returned_indexes.up.sql b/deploy/migrations/clickhouse/092_engine_get_blobs_returned_indexes.up.sql deleted file mode 100644 index d3dc112cb..000000000 --- a/deploy/migrations/clickhouse/092_engine_get_blobs_returned_indexes.up.sql +++ /dev/null @@ -1,9 +0,0 @@ -ALTER TABLE execution_engine_get_blobs_local ON CLUSTER '{cluster}' -ADD COLUMN IF NOT EXISTS returned_blob_indexes Array(UInt8) -COMMENT 'Indexes (0-based) of the requested versioned_hashes that were successfully returned' -AFTER returned_count; - -ALTER TABLE execution_engine_get_blobs ON CLUSTER '{cluster}' -ADD COLUMN IF NOT EXISTS returned_blob_indexes Array(UInt8) -COMMENT 'Indexes (0-based) of the requested versioned_hashes that were successfully returned' -AFTER returned_count; diff --git a/deploy/migrations/clickhouse/093_beacon_blob.down.sql b/deploy/migrations/clickhouse/093_beacon_blob.down.sql deleted file mode 100644 index 47b980e94..000000000 --- a/deploy/migrations/clickhouse/093_beacon_blob.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS beacon_api_eth_v1_beacon_blob ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS beacon_api_eth_v1_beacon_blob_local ON CLUSTER '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/093_beacon_blob.up.sql b/deploy/migrations/clickhouse/093_beacon_blob.up.sql deleted file mode 100644 index 2241920c4..000000000 --- a/deploy/migrations/clickhouse/093_beacon_blob.up.sql +++ /dev/null @@ -1,76 +0,0 @@ -CREATE TABLE beacon_api_eth_v1_beacon_blob_local on cluster '{cluster}' ( - event_date_time DateTime64(3) Codec(DoubleDelta, ZSTD(1)), - slot UInt32 Codec(DoubleDelta, ZSTD(1)), - slot_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - epoch UInt32 Codec(DoubleDelta, ZSTD(1)), - epoch_start_date_time DateTime Codec(DoubleDelta, ZSTD(1)), - block_root FixedString(66) Codec(ZSTD(1)), - block_parent_root FixedString(66) Codec(ZSTD(1)), - proposer_index UInt32 Codec(ZSTD(1)), - blob_index UInt64 Codec(ZSTD(1)), - kzg_commitment FixedString(98) Codec(ZSTD(1)), - versioned_hash FixedString(66) Codec(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_client_id String CODEC(ZSTD(1)), - meta_client_version LowCardinality(String), - meta_client_implementation LowCardinality(String), - meta_client_os LowCardinality(String), - meta_client_ip Nullable(IPv6) CODEC(ZSTD(1)), - meta_client_geo_city LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) CODEC(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) CODEC(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) CODEC(ZSTD(1)), - meta_network_id Int32 CODEC(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String), - meta_consensus_version LowCardinality(String), - meta_consensus_version_major LowCardinality(String), - meta_consensus_version_minor LowCardinality(String), - meta_consensus_version_patch LowCardinality(String), - meta_consensus_implementation LowCardinality(String), - meta_labels Map(String, String) CODEC(ZSTD(1)) -) Engine = ReplicatedMergeTree('/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', '{replica}') -PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY (slot_start_date_time, meta_network_name, meta_client_name, block_root, blob_index); - -ALTER TABLE default.beacon_api_eth_v1_beacon_blob_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Contains beacon API blob metadata derived from block blob_kzg_commitments from each sentry client attached to a beacon node.', -COMMENT COLUMN event_date_time 'When the sentry received the event from a beacon node', -COMMENT COLUMN slot 'Slot number in the beacon block', -COMMENT COLUMN slot_start_date_time 'The wall clock time when the slot started', -COMMENT COLUMN epoch 'The epoch number', -COMMENT COLUMN epoch_start_date_time 'The wall clock time when the epoch started', -COMMENT COLUMN block_root 'The beacon block root hash', -COMMENT COLUMN block_parent_root 'The beacon block parent root hash', -COMMENT COLUMN proposer_index 'The validator index of the block proposer', -COMMENT COLUMN blob_index 'The index of the blob within the block', -COMMENT COLUMN kzg_commitment 'The KZG commitment of the blob', -COMMENT COLUMN versioned_hash 'The versioned hash derived from the KZG commitment (key for joining with execution_engine_get_blobs)', -COMMENT COLUMN meta_client_name 'Name of the client that generated the event', -COMMENT COLUMN meta_client_id 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.', -COMMENT COLUMN meta_client_version 'Version of the client that generated the event', -COMMENT COLUMN meta_client_implementation 'Implementation of the client that generated the event', -COMMENT COLUMN meta_client_os 'Operating system of the client that generated the event', -COMMENT COLUMN meta_client_ip 'IP address of the client that generated the event', -COMMENT COLUMN meta_client_geo_city 'City of the client that generated the event', -COMMENT COLUMN meta_client_geo_country 'Country of the client that generated the event', -COMMENT COLUMN meta_client_geo_country_code 'Country code of the client that generated the event', -COMMENT COLUMN meta_client_geo_continent_code 'Continent code of the client that generated the event', -COMMENT COLUMN meta_client_geo_longitude 'Longitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_latitude 'Latitude of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_number 'Autonomous system number of the client that generated the event', -COMMENT COLUMN meta_client_geo_autonomous_system_organization 'Autonomous system organization of the client that generated the event', -COMMENT COLUMN meta_network_id 'Ethereum network ID', -COMMENT COLUMN meta_network_name 'Ethereum network name', -COMMENT COLUMN meta_consensus_version 'Ethereum consensus client version that generated the event', -COMMENT COLUMN meta_consensus_version_major 'Ethereum consensus client major version that generated the event', -COMMENT COLUMN meta_consensus_version_minor 'Ethereum consensus client minor version that generated the event', -COMMENT COLUMN meta_consensus_version_patch 'Ethereum consensus client patch version that generated the event', -COMMENT COLUMN meta_consensus_implementation 'Ethereum consensus client implementation that generated the event', -COMMENT COLUMN meta_labels 'Labels associated with the event'; - -CREATE TABLE beacon_api_eth_v1_beacon_blob on cluster '{cluster}' AS beacon_api_eth_v1_beacon_blob_local -ENGINE = Distributed('{cluster}', default, beacon_api_eth_v1_beacon_blob_local, rand()); diff --git a/deploy/migrations/clickhouse/094_structlog_call_frames.down.sql b/deploy/migrations/clickhouse/094_structlog_call_frames.down.sql deleted file mode 100644 index d60c4f0eb..000000000 --- a/deploy/migrations/clickhouse/094_structlog_call_frames.down.sql +++ /dev/null @@ -1,45 +0,0 @@ --- Drop canonical_execution_transaction_structlog_agg tables -DROP TABLE IF EXISTS default.canonical_execution_transaction_structlog_agg ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.canonical_execution_transaction_structlog_agg_local ON CLUSTER '{cluster}'; - -ALTER TABLE admin.execution_block_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS task_count; - -ALTER TABLE admin.execution_block ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS task_count; - -ALTER TABLE admin.execution_block_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS complete; - -ALTER TABLE admin.execution_block ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS complete; - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - ADD COLUMN meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - ADD COLUMN meta_network_id Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)); - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - ADD COLUMN program_counter UInt32 COMMENT 'The program counter' CODEC(Delta, ZSTD(1)); - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - ADD COLUMN program_counter UInt32 COMMENT 'The program counter' CODEC(Delta, ZSTD(1)); - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - DROP COLUMN call_frame_path; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - DROP COLUMN call_frame_path; - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - DROP COLUMN call_frame_id; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - DROP COLUMN call_frame_id; - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - DROP COLUMN gas_self; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - DROP COLUMN gas_self; diff --git a/deploy/migrations/clickhouse/094_structlog_call_frames.up.sql b/deploy/migrations/clickhouse/094_structlog_call_frames.up.sql deleted file mode 100644 index be990cad6..000000000 --- a/deploy/migrations/clickhouse/094_structlog_call_frames.up.sql +++ /dev/null @@ -1,91 +0,0 @@ -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - ADD COLUMN gas_self UInt64 DEFAULT 0 COMMENT 'Gas consumed by this opcode only, excludes child frame gas for CALL/CREATE opcodes. sum(gas_self) = total execution gas without double counting' CODEC(ZSTD(1)) AFTER gas_used; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - ADD COLUMN gas_self UInt64 DEFAULT 0 COMMENT 'Gas consumed by this opcode only, excludes child frame gas for CALL/CREATE opcodes. sum(gas_self) = total execution gas without double counting' CODEC(ZSTD(1)) AFTER gas_used; - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - ADD COLUMN call_frame_id UInt32 DEFAULT 0 COMMENT 'Sequential identifier for the call frame within the transaction' CODEC(DoubleDelta, ZSTD(1)) AFTER call_to_address; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - ADD COLUMN call_frame_id UInt32 DEFAULT 0 COMMENT 'Sequential identifier for the call frame within the transaction' CODEC(DoubleDelta, ZSTD(1)) AFTER call_to_address; - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - ADD COLUMN call_frame_path Array(UInt32) DEFAULT [0] COMMENT 'Path of frame IDs from root to current frame' CODEC(ZSTD(1)) AFTER call_frame_id; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - ADD COLUMN call_frame_path Array(UInt32) DEFAULT [0] COMMENT 'Path of frame IDs from root to current frame' CODEC(ZSTD(1)) AFTER call_frame_id; - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - DROP COLUMN program_counter; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - DROP COLUMN program_counter; - -ALTER TABLE canonical_execution_transaction_structlog_local ON CLUSTER '{cluster}' - DROP COLUMN meta_network_id; - -ALTER TABLE canonical_execution_transaction_structlog ON CLUSTER '{cluster}' - DROP COLUMN meta_network_id; - -ALTER TABLE admin.execution_block_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS complete UInt8; - -ALTER TABLE admin.execution_block ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS complete UInt8; - -ALTER TABLE admin.execution_block_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS task_count UInt32; - -ALTER TABLE admin.execution_block ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS task_count UInt32; - --- Create canonical_execution_transaction_structlog_agg table for aggregated structlog data --- This table stores per-frame summary rows (operation='') and per-opcode aggregated rows --- Produces ~50-200x fewer rows than raw structlog table -CREATE TABLE default.canonical_execution_transaction_structlog_agg_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `block_number` UInt64 COMMENT 'The block number' CODEC(DoubleDelta, ZSTD(1)), - `transaction_hash` FixedString(66) COMMENT 'The transaction hash' CODEC(ZSTD(1)), - `transaction_index` UInt32 COMMENT 'The transaction position in the block' CODEC(DoubleDelta, ZSTD(1)), - `call_frame_id` UInt32 COMMENT 'Sequential frame ID within the transaction (0=root)' CODEC(DoubleDelta, ZSTD(1)), - `parent_call_frame_id` Nullable(UInt32) COMMENT 'Parent frame ID (NULL for root frame)' CODEC(ZSTD(1)), - `call_frame_path` Array(UInt32) COMMENT 'Path of frame IDs from root to current frame' CODEC(ZSTD(1)), - `depth` UInt32 COMMENT 'Call nesting depth (0=root)' CODEC(DoubleDelta, ZSTD(1)), - `target_address` Nullable(String) COMMENT 'Contract address being called' CODEC(ZSTD(1)), - `call_type` LowCardinality(String) COMMENT 'Call type: CALL/DELEGATECALL/STATICCALL/CALLCODE/CREATE/CREATE2 (empty for root)', - `operation` LowCardinality(String) COMMENT 'Opcode name for per-opcode rows, empty string for frame summary rows', - `opcode_count` UInt64 COMMENT 'Number of opcodes (total for summary row, count for per-opcode row)' CODEC(ZSTD(1)), - `error_count` UInt64 COMMENT 'Number of errors' CODEC(ZSTD(1)), - `gas` UInt64 COMMENT 'Gas consumed: SUM(gas_self) for per-opcode, frame self gas for summary' CODEC(ZSTD(1)), - `gas_cumulative` UInt64 COMMENT 'Cumulative gas: SUM(gas_used) for per-opcode, frame total for summary' CODEC(ZSTD(1)), - `min_depth` UInt32 COMMENT 'Minimum depth where opcode appeared (per-opcode rows)' CODEC(DoubleDelta, ZSTD(1)), - `max_depth` UInt32 COMMENT 'Maximum depth where opcode appeared (per-opcode rows)' CODEC(DoubleDelta, ZSTD(1)), - `gas_refund` Nullable(UInt64) COMMENT 'Gas refund (root summary row only)' CODEC(ZSTD(1)), - `intrinsic_gas` Nullable(UInt64) COMMENT 'Intrinsic gas (root summary row only, computed)' CODEC(ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name' -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY intDiv(block_number, 201600) -- roughly 1 month of blocks -ORDER BY - ( - block_number, - meta_network_name, - transaction_hash, - call_frame_id, - operation - ) COMMENT 'Aggregated EVM execution data. Summary rows (operation="") contain frame metadata. Per-opcode rows contain aggregated gas/count per (frame, opcode).'; - -CREATE TABLE default.canonical_execution_transaction_structlog_agg ON CLUSTER '{cluster}' AS default.canonical_execution_transaction_structlog_agg_local ENGINE = Distributed( - '{cluster}', - default, - canonical_execution_transaction_structlog_agg_local, - cityHash64( - block_number, - meta_network_name, - transaction_hash, - call_frame_id - ) -); diff --git a/deploy/migrations/clickhouse/095_canonical_beacon_sync_committee.down.sql b/deploy/migrations/clickhouse/095_canonical_beacon_sync_committee.down.sql deleted file mode 100644 index ed4988b6f..000000000 --- a/deploy/migrations/clickhouse/095_canonical_beacon_sync_committee.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.canonical_beacon_sync_committee ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS default.canonical_beacon_sync_committee_local ON cluster '{cluster}' SYNC; diff --git a/deploy/migrations/clickhouse/095_canonical_beacon_sync_committee.up.sql b/deploy/migrations/clickhouse/095_canonical_beacon_sync_committee.up.sql deleted file mode 100644 index a14cb41ec..000000000 --- a/deploy/migrations/clickhouse/095_canonical_beacon_sync_committee.up.sql +++ /dev/null @@ -1,51 +0,0 @@ -CREATE TABLE default.canonical_beacon_sync_committee_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number for when the sync committee is active' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `sync_committee_period` UInt64 COMMENT 'The sync committee period number' CODEC(DoubleDelta, ZSTD(1)), - `validator_aggregates` Array(Array(UInt32)) COMMENT 'The validator indices grouped by subcommittee (64 groups of 8)' CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(epoch_start_date_time) -ORDER BY - ( - epoch_start_date_time, - meta_network_name, - sync_committee_period - ) COMMENT 'Contains canonical beacon API /eth/v1/beacon/states/{state_id}/sync_committees data.'; - -CREATE TABLE default.canonical_beacon_sync_committee ON CLUSTER '{cluster}' AS default.canonical_beacon_sync_committee_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_sync_committee_local, - cityHash64( - epoch_start_date_time, - meta_network_name, - sync_committee_period - ) -); diff --git a/deploy/migrations/clickhouse/096_canonical_beacon_block_sync_aggregate.down.sql b/deploy/migrations/clickhouse/096_canonical_beacon_block_sync_aggregate.down.sql deleted file mode 100644 index 1b8232bed..000000000 --- a/deploy/migrations/clickhouse/096_canonical_beacon_block_sync_aggregate.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS default.canonical_beacon_block_sync_aggregate ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS default.canonical_beacon_block_sync_aggregate_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/096_canonical_beacon_block_sync_aggregate.up.sql b/deploy/migrations/clickhouse/096_canonical_beacon_block_sync_aggregate.up.sql deleted file mode 100644 index c75e0360e..000000000 --- a/deploy/migrations/clickhouse/096_canonical_beacon_block_sync_aggregate.up.sql +++ /dev/null @@ -1,59 +0,0 @@ -CREATE TABLE default.canonical_beacon_block_sync_aggregate_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime COMMENT 'Timestamp when the record was last updated' CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) COMMENT 'When the sentry received the event from a beacon node' CODEC(DoubleDelta, ZSTD(1)), - `slot` UInt32 COMMENT 'Slot number in the beacon chain' CODEC(DoubleDelta, ZSTD(1)), - `slot_start_date_time` DateTime COMMENT 'The wall clock time when the slot started' CODEC(DoubleDelta, ZSTD(1)), - `epoch` UInt32 COMMENT 'The epoch number in the beacon chain' CODEC(DoubleDelta, ZSTD(1)), - `epoch_start_date_time` DateTime COMMENT 'The wall clock time when the epoch started' CODEC(DoubleDelta, ZSTD(1)), - `block_root` FixedString(66) COMMENT 'The root hash of the beacon block' CODEC(ZSTD(1)), - `block_version` LowCardinality(String) COMMENT 'The version of the beacon block', - `sync_committee_period` UInt64 COMMENT 'The sync committee period number (epoch / 256)' CODEC(DoubleDelta, ZSTD(1)), - `sync_committee_bits` String COMMENT 'Raw 512-bit bitvector as hex string' CODEC(ZSTD(1)), - `sync_committee_signature` String COMMENT 'Aggregated signature from participating validators' CODEC(ZSTD(1)), - `validators_participated` Array(UInt32) COMMENT 'Validator indices that participated (voted)' CODEC(ZSTD(1)), - `validators_missed` Array(UInt32) COMMENT 'Validator indices that missed (did not vote)' CODEC(ZSTD(1)), - `participation_count` UInt16 COMMENT 'Number of validators that participated (0-512)' CODEC(DoubleDelta, ZSTD(1)), - `meta_client_name` LowCardinality(String) COMMENT 'Name of the client that generated the event', - `meta_client_id` String COMMENT 'Unique Session ID of the client that generated the event. This changes every time the client is restarted.' CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String) COMMENT 'Version of the client that generated the event', - `meta_client_implementation` LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - `meta_client_os` LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - `meta_client_ip` Nullable(IPv6) COMMENT 'IP address of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) COMMENT 'City of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) COMMENT 'Country of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) COMMENT 'Country code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) COMMENT 'Continent code of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) COMMENT 'Longitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) COMMENT 'Latitude of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' CODEC(ZSTD(1)), - `meta_network_id` Int32 COMMENT 'Ethereum network ID' CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) COMMENT 'Ethereum network name', - `meta_consensus_version` LowCardinality(String) COMMENT 'Ethereum consensus client version that generated the event', - `meta_consensus_version_major` LowCardinality(String) COMMENT 'Ethereum consensus client major version that generated the event', - `meta_consensus_version_minor` LowCardinality(String) COMMENT 'Ethereum consensus client minor version that generated the event', - `meta_consensus_version_patch` LowCardinality(String) COMMENT 'Ethereum consensus client patch version that generated the event', - `meta_consensus_implementation` LowCardinality(String) COMMENT 'Ethereum consensus client implementation that generated the event', - `meta_labels` Map(String, String) COMMENT 'Labels associated with the event' CODEC(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/{database}/tables/{table}/{shard}', - '{replica}', - updated_date_time -) PARTITION BY toStartOfMonth(slot_start_date_time) -ORDER BY - ( - slot_start_date_time, - meta_network_name, - slot - ) COMMENT 'Contains canonical beacon block sync aggregate data with expanded validator participation.'; - -CREATE TABLE default.canonical_beacon_block_sync_aggregate ON CLUSTER '{cluster}' AS default.canonical_beacon_block_sync_aggregate_local ENGINE = Distributed( - '{cluster}', - default, - canonical_beacon_block_sync_aggregate_local, - cityHash64( - slot_start_date_time, - meta_network_name, - slot - ) -); diff --git a/deploy/migrations/clickhouse/097_observoor_initialize.down.sql b/deploy/migrations/clickhouse/097_observoor_initialize.down.sql deleted file mode 100644 index 1e3845966..000000000 --- a/deploy/migrations/clickhouse/097_observoor_initialize.down.sql +++ /dev/null @@ -1,89 +0,0 @@ -DROP DATABASE IF EXISTS observoor ON CLUSTER '{cluster}'; - --- Observoor ClickHouse Schema Teardown - --- Raw events -DROP TABLE IF EXISTS observoor.raw_events ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.raw_events_local ON CLUSTER '{cluster}'; - --- Sync state -DROP TABLE IF EXISTS observoor.sync_state ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.sync_state_local ON CLUSTER '{cluster}'; - --- Syscall latency tables -DROP TABLE IF EXISTS observoor.syscall_read ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_read_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_write ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_write_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_futex ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_futex_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_mmap ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_mmap_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_epoll_wait ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_epoll_wait_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_fsync ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_fsync_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_fdatasync ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_fdatasync_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_pwrite ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.syscall_pwrite_local ON CLUSTER '{cluster}'; - --- Scheduler latency tables -DROP TABLE IF EXISTS observoor.sched_on_cpu ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.sched_on_cpu_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.sched_off_cpu ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.sched_off_cpu_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.sched_runqueue ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.sched_runqueue_local ON CLUSTER '{cluster}'; - --- Memory latency tables -DROP TABLE IF EXISTS observoor.mem_reclaim ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.mem_reclaim_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.mem_compaction ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.mem_compaction_local ON CLUSTER '{cluster}'; - --- Disk latency table -DROP TABLE IF EXISTS observoor.disk_latency ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.disk_latency_local ON CLUSTER '{cluster}'; - --- Memory counter tables -DROP TABLE IF EXISTS observoor.page_fault_major ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.page_fault_major_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.page_fault_minor ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.page_fault_minor_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.swap_in ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.swap_in_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.swap_out ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.swap_out_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.oom_kill ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.oom_kill_local ON CLUSTER '{cluster}'; - --- Process counter tables -DROP TABLE IF EXISTS observoor.fd_open ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.fd_open_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.fd_close ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.fd_close_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.process_exit ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.process_exit_local ON CLUSTER '{cluster}'; - --- Network counter tables -DROP TABLE IF EXISTS observoor.tcp_state_change ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.tcp_state_change_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.net_io ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.net_io_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.tcp_retransmit ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.tcp_retransmit_local ON CLUSTER '{cluster}'; - --- Disk counter tables -DROP TABLE IF EXISTS observoor.disk_bytes ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.disk_bytes_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.block_merge ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.block_merge_local ON CLUSTER '{cluster}'; - --- Gauge tables -DROP TABLE IF EXISTS observoor.tcp_rtt ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.tcp_rtt_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.tcp_cwnd ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.tcp_cwnd_local ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.disk_queue_depth ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.disk_queue_depth_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/097_observoor_initialize.up.sql b/deploy/migrations/clickhouse/097_observoor_initialize.up.sql deleted file mode 100644 index c3e310717..000000000 --- a/deploy/migrations/clickhouse/097_observoor_initialize.up.sql +++ /dev/null @@ -1,1119 +0,0 @@ -CREATE DATABASE IF NOT EXISTS observoor ON CLUSTER '{cluster}'; - --------------------------------------------------------------------------------- --- RAW EVENTS --- One row per kernel event. Use for debugging and detailed analysis. --- Expected volume: ~20 GB/day at 36k events/sec --------------------------------------------------------------------------------- - -CREATE TABLE observoor.raw_events_local ON CLUSTER '{cluster}' ( - -- Timing - timestamp_ns UInt64 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot UInt64 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - - -- Sync state - cl_syncing Bool CODEC(ZSTD(1)), - el_optimistic Bool CODEC(ZSTD(1)), - el_offline Bool CODEC(ZSTD(1)), - - -- Process identification - pid UInt32 CODEC(ZSTD(1)), - tid UInt32 CODEC(ZSTD(1)), - event_type LowCardinality(String), - client_type LowCardinality(String), - - -- Common fields - latency_ns UInt64 CODEC(ZSTD(1)), - bytes Int64 CODEC(ZSTD(1)), - - -- Network fields - src_port UInt16 CODEC(ZSTD(1)), - dst_port UInt16 CODEC(ZSTD(1)), - - -- File descriptor fields - fd Int32 CODEC(ZSTD(1)), - filename String CODEC(ZSTD(1)), - - -- Scheduler fields - voluntary Bool CODEC(ZSTD(1)), - on_cpu_ns UInt64 CODEC(ZSTD(1)), - runqueue_ns UInt64 CODEC(ZSTD(1)), - off_cpu_ns UInt64 CODEC(ZSTD(1)), - - -- Memory fields - major Bool CODEC(ZSTD(1)), - address UInt64 CODEC(ZSTD(1)), - pages UInt64 CODEC(ZSTD(1)), - - -- Disk I/O fields - rw UInt8 CODEC(ZSTD(1)), - queue_depth UInt32 CODEC(ZSTD(1)), - device_id UInt32 CODEC(ZSTD(1)), - - -- TCP fields - tcp_state UInt8 CODEC(ZSTD(1)), - tcp_old_state UInt8 CODEC(ZSTD(1)), - tcp_srtt_us UInt32 CODEC(ZSTD(1)), - tcp_cwnd UInt32 CODEC(ZSTD(1)), - - -- Process lifecycle fields - exit_code UInt32 CODEC(ZSTD(1)), - target_pid UInt32 CODEC(ZSTD(1)), - - -- Metadata - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}' -) -PARTITION BY toStartOfMonth(wallclock_slot_start_date_time) -ORDER BY (meta_network_name, wallclock_slot_start_date_time, client_type, event_type, pid); - -ALTER TABLE observoor.raw_events_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Raw eBPF events captured from Ethereum client processes, one row per kernel event.', -COMMENT COLUMN timestamp_ns 'Wall clock time of the event in nanoseconds since Unix epoch', -COMMENT COLUMN wallclock_slot 'Ethereum slot number at the time of the event (from wall clock)', -COMMENT COLUMN wallclock_slot_start_date_time 'Wall clock time when the slot started', -COMMENT COLUMN cl_syncing 'Whether the consensus layer was syncing when this event was captured', -COMMENT COLUMN el_optimistic 'Whether the execution layer was in optimistic sync mode when this event was captured', -COMMENT COLUMN el_offline 'Whether the execution layer was unreachable when this event was captured', -COMMENT COLUMN pid 'Process ID of the traced Ethereum client', -COMMENT COLUMN tid 'Thread ID within the traced process', -COMMENT COLUMN event_type 'Type of eBPF event (syscall_read, disk_io, net_tx, etc.)', -COMMENT COLUMN client_type 'Ethereum client implementation (geth, reth, prysm, lighthouse, etc.)', -COMMENT COLUMN latency_ns 'Latency in nanoseconds for syscall and disk I/O events', -COMMENT COLUMN bytes 'Byte count for I/O events', -COMMENT COLUMN src_port 'Source port for network events', -COMMENT COLUMN dst_port 'Destination port for network events', -COMMENT COLUMN fd 'File descriptor number', -COMMENT COLUMN filename 'Filename for fd_open events', -COMMENT COLUMN voluntary 'Whether a context switch was voluntary', -COMMENT COLUMN on_cpu_ns 'Time spent on CPU in nanoseconds before a context switch', -COMMENT COLUMN runqueue_ns 'Time spent waiting in the run queue', -COMMENT COLUMN off_cpu_ns 'Time spent off CPU', -COMMENT COLUMN major 'Whether a page fault was a major fault', -COMMENT COLUMN address 'Faulting address for page fault events', -COMMENT COLUMN pages 'Number of pages for swap events', -COMMENT COLUMN rw 'Read (0) or write (1) for disk I/O', -COMMENT COLUMN queue_depth 'Block device queue depth at time of I/O', -COMMENT COLUMN device_id 'Block device ID (major:minor encoded)', -COMMENT COLUMN tcp_state 'New TCP state after state change', -COMMENT COLUMN tcp_old_state 'Previous TCP state before state change', -COMMENT COLUMN tcp_srtt_us 'Smoothed RTT in microseconds', -COMMENT COLUMN tcp_cwnd 'Congestion window size', -COMMENT COLUMN exit_code 'Process exit code', -COMMENT COLUMN target_pid 'Target PID for OOM kill events', -COMMENT COLUMN meta_client_name 'Name of the node running the observoor agent', -COMMENT COLUMN meta_network_name 'Ethereum network name (mainnet, holesky, etc.)'; - -CREATE TABLE observoor.raw_events ON CLUSTER '{cluster}' AS observoor.raw_events_local -ENGINE = Distributed('{cluster}', 'observoor', raw_events_local, rand()); - - --------------------------------------------------------------------------------- --- SYNC STATE --- Separate table for consensus/execution layer sync state. --- Polled periodically (e.g., every slot) to reduce per-row overhead. --------------------------------------------------------------------------------- - -CREATE TABLE observoor.sync_state_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - event_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - cl_syncing Bool CODEC(ZSTD(1)), - el_optimistic Bool CODEC(ZSTD(1)), - el_offline Bool CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(event_time) -ORDER BY (meta_network_name, event_time, meta_client_name); - -ALTER TABLE observoor.sync_state_local ON CLUSTER '{cluster}' -MODIFY COMMENT 'Sync state snapshots for consensus and execution layers.', -COMMENT COLUMN updated_date_time 'Version column for ReplacingMergeTree deduplication', -COMMENT COLUMN event_time 'Time when the sync state was sampled', -COMMENT COLUMN wallclock_slot 'Ethereum slot number at sampling time', -COMMENT COLUMN wallclock_slot_start_date_time 'Wall clock time when the slot started', -COMMENT COLUMN cl_syncing 'Whether the consensus layer is syncing', -COMMENT COLUMN el_optimistic 'Whether the execution layer is in optimistic sync mode', -COMMENT COLUMN el_offline 'Whether the execution layer is unreachable', -COMMENT COLUMN meta_client_name 'Name of the node running the observoor agent', -COMMENT COLUMN meta_network_name 'Ethereum network name (mainnet, holesky, etc.)'; - -CREATE TABLE observoor.sync_state ON CLUSTER '{cluster}' AS observoor.sync_state_local -ENGINE = Distributed('{cluster}', 'observoor', sync_state_local, cityHash64(event_time, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- AGGREGATED METRICS: ONE TABLE PER METRIC --- Time-windowed aggregations. No metric_name column - the table IS the metric. --- ReplicatedReplacingMergeTree for idempotent writes, ORDER BY as composite key. --------------------------------------------------------------------------------- - - --------------------------------------------------------------------------------- --- SYSCALL LATENCY TABLES (8 tables) --- Latency histograms for system call operations --------------------------------------------------------------------------------- - -CREATE TABLE observoor.syscall_read_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.syscall_read ON CLUSTER '{cluster}' AS observoor.syscall_read_local -ENGINE = Distributed('{cluster}', 'observoor', syscall_read_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.syscall_write_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.syscall_write ON CLUSTER '{cluster}' AS observoor.syscall_write_local -ENGINE = Distributed('{cluster}', 'observoor', syscall_write_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.syscall_futex_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.syscall_futex ON CLUSTER '{cluster}' AS observoor.syscall_futex_local -ENGINE = Distributed('{cluster}', 'observoor', syscall_futex_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.syscall_mmap_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.syscall_mmap ON CLUSTER '{cluster}' AS observoor.syscall_mmap_local -ENGINE = Distributed('{cluster}', 'observoor', syscall_mmap_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.syscall_epoll_wait_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.syscall_epoll_wait ON CLUSTER '{cluster}' AS observoor.syscall_epoll_wait_local -ENGINE = Distributed('{cluster}', 'observoor', syscall_epoll_wait_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.syscall_fsync_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.syscall_fsync ON CLUSTER '{cluster}' AS observoor.syscall_fsync_local -ENGINE = Distributed('{cluster}', 'observoor', syscall_fsync_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.syscall_fdatasync_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.syscall_fdatasync ON CLUSTER '{cluster}' AS observoor.syscall_fdatasync_local -ENGINE = Distributed('{cluster}', 'observoor', syscall_fdatasync_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.syscall_pwrite_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.syscall_pwrite ON CLUSTER '{cluster}' AS observoor.syscall_pwrite_local -ENGINE = Distributed('{cluster}', 'observoor', syscall_pwrite_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- SCHEDULER LATENCY TABLES (3 tables) --- CPU scheduling latency histograms --------------------------------------------------------------------------------- - -CREATE TABLE observoor.sched_on_cpu_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.sched_on_cpu ON CLUSTER '{cluster}' AS observoor.sched_on_cpu_local -ENGINE = Distributed('{cluster}', 'observoor', sched_on_cpu_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.sched_off_cpu_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.sched_off_cpu ON CLUSTER '{cluster}' AS observoor.sched_off_cpu_local -ENGINE = Distributed('{cluster}', 'observoor', sched_off_cpu_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.sched_runqueue_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.sched_runqueue ON CLUSTER '{cluster}' AS observoor.sched_runqueue_local -ENGINE = Distributed('{cluster}', 'observoor', sched_runqueue_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- MEMORY LATENCY TABLES (2 tables) --- Memory reclaim and compaction latency histograms --------------------------------------------------------------------------------- - -CREATE TABLE observoor.mem_reclaim_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.mem_reclaim ON CLUSTER '{cluster}' AS observoor.mem_reclaim_local -ENGINE = Distributed('{cluster}', 'observoor', mem_reclaim_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.mem_compaction_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.mem_compaction ON CLUSTER '{cluster}' AS observoor.mem_compaction_local -ENGINE = Distributed('{cluster}', 'observoor', mem_compaction_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- DISK LATENCY TABLE (1 table) --- Block I/O latency histogram with device and rw dimensions --------------------------------------------------------------------------------- - -CREATE TABLE observoor.disk_latency_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - device_id UInt32 CODEC(ZSTD(1)), - rw LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - histogram Tuple( - le_1us UInt32, - le_10us UInt32, - le_100us UInt32, - le_1ms UInt32, - le_10ms UInt32, - le_100ms UInt32, - le_1s UInt32, - le_10s UInt32, - le_100s UInt32, - inf UInt32 - ) CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, device_id, rw); - -CREATE TABLE observoor.disk_latency ON CLUSTER '{cluster}' AS observoor.disk_latency_local -ENGINE = Distributed('{cluster}', 'observoor', disk_latency_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- COUNTER TABLES - MEMORY (5 tables) --- Simple count/sum aggregations for memory events --------------------------------------------------------------------------------- - -CREATE TABLE observoor.page_fault_major_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.page_fault_major ON CLUSTER '{cluster}' AS observoor.page_fault_major_local -ENGINE = Distributed('{cluster}', 'observoor', page_fault_major_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.page_fault_minor_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.page_fault_minor ON CLUSTER '{cluster}' AS observoor.page_fault_minor_local -ENGINE = Distributed('{cluster}', 'observoor', page_fault_minor_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.swap_in_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.swap_in ON CLUSTER '{cluster}' AS observoor.swap_in_local -ENGINE = Distributed('{cluster}', 'observoor', swap_in_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.swap_out_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.swap_out ON CLUSTER '{cluster}' AS observoor.swap_out_local -ENGINE = Distributed('{cluster}', 'observoor', swap_out_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.oom_kill_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.oom_kill ON CLUSTER '{cluster}' AS observoor.oom_kill_local -ENGINE = Distributed('{cluster}', 'observoor', oom_kill_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- COUNTER TABLES - PROCESS (3 tables) --- File descriptor and process exit counters --------------------------------------------------------------------------------- - -CREATE TABLE observoor.fd_open_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.fd_open ON CLUSTER '{cluster}' AS observoor.fd_open_local -ENGINE = Distributed('{cluster}', 'observoor', fd_open_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.fd_close_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.fd_close ON CLUSTER '{cluster}' AS observoor.fd_close_local -ENGINE = Distributed('{cluster}', 'observoor', fd_close_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.process_exit_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.process_exit ON CLUSTER '{cluster}' AS observoor.process_exit_local -ENGINE = Distributed('{cluster}', 'observoor', process_exit_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- COUNTER TABLES - NETWORK (3 tables) --- TCP state changes, network I/O, and retransmits --------------------------------------------------------------------------------- - -CREATE TABLE observoor.tcp_state_change_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.tcp_state_change ON CLUSTER '{cluster}' AS observoor.tcp_state_change_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_state_change_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.net_io_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - local_port UInt16 CODEC(ZSTD(1)), - direction LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, local_port, direction); - -CREATE TABLE observoor.net_io ON CLUSTER '{cluster}' AS observoor.net_io_local -ENGINE = Distributed('{cluster}', 'observoor', net_io_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.tcp_retransmit_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - local_port UInt16 CODEC(ZSTD(1)), - direction LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, local_port, direction); - -CREATE TABLE observoor.tcp_retransmit ON CLUSTER '{cluster}' AS observoor.tcp_retransmit_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_retransmit_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- COUNTER TABLES - DISK (2 tables) --- Disk bytes throughput and block merge counters --------------------------------------------------------------------------------- - -CREATE TABLE observoor.disk_bytes_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - device_id UInt32 CODEC(ZSTD(1)), - rw LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, device_id, rw); - -CREATE TABLE observoor.disk_bytes ON CLUSTER '{cluster}' AS observoor.disk_bytes_local -ENGINE = Distributed('{cluster}', 'observoor', disk_bytes_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.block_merge_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - device_id UInt32 CODEC(ZSTD(1)), - rw LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, device_id, rw); - -CREATE TABLE observoor.block_merge ON CLUSTER '{cluster}' AS observoor.block_merge_local -ENGINE = Distributed('{cluster}', 'observoor', block_merge_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- GAUGE TABLES (3 tables) --- Sampled values with min/max/sum/count (no histogram) --------------------------------------------------------------------------------- - -CREATE TABLE observoor.tcp_rtt_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - local_port UInt16 CODEC(ZSTD(1)), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, local_port); - -CREATE TABLE observoor.tcp_rtt ON CLUSTER '{cluster}' AS observoor.tcp_rtt_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_rtt_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.tcp_cwnd_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - local_port UInt16 CODEC(ZSTD(1)), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, local_port); - -CREATE TABLE observoor.tcp_cwnd ON CLUSTER '{cluster}' AS observoor.tcp_cwnd_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_cwnd_local, cityHash64(window_start, meta_network_name, meta_client_name)); - -CREATE TABLE observoor.disk_queue_depth_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - device_id UInt32 CODEC(ZSTD(1)), - rw LowCardinality(String), - sum Int64 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Int64 CODEC(ZSTD(1)), - max Int64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, device_id, rw); - -CREATE TABLE observoor.disk_queue_depth ON CLUSTER '{cluster}' AS observoor.disk_queue_depth_local -ENGINE = Distributed('{cluster}', 'observoor', disk_queue_depth_local, cityHash64(window_start, meta_network_name, meta_client_name)); diff --git a/deploy/migrations/clickhouse/098_observoor_float32_sum_min_max.down.sql b/deploy/migrations/clickhouse/098_observoor_float32_sum_min_max.down.sql deleted file mode 100644 index 7d8ea18f3..000000000 --- a/deploy/migrations/clickhouse/098_observoor_float32_sum_min_max.down.sql +++ /dev/null @@ -1,293 +0,0 @@ --- Migration 003 rollback: Float32 → Int64 for sum/min/max columns - --------------------------------------------------------------------------------- --- LATENCY TABLES (14) — restore sum, min, max to Int64 --------------------------------------------------------------------------------- - --- syscall_read -ALTER TABLE observoor.syscall_read_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_read ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- syscall_write -ALTER TABLE observoor.syscall_write_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_write ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- syscall_futex -ALTER TABLE observoor.syscall_futex_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_futex ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- syscall_mmap -ALTER TABLE observoor.syscall_mmap_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_mmap ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- syscall_epoll_wait -ALTER TABLE observoor.syscall_epoll_wait_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_epoll_wait ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- syscall_fsync -ALTER TABLE observoor.syscall_fsync_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_fsync ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- syscall_fdatasync -ALTER TABLE observoor.syscall_fdatasync_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_fdatasync ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- syscall_pwrite -ALTER TABLE observoor.syscall_pwrite_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_pwrite ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- sched_on_cpu -ALTER TABLE observoor.sched_on_cpu_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.sched_on_cpu ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- sched_off_cpu -ALTER TABLE observoor.sched_off_cpu_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.sched_off_cpu ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- sched_runqueue -ALTER TABLE observoor.sched_runqueue_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.sched_runqueue ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- mem_reclaim -ALTER TABLE observoor.mem_reclaim_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.mem_reclaim ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- mem_compaction -ALTER TABLE observoor.mem_compaction_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.mem_compaction ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- disk_latency -ALTER TABLE observoor.disk_latency_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.disk_latency ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - - --------------------------------------------------------------------------------- --- COUNTER TABLES (13) — restore sum to Int64 --------------------------------------------------------------------------------- - --- page_fault_major -ALTER TABLE observoor.page_fault_major_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.page_fault_major ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- page_fault_minor -ALTER TABLE observoor.page_fault_minor_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.page_fault_minor ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- swap_in -ALTER TABLE observoor.swap_in_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.swap_in ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- swap_out -ALTER TABLE observoor.swap_out_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.swap_out ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- oom_kill -ALTER TABLE observoor.oom_kill_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.oom_kill ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- fd_open -ALTER TABLE observoor.fd_open_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.fd_open ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- fd_close -ALTER TABLE observoor.fd_close_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.fd_close ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- process_exit -ALTER TABLE observoor.process_exit_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.process_exit ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- tcp_state_change -ALTER TABLE observoor.tcp_state_change_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.tcp_state_change ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- net_io -ALTER TABLE observoor.net_io_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.net_io ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- tcp_retransmit -ALTER TABLE observoor.tcp_retransmit_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.tcp_retransmit ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- disk_bytes -ALTER TABLE observoor.disk_bytes_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.disk_bytes ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - --- block_merge -ALTER TABLE observoor.block_merge_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.block_merge ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64; - - --------------------------------------------------------------------------------- --- GAUGE TABLES (3) — restore sum, min, max to Int64 --------------------------------------------------------------------------------- - --- tcp_rtt -ALTER TABLE observoor.tcp_rtt_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.tcp_rtt ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- tcp_cwnd -ALTER TABLE observoor.tcp_cwnd_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.tcp_cwnd ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; - --- disk_queue_depth -ALTER TABLE observoor.disk_queue_depth_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Int64 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Int64 CODEC(ZSTD(1)); - -ALTER TABLE observoor.disk_queue_depth ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Int64, - MODIFY COLUMN `min` Int64, - MODIFY COLUMN `max` Int64; diff --git a/deploy/migrations/clickhouse/098_observoor_float32_sum_min_max.up.sql b/deploy/migrations/clickhouse/098_observoor_float32_sum_min_max.up.sql deleted file mode 100644 index b44d8d1e8..000000000 --- a/deploy/migrations/clickhouse/098_observoor_float32_sum_min_max.up.sql +++ /dev/null @@ -1,295 +0,0 @@ --- Migration 003: Int64 → Float32 for sum/min/max columns --- Reduces compressed storage ~48% with negligible precision loss for monitoring data. --- ALTER MODIFY COLUMN runs as a background mutation. No downtime required. - --------------------------------------------------------------------------------- --- LATENCY TABLES (14) — modify sum, min, max --------------------------------------------------------------------------------- - --- syscall_read -ALTER TABLE observoor.syscall_read_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_read ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- syscall_write -ALTER TABLE observoor.syscall_write_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_write ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- syscall_futex -ALTER TABLE observoor.syscall_futex_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_futex ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- syscall_mmap -ALTER TABLE observoor.syscall_mmap_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_mmap ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- syscall_epoll_wait -ALTER TABLE observoor.syscall_epoll_wait_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_epoll_wait ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- syscall_fsync -ALTER TABLE observoor.syscall_fsync_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_fsync ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- syscall_fdatasync -ALTER TABLE observoor.syscall_fdatasync_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_fdatasync ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- syscall_pwrite -ALTER TABLE observoor.syscall_pwrite_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.syscall_pwrite ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- sched_on_cpu -ALTER TABLE observoor.sched_on_cpu_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.sched_on_cpu ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- sched_off_cpu -ALTER TABLE observoor.sched_off_cpu_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.sched_off_cpu ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- sched_runqueue -ALTER TABLE observoor.sched_runqueue_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.sched_runqueue ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- mem_reclaim -ALTER TABLE observoor.mem_reclaim_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.mem_reclaim ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- mem_compaction -ALTER TABLE observoor.mem_compaction_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.mem_compaction ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- disk_latency -ALTER TABLE observoor.disk_latency_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.disk_latency ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - - --------------------------------------------------------------------------------- --- COUNTER TABLES (13) — modify sum only --------------------------------------------------------------------------------- - --- page_fault_major -ALTER TABLE observoor.page_fault_major_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.page_fault_major ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- page_fault_minor -ALTER TABLE observoor.page_fault_minor_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.page_fault_minor ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- swap_in -ALTER TABLE observoor.swap_in_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.swap_in ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- swap_out -ALTER TABLE observoor.swap_out_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.swap_out ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- oom_kill -ALTER TABLE observoor.oom_kill_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.oom_kill ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- fd_open -ALTER TABLE observoor.fd_open_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.fd_open ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- fd_close -ALTER TABLE observoor.fd_close_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.fd_close ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- process_exit -ALTER TABLE observoor.process_exit_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.process_exit ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- tcp_state_change -ALTER TABLE observoor.tcp_state_change_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.tcp_state_change ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- net_io -ALTER TABLE observoor.net_io_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.net_io ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- tcp_retransmit -ALTER TABLE observoor.tcp_retransmit_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.tcp_retransmit ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- disk_bytes -ALTER TABLE observoor.disk_bytes_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.disk_bytes ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - --- block_merge -ALTER TABLE observoor.block_merge_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.block_merge ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32; - - --------------------------------------------------------------------------------- --- GAUGE TABLES (3) — modify sum, min, max --------------------------------------------------------------------------------- - --- tcp_rtt -ALTER TABLE observoor.tcp_rtt_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.tcp_rtt ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- tcp_cwnd -ALTER TABLE observoor.tcp_cwnd_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.tcp_cwnd ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; - --- disk_queue_depth -ALTER TABLE observoor.disk_queue_depth_local ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `min` Float32 CODEC(ZSTD(1)), - MODIFY COLUMN `max` Float32 CODEC(ZSTD(1)); - -ALTER TABLE observoor.disk_queue_depth ON CLUSTER '{cluster}' - MODIFY COLUMN `sum` Float32, - MODIFY COLUMN `min` Float32, - MODIFY COLUMN `max` Float32; diff --git a/deploy/migrations/clickhouse/099_observoor_cpu_utilization.down.sql b/deploy/migrations/clickhouse/099_observoor_cpu_utilization.down.sql deleted file mode 100644 index c58d65353..000000000 --- a/deploy/migrations/clickhouse/099_observoor_cpu_utilization.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS observoor.cpu_utilization ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.cpu_utilization_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/099_observoor_cpu_utilization.up.sql b/deploy/migrations/clickhouse/099_observoor_cpu_utilization.up.sql deleted file mode 100644 index f3e977180..000000000 --- a/deploy/migrations/clickhouse/099_observoor_cpu_utilization.up.sql +++ /dev/null @@ -1,36 +0,0 @@ --- Migration 099: add observoor CPU utilization summary table. - -CREATE TABLE observoor.cpu_utilization_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - total_on_cpu_ns Float32 CODEC(ZSTD(1)), - event_count UInt32 CODEC(ZSTD(1)), - active_cores UInt16 CODEC(ZSTD(1)), - system_cores UInt16 CODEC(ZSTD(1)), - max_core_on_cpu_ns Float32 CODEC(ZSTD(1)), - max_core_id UInt32 CODEC(ZSTD(1)), - mean_core_pct Float32 CODEC(ZSTD(1)), - min_core_pct Float32 CODEC(ZSTD(1)), - max_core_pct Float32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.cpu_utilization ON CLUSTER '{cluster}' AS observoor.cpu_utilization_local -ENGINE = Distributed( - '{cluster}', - 'observoor', - cpu_utilization_local, - cityHash64(window_start, meta_network_name, meta_client_name) -); diff --git a/deploy/migrations/clickhouse/100_observoor_port_labels.down.sql b/deploy/migrations/clickhouse/100_observoor_port_labels.down.sql deleted file mode 100644 index 4edabe930..000000000 --- a/deploy/migrations/clickhouse/100_observoor_port_labels.down.sql +++ /dev/null @@ -1,132 +0,0 @@ --- Migration 005 rollback: Restore local_port UInt16 from port_label LowCardinality(String) --- Drops and recreates 4 tables (net_io, tcp_retransmit, tcp_rtt, tcp_cwnd) --- plus their distributed counterparts. Data is lost on rollback. - --------------------------------------------------------------------------------- --- COUNTER TABLES - NETWORK (net_io, tcp_retransmit) --- Restore local_port UInt16 --------------------------------------------------------------------------------- - --- net_io -DROP TABLE IF EXISTS net_io ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS net_io_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE net_io_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - local_port UInt16 CODEC(ZSTD(1)), - direction LowCardinality(String), - sum Float32 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, local_port, direction); - -CREATE TABLE net_io ON CLUSTER '{cluster}' AS net_io_local -ENGINE = Distributed('{cluster}', 'observoor', net_io_local, cityHash64(window_start, meta_network_name, meta_client_name)); - --- tcp_retransmit -DROP TABLE IF EXISTS tcp_retransmit ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tcp_retransmit_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE tcp_retransmit_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - local_port UInt16 CODEC(ZSTD(1)), - direction LowCardinality(String), - sum Float32 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, local_port, direction); - -CREATE TABLE tcp_retransmit ON CLUSTER '{cluster}' AS tcp_retransmit_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_retransmit_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- GAUGE TABLES - TCP (tcp_rtt, tcp_cwnd) --- Restore local_port UInt16 --------------------------------------------------------------------------------- - --- tcp_rtt -DROP TABLE IF EXISTS tcp_rtt ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tcp_rtt_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE tcp_rtt_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - local_port UInt16 CODEC(ZSTD(1)), - sum Float32 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Float32 CODEC(ZSTD(1)), - max Float32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, local_port); - -CREATE TABLE tcp_rtt ON CLUSTER '{cluster}' AS tcp_rtt_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_rtt_local, cityHash64(window_start, meta_network_name, meta_client_name)); - --- tcp_cwnd -DROP TABLE IF EXISTS tcp_cwnd ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS tcp_cwnd_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE tcp_cwnd_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - local_port UInt16 CODEC(ZSTD(1)), - sum Float32 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Float32 CODEC(ZSTD(1)), - max Float32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, local_port); - -CREATE TABLE tcp_cwnd ON CLUSTER '{cluster}' AS tcp_cwnd_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_cwnd_local, cityHash64(window_start, meta_network_name, meta_client_name)); diff --git a/deploy/migrations/clickhouse/100_observoor_port_labels.up.sql b/deploy/migrations/clickhouse/100_observoor_port_labels.up.sql deleted file mode 100644 index 01abe6271..000000000 --- a/deploy/migrations/clickhouse/100_observoor_port_labels.up.sql +++ /dev/null @@ -1,133 +0,0 @@ --- Migration 005: Replace local_port UInt16 with port_label LowCardinality(String) --- Drops and recreates 4 tables (net_io, tcp_retransmit, tcp_rtt, tcp_cwnd) --- plus their distributed counterparts. Historical data in these tables is lost. --- local_port is in ORDER BY so ALTER TABLE cannot change the column type. - --------------------------------------------------------------------------------- --- COUNTER TABLES - NETWORK (net_io, tcp_retransmit) --- Replace local_port UInt16 with port_label LowCardinality(String) --------------------------------------------------------------------------------- - --- net_io: drop distributed first, then local -DROP TABLE IF EXISTS observoor.net_io ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS observoor.net_io_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE observoor.net_io_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - port_label LowCardinality(String), - direction LowCardinality(String), - sum Float32 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, port_label, direction); - -CREATE TABLE observoor.net_io ON CLUSTER '{cluster}' AS observoor.net_io_local -ENGINE = Distributed('{cluster}', 'observoor', net_io_local, cityHash64(window_start, meta_network_name, meta_client_name)); - --- tcp_retransmit: drop distributed first, then local -DROP TABLE IF EXISTS observoor.tcp_retransmit ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS observoor.tcp_retransmit_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE observoor.tcp_retransmit_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - port_label LowCardinality(String), - direction LowCardinality(String), - sum Float32 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, port_label, direction); - -CREATE TABLE observoor.tcp_retransmit ON CLUSTER '{cluster}' AS observoor.tcp_retransmit_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_retransmit_local, cityHash64(window_start, meta_network_name, meta_client_name)); - - --------------------------------------------------------------------------------- --- GAUGE TABLES - TCP (tcp_rtt, tcp_cwnd) --- Replace local_port UInt16 with port_label LowCardinality(String) --------------------------------------------------------------------------------- - --- tcp_rtt: drop distributed first, then local -DROP TABLE IF EXISTS observoor.tcp_rtt ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS observoor.tcp_rtt_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE observoor.tcp_rtt_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - port_label LowCardinality(String), - sum Float32 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Float32 CODEC(ZSTD(1)), - max Float32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, port_label); - -CREATE TABLE observoor.tcp_rtt ON CLUSTER '{cluster}' AS observoor.tcp_rtt_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_rtt_local, cityHash64(window_start, meta_network_name, meta_client_name)); - --- tcp_cwnd: drop distributed first, then local -DROP TABLE IF EXISTS observoor.tcp_cwnd ON CLUSTER '{cluster}' SYNC; -DROP TABLE IF EXISTS observoor.tcp_cwnd_local ON CLUSTER '{cluster}' SYNC; - -CREATE TABLE observoor.tcp_cwnd_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - port_label LowCardinality(String), - sum Float32 CODEC(ZSTD(1)), - count UInt32 CODEC(ZSTD(1)), - min Float32 CODEC(ZSTD(1)), - max Float32 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type, port_label); - -CREATE TABLE observoor.tcp_cwnd ON CLUSTER '{cluster}' AS observoor.tcp_cwnd_local -ENGINE = Distributed('{cluster}', 'observoor', tcp_cwnd_local, cityHash64(window_start, meta_network_name, meta_client_name)); diff --git a/deploy/migrations/clickhouse/101_observoor_sampling_metadata.down.sql b/deploy/migrations/clickhouse/101_observoor_sampling_metadata.down.sql deleted file mode 100644 index c0ddd48ca..000000000 --- a/deploy/migrations/clickhouse/101_observoor_sampling_metadata.down.sql +++ /dev/null @@ -1,280 +0,0 @@ --- Migration 006 rollback: remove sampling metadata columns from aggregated metric tables. - --- syscall_read -ALTER TABLE observoor.syscall_read_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.syscall_read ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- syscall_write -ALTER TABLE observoor.syscall_write_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.syscall_write ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- syscall_futex -ALTER TABLE observoor.syscall_futex_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.syscall_futex ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- syscall_mmap -ALTER TABLE observoor.syscall_mmap_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.syscall_mmap ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- syscall_epoll_wait -ALTER TABLE observoor.syscall_epoll_wait_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.syscall_epoll_wait ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- syscall_fsync -ALTER TABLE observoor.syscall_fsync_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.syscall_fsync ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- syscall_fdatasync -ALTER TABLE observoor.syscall_fdatasync_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.syscall_fdatasync ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- syscall_pwrite -ALTER TABLE observoor.syscall_pwrite_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.syscall_pwrite ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- sched_on_cpu -ALTER TABLE observoor.sched_on_cpu_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.sched_on_cpu ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- sched_off_cpu -ALTER TABLE observoor.sched_off_cpu_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.sched_off_cpu ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- sched_runqueue -ALTER TABLE observoor.sched_runqueue_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.sched_runqueue ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- mem_reclaim -ALTER TABLE observoor.mem_reclaim_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.mem_reclaim ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- mem_compaction -ALTER TABLE observoor.mem_compaction_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.mem_compaction ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- disk_latency -ALTER TABLE observoor.disk_latency_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.disk_latency ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- page_fault_major -ALTER TABLE observoor.page_fault_major_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.page_fault_major ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- page_fault_minor -ALTER TABLE observoor.page_fault_minor_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.page_fault_minor ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- swap_in -ALTER TABLE observoor.swap_in_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.swap_in ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- swap_out -ALTER TABLE observoor.swap_out_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.swap_out ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- oom_kill -ALTER TABLE observoor.oom_kill_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.oom_kill ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- fd_open -ALTER TABLE observoor.fd_open_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.fd_open ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- fd_close -ALTER TABLE observoor.fd_close_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.fd_close ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- process_exit -ALTER TABLE observoor.process_exit_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.process_exit ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- tcp_state_change -ALTER TABLE observoor.tcp_state_change_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.tcp_state_change ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- net_io -ALTER TABLE observoor.net_io_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.net_io ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- tcp_retransmit -ALTER TABLE observoor.tcp_retransmit_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.tcp_retransmit ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- disk_bytes -ALTER TABLE observoor.disk_bytes_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.disk_bytes ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- block_merge -ALTER TABLE observoor.block_merge_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.block_merge ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- tcp_rtt -ALTER TABLE observoor.tcp_rtt_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.tcp_rtt ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- tcp_cwnd -ALTER TABLE observoor.tcp_cwnd_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.tcp_cwnd ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- disk_queue_depth -ALTER TABLE observoor.disk_queue_depth_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.disk_queue_depth ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - --- cpu_utilization -ALTER TABLE observoor.cpu_utilization_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; - -ALTER TABLE observoor.cpu_utilization ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS sampling_rate, - DROP COLUMN IF EXISTS sampling_mode; diff --git a/deploy/migrations/clickhouse/101_observoor_sampling_metadata.up.sql b/deploy/migrations/clickhouse/101_observoor_sampling_metadata.up.sql deleted file mode 100644 index fcaedbc38..000000000 --- a/deploy/migrations/clickhouse/101_observoor_sampling_metadata.up.sql +++ /dev/null @@ -1,281 +0,0 @@ --- Migration 006: add sampling metadata columns to aggregated metric tables. --- Adds sampling_mode + sampling_rate for downstream extrapolation. - --- syscall_read -ALTER TABLE observoor.syscall_read_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.syscall_read ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- syscall_write -ALTER TABLE observoor.syscall_write_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.syscall_write ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- syscall_futex -ALTER TABLE observoor.syscall_futex_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.syscall_futex ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- syscall_mmap -ALTER TABLE observoor.syscall_mmap_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.syscall_mmap ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- syscall_epoll_wait -ALTER TABLE observoor.syscall_epoll_wait_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.syscall_epoll_wait ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- syscall_fsync -ALTER TABLE observoor.syscall_fsync_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.syscall_fsync ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- syscall_fdatasync -ALTER TABLE observoor.syscall_fdatasync_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.syscall_fdatasync ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- syscall_pwrite -ALTER TABLE observoor.syscall_pwrite_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.syscall_pwrite ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- sched_on_cpu -ALTER TABLE observoor.sched_on_cpu_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.sched_on_cpu ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- sched_off_cpu -ALTER TABLE observoor.sched_off_cpu_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.sched_off_cpu ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- sched_runqueue -ALTER TABLE observoor.sched_runqueue_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.sched_runqueue ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- mem_reclaim -ALTER TABLE observoor.mem_reclaim_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.mem_reclaim ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- mem_compaction -ALTER TABLE observoor.mem_compaction_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.mem_compaction ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- disk_latency -ALTER TABLE observoor.disk_latency_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.disk_latency ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- page_fault_major -ALTER TABLE observoor.page_fault_major_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.page_fault_major ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- page_fault_minor -ALTER TABLE observoor.page_fault_minor_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.page_fault_minor ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- swap_in -ALTER TABLE observoor.swap_in_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.swap_in ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- swap_out -ALTER TABLE observoor.swap_out_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.swap_out ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- oom_kill -ALTER TABLE observoor.oom_kill_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.oom_kill ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- fd_open -ALTER TABLE observoor.fd_open_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.fd_open ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- fd_close -ALTER TABLE observoor.fd_close_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.fd_close ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- process_exit -ALTER TABLE observoor.process_exit_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.process_exit ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- tcp_state_change -ALTER TABLE observoor.tcp_state_change_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.tcp_state_change ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- net_io -ALTER TABLE observoor.net_io_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.net_io ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- tcp_retransmit -ALTER TABLE observoor.tcp_retransmit_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.tcp_retransmit ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- disk_bytes -ALTER TABLE observoor.disk_bytes_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.disk_bytes ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- block_merge -ALTER TABLE observoor.block_merge_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.block_merge ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- tcp_rtt -ALTER TABLE observoor.tcp_rtt_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.tcp_rtt ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- tcp_cwnd -ALTER TABLE observoor.tcp_cwnd_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.tcp_cwnd ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- disk_queue_depth -ALTER TABLE observoor.disk_queue_depth_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.disk_queue_depth ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - --- cpu_utilization -ALTER TABLE observoor.cpu_utilization_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; - -ALTER TABLE observoor.cpu_utilization ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS sampling_mode LowCardinality(String) DEFAULT 'none' AFTER client_type, - ADD COLUMN IF NOT EXISTS sampling_rate Float32 DEFAULT 1.0 AFTER sampling_mode; diff --git a/deploy/migrations/clickhouse/102_execution_block_metrics.down.sql b/deploy/migrations/clickhouse/102_execution_block_metrics.down.sql deleted file mode 100644 index a9f922e7c..000000000 --- a/deploy/migrations/clickhouse/102_execution_block_metrics.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS execution_block_metrics ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS execution_block_metrics_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/102_execution_block_metrics.up.sql b/deploy/migrations/clickhouse/102_execution_block_metrics.up.sql deleted file mode 100644 index 3e8bf0a7c..000000000 --- a/deploy/migrations/clickhouse/102_execution_block_metrics.up.sql +++ /dev/null @@ -1,89 +0,0 @@ -CREATE TABLE execution_block_metrics_local ON CLUSTER '{cluster}' ( - -- Timestamps - updated_date_time DateTime COMMENT 'Timestamp when the record was last updated' Codec(DoubleDelta, ZSTD(1)), - event_date_time DateTime64(3) COMMENT 'When the event was received' Codec(DoubleDelta, ZSTD(1)), - - -- Source tracking - source LowCardinality(String) COMMENT 'Data source (e.g., client-logs)', - - -- Block info - block_number UInt64 COMMENT 'Execution block number' Codec(DoubleDelta, ZSTD(1)), - block_hash FixedString(66) COMMENT 'Execution block hash (hex encoded with 0x prefix)' Codec(ZSTD(1)), - gas_used UInt64 COMMENT 'Total gas used by all transactions in the block' Codec(ZSTD(1)), - tx_count UInt32 COMMENT 'Number of transactions in the block' Codec(ZSTD(1)), - - -- Timing in milliseconds - execution_ms Float64 COMMENT 'Time spent executing transactions in milliseconds' Codec(ZSTD(1)), - state_read_ms Float64 COMMENT 'Time spent reading state in milliseconds' Codec(ZSTD(1)), - state_hash_ms Float64 COMMENT 'Time spent computing state hash in milliseconds' Codec(ZSTD(1)), - commit_ms Float64 COMMENT 'Time spent committing state changes in milliseconds' Codec(ZSTD(1)), - total_ms Float64 COMMENT 'Total time for block processing in milliseconds' Codec(ZSTD(1)), - - -- Throughput - mgas_per_sec Float64 COMMENT 'Throughput in million gas per second' Codec(ZSTD(1)), - - -- State reads - state_reads_accounts UInt64 COMMENT 'Number of account reads' Codec(ZSTD(1)), - state_reads_storage_slots UInt64 COMMENT 'Number of storage slot reads' Codec(ZSTD(1)), - state_reads_code UInt64 COMMENT 'Number of code reads' Codec(ZSTD(1)), - state_reads_code_bytes UInt64 COMMENT 'Total bytes of code read' Codec(ZSTD(1)), - - -- State writes - state_writes_accounts UInt64 COMMENT 'Number of account writes' Codec(ZSTD(1)), - state_writes_accounts_deleted UInt64 COMMENT 'Number of accounts deleted' Codec(ZSTD(1)), - state_writes_storage_slots UInt64 COMMENT 'Number of storage slot writes' Codec(ZSTD(1)), - state_writes_storage_slots_deleted UInt64 COMMENT 'Number of storage slots deleted' Codec(ZSTD(1)), - state_writes_code UInt64 COMMENT 'Number of code writes' Codec(ZSTD(1)), - state_writes_code_bytes UInt64 COMMENT 'Total bytes of code written' Codec(ZSTD(1)), - - -- Cache metrics - account_cache_hits Int64 COMMENT 'Number of account cache hits' Codec(ZSTD(1)), - account_cache_misses Int64 COMMENT 'Number of account cache misses' Codec(ZSTD(1)), - account_cache_hit_rate Float64 COMMENT 'Account cache hit rate as percentage' Codec(ZSTD(1)), - storage_cache_hits Int64 COMMENT 'Number of storage cache hits' Codec(ZSTD(1)), - storage_cache_misses Int64 COMMENT 'Number of storage cache misses' Codec(ZSTD(1)), - storage_cache_hit_rate Float64 COMMENT 'Storage cache hit rate as percentage' Codec(ZSTD(1)), - code_cache_hits Int64 COMMENT 'Number of code cache hits' Codec(ZSTD(1)), - code_cache_misses Int64 COMMENT 'Number of code cache misses' Codec(ZSTD(1)), - code_cache_hit_rate Float64 COMMENT 'Code cache hit rate as percentage' Codec(ZSTD(1)), - code_cache_hit_bytes Int64 COMMENT 'Total bytes of code cache hits' Codec(ZSTD(1)), - code_cache_miss_bytes Int64 COMMENT 'Total bytes of code cache misses' Codec(ZSTD(1)), - - -- Standard metadata fields - meta_client_name LowCardinality(String) COMMENT 'Name of the client that generated the event', - meta_client_id String COMMENT 'Unique Session ID of the client that generated the event' Codec(ZSTD(1)), - meta_client_version LowCardinality(String) COMMENT 'Version of the client that generated the event', - meta_client_implementation LowCardinality(String) COMMENT 'Implementation of the client that generated the event', - meta_client_os LowCardinality(String) COMMENT 'Operating system of the client that generated the event', - meta_client_ip Nullable(IPv6) COMMENT 'IP address of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_city LowCardinality(String) COMMENT 'City of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country LowCardinality(String) COMMENT 'Country of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_country_code LowCardinality(String) COMMENT 'Country code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_continent_code LowCardinality(String) COMMENT 'Continent code of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_longitude Nullable(Float64) COMMENT 'Longitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_latitude Nullable(Float64) COMMENT 'Latitude of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_number Nullable(UInt32) COMMENT 'Autonomous system number of the client that generated the event' Codec(ZSTD(1)), - meta_client_geo_autonomous_system_organization Nullable(String) COMMENT 'Autonomous system organization of the client that generated the event' Codec(ZSTD(1)), - meta_network_id Int32 COMMENT 'Ethereum network ID' Codec(DoubleDelta, ZSTD(1)), - meta_network_name LowCardinality(String) COMMENT 'Ethereum network name', - meta_labels Map(String, String) COMMENT 'Labels associated with the event' Codec(ZSTD(1)) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY intDiv(block_number, 5000000) -ORDER BY (block_number, meta_network_name, meta_client_name, event_date_time) -COMMENT 'Contains detailed performance metrics from execution client structured logging for block execution'; - -CREATE TABLE execution_block_metrics ON CLUSTER '{cluster}' AS execution_block_metrics_local -ENGINE = Distributed( - '{cluster}', - default, - execution_block_metrics_local, - cityHash64( - block_number, - meta_network_name, - meta_client_name - ) -); diff --git a/deploy/migrations/clickhouse/103_observoor_process_snapshots.down.sql b/deploy/migrations/clickhouse/103_observoor_process_snapshots.down.sql deleted file mode 100644 index 2c432cd75..000000000 --- a/deploy/migrations/clickhouse/103_observoor_process_snapshots.down.sql +++ /dev/null @@ -1,14 +0,0 @@ -DROP TABLE IF EXISTS observoor.host_specs ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.host_specs_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS observoor.process_sched_usage ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.process_sched_usage_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS observoor.process_fd_usage ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.process_fd_usage_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS observoor.process_io_usage ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.process_io_usage_local ON CLUSTER '{cluster}'; - -DROP TABLE IF EXISTS observoor.memory_usage ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS observoor.memory_usage_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/103_observoor_process_snapshots.up.sql b/deploy/migrations/clickhouse/103_observoor_process_snapshots.up.sql deleted file mode 100644 index fa3902183..000000000 --- a/deploy/migrations/clickhouse/103_observoor_process_snapshots.up.sql +++ /dev/null @@ -1,198 +0,0 @@ --- Migration 103: add process snapshot tables and periodic host_specs snapshots. - -CREATE TABLE observoor.memory_usage_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sampling_mode LowCardinality(String), - sampling_rate Float32 CODEC(ZSTD(1)), - vm_size_bytes UInt64 CODEC(ZSTD(1)), - vm_rss_bytes UInt64 CODEC(ZSTD(1)), - rss_anon_bytes UInt64 CODEC(ZSTD(1)), - rss_file_bytes UInt64 CODEC(ZSTD(1)), - rss_shmem_bytes UInt64 CODEC(ZSTD(1)), - vm_swap_bytes UInt64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.memory_usage ON CLUSTER '{cluster}' AS observoor.memory_usage_local -ENGINE = Distributed( - '{cluster}', - 'observoor', - memory_usage_local, - cityHash64(window_start, meta_network_name, meta_client_name) -); - -CREATE TABLE observoor.process_io_usage_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sampling_mode LowCardinality(String), - sampling_rate Float32 CODEC(ZSTD(1)), - rchar_bytes UInt64 CODEC(ZSTD(1)), - wchar_bytes UInt64 CODEC(ZSTD(1)), - syscr UInt64 CODEC(ZSTD(1)), - syscw UInt64 CODEC(ZSTD(1)), - read_bytes UInt64 CODEC(ZSTD(1)), - write_bytes UInt64 CODEC(ZSTD(1)), - cancelled_write_bytes Int64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.process_io_usage ON CLUSTER '{cluster}' AS observoor.process_io_usage_local -ENGINE = Distributed( - '{cluster}', - 'observoor', - process_io_usage_local, - cityHash64(window_start, meta_network_name, meta_client_name) -); - -CREATE TABLE observoor.process_fd_usage_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sampling_mode LowCardinality(String), - sampling_rate Float32 CODEC(ZSTD(1)), - open_fds UInt32 CODEC(ZSTD(1)), - fd_limit_soft UInt64 CODEC(ZSTD(1)), - fd_limit_hard UInt64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.process_fd_usage ON CLUSTER '{cluster}' AS observoor.process_fd_usage_local -ENGINE = Distributed( - '{cluster}', - 'observoor', - process_fd_usage_local, - cityHash64(window_start, meta_network_name, meta_client_name) -); - -CREATE TABLE observoor.process_sched_usage_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - window_start DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - interval_ms UInt16 CODEC(ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - pid UInt32 CODEC(ZSTD(1)), - client_type LowCardinality(String), - sampling_mode LowCardinality(String), - sampling_rate Float32 CODEC(ZSTD(1)), - threads UInt32 CODEC(ZSTD(1)), - voluntary_ctxt_switches UInt64 CODEC(ZSTD(1)), - nonvoluntary_ctxt_switches UInt64 CODEC(ZSTD(1)), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(window_start) -ORDER BY (meta_network_name, window_start, meta_client_name, pid, client_type); - -CREATE TABLE observoor.process_sched_usage ON CLUSTER '{cluster}' AS observoor.process_sched_usage_local -ENGINE = Distributed( - '{cluster}', - 'observoor', - process_sched_usage_local, - cityHash64(window_start, meta_network_name, meta_client_name) -); - -CREATE TABLE observoor.host_specs_local ON CLUSTER '{cluster}' ( - updated_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - event_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot UInt32 CODEC(DoubleDelta, ZSTD(1)), - wallclock_slot_start_date_time DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - host_id String, - kernel_release LowCardinality(String), - os_name LowCardinality(String), - architecture LowCardinality(String), - cpu_model String, - cpu_vendor LowCardinality(String), - cpu_online_cores UInt16 CODEC(ZSTD(1)), - cpu_logical_cores UInt16 CODEC(ZSTD(1)), - cpu_physical_cores UInt16 CODEC(ZSTD(1)), - cpu_performance_cores UInt16 CODEC(ZSTD(1)), - cpu_efficiency_cores UInt16 CODEC(ZSTD(1)), - cpu_unknown_type_cores UInt16 CODEC(ZSTD(1)), - cpu_logical_ids Array(UInt16), - cpu_core_ids Array(Int32), - cpu_package_ids Array(Int32), - cpu_die_ids Array(Int32), - cpu_cluster_ids Array(Int32), - cpu_core_types Array(UInt8), - cpu_core_type_labels Array(String), - cpu_online_flags Array(UInt8), - cpu_max_freq_khz Array(UInt64), - cpu_base_freq_khz Array(UInt64), - memory_total_bytes UInt64 CODEC(ZSTD(1)), - memory_type LowCardinality(String), - memory_speed_mts UInt32 CODEC(ZSTD(1)), - memory_dimm_count UInt16 CODEC(ZSTD(1)), - memory_dimm_sizes_bytes Array(UInt64), - memory_dimm_types Array(String), - memory_dimm_speeds_mts Array(UInt32), - memory_dimm_configured_speeds_mts Array(UInt32), - memory_dimm_locators Array(String), - memory_dimm_bank_locators Array(String), - memory_dimm_manufacturers Array(String), - memory_dimm_part_numbers Array(String), - memory_dimm_serials Array(String), - disk_count UInt16 CODEC(ZSTD(1)), - disk_total_bytes UInt64 CODEC(ZSTD(1)), - disk_names Array(String), - disk_models Array(String), - disk_vendors Array(String), - disk_serials Array(String), - disk_sizes_bytes Array(UInt64), - disk_rotational Array(UInt8), - meta_client_name LowCardinality(String), - meta_network_name LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/tables/{shard}/{database}/{table}', - '{replica}', - updated_date_time -) -PARTITION BY toStartOfMonth(event_time) -ORDER BY (meta_network_name, event_time, host_id, meta_client_name); - -CREATE TABLE observoor.host_specs ON CLUSTER '{cluster}' AS observoor.host_specs_local -ENGINE = Distributed( - '{cluster}', - 'observoor', - host_specs_local, - cityHash64(event_time, meta_network_name, host_id, meta_client_name) -); diff --git a/deploy/migrations/clickhouse/104_structlog_agg_resource_gas_columns.down.sql b/deploy/migrations/clickhouse/104_structlog_agg_resource_gas_columns.down.sql deleted file mode 100644 index 2b85dc51c..000000000 --- a/deploy/migrations/clickhouse/104_structlog_agg_resource_gas_columns.down.sql +++ /dev/null @@ -1,15 +0,0 @@ -ALTER TABLE canonical_execution_transaction_structlog_agg_local ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS `memory_words_sum_before`, - DROP COLUMN IF EXISTS `memory_words_sum_after`, - DROP COLUMN IF EXISTS `memory_words_sq_sum_before`, - DROP COLUMN IF EXISTS `memory_words_sq_sum_after`, - DROP COLUMN IF EXISTS `memory_expansion_gas`, - DROP COLUMN IF EXISTS `cold_access_count`; - -ALTER TABLE canonical_execution_transaction_structlog_agg ON CLUSTER '{cluster}' - DROP COLUMN IF EXISTS `memory_words_sum_before`, - DROP COLUMN IF EXISTS `memory_words_sum_after`, - DROP COLUMN IF EXISTS `memory_words_sq_sum_before`, - DROP COLUMN IF EXISTS `memory_words_sq_sum_after`, - DROP COLUMN IF EXISTS `memory_expansion_gas`, - DROP COLUMN IF EXISTS `cold_access_count`; diff --git a/deploy/migrations/clickhouse/104_structlog_agg_resource_gas_columns.up.sql b/deploy/migrations/clickhouse/104_structlog_agg_resource_gas_columns.up.sql deleted file mode 100644 index c8ff5fb61..000000000 --- a/deploy/migrations/clickhouse/104_structlog_agg_resource_gas_columns.up.sql +++ /dev/null @@ -1,19 +0,0 @@ --- Add resource gas building block columns for decomposing EVM gas into categories. --- These columns enable downstream SQL to compute memory expansion gas and cold access gas --- without needing per-opcode structlog data. - -ALTER TABLE canonical_execution_transaction_structlog_agg_local ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS `memory_words_sum_before` UInt64 DEFAULT 0 COMMENT 'SUM(ceil(memory_bytes/32)) before each opcode executes. Used with sq_sum to compute memory expansion gas.' CODEC(ZSTD(1)) AFTER `max_depth`, - ADD COLUMN IF NOT EXISTS `memory_words_sum_after` UInt64 DEFAULT 0 COMMENT 'SUM(ceil(memory_bytes/32)) after each opcode executes.' CODEC(ZSTD(1)) AFTER `memory_words_sum_before`, - ADD COLUMN IF NOT EXISTS `memory_words_sq_sum_before` UInt64 DEFAULT 0 COMMENT 'SUM(words_before²). With sum_before, enables exact memory gas via E[cost(after)] - E[cost(before)].' CODEC(ZSTD(1)) AFTER `memory_words_sum_after`, - ADD COLUMN IF NOT EXISTS `memory_words_sq_sum_after` UInt64 DEFAULT 0 COMMENT 'SUM(words_after²). With sum_after, enables exact memory gas via E[cost(after)] - E[cost(before)].' CODEC(ZSTD(1)) AFTER `memory_words_sq_sum_before`, - ADD COLUMN IF NOT EXISTS `memory_expansion_gas` UInt64 DEFAULT 0 COMMENT 'SUM(memory_expansion_gas). Exact per-opcode memory expansion cost, pre-computed to avoid intDiv rounding in SQL reconstruction.' CODEC(ZSTD(1)) AFTER `memory_words_sq_sum_after`, - ADD COLUMN IF NOT EXISTS `cold_access_count` UInt64 DEFAULT 0 COMMENT 'Number of cold storage/account accesses (EIP-2929). cold_gas = cold_count * (cold_cost - warm_cost).' CODEC(ZSTD(1)) AFTER `memory_expansion_gas`; - -ALTER TABLE canonical_execution_transaction_structlog_agg ON CLUSTER '{cluster}' - ADD COLUMN IF NOT EXISTS `memory_words_sum_before` UInt64 DEFAULT 0 COMMENT 'SUM(ceil(memory_bytes/32)) before each opcode executes.' AFTER `max_depth`, - ADD COLUMN IF NOT EXISTS `memory_words_sum_after` UInt64 DEFAULT 0 COMMENT 'SUM(ceil(memory_bytes/32)) after each opcode executes.' AFTER `memory_words_sum_before`, - ADD COLUMN IF NOT EXISTS `memory_words_sq_sum_before` UInt64 DEFAULT 0 COMMENT 'SUM(words_before²).' AFTER `memory_words_sum_after`, - ADD COLUMN IF NOT EXISTS `memory_words_sq_sum_after` UInt64 DEFAULT 0 COMMENT 'SUM(words_after²).' AFTER `memory_words_sq_sum_before`, - ADD COLUMN IF NOT EXISTS `memory_expansion_gas` UInt64 DEFAULT 0 COMMENT 'SUM(memory_expansion_gas). Exact per-opcode memory expansion cost.' AFTER `memory_words_sq_sum_after`, - ADD COLUMN IF NOT EXISTS `cold_access_count` UInt64 DEFAULT 0 COMMENT 'Number of cold storage/account accesses (EIP-2929).' AFTER `memory_expansion_gas`; diff --git a/deploy/migrations/clickhouse/105_libp2p_identify.down.sql b/deploy/migrations/clickhouse/105_libp2p_identify.down.sql deleted file mode 100644 index b4b6d7fc6..000000000 --- a/deploy/migrations/clickhouse/105_libp2p_identify.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE IF EXISTS libp2p_identify ON CLUSTER '{cluster}'; -DROP TABLE IF EXISTS libp2p_identify_local ON CLUSTER '{cluster}'; diff --git a/deploy/migrations/clickhouse/105_libp2p_identify.up.sql b/deploy/migrations/clickhouse/105_libp2p_identify.up.sql deleted file mode 100644 index 5ed4fbc49..000000000 --- a/deploy/migrations/clickhouse/105_libp2p_identify.up.sql +++ /dev/null @@ -1,65 +0,0 @@ -CREATE TABLE IF NOT EXISTS libp2p_identify_local ON CLUSTER '{cluster}' ( - `updated_date_time` DateTime CODEC(DoubleDelta, ZSTD(1)), - `event_date_time` DateTime64(3) CODEC(DoubleDelta, ZSTD(1)), - `remote_peer_id_unique_key` Int64 CODEC(ZSTD(1)), - `success` Bool CODEC(ZSTD(1)), - `error` Nullable(String) CODEC(ZSTD(1)), - `remote_protocol` LowCardinality(String), - `remote_transport_protocol` LowCardinality(String), - `remote_port` UInt16 CODEC(ZSTD(1)), - `remote_ip` Nullable(IPv6) CODEC(ZSTD(1)), - `remote_geo_city` LowCardinality(String) CODEC(ZSTD(1)), - `remote_geo_country` LowCardinality(String) CODEC(ZSTD(1)), - `remote_geo_country_code` LowCardinality(String) CODEC(ZSTD(1)), - `remote_geo_continent_code` LowCardinality(String) CODEC(ZSTD(1)), - `remote_geo_longitude` Nullable(Float64) CODEC(ZSTD(1)), - `remote_geo_latitude` Nullable(Float64) CODEC(ZSTD(1)), - `remote_geo_autonomous_system_number` Nullable(UInt32) CODEC(ZSTD(1)), - `remote_geo_autonomous_system_organization` Nullable(String) CODEC(ZSTD(1)), - `remote_agent_implementation` LowCardinality(String), - `remote_agent_version` LowCardinality(String), - `remote_agent_version_major` LowCardinality(String), - `remote_agent_version_minor` LowCardinality(String), - `remote_agent_version_patch` LowCardinality(String), - `remote_agent_platform` LowCardinality(String), - `protocol_version` LowCardinality(String), - `protocols` Array(String) CODEC(ZSTD(1)), - `listen_addrs` Array(String) CODEC(ZSTD(1)), - `observed_addr` String CODEC(ZSTD(1)), - `transport` LowCardinality(String), - `security` LowCardinality(String), - `muxer` LowCardinality(String), - `direction` LowCardinality(String), - `remote_multiaddr` String CODEC(ZSTD(1)), - `meta_client_name` LowCardinality(String), - `meta_client_id` String CODEC(ZSTD(1)), - `meta_client_version` LowCardinality(String), - `meta_client_implementation` LowCardinality(String), - `meta_client_os` LowCardinality(String), - `meta_client_ip` Nullable(IPv6) CODEC(ZSTD(1)), - `meta_client_geo_city` LowCardinality(String) CODEC(ZSTD(1)), - `meta_client_geo_country` LowCardinality(String) CODEC(ZSTD(1)), - `meta_client_geo_country_code` LowCardinality(String) CODEC(ZSTD(1)), - `meta_client_geo_continent_code` LowCardinality(String) CODEC(ZSTD(1)), - `meta_client_geo_longitude` Nullable(Float64) CODEC(ZSTD(1)), - `meta_client_geo_latitude` Nullable(Float64) CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_number` Nullable(UInt32) CODEC(ZSTD(1)), - `meta_client_geo_autonomous_system_organization` Nullable(String) CODEC(ZSTD(1)), - `meta_network_id` Int32 CODEC(DoubleDelta, ZSTD(1)), - `meta_network_name` LowCardinality(String) -) ENGINE = ReplicatedReplacingMergeTree( - '/clickhouse/{installation}/{cluster}/default/tables/libp2p_identify_local/{shard}', - '{replica}', - updated_date_time -) -PARTITION BY toYYYYMM(event_date_time) -ORDER BY (event_date_time, meta_network_name, meta_client_name, remote_peer_id_unique_key, direction) -SETTINGS index_granularity = 8192; - -CREATE TABLE IF NOT EXISTS libp2p_identify ON CLUSTER '{cluster}' AS libp2p_identify_local -ENGINE = Distributed( - '{cluster}', - 'default', - 'libp2p_identify_local', - cityHash64(event_date_time, meta_network_name, meta_client_name, remote_peer_id_unique_key, direction) -); diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_blob.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_blob.gen.go index e6f5c55dd..40e5b2749 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_blob.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_blob.gen.go @@ -13,6 +13,7 @@ import ( const beaconApiEthV1BeaconBlobTableName route.TableName = "beacon_api_eth_v1_beacon_blob" type beaconApiEthV1BeaconBlobBatch struct { + UpdatedDateTime proto.ColDateTime EventDateTime proto.ColDateTime64 Slot proto.ColUInt32 SlotStartDateTime proto.ColDateTime @@ -25,7 +26,6 @@ type beaconApiEthV1BeaconBlobBatch struct { KzgCommitment route.SafeColFixedStr VersionedHash route.SafeColFixedStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -38,14 +38,12 @@ type beaconApiEthV1BeaconBlobBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -61,7 +59,6 @@ func newbeaconApiEthV1BeaconBlobBatch() *beaconApiEthV1BeaconBlobBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -72,7 +69,6 @@ func (b *beaconApiEthV1BeaconBlobBatch) Rows() int { func (b *beaconApiEthV1BeaconBlobBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -85,19 +81,16 @@ func (b *beaconApiEthV1BeaconBlobBatch) appendMetadata(event *xatu.DecoratedEven b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -110,22 +103,17 @@ func (b *beaconApiEthV1BeaconBlobBatch) appendMetadata(event *xatu.DecoratedEven b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1BeaconBlobBatch) Input() proto.Input { return proto.Input{ + {Name: "updated_date_time", Data: &b.UpdatedDateTime}, {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "slot", Data: &b.Slot}, {Name: "slot_start_date_time", Data: &b.SlotStartDateTime}, @@ -138,7 +126,6 @@ func (b *beaconApiEthV1BeaconBlobBatch) Input() proto.Input { {Name: "kzg_commitment", Data: &b.KzgCommitment}, {Name: "versioned_hash", Data: &b.VersionedHash}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -151,18 +138,17 @@ func (b *beaconApiEthV1BeaconBlobBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } func (b *beaconApiEthV1BeaconBlobBatch) Reset() { + b.UpdatedDateTime.Reset() b.EventDateTime.Reset() b.Slot.Reset() b.SlotStartDateTime.Reset() @@ -175,7 +161,6 @@ func (b *beaconApiEthV1BeaconBlobBatch) Reset() { b.KzgCommitment.Reset() b.VersionedHash.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -188,14 +173,12 @@ func (b *beaconApiEthV1BeaconBlobBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -204,7 +187,8 @@ func (b *beaconApiEthV1BeaconBlobBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 33) + row := make(map[string]any, 31) + row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -217,7 +201,6 @@ func (b *beaconApiEthV1BeaconBlobBatch) Snapshot() []map[string]any { row["kzg_commitment"] = string(b.KzgCommitment.Row(i)) row["versioned_hash"] = string(b.VersionedHash.Row(i)) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -250,14 +233,12 @@ func (b *beaconApiEthV1BeaconBlobBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_blob.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_blob.go index 9b1f48949..f4baae6b1 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_blob.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_blob.go @@ -70,6 +70,8 @@ func (b *beaconApiEthV1BeaconBlobBatch) validate(event *xatu.DecoratedEvent) err } func (b *beaconApiEthV1BeaconBlobBatch) appendRuntime(event *xatu.DecoratedEvent) { + b.UpdatedDateTime.Append(time.Now()) + if ts := event.GetEvent().GetDateTime(); ts != nil { b.EventDateTime.Append(ts.AsTime()) } else { diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_committee.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_committee.gen.go index f7d830e3e..7b0277021 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_committee.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_beacon_committee.gen.go @@ -22,7 +22,6 @@ type beaconApiEthV1BeaconCommitteeBatch struct { Epoch proto.ColUInt32 EpochStartDateTime proto.ColDateTime MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -35,14 +34,12 @@ type beaconApiEthV1BeaconCommitteeBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -55,7 +52,6 @@ func newbeaconApiEthV1BeaconCommitteeBatch() *beaconApiEthV1BeaconCommitteeBatch MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -66,7 +62,6 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) Rows() int { func (b *beaconApiEthV1BeaconCommitteeBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -79,19 +74,16 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) appendMetadata(event *xatu.Decorate b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -104,18 +96,12 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) appendMetadata(event *xatu.Decorate b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1BeaconCommitteeBatch) Input() proto.Input { @@ -129,7 +115,6 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) Input() proto.Input { {Name: "epoch", Data: &b.Epoch}, {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -142,14 +127,12 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -163,7 +146,6 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) Reset() { b.Epoch.Reset() b.EpochStartDateTime.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -176,14 +158,12 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -192,7 +172,7 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 30) + row := make(map[string]any, 27) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -202,7 +182,6 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) Snapshot() []map[string]any { row["epoch"] = b.Epoch.Row(i) row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -235,14 +214,12 @@ func (b *beaconApiEthV1BeaconCommitteeBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_attestation.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_attestation.gen.go index 27dc88d1e..11c360eb4 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_attestation.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_attestation.gen.go @@ -13,6 +13,7 @@ import ( const beaconApiEthV1EventsAttestationTableName route.TableName = "beacon_api_eth_v1_events_attestation" type beaconApiEthV1EventsAttestationBatch struct { + UpdatedDateTime proto.ColDateTime EventDateTime proto.ColDateTime64 Slot proto.ColUInt32 SlotStartDateTime proto.ColDateTime @@ -31,7 +32,6 @@ type beaconApiEthV1EventsAttestationBatch struct { TargetEpochStartDateTime proto.ColDateTime TargetRoot route.SafeColFixedStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -44,14 +44,12 @@ type beaconApiEthV1EventsAttestationBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -67,7 +65,6 @@ func newbeaconApiEthV1EventsAttestationBatch() *beaconApiEthV1EventsAttestationB MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -78,7 +75,6 @@ func (b *beaconApiEthV1EventsAttestationBatch) Rows() int { func (b *beaconApiEthV1EventsAttestationBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -91,19 +87,16 @@ func (b *beaconApiEthV1EventsAttestationBatch) appendMetadata(event *xatu.Decora b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -116,22 +109,17 @@ func (b *beaconApiEthV1EventsAttestationBatch) appendMetadata(event *xatu.Decora b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsAttestationBatch) Input() proto.Input { return proto.Input{ + {Name: "updated_date_time", Data: &b.UpdatedDateTime}, {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "slot", Data: &b.Slot}, {Name: "slot_start_date_time", Data: &b.SlotStartDateTime}, @@ -150,7 +138,6 @@ func (b *beaconApiEthV1EventsAttestationBatch) Input() proto.Input { {Name: "target_epoch_start_date_time", Data: &b.TargetEpochStartDateTime}, {Name: "target_root", Data: &b.TargetRoot}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -163,18 +150,17 @@ func (b *beaconApiEthV1EventsAttestationBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } func (b *beaconApiEthV1EventsAttestationBatch) Reset() { + b.UpdatedDateTime.Reset() b.EventDateTime.Reset() b.Slot.Reset() b.SlotStartDateTime.Reset() @@ -193,7 +179,6 @@ func (b *beaconApiEthV1EventsAttestationBatch) Reset() { b.TargetEpochStartDateTime.Reset() b.TargetRoot.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -206,14 +191,12 @@ func (b *beaconApiEthV1EventsAttestationBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -222,7 +205,8 @@ func (b *beaconApiEthV1EventsAttestationBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 39) + row := make(map[string]any, 37) + row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -245,7 +229,6 @@ func (b *beaconApiEthV1EventsAttestationBatch) Snapshot() []map[string]any { row["target_epoch_start_date_time"] = b.TargetEpochStartDateTime.Row(i).Unix() row["target_root"] = string(b.TargetRoot.Row(i)) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -278,14 +261,12 @@ func (b *beaconApiEthV1EventsAttestationBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_attestation.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_attestation.go index d29a35ad7..29a990f8f 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_attestation.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_attestation.go @@ -80,6 +80,8 @@ func (b *beaconApiEthV1EventsAttestationBatch) validate(event *xatu.DecoratedEve } func (b *beaconApiEthV1EventsAttestationBatch) appendRuntime(event *xatu.DecoratedEvent) { + b.UpdatedDateTime.Append(time.Now()) + if ts := event.GetEvent().GetDateTime(); ts != nil { b.EventDateTime.Append(ts.AsTime()) } else { diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_blob_sidecar.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_blob_sidecar.gen.go index a9a5c43d6..67c04cdd7 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_blob_sidecar.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_blob_sidecar.gen.go @@ -25,7 +25,6 @@ type beaconApiEthV1EventsBlobSidecarBatch struct { KzgCommitment route.SafeColFixedStr VersionedHash route.SafeColFixedStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -38,14 +37,12 @@ type beaconApiEthV1EventsBlobSidecarBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -60,7 +57,6 @@ func newbeaconApiEthV1EventsBlobSidecarBatch() *beaconApiEthV1EventsBlobSidecarB MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -71,7 +67,6 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) Rows() int { func (b *beaconApiEthV1EventsBlobSidecarBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -84,19 +79,16 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) appendMetadata(event *xatu.Decora b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -109,18 +101,12 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) appendMetadata(event *xatu.Decora b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsBlobSidecarBatch) Input() proto.Input { @@ -137,7 +123,6 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) Input() proto.Input { {Name: "kzg_commitment", Data: &b.KzgCommitment}, {Name: "versioned_hash", Data: &b.VersionedHash}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -150,14 +135,12 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -174,7 +157,6 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) Reset() { b.KzgCommitment.Reset() b.VersionedHash.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -187,14 +169,12 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -203,7 +183,7 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 33) + row := make(map[string]any, 30) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -216,7 +196,6 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) Snapshot() []map[string]any { row["kzg_commitment"] = string(b.KzgCommitment.Row(i)) row["versioned_hash"] = string(b.VersionedHash.Row(i)) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -249,14 +228,12 @@ func (b *beaconApiEthV1EventsBlobSidecarBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_block.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_block.gen.go index 3eb8d9ae2..df749c482 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_block.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_block.gen.go @@ -23,7 +23,6 @@ type beaconApiEthV1EventsBlockBatch struct { EpochStartDateTime proto.ColDateTime ExecutionOptimistic proto.ColBool MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -36,14 +35,12 @@ type beaconApiEthV1EventsBlockBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -56,7 +53,6 @@ func newbeaconApiEthV1EventsBlockBatch() *beaconApiEthV1EventsBlockBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -67,7 +63,6 @@ func (b *beaconApiEthV1EventsBlockBatch) Rows() int { func (b *beaconApiEthV1EventsBlockBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -80,19 +75,16 @@ func (b *beaconApiEthV1EventsBlockBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -105,18 +97,12 @@ func (b *beaconApiEthV1EventsBlockBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsBlockBatch) Input() proto.Input { @@ -131,7 +117,6 @@ func (b *beaconApiEthV1EventsBlockBatch) Input() proto.Input { {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "execution_optimistic", Data: &b.ExecutionOptimistic}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -144,14 +129,12 @@ func (b *beaconApiEthV1EventsBlockBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -166,7 +149,6 @@ func (b *beaconApiEthV1EventsBlockBatch) Reset() { b.EpochStartDateTime.Reset() b.ExecutionOptimistic.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -179,14 +161,12 @@ func (b *beaconApiEthV1EventsBlockBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -195,7 +175,7 @@ func (b *beaconApiEthV1EventsBlockBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 31) + row := make(map[string]any, 28) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -206,7 +186,6 @@ func (b *beaconApiEthV1EventsBlockBatch) Snapshot() []map[string]any { row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["execution_optimistic"] = b.ExecutionOptimistic.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -239,14 +218,12 @@ func (b *beaconApiEthV1EventsBlockBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_block_gossip.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_block_gossip.gen.go index c1b75abd7..c62eb3662 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_block_gossip.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_block_gossip.gen.go @@ -22,7 +22,6 @@ type beaconApiEthV1EventsBlockGossipBatch struct { Epoch proto.ColUInt32 EpochStartDateTime proto.ColDateTime MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -35,14 +34,12 @@ type beaconApiEthV1EventsBlockGossipBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -55,7 +52,6 @@ func newbeaconApiEthV1EventsBlockGossipBatch() *beaconApiEthV1EventsBlockGossipB MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -66,7 +62,6 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) Rows() int { func (b *beaconApiEthV1EventsBlockGossipBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -79,19 +74,16 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) appendMetadata(event *xatu.Decora b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -104,18 +96,12 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) appendMetadata(event *xatu.Decora b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsBlockGossipBatch) Input() proto.Input { @@ -129,7 +115,6 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) Input() proto.Input { {Name: "epoch", Data: &b.Epoch}, {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -142,14 +127,12 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -163,7 +146,6 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) Reset() { b.Epoch.Reset() b.EpochStartDateTime.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -176,14 +158,12 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -192,7 +172,7 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 30) + row := make(map[string]any, 27) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -202,7 +182,6 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) Snapshot() []map[string]any { row["epoch"] = b.Epoch.Row(i) row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -235,14 +214,12 @@ func (b *beaconApiEthV1EventsBlockGossipBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_chain_reorg.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_chain_reorg.gen.go index 27e27c16b..8e8f45f87 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_chain_reorg.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_chain_reorg.gen.go @@ -27,7 +27,6 @@ type beaconApiEthV1EventsChainReorgBatch struct { EpochStartDateTime proto.ColDateTime ExecutionOptimistic proto.ColBool MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -40,14 +39,12 @@ type beaconApiEthV1EventsChainReorgBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -63,7 +60,6 @@ func newbeaconApiEthV1EventsChainReorgBatch() *beaconApiEthV1EventsChainReorgBat MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -74,7 +70,6 @@ func (b *beaconApiEthV1EventsChainReorgBatch) Rows() int { func (b *beaconApiEthV1EventsChainReorgBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -87,19 +82,16 @@ func (b *beaconApiEthV1EventsChainReorgBatch) appendMetadata(event *xatu.Decorat b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -112,18 +104,12 @@ func (b *beaconApiEthV1EventsChainReorgBatch) appendMetadata(event *xatu.Decorat b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsChainReorgBatch) Input() proto.Input { @@ -142,7 +128,6 @@ func (b *beaconApiEthV1EventsChainReorgBatch) Input() proto.Input { {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "execution_optimistic", Data: &b.ExecutionOptimistic}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -155,14 +140,12 @@ func (b *beaconApiEthV1EventsChainReorgBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -181,7 +164,6 @@ func (b *beaconApiEthV1EventsChainReorgBatch) Reset() { b.EpochStartDateTime.Reset() b.ExecutionOptimistic.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -194,14 +176,12 @@ func (b *beaconApiEthV1EventsChainReorgBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -210,7 +190,7 @@ func (b *beaconApiEthV1EventsChainReorgBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 35) + row := make(map[string]any, 32) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -225,7 +205,6 @@ func (b *beaconApiEthV1EventsChainReorgBatch) Snapshot() []map[string]any { row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["execution_optimistic"] = b.ExecutionOptimistic.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -258,14 +237,12 @@ func (b *beaconApiEthV1EventsChainReorgBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_contribution_and_proof.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_contribution_and_proof.gen.go index 2fdb44cec..03e48ec49 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_contribution_and_proof.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_contribution_and_proof.gen.go @@ -28,7 +28,6 @@ type beaconApiEthV1EventsContributionAndProofBatch struct { SelectionProof proto.ColStr Signature proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -41,14 +40,12 @@ type beaconApiEthV1EventsContributionAndProofBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -61,7 +58,6 @@ func newbeaconApiEthV1EventsContributionAndProofBatch() *beaconApiEthV1EventsCon MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -72,7 +68,6 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) Rows() int { func (b *beaconApiEthV1EventsContributionAndProofBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -85,19 +80,16 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) appendMetadata(event *xa b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -110,18 +102,12 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) appendMetadata(event *xa b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsContributionAndProofBatch) Input() proto.Input { @@ -141,7 +127,6 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) Input() proto.Input { {Name: "selection_proof", Data: &b.SelectionProof}, {Name: "signature", Data: &b.Signature}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -154,14 +139,12 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -181,7 +164,6 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) Reset() { b.SelectionProof.Reset() b.Signature.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -194,14 +176,12 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -210,7 +190,7 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) Snapshot() []map[string] out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 36) + row := make(map[string]any, 33) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["aggregator_index"] = b.AggregatorIndex.Row(i) @@ -226,7 +206,6 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) Snapshot() []map[string] row["selection_proof"] = b.SelectionProof.Row(i) row["signature"] = b.Signature.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -259,14 +238,12 @@ func (b *beaconApiEthV1EventsContributionAndProofBatch) Snapshot() []map[string] } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_data_column_sidecar.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_data_column_sidecar.gen.go index 66d0b46d6..d7d4c9364 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_data_column_sidecar.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_data_column_sidecar.gen.go @@ -23,8 +23,8 @@ type beaconApiEthV1EventsDataColumnSidecarBatch struct { BlockRoot route.SafeColFixedStr ColumnIndex proto.ColUInt64 KzgCommitmentsCount proto.ColUInt32 + KzgCommitments *proto.ColArr[[]byte] MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -37,27 +37,29 @@ type beaconApiEthV1EventsDataColumnSidecarBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } func newbeaconApiEthV1EventsDataColumnSidecarBatch() *beaconApiEthV1EventsDataColumnSidecarBatch { return &beaconApiEthV1EventsDataColumnSidecarBatch{ - EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + KzgCommitments: func() *proto.ColArr[[]byte] { + var fs route.SafeColFixedStr + fs.SetSize(98) + return proto.NewArray[[]byte](&fs) + }(), MetaClientIP: new(proto.ColIPv6).Nullable(), MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -68,7 +70,6 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Rows() int { func (b *beaconApiEthV1EventsDataColumnSidecarBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -81,19 +82,16 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) appendMetadata(event *xatu. b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -106,18 +104,12 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) appendMetadata(event *xatu. b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Input() proto.Input { @@ -132,8 +124,8 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Input() proto.Input { {Name: "block_root", Data: &b.BlockRoot}, {Name: "column_index", Data: &b.ColumnIndex}, {Name: "kzg_commitments_count", Data: &b.KzgCommitmentsCount}, + {Name: "kzg_commitments", Data: b.KzgCommitments}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -146,14 +138,12 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -168,8 +158,8 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Reset() { b.BlockRoot.Reset() b.ColumnIndex.Reset() b.KzgCommitmentsCount.Reset() + b.KzgCommitments.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -182,14 +172,12 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -198,7 +186,7 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Snapshot() []map[string]any out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 32) + row := make(map[string]any, 30) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -209,8 +197,8 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Snapshot() []map[string]any row["block_root"] = string(b.BlockRoot.Row(i)) row["column_index"] = b.ColumnIndex.Row(i) row["kzg_commitments_count"] = b.KzgCommitmentsCount.Row(i) + row["kzg_commitments"] = route.ByteSlicesToStrings(b.KzgCommitments.Row(i)) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -243,14 +231,12 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) Snapshot() []map[string]any } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_data_column_sidecar.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_data_column_sidecar.go index 3fd7cf009..f60b61150 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_data_column_sidecar.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_data_column_sidecar.go @@ -104,6 +104,14 @@ func (b *beaconApiEthV1EventsDataColumnSidecarBatch) appendPayload(event *xatu.D } else { b.KzgCommitmentsCount.Append(0) } + + commitments := sidecar.GetKzgCommitments() //nolint:staticcheck // deprecated but still populated + byteSlices := make([][]byte, len(commitments)) + for i, c := range commitments { + byteSlices[i] = []byte(c) + } + + b.KzgCommitments.Append(byteSlices) } func (b *beaconApiEthV1EventsDataColumnSidecarBatch) appendAdditionalData( diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_finalized_checkpoint.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_finalized_checkpoint.gen.go index b4d8a790d..957a1d0e5 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_finalized_checkpoint.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_finalized_checkpoint.gen.go @@ -21,7 +21,6 @@ type beaconApiEthV1EventsFinalizedCheckpointBatch struct { EpochStartDateTime proto.ColDateTime ExecutionOptimistic proto.ColBool MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -34,14 +33,12 @@ type beaconApiEthV1EventsFinalizedCheckpointBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -55,7 +52,6 @@ func newbeaconApiEthV1EventsFinalizedCheckpointBatch() *beaconApiEthV1EventsFina MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -66,7 +62,6 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Rows() int { func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -79,19 +74,16 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) appendMetadata(event *xat b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -104,18 +96,12 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) appendMetadata(event *xat b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Input() proto.Input { @@ -128,7 +114,6 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Input() proto.Input { {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "execution_optimistic", Data: &b.ExecutionOptimistic}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -141,14 +126,12 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -161,7 +144,6 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Reset() { b.EpochStartDateTime.Reset() b.ExecutionOptimistic.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -174,14 +156,12 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -190,7 +170,7 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Snapshot() []map[string]a out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 29) + row := make(map[string]any, 26) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["block"] = string(b.Block.Row(i)) @@ -199,7 +179,6 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Snapshot() []map[string]a row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["execution_optimistic"] = b.ExecutionOptimistic.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -232,14 +211,12 @@ func (b *beaconApiEthV1EventsFinalizedCheckpointBatch) Snapshot() []map[string]a } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_head.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_head.gen.go index 5ded90783..fe02e675b 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_head.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_head.gen.go @@ -26,7 +26,6 @@ type beaconApiEthV1EventsHeadBatch struct { PreviousDutyDependentRoot route.SafeColFixedStr CurrentDutyDependentRoot route.SafeColFixedStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -39,14 +38,12 @@ type beaconApiEthV1EventsHeadBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -61,7 +58,6 @@ func newbeaconApiEthV1EventsHeadBatch() *beaconApiEthV1EventsHeadBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -72,7 +68,6 @@ func (b *beaconApiEthV1EventsHeadBatch) Rows() int { func (b *beaconApiEthV1EventsHeadBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -85,19 +80,16 @@ func (b *beaconApiEthV1EventsHeadBatch) appendMetadata(event *xatu.DecoratedEven b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -110,18 +102,12 @@ func (b *beaconApiEthV1EventsHeadBatch) appendMetadata(event *xatu.DecoratedEven b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsHeadBatch) Input() proto.Input { @@ -139,7 +125,6 @@ func (b *beaconApiEthV1EventsHeadBatch) Input() proto.Input { {Name: "previous_duty_dependent_root", Data: &b.PreviousDutyDependentRoot}, {Name: "current_duty_dependent_root", Data: &b.CurrentDutyDependentRoot}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -152,14 +137,12 @@ func (b *beaconApiEthV1EventsHeadBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -177,7 +160,6 @@ func (b *beaconApiEthV1EventsHeadBatch) Reset() { b.PreviousDutyDependentRoot.Reset() b.CurrentDutyDependentRoot.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -190,14 +172,12 @@ func (b *beaconApiEthV1EventsHeadBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -206,7 +186,7 @@ func (b *beaconApiEthV1EventsHeadBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 34) + row := make(map[string]any, 31) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -220,7 +200,6 @@ func (b *beaconApiEthV1EventsHeadBatch) Snapshot() []map[string]any { row["previous_duty_dependent_root"] = string(b.PreviousDutyDependentRoot.Row(i)) row["current_duty_dependent_root"] = string(b.CurrentDutyDependentRoot.Row(i)) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -253,14 +232,12 @@ func (b *beaconApiEthV1EventsHeadBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_voluntary_exit.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_voluntary_exit.gen.go index 5df6cd65f..8b430aea5 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_voluntary_exit.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_events_voluntary_exit.gen.go @@ -24,7 +24,6 @@ type beaconApiEthV1EventsVoluntaryExitBatch struct { ValidatorIndex proto.ColUInt32 Signature proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -37,14 +36,12 @@ type beaconApiEthV1EventsVoluntaryExitBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -56,7 +53,6 @@ func newbeaconApiEthV1EventsVoluntaryExitBatch() *beaconApiEthV1EventsVoluntaryE MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -67,7 +63,6 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) Rows() int { func (b *beaconApiEthV1EventsVoluntaryExitBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -80,19 +75,16 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) appendMetadata(event *xatu.Deco b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -105,18 +97,12 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) appendMetadata(event *xatu.Deco b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1EventsVoluntaryExitBatch) Input() proto.Input { @@ -132,7 +118,6 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) Input() proto.Input { {Name: "validator_index", Data: &b.ValidatorIndex}, {Name: "signature", Data: &b.Signature}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -145,14 +130,12 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -168,7 +151,6 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) Reset() { b.ValidatorIndex.Reset() b.Signature.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -181,14 +163,12 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -197,7 +177,7 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 32) + row := make(map[string]any, 29) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["epoch"] = b.Epoch.Row(i) @@ -209,7 +189,6 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) Snapshot() []map[string]any { row["validator_index"] = b.ValidatorIndex.Row(i) row["signature"] = b.Signature.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -242,14 +221,12 @@ func (b *beaconApiEthV1EventsVoluntaryExitBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_proposer_duty.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_proposer_duty.gen.go index 6efe22649..576e87630 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_proposer_duty.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_proposer_duty.gen.go @@ -22,7 +22,6 @@ type beaconApiEthV1ProposerDutyBatch struct { ProposerValidatorIndex proto.ColUInt32 ProposerPubkey proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -35,14 +34,12 @@ type beaconApiEthV1ProposerDutyBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -54,7 +51,6 @@ func newbeaconApiEthV1ProposerDutyBatch() *beaconApiEthV1ProposerDutyBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -65,7 +61,6 @@ func (b *beaconApiEthV1ProposerDutyBatch) Rows() int { func (b *beaconApiEthV1ProposerDutyBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -78,19 +73,16 @@ func (b *beaconApiEthV1ProposerDutyBatch) appendMetadata(event *xatu.DecoratedEv b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -103,18 +95,12 @@ func (b *beaconApiEthV1ProposerDutyBatch) appendMetadata(event *xatu.DecoratedEv b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1ProposerDutyBatch) Input() proto.Input { @@ -128,7 +114,6 @@ func (b *beaconApiEthV1ProposerDutyBatch) Input() proto.Input { {Name: "proposer_validator_index", Data: &b.ProposerValidatorIndex}, {Name: "proposer_pubkey", Data: &b.ProposerPubkey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -141,14 +126,12 @@ func (b *beaconApiEthV1ProposerDutyBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -162,7 +145,6 @@ func (b *beaconApiEthV1ProposerDutyBatch) Reset() { b.ProposerValidatorIndex.Reset() b.ProposerPubkey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -175,14 +157,12 @@ func (b *beaconApiEthV1ProposerDutyBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -191,7 +171,7 @@ func (b *beaconApiEthV1ProposerDutyBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 30) + row := make(map[string]any, 27) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -201,7 +181,6 @@ func (b *beaconApiEthV1ProposerDutyBatch) Snapshot() []map[string]any { row["proposer_validator_index"] = b.ProposerValidatorIndex.Row(i) row["proposer_pubkey"] = b.ProposerPubkey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -234,14 +213,12 @@ func (b *beaconApiEthV1ProposerDutyBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v1_validator_attestation_data.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v1_validator_attestation_data.gen.go index 30c9d6c53..7fc4d045e 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v1_validator_attestation_data.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v1_validator_attestation_data.gen.go @@ -31,7 +31,6 @@ type beaconApiEthV1ValidatorAttestationDataBatch struct { RequestDuration proto.ColUInt32 RequestSlotStartDiff proto.ColUInt32 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -44,14 +43,12 @@ type beaconApiEthV1ValidatorAttestationDataBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -66,7 +63,6 @@ func newbeaconApiEthV1ValidatorAttestationDataBatch() *beaconApiEthV1ValidatorAt MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -77,7 +73,6 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) Rows() int { func (b *beaconApiEthV1ValidatorAttestationDataBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -90,19 +85,16 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) appendMetadata(event *xatu b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -115,18 +107,12 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) appendMetadata(event *xatu b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV1ValidatorAttestationDataBatch) Input() proto.Input { @@ -149,7 +135,6 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) Input() proto.Input { {Name: "request_duration", Data: &b.RequestDuration}, {Name: "request_slot_start_diff", Data: &b.RequestSlotStartDiff}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -162,14 +147,12 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -192,7 +175,6 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) Reset() { b.RequestDuration.Reset() b.RequestSlotStartDiff.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -205,14 +187,12 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -221,7 +201,7 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) Snapshot() []map[string]an out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 39) + row := make(map[string]any, 36) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -240,7 +220,6 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) Snapshot() []map[string]an row["request_duration"] = b.RequestDuration.Row(i) row["request_slot_start_diff"] = b.RequestSlotStartDiff.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -273,14 +252,12 @@ func (b *beaconApiEthV1ValidatorAttestationDataBatch) Snapshot() []map[string]an } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v2_beacon_block.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v2_beacon_block.gen.go index 14e8ffede..c2a6a9c3f 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v2_beacon_block.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v2_beacon_block.gen.go @@ -28,9 +28,9 @@ type beaconApiEthV2BeaconBlockBatch struct { ProposerIndex proto.ColUInt32 Eth1DataBlockHash route.SafeColFixedStr Eth1DataDepositRoot route.SafeColFixedStr - ExecutionPayloadBlockHash route.SafeColFixedStr - ExecutionPayloadBlockNumber proto.ColUInt32 - ExecutionPayloadFeeRecipient proto.ColStr + ExecutionPayloadBlockHash *proto.ColNullable[[]byte] + ExecutionPayloadBlockNumber *proto.ColNullable[uint32] + ExecutionPayloadFeeRecipient *proto.ColNullable[string] ExecutionPayloadBaseFeePerGas *proto.ColNullable[proto.UInt128] ExecutionPayloadBlobGasUsed *proto.ColNullable[uint64] ExecutionPayloadExcessBlobGas *proto.ColNullable[uint64] @@ -42,7 +42,6 @@ type beaconApiEthV2BeaconBlockBatch struct { ExecutionPayloadTransactionsTotalBytes *proto.ColNullable[uint32] ExecutionPayloadTransactionsTotalBytesCompressed *proto.ColNullable[uint32] MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -55,14 +54,12 @@ type beaconApiEthV2BeaconBlockBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -76,7 +73,9 @@ func newbeaconApiEthV2BeaconBlockBatch() *beaconApiEthV2BeaconBlockBatch { StateRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), Eth1DataBlockHash: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), Eth1DataDepositRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - ExecutionPayloadBlockHash: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + ExecutionPayloadBlockHash: route.NewNullableFixedStr(66), + ExecutionPayloadBlockNumber: new(proto.ColUInt32).Nullable(), + ExecutionPayloadFeeRecipient: new(proto.ColStr).Nullable(), ExecutionPayloadBaseFeePerGas: new(proto.ColUInt128).Nullable(), ExecutionPayloadBlobGasUsed: new(proto.ColUInt64).Nullable(), ExecutionPayloadExcessBlobGas: new(proto.ColUInt64).Nullable(), @@ -92,7 +91,6 @@ func newbeaconApiEthV2BeaconBlockBatch() *beaconApiEthV2BeaconBlockBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -103,7 +101,6 @@ func (b *beaconApiEthV2BeaconBlockBatch) Rows() int { func (b *beaconApiEthV2BeaconBlockBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -116,19 +113,16 @@ func (b *beaconApiEthV2BeaconBlockBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -141,18 +135,12 @@ func (b *beaconApiEthV2BeaconBlockBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV2BeaconBlockBatch) Input() proto.Input { @@ -172,9 +160,9 @@ func (b *beaconApiEthV2BeaconBlockBatch) Input() proto.Input { {Name: "proposer_index", Data: &b.ProposerIndex}, {Name: "eth1_data_block_hash", Data: &b.Eth1DataBlockHash}, {Name: "eth1_data_deposit_root", Data: &b.Eth1DataDepositRoot}, - {Name: "execution_payload_block_hash", Data: &b.ExecutionPayloadBlockHash}, - {Name: "execution_payload_block_number", Data: &b.ExecutionPayloadBlockNumber}, - {Name: "execution_payload_fee_recipient", Data: &b.ExecutionPayloadFeeRecipient}, + {Name: "execution_payload_block_hash", Data: b.ExecutionPayloadBlockHash}, + {Name: "execution_payload_block_number", Data: b.ExecutionPayloadBlockNumber}, + {Name: "execution_payload_fee_recipient", Data: b.ExecutionPayloadFeeRecipient}, {Name: "execution_payload_base_fee_per_gas", Data: b.ExecutionPayloadBaseFeePerGas}, {Name: "execution_payload_blob_gas_used", Data: b.ExecutionPayloadBlobGasUsed}, {Name: "execution_payload_excess_blob_gas", Data: b.ExecutionPayloadExcessBlobGas}, @@ -186,7 +174,6 @@ func (b *beaconApiEthV2BeaconBlockBatch) Input() proto.Input { {Name: "execution_payload_transactions_total_bytes", Data: b.ExecutionPayloadTransactionsTotalBytes}, {Name: "execution_payload_transactions_total_bytes_compressed", Data: b.ExecutionPayloadTransactionsTotalBytesCompressed}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -199,14 +186,12 @@ func (b *beaconApiEthV2BeaconBlockBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -240,7 +225,6 @@ func (b *beaconApiEthV2BeaconBlockBatch) Reset() { b.ExecutionPayloadTransactionsTotalBytes.Reset() b.ExecutionPayloadTransactionsTotalBytesCompressed.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -253,14 +237,12 @@ func (b *beaconApiEthV2BeaconBlockBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -269,7 +251,7 @@ func (b *beaconApiEthV2BeaconBlockBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 50) + row := make(map[string]any, 47) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -293,9 +275,21 @@ func (b *beaconApiEthV2BeaconBlockBatch) Snapshot() []map[string]any { row["proposer_index"] = b.ProposerIndex.Row(i) row["eth1_data_block_hash"] = string(b.Eth1DataBlockHash.Row(i)) row["eth1_data_deposit_root"] = string(b.Eth1DataDepositRoot.Row(i)) - row["execution_payload_block_hash"] = string(b.ExecutionPayloadBlockHash.Row(i)) - row["execution_payload_block_number"] = b.ExecutionPayloadBlockNumber.Row(i) - row["execution_payload_fee_recipient"] = b.ExecutionPayloadFeeRecipient.Row(i) + if v := b.ExecutionPayloadBlockHash.Row(i); v.Set { + row["execution_payload_block_hash"] = string(v.Value) + } else { + row["execution_payload_block_hash"] = nil + } + if v := b.ExecutionPayloadBlockNumber.Row(i); v.Set { + row["execution_payload_block_number"] = v.Value + } else { + row["execution_payload_block_number"] = nil + } + if v := b.ExecutionPayloadFeeRecipient.Row(i); v.Set { + row["execution_payload_fee_recipient"] = v.Value + } else { + row["execution_payload_fee_recipient"] = nil + } if v := b.ExecutionPayloadBaseFeePerGas.Row(i); v.Set { row["execution_payload_base_fee_per_gas"] = route.UInt128ToString(v.Value) } else { @@ -339,7 +333,6 @@ func (b *beaconApiEthV2BeaconBlockBatch) Snapshot() []map[string]any { row["execution_payload_transactions_total_bytes_compressed"] = nil } row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -372,14 +365,12 @@ func (b *beaconApiEthV2BeaconBlockBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v2_beacon_block.go b/pkg/consumoor/route/beacon/beacon_api_eth_v2_beacon_block.go index 525fe1493..0ebe682c3 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v2_beacon_block.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v2_beacon_block.go @@ -273,9 +273,9 @@ func (b *beaconApiEthV2BeaconBlockBatch) appendEth1Data(eth1Data *ethv1.Eth1Data } func (b *beaconApiEthV2BeaconBlockBatch) appendNoExecutionPayload() { - b.ExecutionPayloadBlockHash.Append(nil) - b.ExecutionPayloadBlockNumber.Append(0) - b.ExecutionPayloadFeeRecipient.Append("") + b.ExecutionPayloadBlockHash.Append(proto.Nullable[[]byte]{}) + b.ExecutionPayloadBlockNumber.Append(proto.Nullable[uint32]{}) + b.ExecutionPayloadFeeRecipient.Append(proto.Nullable[string]{}) b.ExecutionPayloadBaseFeePerGas.Append(proto.Nullable[proto.UInt128]{}) b.ExecutionPayloadBlobGasUsed.Append(proto.Nullable[uint64]{}) b.ExecutionPayloadExcessBlobGas.Append(proto.Nullable[uint64]{}) @@ -301,15 +301,15 @@ func (b *beaconApiEthV2BeaconBlockBatch) appendExecutionPayloadV2( b.ExecutionPayloadBaseFeePerGas.Append(proto.NewNullable[proto.UInt128](baseFeePerGas)) } - b.ExecutionPayloadBlockHash.Append([]byte(payload.GetBlockHash())) - b.ExecutionPayloadFeeRecipient.Append(payload.GetFeeRecipient()) + b.ExecutionPayloadBlockHash.Append(proto.NewNullable[[]byte]([]byte(payload.GetBlockHash()))) + b.ExecutionPayloadFeeRecipient.Append(proto.NewNullable[string](payload.GetFeeRecipient())) b.ExecutionPayloadStateRoot.Append([]byte(payload.GetStateRoot())) b.ExecutionPayloadParentHash.Append([]byte(payload.GetParentHash())) if blockNumber := payload.GetBlockNumber(); blockNumber != nil { - b.ExecutionPayloadBlockNumber.Append(uint32(blockNumber.GetValue())) //nolint:gosec // block number fits uint32 + b.ExecutionPayloadBlockNumber.Append(proto.NewNullable[uint32](uint32(blockNumber.GetValue()))) //nolint:gosec // block number fits uint32 } else { - b.ExecutionPayloadBlockNumber.Append(0) + b.ExecutionPayloadBlockNumber.Append(proto.Nullable[uint32]{}) } if gasLimit := payload.GetGasLimit(); gasLimit != nil { @@ -346,15 +346,15 @@ func (b *beaconApiEthV2BeaconBlockBatch) appendExecutionPayloadCapellaV2( b.ExecutionPayloadBaseFeePerGas.Append(proto.NewNullable[proto.UInt128](baseFeePerGas)) } - b.ExecutionPayloadBlockHash.Append([]byte(payload.GetBlockHash())) - b.ExecutionPayloadFeeRecipient.Append(payload.GetFeeRecipient()) + b.ExecutionPayloadBlockHash.Append(proto.NewNullable[[]byte]([]byte(payload.GetBlockHash()))) + b.ExecutionPayloadFeeRecipient.Append(proto.NewNullable[string](payload.GetFeeRecipient())) b.ExecutionPayloadStateRoot.Append([]byte(payload.GetStateRoot())) b.ExecutionPayloadParentHash.Append([]byte(payload.GetParentHash())) if blockNumber := payload.GetBlockNumber(); blockNumber != nil { - b.ExecutionPayloadBlockNumber.Append(uint32(blockNumber.GetValue())) //nolint:gosec // block number fits uint32 + b.ExecutionPayloadBlockNumber.Append(proto.NewNullable[uint32](uint32(blockNumber.GetValue()))) //nolint:gosec // block number fits uint32 } else { - b.ExecutionPayloadBlockNumber.Append(0) + b.ExecutionPayloadBlockNumber.Append(proto.Nullable[uint32]{}) } if gasLimit := payload.GetGasLimit(); gasLimit != nil { @@ -391,15 +391,15 @@ func (b *beaconApiEthV2BeaconBlockBatch) appendExecutionPayloadDeneb( b.ExecutionPayloadBaseFeePerGas.Append(proto.NewNullable[proto.UInt128](baseFeePerGas)) } - b.ExecutionPayloadBlockHash.Append([]byte(payload.GetBlockHash())) - b.ExecutionPayloadFeeRecipient.Append(payload.GetFeeRecipient()) + b.ExecutionPayloadBlockHash.Append(proto.NewNullable[[]byte]([]byte(payload.GetBlockHash()))) + b.ExecutionPayloadFeeRecipient.Append(proto.NewNullable[string](payload.GetFeeRecipient())) b.ExecutionPayloadStateRoot.Append([]byte(payload.GetStateRoot())) b.ExecutionPayloadParentHash.Append([]byte(payload.GetParentHash())) if blockNumber := payload.GetBlockNumber(); blockNumber != nil { - b.ExecutionPayloadBlockNumber.Append(uint32(blockNumber.GetValue())) //nolint:gosec // block number fits uint32 + b.ExecutionPayloadBlockNumber.Append(proto.NewNullable[uint32](uint32(blockNumber.GetValue()))) //nolint:gosec // block number fits uint32 } else { - b.ExecutionPayloadBlockNumber.Append(0) + b.ExecutionPayloadBlockNumber.Append(proto.Nullable[uint32]{}) } if blobGasUsed := payload.GetBlobGasUsed(); blobGasUsed != nil { @@ -445,15 +445,15 @@ func (b *beaconApiEthV2BeaconBlockBatch) appendExecutionPayloadElectra( b.ExecutionPayloadBaseFeePerGas.Append(proto.NewNullable[proto.UInt128](baseFeePerGas)) } - b.ExecutionPayloadBlockHash.Append([]byte(payload.GetBlockHash())) - b.ExecutionPayloadFeeRecipient.Append(payload.GetFeeRecipient()) + b.ExecutionPayloadBlockHash.Append(proto.NewNullable[[]byte]([]byte(payload.GetBlockHash()))) + b.ExecutionPayloadFeeRecipient.Append(proto.NewNullable[string](payload.GetFeeRecipient())) b.ExecutionPayloadStateRoot.Append([]byte(payload.GetStateRoot())) b.ExecutionPayloadParentHash.Append([]byte(payload.GetParentHash())) if blockNumber := payload.GetBlockNumber(); blockNumber != nil { - b.ExecutionPayloadBlockNumber.Append(uint32(blockNumber.GetValue())) //nolint:gosec // block number fits uint32 + b.ExecutionPayloadBlockNumber.Append(proto.NewNullable[uint32](uint32(blockNumber.GetValue()))) //nolint:gosec // block number fits uint32 } else { - b.ExecutionPayloadBlockNumber.Append(0) + b.ExecutionPayloadBlockNumber.Append(proto.Nullable[uint32]{}) } if blobGasUsed := payload.GetBlobGasUsed(); blobGasUsed != nil { diff --git a/pkg/consumoor/route/beacon/beacon_api_eth_v3_validator_block.gen.go b/pkg/consumoor/route/beacon/beacon_api_eth_v3_validator_block.gen.go index 47240e048..a07807991 100644 --- a/pkg/consumoor/route/beacon/beacon_api_eth_v3_validator_block.gen.go +++ b/pkg/consumoor/route/beacon/beacon_api_eth_v3_validator_block.gen.go @@ -34,7 +34,6 @@ type beaconApiEthV3ValidatorBlockBatch struct { ExecutionPayloadTransactionsTotalBytes *proto.ColNullable[uint32] ExecutionPayloadTransactionsTotalBytesCompressed *proto.ColNullable[uint32] MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -47,14 +46,12 @@ type beaconApiEthV3ValidatorBlockBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaConsensusVersion proto.ColStr MetaConsensusVersionMajor proto.ColStr MetaConsensusVersionMinor proto.ColStr MetaConsensusVersionPatch proto.ColStr MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -78,7 +75,6 @@ func newbeaconApiEthV3ValidatorBlockBatch() *beaconApiEthV3ValidatorBlockBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -89,7 +85,6 @@ func (b *beaconApiEthV3ValidatorBlockBatch) Rows() int { func (b *beaconApiEthV3ValidatorBlockBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -102,19 +97,16 @@ func (b *beaconApiEthV3ValidatorBlockBatch) appendMetadata(event *xatu.Decorated b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaConsensusVersion.Append("") b.MetaConsensusVersionMajor.Append("") b.MetaConsensusVersionMinor.Append("") b.MetaConsensusVersionPatch.Append("") b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -127,18 +119,12 @@ func (b *beaconApiEthV3ValidatorBlockBatch) appendMetadata(event *xatu.Decorated b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *beaconApiEthV3ValidatorBlockBatch) Input() proto.Input { @@ -164,7 +150,6 @@ func (b *beaconApiEthV3ValidatorBlockBatch) Input() proto.Input { {Name: "execution_payload_transactions_total_bytes", Data: b.ExecutionPayloadTransactionsTotalBytes}, {Name: "execution_payload_transactions_total_bytes_compressed", Data: b.ExecutionPayloadTransactionsTotalBytesCompressed}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -177,14 +162,12 @@ func (b *beaconApiEthV3ValidatorBlockBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -210,7 +193,6 @@ func (b *beaconApiEthV3ValidatorBlockBatch) Reset() { b.ExecutionPayloadTransactionsTotalBytes.Reset() b.ExecutionPayloadTransactionsTotalBytesCompressed.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -223,14 +205,12 @@ func (b *beaconApiEthV3ValidatorBlockBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaConsensusVersion.Reset() b.MetaConsensusVersionMajor.Reset() b.MetaConsensusVersionMinor.Reset() b.MetaConsensusVersionPatch.Reset() b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -239,7 +219,7 @@ func (b *beaconApiEthV3ValidatorBlockBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 42) + row := make(map[string]any, 39) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -309,7 +289,6 @@ func (b *beaconApiEthV3ValidatorBlockBatch) Snapshot() []map[string]any { row["execution_payload_transactions_total_bytes_compressed"] = nil } row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -342,14 +321,12 @@ func (b *beaconApiEthV3ValidatorBlockBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_blob_sidecar.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_blob_sidecar.gen.go index b69b1a61b..01bb5e167 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_blob_sidecar.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_blob_sidecar.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,59 +11,32 @@ import ( const canonicalBeaconBlobSidecarTableName route.TableName = "canonical_beacon_blob_sidecar" type canonicalBeaconBlobSidecarBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockParentRoot route.SafeColFixedStr - VersionedHash route.SafeColFixedStr - KzgCommitment route.SafeColFixedStr - KzgProof route.SafeColFixedStr - ProposerIndex proto.ColUInt32 - BlobIndex proto.ColUInt64 - BlobSize proto.ColUInt32 - BlobEmptySize *proto.ColNullable[uint32] - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockParentRoot route.SafeColFixedStr + VersionedHash route.SafeColFixedStr + KzgCommitment route.SafeColFixedStr + KzgProof route.SafeColFixedStr + ProposerIndex proto.ColUInt32 + BlobIndex proto.ColUInt64 + BlobSize proto.ColUInt32 + BlobEmptySize *proto.ColNullable[uint32] + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlobSidecarBatch() *canonicalBeaconBlobSidecarBatch { return &canonicalBeaconBlobSidecarBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - BlockParentRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - VersionedHash: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - KzgCommitment: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(98); return c }(), - KzgProof: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(98); return c }(), - BlobEmptySize: new(proto.ColUInt32).Nullable(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + BlockParentRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + VersionedHash: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + KzgCommitment: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(98); return c }(), + KzgProof: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(98); return c }(), + BlobEmptySize: new(proto.ColUInt32).Nullable(), } } @@ -75,57 +46,11 @@ func (b *canonicalBeaconBlobSidecarBatch) Rows() int { func (b *canonicalBeaconBlobSidecarBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlobSidecarBatch) Input() proto.Input { @@ -144,28 +69,7 @@ func (b *canonicalBeaconBlobSidecarBatch) Input() proto.Input { {Name: "blob_index", Data: &b.BlobIndex}, {Name: "blob_size", Data: &b.BlobSize}, {Name: "blob_empty_size", Data: b.BlobEmptySize}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -184,28 +88,7 @@ func (b *canonicalBeaconBlobSidecarBatch) Reset() { b.BlobIndex.Reset() b.BlobSize.Reset() b.BlobEmptySize.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -214,7 +97,7 @@ func (b *canonicalBeaconBlobSidecarBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 36) + row := make(map[string]any, 15) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -233,48 +116,7 @@ func (b *canonicalBeaconBlobSidecarBatch) Snapshot() []map[string]any { } else { row["blob_empty_size"] = nil } - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block.gen.go index 421b8281c..5e383684f 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -40,28 +38,7 @@ type canonicalBeaconBlockBatch struct { ExecutionPayloadTransactionsCount *proto.ColNullable[uint32] ExecutionPayloadTransactionsTotalBytes *proto.ColNullable[uint32] ExecutionPayloadTransactionsTotalBytesCompressed *proto.ColNullable[uint32] - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -87,12 +64,6 @@ func newcanonicalBeaconBlockBatch() *canonicalBeaconBlockBatch { ExecutionPayloadTransactionsCount: new(proto.ColUInt32).Nullable(), ExecutionPayloadTransactionsTotalBytes: new(proto.ColUInt32).Nullable(), ExecutionPayloadTransactionsTotalBytesCompressed: new(proto.ColUInt32).Nullable(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -102,57 +73,11 @@ func (b *canonicalBeaconBlockBatch) Rows() int { func (b *canonicalBeaconBlockBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockBatch) Input() proto.Input { @@ -184,28 +109,7 @@ func (b *canonicalBeaconBlockBatch) Input() proto.Input { {Name: "execution_payload_transactions_count", Data: b.ExecutionPayloadTransactionsCount}, {Name: "execution_payload_transactions_total_bytes", Data: b.ExecutionPayloadTransactionsTotalBytes}, {Name: "execution_payload_transactions_total_bytes_compressed", Data: b.ExecutionPayloadTransactionsTotalBytesCompressed}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -237,28 +141,7 @@ func (b *canonicalBeaconBlockBatch) Reset() { b.ExecutionPayloadTransactionsCount.Reset() b.ExecutionPayloadTransactionsTotalBytes.Reset() b.ExecutionPayloadTransactionsTotalBytesCompressed.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -267,7 +150,7 @@ func (b *canonicalBeaconBlockBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 49) + row := make(map[string]any, 28) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -355,48 +238,7 @@ func (b *canonicalBeaconBlockBatch) Snapshot() []map[string]any { } else { row["execution_payload_transactions_total_bytes_compressed"] = nil } - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_attester_slashing.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block_attester_slashing.gen.go index 3b07a949d..24b3fa165 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_attester_slashing.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_attester_slashing.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,73 +11,46 @@ import ( const canonicalBeaconBlockAttesterSlashingTableName route.TableName = "canonical_beacon_block_attester_slashing" type canonicalBeaconBlockAttesterSlashingBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockVersion proto.ColStr - Attestation1AttestingIndices *proto.ColArr[uint32] - Attestation1Signature proto.ColStr - Attestation1DataBeaconBlockRoot route.SafeColFixedStr - Attestation1DataSlot proto.ColUInt32 - Attestation1DataIndex proto.ColUInt32 - Attestation1DataSourceEpoch proto.ColUInt32 - Attestation1DataSourceRoot route.SafeColFixedStr - Attestation1DataTargetEpoch proto.ColUInt32 - Attestation1DataTargetRoot route.SafeColFixedStr - Attestation2AttestingIndices *proto.ColArr[uint32] - Attestation2Signature proto.ColStr - Attestation2DataBeaconBlockRoot route.SafeColFixedStr - Attestation2DataSlot proto.ColUInt32 - Attestation2DataIndex proto.ColUInt32 - Attestation2DataSourceEpoch proto.ColUInt32 - Attestation2DataSourceRoot route.SafeColFixedStr - Attestation2DataTargetEpoch proto.ColUInt32 - Attestation2DataTargetRoot route.SafeColFixedStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockVersion proto.ColStr + Attestation1AttestingIndices *proto.ColArr[uint32] + Attestation1Signature proto.ColStr + Attestation1DataBeaconBlockRoot route.SafeColFixedStr + Attestation1DataSlot proto.ColUInt32 + Attestation1DataIndex proto.ColUInt32 + Attestation1DataSourceEpoch proto.ColUInt32 + Attestation1DataSourceRoot route.SafeColFixedStr + Attestation1DataTargetEpoch proto.ColUInt32 + Attestation1DataTargetRoot route.SafeColFixedStr + Attestation2AttestingIndices *proto.ColArr[uint32] + Attestation2Signature proto.ColStr + Attestation2DataBeaconBlockRoot route.SafeColFixedStr + Attestation2DataSlot proto.ColUInt32 + Attestation2DataIndex proto.ColUInt32 + Attestation2DataSourceEpoch proto.ColUInt32 + Attestation2DataSourceRoot route.SafeColFixedStr + Attestation2DataTargetEpoch proto.ColUInt32 + Attestation2DataTargetRoot route.SafeColFixedStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlockAttesterSlashingBatch() *canonicalBeaconBlockAttesterSlashingBatch { return &canonicalBeaconBlockAttesterSlashingBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - Attestation1AttestingIndices: proto.NewArray[uint32](new(proto.ColUInt32)), - Attestation1DataBeaconBlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - Attestation1DataSourceRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - Attestation1DataTargetRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - Attestation2AttestingIndices: proto.NewArray[uint32](new(proto.ColUInt32)), - Attestation2DataBeaconBlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - Attestation2DataSourceRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - Attestation2DataTargetRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + Attestation1AttestingIndices: proto.NewArray[uint32](new(proto.ColUInt32)), + Attestation1DataBeaconBlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + Attestation1DataSourceRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + Attestation1DataTargetRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + Attestation2AttestingIndices: proto.NewArray[uint32](new(proto.ColUInt32)), + Attestation2DataBeaconBlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + Attestation2DataSourceRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + Attestation2DataTargetRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), } } @@ -89,57 +60,11 @@ func (b *canonicalBeaconBlockAttesterSlashingBatch) Rows() int { func (b *canonicalBeaconBlockAttesterSlashingBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockAttesterSlashingBatch) Input() proto.Input { @@ -169,28 +94,7 @@ func (b *canonicalBeaconBlockAttesterSlashingBatch) Input() proto.Input { {Name: "attestation_2_data_source_root", Data: &b.Attestation2DataSourceRoot}, {Name: "attestation_2_data_target_epoch", Data: &b.Attestation2DataTargetEpoch}, {Name: "attestation_2_data_target_root", Data: &b.Attestation2DataTargetRoot}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -220,28 +124,7 @@ func (b *canonicalBeaconBlockAttesterSlashingBatch) Reset() { b.Attestation2DataSourceRoot.Reset() b.Attestation2DataTargetEpoch.Reset() b.Attestation2DataTargetRoot.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -250,7 +133,7 @@ func (b *canonicalBeaconBlockAttesterSlashingBatch) Snapshot() []map[string]any out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 47) + row := make(map[string]any, 26) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -276,48 +159,7 @@ func (b *canonicalBeaconBlockAttesterSlashingBatch) Snapshot() []map[string]any row["attestation_2_data_source_root"] = string(b.Attestation2DataSourceRoot.Row(i)) row["attestation_2_data_target_epoch"] = b.Attestation2DataTargetEpoch.Row(i) row["attestation_2_data_target_root"] = string(b.Attestation2DataTargetRoot.Row(i)) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_attester_slashing_test.go b/pkg/consumoor/route/canonical/canonical_beacon_block_attester_slashing_test.go index a809fa9a5..42f4c2f7e 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_attester_slashing_test.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_attester_slashing_test.go @@ -28,6 +28,6 @@ func TestSnapshot_canonical_beacon_block_attester_slashing(t *testing.T) { EthV2BeaconBlockAttesterSlashing: ðv1.AttesterSlashingV2{}, }, }, 1, map[string]any{ - "meta_client_name": "test-client", + "meta_network_name": "mainnet", }) } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_bls_to_execution_change.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block_bls_to_execution_change.gen.go index d6beb6382..5983c847b 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_bls_to_execution_change.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_bls_to_execution_change.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,52 +11,25 @@ import ( const canonicalBeaconBlockBlsToExecutionChangeTableName route.TableName = "canonical_beacon_block_bls_to_execution_change" type canonicalBeaconBlockBlsToExecutionChangeBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockVersion proto.ColStr - ExchangingMessageValidatorIndex proto.ColUInt32 - ExchangingMessageFromBlsPubkey proto.ColStr - ExchangingMessageToExecutionAddress route.SafeColFixedStr - ExchangingSignature proto.ColStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockVersion proto.ColStr + ExchangingMessageValidatorIndex proto.ColUInt32 + ExchangingMessageFromBlsPubkey proto.ColStr + ExchangingMessageToExecutionAddress route.SafeColFixedStr + ExchangingSignature proto.ColStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlockBlsToExecutionChangeBatch() *canonicalBeaconBlockBlsToExecutionChangeBatch { return &canonicalBeaconBlockBlsToExecutionChangeBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - ExchangingMessageToExecutionAddress: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(42); return c }(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + ExchangingMessageToExecutionAddress: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(42); return c }(), } } @@ -68,57 +39,11 @@ func (b *canonicalBeaconBlockBlsToExecutionChangeBatch) Rows() int { func (b *canonicalBeaconBlockBlsToExecutionChangeBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockBlsToExecutionChangeBatch) Input() proto.Input { @@ -134,28 +59,7 @@ func (b *canonicalBeaconBlockBlsToExecutionChangeBatch) Input() proto.Input { {Name: "exchanging_message_from_bls_pubkey", Data: &b.ExchangingMessageFromBlsPubkey}, {Name: "exchanging_message_to_execution_address", Data: &b.ExchangingMessageToExecutionAddress}, {Name: "exchanging_signature", Data: &b.ExchangingSignature}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -171,28 +75,7 @@ func (b *canonicalBeaconBlockBlsToExecutionChangeBatch) Reset() { b.ExchangingMessageFromBlsPubkey.Reset() b.ExchangingMessageToExecutionAddress.Reset() b.ExchangingSignature.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -201,7 +84,7 @@ func (b *canonicalBeaconBlockBlsToExecutionChangeBatch) Snapshot() []map[string] out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 33) + row := make(map[string]any, 12) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -213,48 +96,7 @@ func (b *canonicalBeaconBlockBlsToExecutionChangeBatch) Snapshot() []map[string] row["exchanging_message_from_bls_pubkey"] = b.ExchangingMessageFromBlsPubkey.Row(i) row["exchanging_message_to_execution_address"] = string(b.ExchangingMessageToExecutionAddress.Row(i)) row["exchanging_signature"] = b.ExchangingSignature.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_bls_to_execution_change_test.go b/pkg/consumoor/route/canonical/canonical_beacon_block_bls_to_execution_change_test.go index 53874c06a..248dafd52 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_bls_to_execution_change_test.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_bls_to_execution_change_test.go @@ -28,6 +28,6 @@ func TestSnapshot_canonical_beacon_block_bls_to_execution_change(t *testing.T) { EthV2BeaconBlockBlsToExecutionChange: ðv2.SignedBLSToExecutionChangeV2{}, }, }, 1, map[string]any{ - "meta_client_name": "test-client", + "meta_network_name": "mainnet", }) } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_deposit.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block_deposit.gen.go index ec7c96d58..5b644faf4 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_deposit.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_deposit.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,54 +11,27 @@ import ( const canonicalBeaconBlockDepositTableName route.TableName = "canonical_beacon_block_deposit" type canonicalBeaconBlockDepositBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockVersion proto.ColStr - DepositProof *proto.ColArr[string] - DepositDataPubkey proto.ColStr - DepositDataWithdrawalCredentials route.SafeColFixedStr - DepositDataAmount proto.ColUInt128 - DepositDataSignature proto.ColStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockVersion proto.ColStr + DepositProof *proto.ColArr[string] + DepositDataPubkey proto.ColStr + DepositDataWithdrawalCredentials route.SafeColFixedStr + DepositDataAmount proto.ColUInt128 + DepositDataSignature proto.ColStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlockDepositBatch() *canonicalBeaconBlockDepositBatch { return &canonicalBeaconBlockDepositBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - DepositProof: proto.NewArray[string](new(proto.ColStr)), - DepositDataWithdrawalCredentials: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + DepositProof: proto.NewArray[string](new(proto.ColStr)), + DepositDataWithdrawalCredentials: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), } } @@ -70,57 +41,11 @@ func (b *canonicalBeaconBlockDepositBatch) Rows() int { func (b *canonicalBeaconBlockDepositBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockDepositBatch) Input() proto.Input { @@ -137,28 +62,7 @@ func (b *canonicalBeaconBlockDepositBatch) Input() proto.Input { {Name: "deposit_data_withdrawal_credentials", Data: &b.DepositDataWithdrawalCredentials}, {Name: "deposit_data_amount", Data: &b.DepositDataAmount}, {Name: "deposit_data_signature", Data: &b.DepositDataSignature}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -175,28 +79,7 @@ func (b *canonicalBeaconBlockDepositBatch) Reset() { b.DepositDataWithdrawalCredentials.Reset() b.DepositDataAmount.Reset() b.DepositDataSignature.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -205,7 +88,7 @@ func (b *canonicalBeaconBlockDepositBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 34) + row := make(map[string]any, 13) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -218,48 +101,7 @@ func (b *canonicalBeaconBlockDepositBatch) Snapshot() []map[string]any { row["deposit_data_withdrawal_credentials"] = string(b.DepositDataWithdrawalCredentials.Row(i)) row["deposit_data_amount"] = route.UInt128ToString(b.DepositDataAmount.Row(i)) row["deposit_data_signature"] = b.DepositDataSignature.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_deposit_test.go b/pkg/consumoor/route/canonical/canonical_beacon_block_deposit_test.go index 31a2b6f62..2a9abaa15 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_deposit_test.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_deposit_test.go @@ -28,6 +28,6 @@ func TestSnapshot_canonical_beacon_block_deposit(t *testing.T) { EthV2BeaconBlockDeposit: ðv1.DepositV2{}, }, }, 1, map[string]any{ - "meta_client_name": "test-client", + "meta_network_name": "mainnet", }) } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_execution_transaction.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block_execution_transaction.gen.go index 106e60ce2..fff660838 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_execution_transaction.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_execution_transaction.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,75 +11,48 @@ import ( const canonicalBeaconBlockExecutionTransactionTableName route.TableName = "canonical_beacon_block_execution_transaction" type canonicalBeaconBlockExecutionTransactionBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockVersion proto.ColStr - Position proto.ColUInt32 - Hash route.SafeColFixedStr - From route.SafeColFixedStr - To *proto.ColNullable[[]byte] - Nonce proto.ColUInt64 - GasPrice proto.ColUInt128 - Gas proto.ColUInt64 - GasTipCap *proto.ColNullable[proto.UInt128] - GasFeeCap *proto.ColNullable[proto.UInt128] - Value proto.ColUInt128 - Type proto.ColUInt8 - Size proto.ColUInt32 - CallDataSize proto.ColUInt32 - BlobGas *proto.ColNullable[uint64] - BlobGasFeeCap *proto.ColNullable[proto.UInt128] - BlobHashes *proto.ColArr[string] - BlobSidecarsSize *proto.ColNullable[uint32] - BlobSidecarsEmptySize *proto.ColNullable[uint32] - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockVersion proto.ColStr + Position proto.ColUInt32 + Hash route.SafeColFixedStr + From route.SafeColFixedStr + To *proto.ColNullable[[]byte] + Nonce proto.ColUInt64 + GasPrice proto.ColUInt128 + Gas proto.ColUInt64 + GasTipCap *proto.ColNullable[proto.UInt128] + GasFeeCap *proto.ColNullable[proto.UInt128] + Value proto.ColUInt128 + Type proto.ColUInt8 + Size proto.ColUInt32 + CallDataSize proto.ColUInt32 + BlobGas *proto.ColNullable[uint64] + BlobGasFeeCap *proto.ColNullable[proto.UInt128] + BlobHashes *proto.ColArr[string] + BlobSidecarsSize *proto.ColNullable[uint32] + BlobSidecarsEmptySize *proto.ColNullable[uint32] + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlockExecutionTransactionBatch() *canonicalBeaconBlockExecutionTransactionBatch { return &canonicalBeaconBlockExecutionTransactionBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - Hash: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - From: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(42); return c }(), - To: route.NewNullableFixedStr(42), - GasTipCap: new(proto.ColUInt128).Nullable(), - GasFeeCap: new(proto.ColUInt128).Nullable(), - BlobGas: new(proto.ColUInt64).Nullable(), - BlobGasFeeCap: new(proto.ColUInt128).Nullable(), - BlobHashes: proto.NewArray[string](new(proto.ColStr)), - BlobSidecarsSize: new(proto.ColUInt32).Nullable(), - BlobSidecarsEmptySize: new(proto.ColUInt32).Nullable(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + Hash: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + From: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(42); return c }(), + To: route.NewNullableFixedStr(42), + GasTipCap: new(proto.ColUInt128).Nullable(), + GasFeeCap: new(proto.ColUInt128).Nullable(), + BlobGas: new(proto.ColUInt64).Nullable(), + BlobGasFeeCap: new(proto.ColUInt128).Nullable(), + BlobHashes: proto.NewArray[string](new(proto.ColStr)), + BlobSidecarsSize: new(proto.ColUInt32).Nullable(), + BlobSidecarsEmptySize: new(proto.ColUInt32).Nullable(), } } @@ -91,57 +62,11 @@ func (b *canonicalBeaconBlockExecutionTransactionBatch) Rows() int { func (b *canonicalBeaconBlockExecutionTransactionBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockExecutionTransactionBatch) Input() proto.Input { @@ -171,28 +96,7 @@ func (b *canonicalBeaconBlockExecutionTransactionBatch) Input() proto.Input { {Name: "blob_hashes", Data: b.BlobHashes}, {Name: "blob_sidecars_size", Data: b.BlobSidecarsSize}, {Name: "blob_sidecars_empty_size", Data: b.BlobSidecarsEmptySize}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -222,28 +126,7 @@ func (b *canonicalBeaconBlockExecutionTransactionBatch) Reset() { b.BlobHashes.Reset() b.BlobSidecarsSize.Reset() b.BlobSidecarsEmptySize.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -252,7 +135,7 @@ func (b *canonicalBeaconBlockExecutionTransactionBatch) Snapshot() []map[string] out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 47) + row := make(map[string]any, 26) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -306,48 +189,7 @@ func (b *canonicalBeaconBlockExecutionTransactionBatch) Snapshot() []map[string] } else { row["blob_sidecars_empty_size"] = nil } - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_proposer_slashing.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block_proposer_slashing.gen.go index ac985c017..f23c6f151 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_proposer_slashing.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_proposer_slashing.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,65 +11,38 @@ import ( const canonicalBeaconBlockProposerSlashingTableName route.TableName = "canonical_beacon_block_proposer_slashing" type canonicalBeaconBlockProposerSlashingBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockVersion proto.ColStr - SignedHeader1MessageSlot proto.ColUInt32 - SignedHeader1MessageProposerIndex proto.ColUInt32 - SignedHeader1MessageBodyRoot route.SafeColFixedStr - SignedHeader1MessageParentRoot route.SafeColFixedStr - SignedHeader1MessageStateRoot route.SafeColFixedStr - SignedHeader1Signature proto.ColStr - SignedHeader2MessageSlot proto.ColUInt32 - SignedHeader2MessageProposerIndex proto.ColUInt32 - SignedHeader2MessageBodyRoot route.SafeColFixedStr - SignedHeader2MessageParentRoot route.SafeColFixedStr - SignedHeader2MessageStateRoot route.SafeColFixedStr - SignedHeader2Signature proto.ColStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockVersion proto.ColStr + SignedHeader1MessageSlot proto.ColUInt32 + SignedHeader1MessageProposerIndex proto.ColUInt32 + SignedHeader1MessageBodyRoot route.SafeColFixedStr + SignedHeader1MessageParentRoot route.SafeColFixedStr + SignedHeader1MessageStateRoot route.SafeColFixedStr + SignedHeader1Signature proto.ColStr + SignedHeader2MessageSlot proto.ColUInt32 + SignedHeader2MessageProposerIndex proto.ColUInt32 + SignedHeader2MessageBodyRoot route.SafeColFixedStr + SignedHeader2MessageParentRoot route.SafeColFixedStr + SignedHeader2MessageStateRoot route.SafeColFixedStr + SignedHeader2Signature proto.ColStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlockProposerSlashingBatch() *canonicalBeaconBlockProposerSlashingBatch { return &canonicalBeaconBlockProposerSlashingBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - SignedHeader1MessageBodyRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - SignedHeader1MessageParentRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - SignedHeader1MessageStateRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - SignedHeader2MessageBodyRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - SignedHeader2MessageParentRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - SignedHeader2MessageStateRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + SignedHeader1MessageBodyRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + SignedHeader1MessageParentRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + SignedHeader1MessageStateRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + SignedHeader2MessageBodyRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + SignedHeader2MessageParentRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + SignedHeader2MessageStateRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), } } @@ -81,57 +52,11 @@ func (b *canonicalBeaconBlockProposerSlashingBatch) Rows() int { func (b *canonicalBeaconBlockProposerSlashingBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockProposerSlashingBatch) Input() proto.Input { @@ -155,28 +80,7 @@ func (b *canonicalBeaconBlockProposerSlashingBatch) Input() proto.Input { {Name: "signed_header_2_message_parent_root", Data: &b.SignedHeader2MessageParentRoot}, {Name: "signed_header_2_message_state_root", Data: &b.SignedHeader2MessageStateRoot}, {Name: "signed_header_2_signature", Data: &b.SignedHeader2Signature}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -200,28 +104,7 @@ func (b *canonicalBeaconBlockProposerSlashingBatch) Reset() { b.SignedHeader2MessageParentRoot.Reset() b.SignedHeader2MessageStateRoot.Reset() b.SignedHeader2Signature.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -230,7 +113,7 @@ func (b *canonicalBeaconBlockProposerSlashingBatch) Snapshot() []map[string]any out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 41) + row := make(map[string]any, 20) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -250,48 +133,7 @@ func (b *canonicalBeaconBlockProposerSlashingBatch) Snapshot() []map[string]any row["signed_header_2_message_parent_root"] = string(b.SignedHeader2MessageParentRoot.Row(i)) row["signed_header_2_message_state_root"] = string(b.SignedHeader2MessageStateRoot.Row(i)) row["signed_header_2_signature"] = b.SignedHeader2Signature.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_proposer_slashing_test.go b/pkg/consumoor/route/canonical/canonical_beacon_block_proposer_slashing_test.go index 3217757e2..dd8f84f98 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_proposer_slashing_test.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_proposer_slashing_test.go @@ -28,6 +28,6 @@ func TestSnapshot_canonical_beacon_block_proposer_slashing(t *testing.T) { EthV2BeaconBlockProposerSlashing: ðv1.ProposerSlashingV2{}, }, }, 1, map[string]any{ - "meta_client_name": "test-client", + "meta_network_name": "mainnet", }) } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_sync_aggregate.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block_sync_aggregate.gen.go index 178901322..eaeb0e9cb 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_sync_aggregate.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_sync_aggregate.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,57 +11,30 @@ import ( const canonicalBeaconBlockSyncAggregateTableName route.TableName = "canonical_beacon_block_sync_aggregate" type canonicalBeaconBlockSyncAggregateBatch struct { - UpdatedDateTime proto.ColDateTime - EventDateTime proto.ColDateTime64 - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockVersion proto.ColStr - SyncCommitteePeriod proto.ColUInt64 - SyncCommitteeBits proto.ColStr - SyncCommitteeSignature proto.ColStr - ValidatorsParticipated *proto.ColArr[uint32] - ValidatorsMissed *proto.ColArr[uint32] - ParticipationCount proto.ColUInt16 - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + EventDateTime proto.ColDateTime64 + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockVersion proto.ColStr + SyncCommitteePeriod proto.ColUInt64 + SyncCommitteeBits proto.ColStr + SyncCommitteeSignature proto.ColStr + ValidatorsParticipated *proto.ColArr[uint32] + ValidatorsMissed *proto.ColArr[uint32] + ParticipationCount proto.ColUInt16 + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlockSyncAggregateBatch() *canonicalBeaconBlockSyncAggregateBatch { return &canonicalBeaconBlockSyncAggregateBatch{ - EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - ValidatorsParticipated: proto.NewArray[uint32](new(proto.ColUInt32)), - ValidatorsMissed: proto.NewArray[uint32](new(proto.ColUInt32)), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + ValidatorsParticipated: proto.NewArray[uint32](new(proto.ColUInt32)), + ValidatorsMissed: proto.NewArray[uint32](new(proto.ColUInt32)), } } @@ -73,57 +44,11 @@ func (b *canonicalBeaconBlockSyncAggregateBatch) Rows() int { func (b *canonicalBeaconBlockSyncAggregateBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockSyncAggregateBatch) Input() proto.Input { @@ -142,28 +67,7 @@ func (b *canonicalBeaconBlockSyncAggregateBatch) Input() proto.Input { {Name: "validators_participated", Data: b.ValidatorsParticipated}, {Name: "validators_missed", Data: b.ValidatorsMissed}, {Name: "participation_count", Data: &b.ParticipationCount}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -182,28 +86,7 @@ func (b *canonicalBeaconBlockSyncAggregateBatch) Reset() { b.ValidatorsParticipated.Reset() b.ValidatorsMissed.Reset() b.ParticipationCount.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -212,7 +95,7 @@ func (b *canonicalBeaconBlockSyncAggregateBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 36) + row := make(map[string]any, 15) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -227,48 +110,7 @@ func (b *canonicalBeaconBlockSyncAggregateBatch) Snapshot() []map[string]any { row["validators_participated"] = b.ValidatorsParticipated.Row(i) row["validators_missed"] = b.ValidatorsMissed.Row(i) row["participation_count"] = b.ParticipationCount.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_sync_aggregate_test.go b/pkg/consumoor/route/canonical/canonical_beacon_block_sync_aggregate_test.go index 33f777364..bd4e6ab19 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_sync_aggregate_test.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_sync_aggregate_test.go @@ -22,6 +22,6 @@ func TestSnapshot_canonical_beacon_block_sync_aggregate(t *testing.T) { }, }, }, 1, map[string]any{ - "meta_client_name": "test-client", + "meta_network_name": "mainnet", }) } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_voluntary_exit.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block_voluntary_exit.gen.go index a3e923965..56c22003b 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_voluntary_exit.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_voluntary_exit.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,50 +11,23 @@ import ( const canonicalBeaconBlockVoluntaryExitTableName route.TableName = "canonical_beacon_block_voluntary_exit" type canonicalBeaconBlockVoluntaryExitBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockVersion proto.ColStr - VoluntaryExitMessageEpoch proto.ColUInt32 - VoluntaryExitMessageValidatorIndex proto.ColUInt32 - VoluntaryExitSignature proto.ColStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockVersion proto.ColStr + VoluntaryExitMessageEpoch proto.ColUInt32 + VoluntaryExitMessageValidatorIndex proto.ColUInt32 + VoluntaryExitSignature proto.ColStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlockVoluntaryExitBatch() *canonicalBeaconBlockVoluntaryExitBatch { return &canonicalBeaconBlockVoluntaryExitBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), } } @@ -66,57 +37,11 @@ func (b *canonicalBeaconBlockVoluntaryExitBatch) Rows() int { func (b *canonicalBeaconBlockVoluntaryExitBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockVoluntaryExitBatch) Input() proto.Input { @@ -131,28 +56,7 @@ func (b *canonicalBeaconBlockVoluntaryExitBatch) Input() proto.Input { {Name: "voluntary_exit_message_epoch", Data: &b.VoluntaryExitMessageEpoch}, {Name: "voluntary_exit_message_validator_index", Data: &b.VoluntaryExitMessageValidatorIndex}, {Name: "voluntary_exit_signature", Data: &b.VoluntaryExitSignature}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -167,28 +71,7 @@ func (b *canonicalBeaconBlockVoluntaryExitBatch) Reset() { b.VoluntaryExitMessageEpoch.Reset() b.VoluntaryExitMessageValidatorIndex.Reset() b.VoluntaryExitSignature.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -197,7 +80,7 @@ func (b *canonicalBeaconBlockVoluntaryExitBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 32) + row := make(map[string]any, 11) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -208,48 +91,7 @@ func (b *canonicalBeaconBlockVoluntaryExitBatch) Snapshot() []map[string]any { row["voluntary_exit_message_epoch"] = b.VoluntaryExitMessageEpoch.Row(i) row["voluntary_exit_message_validator_index"] = b.VoluntaryExitMessageValidatorIndex.Row(i) row["voluntary_exit_signature"] = b.VoluntaryExitSignature.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_voluntary_exit_test.go b/pkg/consumoor/route/canonical/canonical_beacon_block_voluntary_exit_test.go index dd1f188ca..4ef814f44 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_voluntary_exit_test.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_voluntary_exit_test.go @@ -28,6 +28,6 @@ func TestSnapshot_canonical_beacon_block_voluntary_exit(t *testing.T) { EthV2BeaconBlockVoluntaryExit: ðv1.SignedVoluntaryExitV2{}, }, }, 1, map[string]any{ - "meta_client_name": "test-client", + "meta_network_name": "mainnet", }) } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_block_withdrawal.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_block_withdrawal.gen.go index 708ff3527..0c97debc4 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_block_withdrawal.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_block_withdrawal.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,52 +11,25 @@ import ( const canonicalBeaconBlockWithdrawalTableName route.TableName = "canonical_beacon_block_withdrawal" type canonicalBeaconBlockWithdrawalBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - BlockRoot route.SafeColFixedStr - BlockVersion proto.ColStr - WithdrawalIndex proto.ColUInt32 - WithdrawalValidatorIndex proto.ColUInt32 - WithdrawalAddress route.SafeColFixedStr - WithdrawalAmount proto.ColUInt128 - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + BlockRoot route.SafeColFixedStr + BlockVersion proto.ColStr + WithdrawalIndex proto.ColUInt32 + WithdrawalValidatorIndex proto.ColUInt32 + WithdrawalAddress route.SafeColFixedStr + WithdrawalAmount proto.ColUInt128 + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconBlockWithdrawalBatch() *canonicalBeaconBlockWithdrawalBatch { return &canonicalBeaconBlockWithdrawalBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - WithdrawalAddress: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(42); return c }(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + WithdrawalAddress: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(42); return c }(), } } @@ -68,57 +39,11 @@ func (b *canonicalBeaconBlockWithdrawalBatch) Rows() int { func (b *canonicalBeaconBlockWithdrawalBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconBlockWithdrawalBatch) Input() proto.Input { @@ -134,28 +59,7 @@ func (b *canonicalBeaconBlockWithdrawalBatch) Input() proto.Input { {Name: "withdrawal_validator_index", Data: &b.WithdrawalValidatorIndex}, {Name: "withdrawal_address", Data: &b.WithdrawalAddress}, {Name: "withdrawal_amount", Data: &b.WithdrawalAmount}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -171,28 +75,7 @@ func (b *canonicalBeaconBlockWithdrawalBatch) Reset() { b.WithdrawalValidatorIndex.Reset() b.WithdrawalAddress.Reset() b.WithdrawalAmount.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -201,7 +84,7 @@ func (b *canonicalBeaconBlockWithdrawalBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 33) + row := make(map[string]any, 12) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -213,48 +96,7 @@ func (b *canonicalBeaconBlockWithdrawalBatch) Snapshot() []map[string]any { row["withdrawal_validator_index"] = b.WithdrawalValidatorIndex.Row(i) row["withdrawal_address"] = string(b.WithdrawalAddress.Row(i)) row["withdrawal_amount"] = route.UInt128ToString(b.WithdrawalAmount.Row(i)) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_committee.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_committee.gen.go index 4033d32e3..89ee8c8cc 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_committee.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_committee.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,47 +11,20 @@ import ( const canonicalBeaconCommitteeTableName route.TableName = "canonical_beacon_committee" type canonicalBeaconCommitteeBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - CommitteeIndex proto.ColStr - Validators *proto.ColArr[uint32] - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + CommitteeIndex proto.ColStr + Validators *proto.ColArr[uint32] + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconCommitteeBatch() *canonicalBeaconCommitteeBatch { return &canonicalBeaconCommitteeBatch{ - Validators: proto.NewArray[uint32](new(proto.ColUInt32)), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + Validators: proto.NewArray[uint32](new(proto.ColUInt32)), } } @@ -63,57 +34,11 @@ func (b *canonicalBeaconCommitteeBatch) Rows() int { func (b *canonicalBeaconCommitteeBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconCommitteeBatch) Input() proto.Input { @@ -125,28 +50,7 @@ func (b *canonicalBeaconCommitteeBatch) Input() proto.Input { {Name: "validators", Data: b.Validators}, {Name: "epoch", Data: &b.Epoch}, {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -158,28 +62,7 @@ func (b *canonicalBeaconCommitteeBatch) Reset() { b.Validators.Reset() b.Epoch.Reset() b.EpochStartDateTime.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -188,7 +71,7 @@ func (b *canonicalBeaconCommitteeBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 29) + row := make(map[string]any, 8) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -196,48 +79,7 @@ func (b *canonicalBeaconCommitteeBatch) Snapshot() []map[string]any { row["validators"] = b.Validators.Row(i) row["epoch"] = b.Epoch.Row(i) row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_elaborated_attestation.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_elaborated_attestation.gen.go index 3a70daf19..6179d9c9e 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_elaborated_attestation.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_elaborated_attestation.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,64 +11,37 @@ import ( const canonicalBeaconElaboratedAttestationTableName route.TableName = "canonical_beacon_elaborated_attestation" type canonicalBeaconElaboratedAttestationBatch struct { - UpdatedDateTime proto.ColDateTime - BlockSlot proto.ColUInt32 - BlockSlotStartDateTime proto.ColDateTime - BlockEpoch proto.ColUInt32 - BlockEpochStartDateTime proto.ColDateTime - PositionInBlock proto.ColUInt32 - BlockRoot route.SafeColFixedStr - Validators *proto.ColArr[uint32] - CommitteeIndex proto.ColStr - BeaconBlockRoot route.SafeColFixedStr - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - SourceEpoch proto.ColUInt32 - SourceEpochStartDateTime proto.ColDateTime - SourceRoot route.SafeColFixedStr - TargetEpoch proto.ColUInt32 - TargetEpochStartDateTime proto.ColDateTime - TargetRoot route.SafeColFixedStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + BlockSlot proto.ColUInt32 + BlockSlotStartDateTime proto.ColDateTime + BlockEpoch proto.ColUInt32 + BlockEpochStartDateTime proto.ColDateTime + PositionInBlock proto.ColUInt32 + BlockRoot route.SafeColFixedStr + Validators *proto.ColArr[uint32] + CommitteeIndex proto.ColStr + BeaconBlockRoot route.SafeColFixedStr + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + SourceEpoch proto.ColUInt32 + SourceEpochStartDateTime proto.ColDateTime + SourceRoot route.SafeColFixedStr + TargetEpoch proto.ColUInt32 + TargetEpochStartDateTime proto.ColDateTime + TargetRoot route.SafeColFixedStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconElaboratedAttestationBatch() *canonicalBeaconElaboratedAttestationBatch { return &canonicalBeaconElaboratedAttestationBatch{ - BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - Validators: proto.NewArray[uint32](new(proto.ColUInt32)), - BeaconBlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - SourceRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - TargetRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + BlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + Validators: proto.NewArray[uint32](new(proto.ColUInt32)), + BeaconBlockRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + SourceRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), + TargetRoot: func() route.SafeColFixedStr { var c route.SafeColFixedStr; c.SetSize(66); return c }(), } } @@ -80,57 +51,11 @@ func (b *canonicalBeaconElaboratedAttestationBatch) Rows() int { func (b *canonicalBeaconElaboratedAttestationBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconElaboratedAttestationBatch) Input() proto.Input { @@ -155,28 +80,7 @@ func (b *canonicalBeaconElaboratedAttestationBatch) Input() proto.Input { {Name: "target_epoch", Data: &b.TargetEpoch}, {Name: "target_epoch_start_date_time", Data: &b.TargetEpochStartDateTime}, {Name: "target_root", Data: &b.TargetRoot}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -201,28 +105,7 @@ func (b *canonicalBeaconElaboratedAttestationBatch) Reset() { b.TargetEpoch.Reset() b.TargetEpochStartDateTime.Reset() b.TargetRoot.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -231,7 +114,7 @@ func (b *canonicalBeaconElaboratedAttestationBatch) Snapshot() []map[string]any out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 42) + row := make(map[string]any, 21) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["block_slot"] = b.BlockSlot.Row(i) row["block_slot_start_date_time"] = b.BlockSlotStartDateTime.Row(i).Unix() @@ -252,48 +135,7 @@ func (b *canonicalBeaconElaboratedAttestationBatch) Snapshot() []map[string]any row["target_epoch"] = b.TargetEpoch.Row(i) row["target_epoch_start_date_time"] = b.TargetEpochStartDateTime.Row(i).Unix() row["target_root"] = string(b.TargetRoot.Row(i)) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_elaborated_attestation_test.go b/pkg/consumoor/route/canonical/canonical_beacon_elaborated_attestation_test.go index 8ed755183..f8e90a752 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_elaborated_attestation_test.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_elaborated_attestation_test.go @@ -32,6 +32,6 @@ func TestSnapshot_canonical_beacon_elaborated_attestation(t *testing.T) { }, }, }, 1, map[string]any{ - "meta_client_name": "test-client", + "meta_network_name": "mainnet", }) } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_proposer_duty.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_proposer_duty.gen.go index 783479989..49410d7a5 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_proposer_duty.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_proposer_duty.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,47 +11,19 @@ import ( const canonicalBeaconProposerDutyTableName route.TableName = "canonical_beacon_proposer_duty" type canonicalBeaconProposerDutyBatch struct { - UpdatedDateTime proto.ColDateTime - Slot proto.ColUInt32 - SlotStartDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - ProposerValidatorIndex proto.ColUInt32 - ProposerPubkey proto.ColStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Slot proto.ColUInt32 + SlotStartDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + ProposerValidatorIndex proto.ColUInt32 + ProposerPubkey proto.ColStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconProposerDutyBatch() *canonicalBeaconProposerDutyBatch { - return &canonicalBeaconProposerDutyBatch{ - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), - } + return &canonicalBeaconProposerDutyBatch{} } func (b *canonicalBeaconProposerDutyBatch) Rows() int { @@ -62,57 +32,11 @@ func (b *canonicalBeaconProposerDutyBatch) Rows() int { func (b *canonicalBeaconProposerDutyBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconProposerDutyBatch) Input() proto.Input { @@ -124,28 +48,7 @@ func (b *canonicalBeaconProposerDutyBatch) Input() proto.Input { {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "proposer_validator_index", Data: &b.ProposerValidatorIndex}, {Name: "proposer_pubkey", Data: &b.ProposerPubkey}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -157,28 +60,7 @@ func (b *canonicalBeaconProposerDutyBatch) Reset() { b.EpochStartDateTime.Reset() b.ProposerValidatorIndex.Reset() b.ProposerPubkey.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -187,7 +69,7 @@ func (b *canonicalBeaconProposerDutyBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 29) + row := make(map[string]any, 8) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -195,48 +77,7 @@ func (b *canonicalBeaconProposerDutyBatch) Snapshot() []map[string]any { row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["proposer_validator_index"] = b.ProposerValidatorIndex.Row(i) row["proposer_pubkey"] = b.ProposerPubkey.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_sync_committee.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_sync_committee.gen.go index 12023f4a4..4f5324105 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_sync_committee.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_sync_committee.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,47 +11,20 @@ import ( const canonicalBeaconSyncCommitteeTableName route.TableName = "canonical_beacon_sync_committee" type canonicalBeaconSyncCommitteeBatch struct { - UpdatedDateTime proto.ColDateTime - EventDateTime proto.ColDateTime64 - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - SyncCommitteePeriod proto.ColUInt64 - ValidatorAggregates *proto.ColArr[[]uint32] - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + EventDateTime proto.ColDateTime64 + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + SyncCommitteePeriod proto.ColUInt64 + ValidatorAggregates *proto.ColArr[[]uint32] + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconSyncCommitteeBatch() *canonicalBeaconSyncCommitteeBatch { return &canonicalBeaconSyncCommitteeBatch{ - EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), - ValidatorAggregates: proto.NewArray[[]uint32](&proto.ColArr[uint32]{Data: new(proto.ColUInt32)}), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), + ValidatorAggregates: proto.NewArray[[]uint32](&proto.ColArr[uint32]{Data: new(proto.ColUInt32)}), } } @@ -63,57 +34,11 @@ func (b *canonicalBeaconSyncCommitteeBatch) Rows() int { func (b *canonicalBeaconSyncCommitteeBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconSyncCommitteeBatch) Input() proto.Input { @@ -124,28 +49,7 @@ func (b *canonicalBeaconSyncCommitteeBatch) Input() proto.Input { {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "sync_committee_period", Data: &b.SyncCommitteePeriod}, {Name: "validator_aggregates", Data: b.ValidatorAggregates}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -156,28 +60,7 @@ func (b *canonicalBeaconSyncCommitteeBatch) Reset() { b.EpochStartDateTime.Reset() b.SyncCommitteePeriod.Reset() b.ValidatorAggregates.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -186,55 +69,14 @@ func (b *canonicalBeaconSyncCommitteeBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 28) + row := make(map[string]any, 7) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["epoch"] = b.Epoch.Row(i) row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["sync_committee_period"] = b.SyncCommitteePeriod.Row(i) row["validator_aggregates"] = b.ValidatorAggregates.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_sync_committee_test.go b/pkg/consumoor/route/canonical/canonical_beacon_sync_committee_test.go index 494753358..5f4402029 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_sync_committee_test.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_sync_committee_test.go @@ -37,6 +37,6 @@ func TestSnapshot_canonical_beacon_sync_committee(t *testing.T) { }, }, }, 1, map[string]any{ - "meta_client_name": "test-client", + "meta_network_name": "mainnet", }) } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_validators.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_validators.gen.go index 406f9d923..f7866f56d 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_validators.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_validators.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,57 +11,30 @@ import ( const canonicalBeaconValidatorsTableName route.TableName = "canonical_beacon_validators" type canonicalBeaconValidatorsBatch struct { - UpdatedDateTime proto.ColDateTime - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - Index proto.ColUInt32 - Balance *proto.ColNullable[uint64] - Status proto.ColStr - EffectiveBalance *proto.ColNullable[uint64] - Slashed proto.ColBool - ActivationEpoch *proto.ColNullable[uint64] - ActivationEligibilityEpoch *proto.ColNullable[uint64] - ExitEpoch *proto.ColNullable[uint64] - WithdrawableEpoch *proto.ColNullable[uint64] - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + Index proto.ColUInt32 + Balance *proto.ColNullable[uint64] + Status proto.ColStr + EffectiveBalance *proto.ColNullable[uint64] + Slashed proto.ColBool + ActivationEpoch *proto.ColNullable[uint64] + ActivationEligibilityEpoch *proto.ColNullable[uint64] + ExitEpoch *proto.ColNullable[uint64] + WithdrawableEpoch *proto.ColNullable[uint64] + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconValidatorsBatch() *canonicalBeaconValidatorsBatch { return &canonicalBeaconValidatorsBatch{ - Balance: new(proto.ColUInt64).Nullable(), - EffectiveBalance: new(proto.ColUInt64).Nullable(), - ActivationEpoch: new(proto.ColUInt64).Nullable(), - ActivationEligibilityEpoch: new(proto.ColUInt64).Nullable(), - ExitEpoch: new(proto.ColUInt64).Nullable(), - WithdrawableEpoch: new(proto.ColUInt64).Nullable(), - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), + Balance: new(proto.ColUInt64).Nullable(), + EffectiveBalance: new(proto.ColUInt64).Nullable(), + ActivationEpoch: new(proto.ColUInt64).Nullable(), + ActivationEligibilityEpoch: new(proto.ColUInt64).Nullable(), + ExitEpoch: new(proto.ColUInt64).Nullable(), + WithdrawableEpoch: new(proto.ColUInt64).Nullable(), } } @@ -73,57 +44,11 @@ func (b *canonicalBeaconValidatorsBatch) Rows() int { func (b *canonicalBeaconValidatorsBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconValidatorsBatch) Input() proto.Input { @@ -140,28 +65,7 @@ func (b *canonicalBeaconValidatorsBatch) Input() proto.Input { {Name: "activation_eligibility_epoch", Data: b.ActivationEligibilityEpoch}, {Name: "exit_epoch", Data: b.ExitEpoch}, {Name: "withdrawable_epoch", Data: b.WithdrawableEpoch}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -178,28 +82,7 @@ func (b *canonicalBeaconValidatorsBatch) Reset() { b.ActivationEligibilityEpoch.Reset() b.ExitEpoch.Reset() b.WithdrawableEpoch.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -208,7 +91,7 @@ func (b *canonicalBeaconValidatorsBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 34) + row := make(map[string]any, 13) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["epoch"] = b.Epoch.Row(i) row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() @@ -245,48 +128,7 @@ func (b *canonicalBeaconValidatorsBatch) Snapshot() []map[string]any { } else { row["withdrawable_epoch"] = nil } - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_validators_pubkeys.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_validators_pubkeys.gen.go index 0fad0203f..11ddeb7d9 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_validators_pubkeys.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_validators_pubkeys.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,46 +11,17 @@ import ( const canonicalBeaconValidatorsPubkeysTableName route.TableName = "canonical_beacon_validators_pubkeys" type canonicalBeaconValidatorsPubkeysBatch struct { - UpdatedDateTime proto.ColDateTime - Version proto.ColUInt32 - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - Index proto.ColUInt32 - Pubkey proto.ColStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + Index proto.ColUInt32 + Pubkey proto.ColStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconValidatorsPubkeysBatch() *canonicalBeaconValidatorsPubkeysBatch { - return &canonicalBeaconValidatorsPubkeysBatch{ - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), - } + return &canonicalBeaconValidatorsPubkeysBatch{} } func (b *canonicalBeaconValidatorsPubkeysBatch) Rows() int { @@ -61,121 +30,31 @@ func (b *canonicalBeaconValidatorsPubkeysBatch) Rows() int { func (b *canonicalBeaconValidatorsPubkeysBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconValidatorsPubkeysBatch) Input() proto.Input { return proto.Input{ {Name: "updated_date_time", Data: &b.UpdatedDateTime}, - {Name: "version", Data: &b.Version}, {Name: "epoch", Data: &b.Epoch}, {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "index", Data: &b.Index}, {Name: "pubkey", Data: &b.Pubkey}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } func (b *canonicalBeaconValidatorsPubkeysBatch) Reset() { b.UpdatedDateTime.Reset() - b.Version.Reset() b.Epoch.Reset() b.EpochStartDateTime.Reset() b.Index.Reset() b.Pubkey.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -184,55 +63,13 @@ func (b *canonicalBeaconValidatorsPubkeysBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 28) + row := make(map[string]any, 6) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() - row["version"] = b.Version.Row(i) row["epoch"] = b.Epoch.Row(i) row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["index"] = b.Index.Row(i) row["pubkey"] = b.Pubkey.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_validators_pubkeys.go b/pkg/consumoor/route/canonical/canonical_beacon_validators_pubkeys.go index a661e345b..185407d95 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_validators_pubkeys.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_validators_pubkeys.go @@ -74,7 +74,6 @@ func (b *canonicalBeaconValidatorsPubkeysBatch) FlattenTo(event *xatu.DecoratedE } b.UpdatedDateTime.Append(now) - b.Version.Append(uint32(4294967295 - epochStartTime.Unix())) //nolint:gosec // inverse timestamp for ReplacingMergeTree dedup b.Epoch.Append(epoch) b.EpochStartDateTime.Append(epochStartTime) diff --git a/pkg/consumoor/route/canonical/canonical_beacon_validators_withdrawal_credentials.gen.go b/pkg/consumoor/route/canonical/canonical_beacon_validators_withdrawal_credentials.gen.go index 49b12616c..6c424ac5d 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_validators_withdrawal_credentials.gen.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_validators_withdrawal_credentials.gen.go @@ -3,8 +3,6 @@ package canonical import ( - "net" - "github.com/ClickHouse/ch-go/proto" "github.com/ethpandaops/xatu/pkg/consumoor/route" "github.com/ethpandaops/xatu/pkg/proto/xatu" @@ -13,46 +11,17 @@ import ( const canonicalBeaconValidatorsWithdrawalCredentialsTableName route.TableName = "canonical_beacon_validators_withdrawal_credentials" type canonicalBeaconValidatorsWithdrawalCredentialsBatch struct { - UpdatedDateTime proto.ColDateTime - Version proto.ColUInt32 - Epoch proto.ColUInt32 - EpochStartDateTime proto.ColDateTime - Index proto.ColUInt32 - WithdrawalCredentials proto.ColStr - MetaClientName proto.ColStr - MetaClientID proto.ColStr - MetaClientVersion proto.ColStr - MetaClientImplementation proto.ColStr - MetaClientOS proto.ColStr - MetaClientIP *proto.ColNullable[proto.IPv6] - MetaClientGeoCity proto.ColStr - MetaClientGeoCountry proto.ColStr - MetaClientGeoCountryCode proto.ColStr - MetaClientGeoContinentCode proto.ColStr - MetaClientGeoLongitude *proto.ColNullable[float64] - MetaClientGeoLatitude *proto.ColNullable[float64] - MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] - MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 - MetaNetworkName proto.ColStr - MetaConsensusVersion proto.ColStr - MetaConsensusVersionMajor proto.ColStr - MetaConsensusVersionMinor proto.ColStr - MetaConsensusVersionPatch proto.ColStr - MetaConsensusImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] - rows int + UpdatedDateTime proto.ColDateTime + Epoch proto.ColUInt32 + EpochStartDateTime proto.ColDateTime + Index proto.ColUInt32 + WithdrawalCredentials proto.ColStr + MetaNetworkName proto.ColStr + rows int } func newcanonicalBeaconValidatorsWithdrawalCredentialsBatch() *canonicalBeaconValidatorsWithdrawalCredentialsBatch { - return &canonicalBeaconValidatorsWithdrawalCredentialsBatch{ - MetaClientIP: new(proto.ColIPv6).Nullable(), - MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), - MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), - MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), - } + return &canonicalBeaconValidatorsWithdrawalCredentialsBatch{} } func (b *canonicalBeaconValidatorsWithdrawalCredentialsBatch) Rows() int { @@ -61,121 +30,31 @@ func (b *canonicalBeaconValidatorsWithdrawalCredentialsBatch) Rows() int { func (b *canonicalBeaconValidatorsWithdrawalCredentialsBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaClientName.Append("") - b.MetaClientID.Append("") - b.MetaClientVersion.Append("") - b.MetaClientImplementation.Append("") - b.MetaClientOS.Append("") - b.MetaClientIP.Append(proto.Nullable[proto.IPv6]{}) - b.MetaClientGeoCity.Append("") - b.MetaClientGeoCountry.Append("") - b.MetaClientGeoCountryCode.Append("") - b.MetaClientGeoContinentCode.Append("") - b.MetaClientGeoLongitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaConsensusVersion.Append("") - b.MetaConsensusVersionMajor.Append("") - b.MetaConsensusVersionMinor.Append("") - b.MetaConsensusVersionPatch.Append("") - b.MetaConsensusImplementation.Append("") - b.MetaLabels.Append(nil) return } - b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) - b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) - b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) - b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) - b.MetaClientIP.Append(proto.NewNullable[proto.IPv6](route.NormalizeIPToIPv6(event.GetMeta().GetServer().GetClient().GetIP()))) - b.MetaClientGeoCity.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCity()) - b.MetaClientGeoCountry.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountry()) - b.MetaClientGeoCountryCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetCountryCode()) - b.MetaClientGeoContinentCode.Append(event.GetMeta().GetServer().GetClient().GetGeo().GetContinentCode()) - b.MetaClientGeoLongitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLongitude())) - b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) - b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) - b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - b.MetaConsensusVersion.Append(route.NormalizeConsensusVersion(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMajor.Append(route.ConsensusVersionMajor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionMinor.Append(route.ConsensusVersionMinor(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusVersionPatch.Append(route.ConsensusVersionPatch(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetVersion())) - b.MetaConsensusImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetConsensus().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *canonicalBeaconValidatorsWithdrawalCredentialsBatch) Input() proto.Input { return proto.Input{ {Name: "updated_date_time", Data: &b.UpdatedDateTime}, - {Name: "version", Data: &b.Version}, {Name: "epoch", Data: &b.Epoch}, {Name: "epoch_start_date_time", Data: &b.EpochStartDateTime}, {Name: "index", Data: &b.Index}, {Name: "withdrawal_credentials", Data: &b.WithdrawalCredentials}, - {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, - {Name: "meta_client_version", Data: &b.MetaClientVersion}, - {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, - {Name: "meta_client_os", Data: &b.MetaClientOS}, - {Name: "meta_client_ip", Data: b.MetaClientIP}, - {Name: "meta_client_geo_city", Data: &b.MetaClientGeoCity}, - {Name: "meta_client_geo_country", Data: &b.MetaClientGeoCountry}, - {Name: "meta_client_geo_country_code", Data: &b.MetaClientGeoCountryCode}, - {Name: "meta_client_geo_continent_code", Data: &b.MetaClientGeoContinentCode}, - {Name: "meta_client_geo_longitude", Data: b.MetaClientGeoLongitude}, - {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, - {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, - {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_consensus_version", Data: &b.MetaConsensusVersion}, - {Name: "meta_consensus_version_major", Data: &b.MetaConsensusVersionMajor}, - {Name: "meta_consensus_version_minor", Data: &b.MetaConsensusVersionMinor}, - {Name: "meta_consensus_version_patch", Data: &b.MetaConsensusVersionPatch}, - {Name: "meta_consensus_implementation", Data: &b.MetaConsensusImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } func (b *canonicalBeaconValidatorsWithdrawalCredentialsBatch) Reset() { b.UpdatedDateTime.Reset() - b.Version.Reset() b.Epoch.Reset() b.EpochStartDateTime.Reset() b.Index.Reset() b.WithdrawalCredentials.Reset() - b.MetaClientName.Reset() - b.MetaClientID.Reset() - b.MetaClientVersion.Reset() - b.MetaClientImplementation.Reset() - b.MetaClientOS.Reset() - b.MetaClientIP.Reset() - b.MetaClientGeoCity.Reset() - b.MetaClientGeoCountry.Reset() - b.MetaClientGeoCountryCode.Reset() - b.MetaClientGeoContinentCode.Reset() - b.MetaClientGeoLongitude.Reset() - b.MetaClientGeoLatitude.Reset() - b.MetaClientGeoAutonomousSystemNumber.Reset() - b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaConsensusVersion.Reset() - b.MetaConsensusVersionMajor.Reset() - b.MetaConsensusVersionMinor.Reset() - b.MetaConsensusVersionPatch.Reset() - b.MetaConsensusImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -184,55 +63,13 @@ func (b *canonicalBeaconValidatorsWithdrawalCredentialsBatch) Snapshot() []map[s out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 28) + row := make(map[string]any, 6) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() - row["version"] = b.Version.Row(i) row["epoch"] = b.Epoch.Row(i) row["epoch_start_date_time"] = b.EpochStartDateTime.Row(i).Unix() row["index"] = b.Index.Row(i) row["withdrawal_credentials"] = b.WithdrawalCredentials.Row(i) - row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) - row["meta_client_version"] = b.MetaClientVersion.Row(i) - row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) - row["meta_client_os"] = b.MetaClientOS.Row(i) - if v := b.MetaClientIP.Row(i); v.Set { - row["meta_client_ip"] = net.IP(v.Value[:]).String() - } else { - row["meta_client_ip"] = nil - } - row["meta_client_geo_city"] = b.MetaClientGeoCity.Row(i) - row["meta_client_geo_country"] = b.MetaClientGeoCountry.Row(i) - row["meta_client_geo_country_code"] = b.MetaClientGeoCountryCode.Row(i) - row["meta_client_geo_continent_code"] = b.MetaClientGeoContinentCode.Row(i) - if v := b.MetaClientGeoLongitude.Row(i); v.Set { - row["meta_client_geo_longitude"] = v.Value - } else { - row["meta_client_geo_longitude"] = nil - } - if v := b.MetaClientGeoLatitude.Row(i); v.Set { - row["meta_client_geo_latitude"] = v.Value - } else { - row["meta_client_geo_latitude"] = nil - } - if v := b.MetaClientGeoAutonomousSystemNumber.Row(i); v.Set { - row["meta_client_geo_autonomous_system_number"] = v.Value - } else { - row["meta_client_geo_autonomous_system_number"] = nil - } - if v := b.MetaClientGeoAutonomousSystemOrganization.Row(i); v.Set { - row["meta_client_geo_autonomous_system_organization"] = v.Value - } else { - row["meta_client_geo_autonomous_system_organization"] = nil - } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_consensus_version"] = b.MetaConsensusVersion.Row(i) - row["meta_consensus_version_major"] = b.MetaConsensusVersionMajor.Row(i) - row["meta_consensus_version_minor"] = b.MetaConsensusVersionMinor.Row(i) - row["meta_consensus_version_patch"] = b.MetaConsensusVersionPatch.Row(i) - row["meta_consensus_implementation"] = b.MetaConsensusImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/canonical/canonical_beacon_validators_withdrawal_credentials.go b/pkg/consumoor/route/canonical/canonical_beacon_validators_withdrawal_credentials.go index 08a5ec23e..7472fce5c 100644 --- a/pkg/consumoor/route/canonical/canonical_beacon_validators_withdrawal_credentials.go +++ b/pkg/consumoor/route/canonical/canonical_beacon_validators_withdrawal_credentials.go @@ -74,7 +74,6 @@ func (b *canonicalBeaconValidatorsWithdrawalCredentialsBatch) FlattenTo(event *x } b.UpdatedDateTime.Append(now) - b.Version.Append(uint32(4294967295 - epochStartTime.Unix())) //nolint:gosec // inverse timestamp for ReplacingMergeTree dedup b.Epoch.Append(epoch) b.EpochStartDateTime.Append(epochStartTime) diff --git a/pkg/consumoor/route/execution/consensus_engine_api_get_blobs.gen.go b/pkg/consumoor/route/execution/consensus_engine_api_get_blobs.gen.go index b09a4013e..354af6702 100644 --- a/pkg/consumoor/route/execution/consensus_engine_api_get_blobs.gen.go +++ b/pkg/consumoor/route/execution/consensus_engine_api_get_blobs.gen.go @@ -35,7 +35,6 @@ type consensusEngineApiGetBlobsBatch struct { MetaExecutionVersionMinor proto.ColStr MetaExecutionVersionPatch proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -48,7 +47,6 @@ type consensusEngineApiGetBlobsBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -85,7 +83,6 @@ func (b *consensusEngineApiGetBlobsBatch) appendMetadata(event *xatu.DecoratedEv b.MetaExecutionVersionMinor.Append("") b.MetaExecutionVersionPatch.Append("") b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -98,7 +95,6 @@ func (b *consensusEngineApiGetBlobsBatch) appendMetadata(event *xatu.DecoratedEv b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } @@ -109,7 +105,6 @@ func (b *consensusEngineApiGetBlobsBatch) appendMetadata(event *xatu.DecoratedEv b.MetaExecutionVersionMinor.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionMinor()) b.MetaExecutionVersionPatch.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionPatch()) b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -122,7 +117,6 @@ func (b *consensusEngineApiGetBlobsBatch) appendMetadata(event *xatu.DecoratedEv b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -150,7 +144,6 @@ func (b *consensusEngineApiGetBlobsBatch) Input() proto.Input { {Name: "meta_execution_version_minor", Data: &b.MetaExecutionVersionMinor}, {Name: "meta_execution_version_patch", Data: &b.MetaExecutionVersionPatch}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -163,7 +156,6 @@ func (b *consensusEngineApiGetBlobsBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -191,7 +183,6 @@ func (b *consensusEngineApiGetBlobsBatch) Reset() { b.MetaExecutionVersionMinor.Reset() b.MetaExecutionVersionPatch.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -204,7 +195,6 @@ func (b *consensusEngineApiGetBlobsBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -214,7 +204,7 @@ func (b *consensusEngineApiGetBlobsBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 37) + row := make(map[string]any, 35) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["requested_date_time"] = b.RequestedDateTime.Row(i).UnixMilli() @@ -241,7 +231,6 @@ func (b *consensusEngineApiGetBlobsBatch) Snapshot() []map[string]any { row["meta_execution_version_minor"] = b.MetaExecutionVersionMinor.Row(i) row["meta_execution_version_patch"] = b.MetaExecutionVersionPatch.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -274,7 +263,6 @@ func (b *consensusEngineApiGetBlobsBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/execution/consensus_engine_api_new_payload.gen.go b/pkg/consumoor/route/execution/consensus_engine_api_new_payload.gen.go index 93c631e67..2e8cb1918 100644 --- a/pkg/consumoor/route/execution/consensus_engine_api_new_payload.gen.go +++ b/pkg/consumoor/route/execution/consensus_engine_api_new_payload.gen.go @@ -41,7 +41,6 @@ type consensusEngineApiNewPayloadBatch struct { MetaExecutionVersionMinor proto.ColStr MetaExecutionVersionPatch proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -54,7 +53,6 @@ type consensusEngineApiNewPayloadBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -89,7 +87,6 @@ func (b *consensusEngineApiNewPayloadBatch) appendMetadata(event *xatu.Decorated b.MetaExecutionVersionMinor.Append("") b.MetaExecutionVersionPatch.Append("") b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -102,7 +99,6 @@ func (b *consensusEngineApiNewPayloadBatch) appendMetadata(event *xatu.Decorated b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } @@ -113,7 +109,6 @@ func (b *consensusEngineApiNewPayloadBatch) appendMetadata(event *xatu.Decorated b.MetaExecutionVersionMinor.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionMinor()) b.MetaExecutionVersionPatch.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionPatch()) b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -126,7 +121,6 @@ func (b *consensusEngineApiNewPayloadBatch) appendMetadata(event *xatu.Decorated b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -160,7 +154,6 @@ func (b *consensusEngineApiNewPayloadBatch) Input() proto.Input { {Name: "meta_execution_version_minor", Data: &b.MetaExecutionVersionMinor}, {Name: "meta_execution_version_patch", Data: &b.MetaExecutionVersionPatch}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -173,7 +166,6 @@ func (b *consensusEngineApiNewPayloadBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -207,7 +199,6 @@ func (b *consensusEngineApiNewPayloadBatch) Reset() { b.MetaExecutionVersionMinor.Reset() b.MetaExecutionVersionPatch.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -220,7 +211,6 @@ func (b *consensusEngineApiNewPayloadBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -230,7 +220,7 @@ func (b *consensusEngineApiNewPayloadBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 43) + row := make(map[string]any, 41) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["requested_date_time"] = b.RequestedDateTime.Row(i).UnixMilli() @@ -267,7 +257,6 @@ func (b *consensusEngineApiNewPayloadBatch) Snapshot() []map[string]any { row["meta_execution_version_minor"] = b.MetaExecutionVersionMinor.Row(i) row["meta_execution_version_patch"] = b.MetaExecutionVersionPatch.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -300,7 +289,6 @@ func (b *consensusEngineApiNewPayloadBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/execution/execution_block_metrics.gen.go b/pkg/consumoor/route/execution/execution_block_metrics.gen.go index a7a049546..ff711065f 100644 --- a/pkg/consumoor/route/execution/execution_block_metrics.gen.go +++ b/pkg/consumoor/route/execution/execution_block_metrics.gen.go @@ -48,7 +48,6 @@ type executionBlockMetricsBatch struct { CodeCacheHitBytes proto.ColInt64 CodeCacheMissBytes proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -61,9 +60,7 @@ type executionBlockMetricsBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -76,7 +73,6 @@ func newexecutionBlockMetricsBatch() *executionBlockMetricsBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -87,7 +83,6 @@ func (b *executionBlockMetricsBatch) Rows() int { func (b *executionBlockMetricsBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -100,14 +95,11 @@ func (b *executionBlockMetricsBatch) appendMetadata(event *xatu.DecoratedEvent) b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -120,13 +112,7 @@ func (b *executionBlockMetricsBatch) appendMetadata(event *xatu.DecoratedEvent) b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *executionBlockMetricsBatch) Input() proto.Input { @@ -166,7 +152,6 @@ func (b *executionBlockMetricsBatch) Input() proto.Input { {Name: "code_cache_hit_bytes", Data: &b.CodeCacheHitBytes}, {Name: "code_cache_miss_bytes", Data: &b.CodeCacheMissBytes}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -179,9 +164,7 @@ func (b *executionBlockMetricsBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -221,7 +204,6 @@ func (b *executionBlockMetricsBatch) Reset() { b.CodeCacheHitBytes.Reset() b.CodeCacheMissBytes.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -234,9 +216,7 @@ func (b *executionBlockMetricsBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -245,7 +225,7 @@ func (b *executionBlockMetricsBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 51) + row := make(map[string]any, 48) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["source"] = b.Source.Row(i) @@ -281,7 +261,6 @@ func (b *executionBlockMetricsBatch) Snapshot() []map[string]any { row["code_cache_hit_bytes"] = b.CodeCacheHitBytes.Row(i) row["code_cache_miss_bytes"] = b.CodeCacheMissBytes.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -314,9 +293,7 @@ func (b *executionBlockMetricsBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/execution/execution_engine_get_blobs.gen.go b/pkg/consumoor/route/execution/execution_engine_get_blobs.gen.go index 4762cd1ca..223f0fcec 100644 --- a/pkg/consumoor/route/execution/execution_engine_get_blobs.gen.go +++ b/pkg/consumoor/route/execution/execution_engine_get_blobs.gen.go @@ -16,7 +16,7 @@ type executionEngineGetBlobsBatch struct { UpdatedDateTime proto.ColDateTime EventDateTime proto.ColDateTime64 RequestedDateTime proto.ColDateTime64 - DurationMs proto.ColUInt32 + DurationMs proto.ColUInt64 Source proto.ColStr RequestedCount proto.ColUInt32 VersionedHashes *proto.ColArr[[]byte] @@ -31,7 +31,6 @@ type executionEngineGetBlobsBatch struct { MetaExecutionVersionMinor proto.ColStr MetaExecutionVersionPatch proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -44,7 +43,6 @@ type executionEngineGetBlobsBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -80,7 +78,6 @@ func (b *executionEngineGetBlobsBatch) appendMetadata(event *xatu.DecoratedEvent b.MetaExecutionVersionMinor.Append("") b.MetaExecutionVersionPatch.Append("") b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -93,7 +90,6 @@ func (b *executionEngineGetBlobsBatch) appendMetadata(event *xatu.DecoratedEvent b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } @@ -104,7 +100,6 @@ func (b *executionEngineGetBlobsBatch) appendMetadata(event *xatu.DecoratedEvent b.MetaExecutionVersionMinor.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionMinor()) b.MetaExecutionVersionPatch.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionPatch()) b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -117,7 +112,6 @@ func (b *executionEngineGetBlobsBatch) appendMetadata(event *xatu.DecoratedEvent b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -141,7 +135,6 @@ func (b *executionEngineGetBlobsBatch) Input() proto.Input { {Name: "meta_execution_version_minor", Data: &b.MetaExecutionVersionMinor}, {Name: "meta_execution_version_patch", Data: &b.MetaExecutionVersionPatch}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -154,7 +147,6 @@ func (b *executionEngineGetBlobsBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -178,7 +170,6 @@ func (b *executionEngineGetBlobsBatch) Reset() { b.MetaExecutionVersionMinor.Reset() b.MetaExecutionVersionPatch.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -191,7 +182,6 @@ func (b *executionEngineGetBlobsBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -201,7 +191,7 @@ func (b *executionEngineGetBlobsBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 33) + row := make(map[string]any, 31) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["requested_date_time"] = b.RequestedDateTime.Row(i).UnixMilli() @@ -224,7 +214,6 @@ func (b *executionEngineGetBlobsBatch) Snapshot() []map[string]any { row["meta_execution_version_minor"] = b.MetaExecutionVersionMinor.Row(i) row["meta_execution_version_patch"] = b.MetaExecutionVersionPatch.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -257,7 +246,6 @@ func (b *executionEngineGetBlobsBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/execution/execution_engine_get_blobs.go b/pkg/consumoor/route/execution/execution_engine_get_blobs.go index 57b3d94b6..f8e1de953 100644 --- a/pkg/consumoor/route/execution/execution_engine_get_blobs.go +++ b/pkg/consumoor/route/execution/execution_engine_get_blobs.go @@ -90,7 +90,7 @@ func (b *executionEngineGetBlobsBatch) appendPayload(event *xatu.DecoratedEvent) } if durationMs := payload.GetDurationMs(); durationMs != nil { - b.DurationMs.Append(uint32(durationMs.GetValue())) //nolint:gosec // duration fits uint32 + b.DurationMs.Append(uint64(durationMs.GetValue())) } else { b.DurationMs.Append(0) } diff --git a/pkg/consumoor/route/execution/execution_engine_new_payload.gen.go b/pkg/consumoor/route/execution/execution_engine_new_payload.gen.go index da77efca1..a1d15bb90 100644 --- a/pkg/consumoor/route/execution/execution_engine_new_payload.gen.go +++ b/pkg/consumoor/route/execution/execution_engine_new_payload.gen.go @@ -16,7 +16,7 @@ type executionEngineNewPayloadBatch struct { UpdatedDateTime proto.ColDateTime EventDateTime proto.ColDateTime64 RequestedDateTime proto.ColDateTime64 - DurationMs proto.ColUInt32 + DurationMs proto.ColUInt64 Source proto.ColStr BlockNumber proto.ColUInt64 BlockHash route.SafeColFixedStr @@ -35,7 +35,6 @@ type executionEngineNewPayloadBatch struct { MetaExecutionVersionMinor proto.ColStr MetaExecutionVersionPatch proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -48,7 +47,6 @@ type executionEngineNewPayloadBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -81,7 +79,6 @@ func (b *executionEngineNewPayloadBatch) appendMetadata(event *xatu.DecoratedEve b.MetaExecutionVersionMinor.Append("") b.MetaExecutionVersionPatch.Append("") b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -94,7 +91,6 @@ func (b *executionEngineNewPayloadBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } @@ -105,7 +101,6 @@ func (b *executionEngineNewPayloadBatch) appendMetadata(event *xatu.DecoratedEve b.MetaExecutionVersionMinor.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionMinor()) b.MetaExecutionVersionPatch.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionPatch()) b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -118,7 +113,6 @@ func (b *executionEngineNewPayloadBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -146,7 +140,6 @@ func (b *executionEngineNewPayloadBatch) Input() proto.Input { {Name: "meta_execution_version_minor", Data: &b.MetaExecutionVersionMinor}, {Name: "meta_execution_version_patch", Data: &b.MetaExecutionVersionPatch}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -159,7 +152,6 @@ func (b *executionEngineNewPayloadBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -187,7 +179,6 @@ func (b *executionEngineNewPayloadBatch) Reset() { b.MetaExecutionVersionMinor.Reset() b.MetaExecutionVersionPatch.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -200,7 +191,6 @@ func (b *executionEngineNewPayloadBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -210,7 +200,7 @@ func (b *executionEngineNewPayloadBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 37) + row := make(map[string]any, 35) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["requested_date_time"] = b.RequestedDateTime.Row(i).UnixMilli() @@ -241,7 +231,6 @@ func (b *executionEngineNewPayloadBatch) Snapshot() []map[string]any { row["meta_execution_version_minor"] = b.MetaExecutionVersionMinor.Row(i) row["meta_execution_version_patch"] = b.MetaExecutionVersionPatch.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -274,7 +263,6 @@ func (b *executionEngineNewPayloadBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/execution/execution_engine_new_payload.go b/pkg/consumoor/route/execution/execution_engine_new_payload.go index 829178e6a..83114b0e8 100644 --- a/pkg/consumoor/route/execution/execution_engine_new_payload.go +++ b/pkg/consumoor/route/execution/execution_engine_new_payload.go @@ -102,7 +102,7 @@ func (b *executionEngineNewPayloadBatch) appendPayload(event *xatu.DecoratedEven } if durationMs := payload.GetDurationMs(); durationMs != nil { - b.DurationMs.Append(uint32(durationMs.GetValue())) //nolint:gosec // duration fits uint32 + b.DurationMs.Append(uint64(durationMs.GetValue())) } else { b.DurationMs.Append(0) } diff --git a/pkg/consumoor/route/execution/execution_state_size.gen.go b/pkg/consumoor/route/execution/execution_state_size.gen.go index bfcbdd73e..f1aff03cd 100644 --- a/pkg/consumoor/route/execution/execution_state_size.gen.go +++ b/pkg/consumoor/route/execution/execution_state_size.gen.go @@ -28,7 +28,6 @@ type executionStateSizeBatch struct { StorageTrienodes proto.ColUInt64 StorageTrienodeBytes proto.ColUInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -41,14 +40,12 @@ type executionStateSizeBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaExecutionVersion proto.ColStr MetaExecutionVersionMajor proto.ColStr MetaExecutionVersionMinor proto.ColStr MetaExecutionVersionPatch proto.ColStr MetaExecutionImplementation proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -61,7 +58,6 @@ func newexecutionStateSizeBatch() *executionStateSizeBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -72,7 +68,6 @@ func (b *executionStateSizeBatch) Rows() int { func (b *executionStateSizeBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -85,19 +80,16 @@ func (b *executionStateSizeBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaExecutionVersion.Append("") b.MetaExecutionVersionMajor.Append("") b.MetaExecutionVersionMinor.Append("") b.MetaExecutionVersionPatch.Append("") b.MetaExecutionImplementation.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -110,18 +102,12 @@ func (b *executionStateSizeBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaExecutionVersion.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersion()) b.MetaExecutionVersionMajor.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionMajor()) b.MetaExecutionVersionMinor.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionMinor()) b.MetaExecutionVersionPatch.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetVersionPatch()) b.MetaExecutionImplementation.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetImplementation()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *executionStateSizeBatch) Input() proto.Input { @@ -141,7 +127,6 @@ func (b *executionStateSizeBatch) Input() proto.Input { {Name: "storage_trienodes", Data: &b.StorageTrienodes}, {Name: "storage_trienode_bytes", Data: &b.StorageTrienodeBytes}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -154,14 +139,12 @@ func (b *executionStateSizeBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_execution_version", Data: &b.MetaExecutionVersion}, {Name: "meta_execution_version_major", Data: &b.MetaExecutionVersionMajor}, {Name: "meta_execution_version_minor", Data: &b.MetaExecutionVersionMinor}, {Name: "meta_execution_version_patch", Data: &b.MetaExecutionVersionPatch}, {Name: "meta_execution_implementation", Data: &b.MetaExecutionImplementation}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -181,7 +164,6 @@ func (b *executionStateSizeBatch) Reset() { b.StorageTrienodes.Reset() b.StorageTrienodeBytes.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -194,14 +176,12 @@ func (b *executionStateSizeBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaExecutionVersion.Reset() b.MetaExecutionVersionMajor.Reset() b.MetaExecutionVersionMinor.Reset() b.MetaExecutionVersionPatch.Reset() b.MetaExecutionImplementation.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -210,7 +190,7 @@ func (b *executionStateSizeBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 36) + row := make(map[string]any, 33) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["block_number"] = b.BlockNumber.Row(i) @@ -226,7 +206,6 @@ func (b *executionStateSizeBatch) Snapshot() []map[string]any { row["storage_trienodes"] = b.StorageTrienodes.Row(i) row["storage_trienode_bytes"] = b.StorageTrienodeBytes.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -259,14 +238,12 @@ func (b *executionStateSizeBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_execution_version"] = b.MetaExecutionVersion.Row(i) row["meta_execution_version_major"] = b.MetaExecutionVersionMajor.Row(i) row["meta_execution_version_minor"] = b.MetaExecutionVersionMinor.Row(i) row["meta_execution_version_patch"] = b.MetaExecutionVersionPatch.Row(i) row["meta_execution_implementation"] = b.MetaExecutionImplementation.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/execution/mempool_transaction.gen.go b/pkg/consumoor/route/execution/mempool_transaction.gen.go index 2ed3095a7..df457ac25 100644 --- a/pkg/consumoor/route/execution/mempool_transaction.gen.go +++ b/pkg/consumoor/route/execution/mempool_transaction.gen.go @@ -33,7 +33,6 @@ type mempoolTransactionBatch struct { BlobSidecarsSize *proto.ColNullable[uint32] BlobSidecarsEmptySize *proto.ColNullable[uint32] MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -46,11 +45,9 @@ type mempoolTransactionBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr MetaExecutionForkIDHash proto.ColStr MetaExecutionForkIDNext proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -73,7 +70,6 @@ func newmempoolTransactionBatch() *mempoolTransactionBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -84,7 +80,6 @@ func (b *mempoolTransactionBatch) Rows() int { func (b *mempoolTransactionBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -97,16 +92,13 @@ func (b *mempoolTransactionBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") b.MetaExecutionForkIDHash.Append("") b.MetaExecutionForkIDNext.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -119,15 +111,9 @@ func (b *mempoolTransactionBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) b.MetaExecutionForkIDHash.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetForkId().GetHash()) b.MetaExecutionForkIDNext.Append(event.GetMeta().GetClient().GetEthereum().GetExecution().GetForkId().GetNext()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *mempoolTransactionBatch) Input() proto.Input { @@ -152,7 +138,6 @@ func (b *mempoolTransactionBatch) Input() proto.Input { {Name: "blob_sidecars_size", Data: b.BlobSidecarsSize}, {Name: "blob_sidecars_empty_size", Data: b.BlobSidecarsEmptySize}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -165,11 +150,9 @@ func (b *mempoolTransactionBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, {Name: "meta_execution_fork_id_hash", Data: &b.MetaExecutionForkIDHash}, {Name: "meta_execution_fork_id_next", Data: &b.MetaExecutionForkIDNext}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -194,7 +177,6 @@ func (b *mempoolTransactionBatch) Reset() { b.BlobSidecarsSize.Reset() b.BlobSidecarsEmptySize.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -207,11 +189,9 @@ func (b *mempoolTransactionBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.MetaExecutionForkIDHash.Reset() b.MetaExecutionForkIDNext.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -220,7 +200,7 @@ func (b *mempoolTransactionBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 38) + row := make(map[string]any, 35) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["hash"] = string(b.Hash.Row(i)) @@ -273,7 +253,6 @@ func (b *mempoolTransactionBatch) Snapshot() []map[string]any { row["blob_sidecars_empty_size"] = nil } row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -306,11 +285,9 @@ func (b *mempoolTransactionBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) row["meta_execution_fork_id_hash"] = b.MetaExecutionForkIDHash.Row(i) row["meta_execution_fork_id_next"] = b.MetaExecutionForkIDNext.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_add_peer.gen.go b/pkg/consumoor/route/libp2p/libp2p_add_peer.gen.go index 2f8052ade..78221fc9d 100644 --- a/pkg/consumoor/route/libp2p/libp2p_add_peer.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_add_peer.gen.go @@ -18,7 +18,6 @@ type libp2pAddPeerBatch struct { PeerIDUniqueKey proto.ColInt64 Protocol proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -31,7 +30,6 @@ type libp2pAddPeerBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -54,7 +52,6 @@ func (b *libp2pAddPeerBatch) Rows() int { func (b *libp2pAddPeerBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -67,13 +64,11 @@ func (b *libp2pAddPeerBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -86,7 +81,6 @@ func (b *libp2pAddPeerBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -97,7 +91,6 @@ func (b *libp2pAddPeerBatch) Input() proto.Input { {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "protocol", Data: &b.Protocol}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -110,7 +103,6 @@ func (b *libp2pAddPeerBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -121,7 +113,6 @@ func (b *libp2pAddPeerBatch) Reset() { b.PeerIDUniqueKey.Reset() b.Protocol.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -134,7 +125,6 @@ func (b *libp2pAddPeerBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -144,13 +134,12 @@ func (b *libp2pAddPeerBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 20) + row := make(map[string]any, 18) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["protocol"] = b.Protocol.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -183,7 +172,6 @@ func (b *libp2pAddPeerBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_connected.gen.go b/pkg/consumoor/route/libp2p/libp2p_connected.gen.go index b677c09b1..68edffb42 100644 --- a/pkg/consumoor/route/libp2p/libp2p_connected.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_connected.gen.go @@ -18,7 +18,7 @@ type libp2pConnectedBatch struct { RemotePeerIDUniqueKey proto.ColInt64 RemoteProtocol proto.ColStr RemoteTransportProtocol proto.ColStr - RemotePort proto.ColUInt16 + RemotePort *proto.ColNullable[uint16] RemoteIP *proto.ColNullable[proto.IPv6] RemoteGeoCity proto.ColStr RemoteGeoCountry proto.ColStr @@ -38,7 +38,6 @@ type libp2pConnectedBatch struct { Opened proto.ColDateTime Transient proto.ColBool MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -51,7 +50,6 @@ type libp2pConnectedBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -59,6 +57,7 @@ type libp2pConnectedBatch struct { func newlibp2pConnectedBatch() *libp2pConnectedBatch { return &libp2pConnectedBatch{ EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), + RemotePort: new(proto.ColUInt16).Nullable(), RemoteIP: new(proto.ColIPv6).Nullable(), RemoteGeoLongitude: new(proto.ColFloat64).Nullable(), RemoteGeoLatitude: new(proto.ColFloat64).Nullable(), @@ -79,7 +78,6 @@ func (b *libp2pConnectedBatch) Rows() int { func (b *libp2pConnectedBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -92,13 +90,11 @@ func (b *libp2pConnectedBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -111,7 +107,6 @@ func (b *libp2pConnectedBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -122,7 +117,7 @@ func (b *libp2pConnectedBatch) Input() proto.Input { {Name: "remote_peer_id_unique_key", Data: &b.RemotePeerIDUniqueKey}, {Name: "remote_protocol", Data: &b.RemoteProtocol}, {Name: "remote_transport_protocol", Data: &b.RemoteTransportProtocol}, - {Name: "remote_port", Data: &b.RemotePort}, + {Name: "remote_port", Data: b.RemotePort}, {Name: "remote_ip", Data: b.RemoteIP}, {Name: "remote_geo_city", Data: &b.RemoteGeoCity}, {Name: "remote_geo_country", Data: &b.RemoteGeoCountry}, @@ -142,7 +137,6 @@ func (b *libp2pConnectedBatch) Input() proto.Input { {Name: "opened", Data: &b.Opened}, {Name: "transient", Data: &b.Transient}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -155,7 +149,6 @@ func (b *libp2pConnectedBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -186,7 +179,6 @@ func (b *libp2pConnectedBatch) Reset() { b.Opened.Reset() b.Transient.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -199,7 +191,6 @@ func (b *libp2pConnectedBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -209,13 +200,17 @@ func (b *libp2pConnectedBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 40) + row := make(map[string]any, 38) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["remote_peer_id_unique_key"] = b.RemotePeerIDUniqueKey.Row(i) row["remote_protocol"] = b.RemoteProtocol.Row(i) row["remote_transport_protocol"] = b.RemoteTransportProtocol.Row(i) - row["remote_port"] = b.RemotePort.Row(i) + if v := b.RemotePort.Row(i); v.Set { + row["remote_port"] = v.Value + } else { + row["remote_port"] = nil + } if v := b.RemoteIP.Row(i); v.Set { row["remote_ip"] = net.IP(v.Value[:]).String() } else { @@ -255,7 +250,6 @@ func (b *libp2pConnectedBatch) Snapshot() []map[string]any { row["opened"] = b.Opened.Row(i).Unix() row["transient"] = b.Transient.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -288,7 +282,6 @@ func (b *libp2pConnectedBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_connected.go b/pkg/consumoor/route/libp2p/libp2p_connected.go index b9e60c98d..e634559c4 100644 --- a/pkg/consumoor/route/libp2p/libp2p_connected.go +++ b/pkg/consumoor/route/libp2p/libp2p_connected.go @@ -101,15 +101,15 @@ func (b *libp2pConnectedBatch) appendPayload( b.RemoteTransportProtocol.Append(addr.Transport) if addr.Port > 0 { - b.RemotePort.Append(uint16(addr.Port)) //nolint:gosec // port fits uint16 + b.RemotePort.Append(chProto.NewNullable[uint16](uint16(addr.Port))) //nolint:gosec // port fits uint16 } else { - b.RemotePort.Append(0) + b.RemotePort.Append(chProto.Nullable[uint16]{}) } } else { b.RemoteProtocol.Append("") b.RemoteIP.Append(chProto.Nullable[chProto.IPv6]{}) b.RemoteTransportProtocol.Append("") - b.RemotePort.Append(0) + b.RemotePort.Append(chProto.Nullable[uint16]{}) } // Parse agent version fields. diff --git a/pkg/consumoor/route/libp2p/libp2p_deliver_message.gen.go b/pkg/consumoor/route/libp2p/libp2p_deliver_message.gen.go index a761ba3e0..61593b17c 100644 --- a/pkg/consumoor/route/libp2p/libp2p_deliver_message.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_deliver_message.gen.go @@ -25,7 +25,6 @@ type libp2pDeliverMessageBatch struct { MessageID proto.ColStr MessageSize proto.ColUInt32 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -38,7 +37,6 @@ type libp2pDeliverMessageBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -61,7 +59,6 @@ func (b *libp2pDeliverMessageBatch) Rows() int { func (b *libp2pDeliverMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -74,13 +71,11 @@ func (b *libp2pDeliverMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -93,7 +88,6 @@ func (b *libp2pDeliverMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -111,7 +105,6 @@ func (b *libp2pDeliverMessageBatch) Input() proto.Input { {Name: "message_id", Data: &b.MessageID}, {Name: "message_size", Data: &b.MessageSize}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -124,7 +117,6 @@ func (b *libp2pDeliverMessageBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -142,7 +134,6 @@ func (b *libp2pDeliverMessageBatch) Reset() { b.MessageID.Reset() b.MessageSize.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -155,7 +146,6 @@ func (b *libp2pDeliverMessageBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -165,7 +155,7 @@ func (b *libp2pDeliverMessageBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 27) + row := make(map[string]any, 25) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["topic_layer"] = b.TopicLayer.Row(i) @@ -178,7 +168,6 @@ func (b *libp2pDeliverMessageBatch) Snapshot() []map[string]any { row["message_id"] = b.MessageID.Row(i) row["message_size"] = b.MessageSize.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -211,7 +200,6 @@ func (b *libp2pDeliverMessageBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_disconnected.gen.go b/pkg/consumoor/route/libp2p/libp2p_disconnected.gen.go index 28413184b..ce2b9a3bd 100644 --- a/pkg/consumoor/route/libp2p/libp2p_disconnected.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_disconnected.gen.go @@ -18,7 +18,7 @@ type libp2pDisconnectedBatch struct { RemotePeerIDUniqueKey proto.ColInt64 RemoteProtocol proto.ColStr RemoteTransportProtocol proto.ColStr - RemotePort proto.ColUInt16 + RemotePort *proto.ColNullable[uint16] RemoteIP *proto.ColNullable[proto.IPv6] RemoteGeoCity proto.ColStr RemoteGeoCountry proto.ColStr @@ -38,7 +38,6 @@ type libp2pDisconnectedBatch struct { Opened proto.ColDateTime Transient proto.ColBool MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -51,7 +50,6 @@ type libp2pDisconnectedBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -59,6 +57,7 @@ type libp2pDisconnectedBatch struct { func newlibp2pDisconnectedBatch() *libp2pDisconnectedBatch { return &libp2pDisconnectedBatch{ EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), + RemotePort: new(proto.ColUInt16).Nullable(), RemoteIP: new(proto.ColIPv6).Nullable(), RemoteGeoLongitude: new(proto.ColFloat64).Nullable(), RemoteGeoLatitude: new(proto.ColFloat64).Nullable(), @@ -79,7 +78,6 @@ func (b *libp2pDisconnectedBatch) Rows() int { func (b *libp2pDisconnectedBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -92,13 +90,11 @@ func (b *libp2pDisconnectedBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -111,7 +107,6 @@ func (b *libp2pDisconnectedBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -122,7 +117,7 @@ func (b *libp2pDisconnectedBatch) Input() proto.Input { {Name: "remote_peer_id_unique_key", Data: &b.RemotePeerIDUniqueKey}, {Name: "remote_protocol", Data: &b.RemoteProtocol}, {Name: "remote_transport_protocol", Data: &b.RemoteTransportProtocol}, - {Name: "remote_port", Data: &b.RemotePort}, + {Name: "remote_port", Data: b.RemotePort}, {Name: "remote_ip", Data: b.RemoteIP}, {Name: "remote_geo_city", Data: &b.RemoteGeoCity}, {Name: "remote_geo_country", Data: &b.RemoteGeoCountry}, @@ -142,7 +137,6 @@ func (b *libp2pDisconnectedBatch) Input() proto.Input { {Name: "opened", Data: &b.Opened}, {Name: "transient", Data: &b.Transient}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -155,7 +149,6 @@ func (b *libp2pDisconnectedBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -186,7 +179,6 @@ func (b *libp2pDisconnectedBatch) Reset() { b.Opened.Reset() b.Transient.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -199,7 +191,6 @@ func (b *libp2pDisconnectedBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -209,13 +200,17 @@ func (b *libp2pDisconnectedBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 40) + row := make(map[string]any, 38) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["remote_peer_id_unique_key"] = b.RemotePeerIDUniqueKey.Row(i) row["remote_protocol"] = b.RemoteProtocol.Row(i) row["remote_transport_protocol"] = b.RemoteTransportProtocol.Row(i) - row["remote_port"] = b.RemotePort.Row(i) + if v := b.RemotePort.Row(i); v.Set { + row["remote_port"] = v.Value + } else { + row["remote_port"] = nil + } if v := b.RemoteIP.Row(i); v.Set { row["remote_ip"] = net.IP(v.Value[:]).String() } else { @@ -255,7 +250,6 @@ func (b *libp2pDisconnectedBatch) Snapshot() []map[string]any { row["opened"] = b.Opened.Row(i).Unix() row["transient"] = b.Transient.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -288,7 +282,6 @@ func (b *libp2pDisconnectedBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_disconnected.go b/pkg/consumoor/route/libp2p/libp2p_disconnected.go index 472ab31f0..08cabf670 100644 --- a/pkg/consumoor/route/libp2p/libp2p_disconnected.go +++ b/pkg/consumoor/route/libp2p/libp2p_disconnected.go @@ -101,15 +101,15 @@ func (b *libp2pDisconnectedBatch) appendPayload( b.RemoteTransportProtocol.Append(addr.Transport) if addr.Port > 0 { - b.RemotePort.Append(uint16(addr.Port)) //nolint:gosec // port fits uint16 + b.RemotePort.Append(chProto.NewNullable[uint16](uint16(addr.Port))) //nolint:gosec // port fits uint16 } else { - b.RemotePort.Append(0) + b.RemotePort.Append(chProto.Nullable[uint16]{}) } } else { b.RemoteProtocol.Append("") b.RemoteIP.Append(chProto.Nullable[chProto.IPv6]{}) b.RemoteTransportProtocol.Append("") - b.RemotePort.Append(0) + b.RemotePort.Append(chProto.Nullable[uint16]{}) } // Parse agent version fields. diff --git a/pkg/consumoor/route/libp2p/libp2p_drop_rpc.gen.go b/pkg/consumoor/route/libp2p/libp2p_drop_rpc.gen.go index 89f5a2838..e1aaf4f14 100644 --- a/pkg/consumoor/route/libp2p/libp2p_drop_rpc.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_drop_rpc.gen.go @@ -18,7 +18,6 @@ type libp2pDropRpcBatch struct { EventDateTime proto.ColDateTime64 PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -31,7 +30,6 @@ type libp2pDropRpcBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -54,7 +52,6 @@ func (b *libp2pDropRpcBatch) Rows() int { func (b *libp2pDropRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -67,13 +64,11 @@ func (b *libp2pDropRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -86,7 +81,6 @@ func (b *libp2pDropRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -97,7 +91,6 @@ func (b *libp2pDropRpcBatch) Input() proto.Input { {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -110,7 +103,6 @@ func (b *libp2pDropRpcBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -121,7 +113,6 @@ func (b *libp2pDropRpcBatch) Reset() { b.EventDateTime.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -134,7 +125,6 @@ func (b *libp2pDropRpcBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -144,13 +134,12 @@ func (b *libp2pDropRpcBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 20) + row := make(map[string]any, 18) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -183,7 +172,6 @@ func (b *libp2pDropRpcBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_duplicate_message.gen.go b/pkg/consumoor/route/libp2p/libp2p_duplicate_message.gen.go index 095c5b6ae..38cb92f80 100644 --- a/pkg/consumoor/route/libp2p/libp2p_duplicate_message.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_duplicate_message.gen.go @@ -25,7 +25,6 @@ type libp2pDuplicateMessageBatch struct { MessageID proto.ColStr MessageSize proto.ColUInt32 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -38,7 +37,6 @@ type libp2pDuplicateMessageBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -61,7 +59,6 @@ func (b *libp2pDuplicateMessageBatch) Rows() int { func (b *libp2pDuplicateMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -74,13 +71,11 @@ func (b *libp2pDuplicateMessageBatch) appendMetadata(event *xatu.DecoratedEvent) b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -93,7 +88,6 @@ func (b *libp2pDuplicateMessageBatch) appendMetadata(event *xatu.DecoratedEvent) b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -111,7 +105,6 @@ func (b *libp2pDuplicateMessageBatch) Input() proto.Input { {Name: "message_id", Data: &b.MessageID}, {Name: "message_size", Data: &b.MessageSize}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -124,7 +117,6 @@ func (b *libp2pDuplicateMessageBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -142,7 +134,6 @@ func (b *libp2pDuplicateMessageBatch) Reset() { b.MessageID.Reset() b.MessageSize.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -155,7 +146,6 @@ func (b *libp2pDuplicateMessageBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -165,7 +155,7 @@ func (b *libp2pDuplicateMessageBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 27) + row := make(map[string]any, 25) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["topic_layer"] = b.TopicLayer.Row(i) @@ -178,7 +168,6 @@ func (b *libp2pDuplicateMessageBatch) Snapshot() []map[string]any { row["message_id"] = b.MessageID.Row(i) row["message_size"] = b.MessageSize.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -211,7 +200,6 @@ func (b *libp2pDuplicateMessageBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_aggregate_and_proof.gen.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_aggregate_and_proof.gen.go index a2a080932..cef5c8194 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_aggregate_and_proof.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_aggregate_and_proof.gen.go @@ -14,7 +14,6 @@ const libp2pGossipsubAggregateAndProofTableName route.TableName = "libp2p_gossip type libp2pGossipsubAggregateAndProofBatch struct { UpdatedDateTime proto.ColDateTime - Version proto.ColUInt32 EventDateTime proto.ColDateTime64 Slot proto.ColUInt32 SlotStartDateTime proto.ColDateTime @@ -41,7 +40,6 @@ type libp2pGossipsubAggregateAndProofBatch struct { TargetEpoch proto.ColUInt32 TargetRoot route.SafeColFixedStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -54,7 +52,6 @@ type libp2pGossipsubAggregateAndProofBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -80,7 +77,6 @@ func (b *libp2pGossipsubAggregateAndProofBatch) Rows() int { func (b *libp2pGossipsubAggregateAndProofBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -93,13 +89,11 @@ func (b *libp2pGossipsubAggregateAndProofBatch) appendMetadata(event *xatu.Decor b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -112,14 +106,12 @@ func (b *libp2pGossipsubAggregateAndProofBatch) appendMetadata(event *xatu.Decor b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } func (b *libp2pGossipsubAggregateAndProofBatch) Input() proto.Input { return proto.Input{ {Name: "updated_date_time", Data: &b.UpdatedDateTime}, - {Name: "version", Data: &b.Version}, {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "slot", Data: &b.Slot}, {Name: "slot_start_date_time", Data: &b.SlotStartDateTime}, @@ -146,7 +138,6 @@ func (b *libp2pGossipsubAggregateAndProofBatch) Input() proto.Input { {Name: "target_epoch", Data: &b.TargetEpoch}, {Name: "target_root", Data: &b.TargetRoot}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -159,14 +150,12 @@ func (b *libp2pGossipsubAggregateAndProofBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } func (b *libp2pGossipsubAggregateAndProofBatch) Reset() { b.UpdatedDateTime.Reset() - b.Version.Reset() b.EventDateTime.Reset() b.Slot.Reset() b.SlotStartDateTime.Reset() @@ -193,7 +182,6 @@ func (b *libp2pGossipsubAggregateAndProofBatch) Reset() { b.TargetEpoch.Reset() b.TargetRoot.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -206,7 +194,6 @@ func (b *libp2pGossipsubAggregateAndProofBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -216,9 +203,8 @@ func (b *libp2pGossipsubAggregateAndProofBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 43) + row := make(map[string]any, 40) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() - row["version"] = b.Version.Row(i) row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -245,7 +231,6 @@ func (b *libp2pGossipsubAggregateAndProofBatch) Snapshot() []map[string]any { row["target_epoch"] = b.TargetEpoch.Row(i) row["target_root"] = string(b.TargetRoot.Row(i)) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -278,7 +263,6 @@ func (b *libp2pGossipsubAggregateAndProofBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_aggregate_and_proof.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_aggregate_and_proof.go index 02db7e037..777738c96 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_aggregate_and_proof.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_aggregate_and_proof.go @@ -187,7 +187,7 @@ func (b *libp2pGossipsubAggregateAndProofBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.AggregatorIndex.Append(0) b.MessageID.Append("") b.MessageSize.Append(0) @@ -211,7 +211,7 @@ func (b *libp2pGossipsubAggregateAndProofBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.AggregatorIndex.Append(0) b.MessageID.Append("") b.MessageSize.Append(0) @@ -225,8 +225,6 @@ func (b *libp2pGossipsubAggregateAndProofBatch) appendClientAdditionalData( } // Extract slot/epoch/wallclock/propagation fields. - var propagationSlotStartDiff uint32 - setGossipsubSlotEpochFields(additional, func(f gossipsubSlotEpochResult) { b.Slot.Append(f.Slot) b.SlotStartDateTime.Append(time.Unix(f.SlotStartDateTime, 0)) @@ -237,12 +235,8 @@ func (b *libp2pGossipsubAggregateAndProofBatch) appendClientAdditionalData( b.WallclockEpoch.Append(f.WallclockEpoch) b.WallclockEpochStartDateTime.Append(time.Unix(f.WallclockEpochStartDateTime, 0)) b.PropagationSlotStartDiff.Append(f.PropagationSlotStartDiff) - propagationSlotStartDiff = f.PropagationSlotStartDiff }) - // Compute version for ReplacingMergeTree dedup. - b.Version.Append(4294967295 - propagationSlotStartDiff) - if aggIdx := additional.GetAggregatorIndex(); aggIdx != nil { b.AggregatorIndex.Append(uint32(aggIdx.GetValue())) } else { diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_attestation.gen.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_attestation.gen.go index df584e6a7..b376ff7d6 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_attestation.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_attestation.gen.go @@ -14,7 +14,6 @@ const libp2pGossipsubBeaconAttestationTableName route.TableName = "libp2p_gossip type libp2pGossipsubBeaconAttestationBatch struct { UpdatedDateTime proto.ColDateTime - Version proto.ColUInt32 EventDateTime proto.ColDateTime64 Slot proto.ColUInt32 SlotStartDateTime proto.ColDateTime @@ -44,7 +43,6 @@ type libp2pGossipsubBeaconAttestationBatch struct { TargetEpochStartDateTime proto.ColDateTime TargetRoot route.SafeColFixedStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -57,7 +55,6 @@ type libp2pGossipsubBeaconAttestationBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -84,7 +81,6 @@ func (b *libp2pGossipsubBeaconAttestationBatch) Rows() int { func (b *libp2pGossipsubBeaconAttestationBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -97,13 +93,11 @@ func (b *libp2pGossipsubBeaconAttestationBatch) appendMetadata(event *xatu.Decor b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -116,14 +110,12 @@ func (b *libp2pGossipsubBeaconAttestationBatch) appendMetadata(event *xatu.Decor b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } func (b *libp2pGossipsubBeaconAttestationBatch) Input() proto.Input { return proto.Input{ {Name: "updated_date_time", Data: &b.UpdatedDateTime}, - {Name: "version", Data: &b.Version}, {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "slot", Data: &b.Slot}, {Name: "slot_start_date_time", Data: &b.SlotStartDateTime}, @@ -153,7 +145,6 @@ func (b *libp2pGossipsubBeaconAttestationBatch) Input() proto.Input { {Name: "target_epoch_start_date_time", Data: &b.TargetEpochStartDateTime}, {Name: "target_root", Data: &b.TargetRoot}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -166,14 +157,12 @@ func (b *libp2pGossipsubBeaconAttestationBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } func (b *libp2pGossipsubBeaconAttestationBatch) Reset() { b.UpdatedDateTime.Reset() - b.Version.Reset() b.EventDateTime.Reset() b.Slot.Reset() b.SlotStartDateTime.Reset() @@ -203,7 +192,6 @@ func (b *libp2pGossipsubBeaconAttestationBatch) Reset() { b.TargetEpochStartDateTime.Reset() b.TargetRoot.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -216,7 +204,6 @@ func (b *libp2pGossipsubBeaconAttestationBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -226,9 +213,8 @@ func (b *libp2pGossipsubBeaconAttestationBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 46) + row := make(map[string]any, 43) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() - row["version"] = b.Version.Row(i) row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -262,7 +248,6 @@ func (b *libp2pGossipsubBeaconAttestationBatch) Snapshot() []map[string]any { row["target_epoch_start_date_time"] = b.TargetEpochStartDateTime.Row(i).Unix() row["target_root"] = string(b.TargetRoot.Row(i)) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -295,7 +280,6 @@ func (b *libp2pGossipsubBeaconAttestationBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_attestation.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_attestation.go index 27ea397e0..c5a413594 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_attestation.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_attestation.go @@ -151,7 +151,7 @@ func (b *libp2pGossipsubBeaconAttestationBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.SourceEpochStartDateTime.Append(time.Time{}) b.TargetEpochStartDateTime.Append(time.Time{}) b.AttestingValidatorCommitteeIndex.Append("") @@ -178,7 +178,7 @@ func (b *libp2pGossipsubBeaconAttestationBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.SourceEpochStartDateTime.Append(time.Time{}) b.TargetEpochStartDateTime.Append(time.Time{}) b.AttestingValidatorCommitteeIndex.Append("") @@ -195,8 +195,6 @@ func (b *libp2pGossipsubBeaconAttestationBatch) appendClientAdditionalData( } // Extract slot/epoch/wallclock/propagation fields. - var propagationSlotStartDiff uint32 - setGossipsubSlotEpochFields(additional, func(f gossipsubSlotEpochResult) { b.Slot.Append(f.Slot) b.SlotStartDateTime.Append(time.Unix(f.SlotStartDateTime, 0)) @@ -207,12 +205,8 @@ func (b *libp2pGossipsubBeaconAttestationBatch) appendClientAdditionalData( b.WallclockEpoch.Append(f.WallclockEpoch) b.WallclockEpochStartDateTime.Append(time.Unix(f.WallclockEpochStartDateTime, 0)) b.PropagationSlotStartDiff.Append(f.PropagationSlotStartDiff) - propagationSlotStartDiff = f.PropagationSlotStartDiff }) - // Compute version for ReplacingMergeTree dedup. - b.Version.Append(4294967295 - propagationSlotStartDiff) - // Extract source/target epoch datetime from additional data. if source := additional.GetSource(); source != nil { if epoch := source.GetEpoch(); epoch != nil { diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_block.gen.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_block.gen.go index 03f19172f..2ea23a821 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_block.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_block.gen.go @@ -14,7 +14,6 @@ const libp2pGossipsubBeaconBlockTableName route.TableName = "libp2p_gossipsub_be type libp2pGossipsubBeaconBlockBatch struct { UpdatedDateTime proto.ColDateTime - Version proto.ColUInt32 EventDateTime proto.ColDateTime64 Slot proto.ColUInt32 SlotStartDateTime proto.ColDateTime @@ -35,7 +34,6 @@ type libp2pGossipsubBeaconBlockBatch struct { TopicName proto.ColStr TopicEncoding proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -48,7 +46,6 @@ type libp2pGossipsubBeaconBlockBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -72,7 +69,6 @@ func (b *libp2pGossipsubBeaconBlockBatch) Rows() int { func (b *libp2pGossipsubBeaconBlockBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -85,13 +81,11 @@ func (b *libp2pGossipsubBeaconBlockBatch) appendMetadata(event *xatu.DecoratedEv b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -104,14 +98,12 @@ func (b *libp2pGossipsubBeaconBlockBatch) appendMetadata(event *xatu.DecoratedEv b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } func (b *libp2pGossipsubBeaconBlockBatch) Input() proto.Input { return proto.Input{ {Name: "updated_date_time", Data: &b.UpdatedDateTime}, - {Name: "version", Data: &b.Version}, {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "slot", Data: &b.Slot}, {Name: "slot_start_date_time", Data: &b.SlotStartDateTime}, @@ -132,7 +124,6 @@ func (b *libp2pGossipsubBeaconBlockBatch) Input() proto.Input { {Name: "topic_name", Data: &b.TopicName}, {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -145,14 +136,12 @@ func (b *libp2pGossipsubBeaconBlockBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } func (b *libp2pGossipsubBeaconBlockBatch) Reset() { b.UpdatedDateTime.Reset() - b.Version.Reset() b.EventDateTime.Reset() b.Slot.Reset() b.SlotStartDateTime.Reset() @@ -173,7 +162,6 @@ func (b *libp2pGossipsubBeaconBlockBatch) Reset() { b.TopicName.Reset() b.TopicEncoding.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -186,7 +174,6 @@ func (b *libp2pGossipsubBeaconBlockBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -196,9 +183,8 @@ func (b *libp2pGossipsubBeaconBlockBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 37) + row := make(map[string]any, 34) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() - row["version"] = b.Version.Row(i) row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -219,7 +205,6 @@ func (b *libp2pGossipsubBeaconBlockBatch) Snapshot() []map[string]any { row["topic_name"] = b.TopicName.Row(i) row["topic_encoding"] = b.TopicEncoding.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -252,7 +237,6 @@ func (b *libp2pGossipsubBeaconBlockBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_block.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_block.go index 89abdd48e..157fd98b0 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_block.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_beacon_block.go @@ -127,7 +127,7 @@ func (b *libp2pGossipsubBeaconBlockBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.MessageID.Append("") b.MessageSize.Append(0) b.TopicLayer.Append("") @@ -150,7 +150,7 @@ func (b *libp2pGossipsubBeaconBlockBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.MessageID.Append("") b.MessageSize.Append(0) b.TopicLayer.Append("") @@ -163,8 +163,6 @@ func (b *libp2pGossipsubBeaconBlockBatch) appendClientAdditionalData( } // Extract slot/epoch/wallclock/propagation fields. - var propagationSlotStartDiff uint32 - setGossipsubSlotEpochFields(additional, func(f gossipsubSlotEpochResult) { b.Slot.Append(f.Slot) b.SlotStartDateTime.Append(time.Unix(f.SlotStartDateTime, 0)) @@ -175,12 +173,8 @@ func (b *libp2pGossipsubBeaconBlockBatch) appendClientAdditionalData( b.WallclockEpoch.Append(f.WallclockEpoch) b.WallclockEpochStartDateTime.Append(time.Unix(f.WallclockEpochStartDateTime, 0)) b.PropagationSlotStartDiff.Append(f.PropagationSlotStartDiff) - propagationSlotStartDiff = f.PropagationSlotStartDiff }) - // Compute version for ReplacingMergeTree dedup. - b.Version.Append(4294967295 - propagationSlotStartDiff) - // Extract message fields. b.MessageID.Append(wrappedStringValue(additional.GetMessageId())) diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_blob_sidecar.gen.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_blob_sidecar.gen.go index 52536877a..96e22e63b 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_blob_sidecar.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_blob_sidecar.gen.go @@ -14,7 +14,6 @@ const libp2pGossipsubBlobSidecarTableName route.TableName = "libp2p_gossipsub_bl type libp2pGossipsubBlobSidecarBatch struct { UpdatedDateTime proto.ColDateTime - Version proto.ColUInt32 EventDateTime proto.ColDateTime64 Slot proto.ColUInt32 SlotStartDateTime proto.ColDateTime @@ -38,7 +37,6 @@ type libp2pGossipsubBlobSidecarBatch struct { TopicName proto.ColStr TopicEncoding proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -51,7 +49,6 @@ type libp2pGossipsubBlobSidecarBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -77,7 +74,6 @@ func (b *libp2pGossipsubBlobSidecarBatch) Rows() int { func (b *libp2pGossipsubBlobSidecarBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -90,13 +86,11 @@ func (b *libp2pGossipsubBlobSidecarBatch) appendMetadata(event *xatu.DecoratedEv b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -109,14 +103,12 @@ func (b *libp2pGossipsubBlobSidecarBatch) appendMetadata(event *xatu.DecoratedEv b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } func (b *libp2pGossipsubBlobSidecarBatch) Input() proto.Input { return proto.Input{ {Name: "updated_date_time", Data: &b.UpdatedDateTime}, - {Name: "version", Data: &b.Version}, {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "slot", Data: &b.Slot}, {Name: "slot_start_date_time", Data: &b.SlotStartDateTime}, @@ -140,7 +132,6 @@ func (b *libp2pGossipsubBlobSidecarBatch) Input() proto.Input { {Name: "topic_name", Data: &b.TopicName}, {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -153,14 +144,12 @@ func (b *libp2pGossipsubBlobSidecarBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } func (b *libp2pGossipsubBlobSidecarBatch) Reset() { b.UpdatedDateTime.Reset() - b.Version.Reset() b.EventDateTime.Reset() b.Slot.Reset() b.SlotStartDateTime.Reset() @@ -184,7 +173,6 @@ func (b *libp2pGossipsubBlobSidecarBatch) Reset() { b.TopicName.Reset() b.TopicEncoding.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -197,7 +185,6 @@ func (b *libp2pGossipsubBlobSidecarBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -207,9 +194,8 @@ func (b *libp2pGossipsubBlobSidecarBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 40) + row := make(map[string]any, 37) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() - row["version"] = b.Version.Row(i) row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -233,7 +219,6 @@ func (b *libp2pGossipsubBlobSidecarBatch) Snapshot() []map[string]any { row["topic_name"] = b.TopicName.Row(i) row["topic_encoding"] = b.TopicEncoding.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -266,7 +251,6 @@ func (b *libp2pGossipsubBlobSidecarBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_blob_sidecar.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_blob_sidecar.go index 7120e87af..68ed882cb 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_blob_sidecar.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_blob_sidecar.go @@ -139,7 +139,7 @@ func (b *libp2pGossipsubBlobSidecarBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.MessageID.Append("") b.MessageSize.Append(0) b.TopicLayer.Append("") @@ -162,7 +162,7 @@ func (b *libp2pGossipsubBlobSidecarBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.MessageID.Append("") b.MessageSize.Append(0) b.TopicLayer.Append("") @@ -175,8 +175,6 @@ func (b *libp2pGossipsubBlobSidecarBatch) appendClientAdditionalData( } // Extract slot/epoch/wallclock/propagation fields. - var propagationSlotStartDiff uint32 - setGossipsubSlotEpochFields(additional, func(f gossipsubSlotEpochResult) { b.Slot.Append(f.Slot) b.SlotStartDateTime.Append(time.Unix(f.SlotStartDateTime, 0)) @@ -187,12 +185,8 @@ func (b *libp2pGossipsubBlobSidecarBatch) appendClientAdditionalData( b.WallclockEpoch.Append(f.WallclockEpoch) b.WallclockEpochStartDateTime.Append(time.Unix(f.WallclockEpochStartDateTime, 0)) b.PropagationSlotStartDiff.Append(f.PropagationSlotStartDiff) - propagationSlotStartDiff = f.PropagationSlotStartDiff }) - // Compute version for ReplacingMergeTree dedup. - b.Version.Append(4294967295 - propagationSlotStartDiff) - // Extract message fields. b.MessageID.Append(wrappedStringValue(additional.GetMessageId())) diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_data_column_sidecar.gen.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_data_column_sidecar.gen.go index c419a6714..1342f72ce 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_data_column_sidecar.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_data_column_sidecar.gen.go @@ -14,7 +14,6 @@ const libp2pGossipsubDataColumnSidecarTableName route.TableName = "libp2p_gossip type libp2pGossipsubDataColumnSidecarBatch struct { UpdatedDateTime proto.ColDateTime - Version proto.ColUInt32 EventDateTime proto.ColDateTime64 Slot proto.ColUInt32 SlotStartDateTime proto.ColDateTime @@ -39,7 +38,6 @@ type libp2pGossipsubDataColumnSidecarBatch struct { TopicName proto.ColStr TopicEncoding proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -52,7 +50,6 @@ type libp2pGossipsubDataColumnSidecarBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -78,7 +75,6 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) Rows() int { func (b *libp2pGossipsubDataColumnSidecarBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -91,13 +87,11 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) appendMetadata(event *xatu.Decor b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -110,14 +104,12 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) appendMetadata(event *xatu.Decor b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } func (b *libp2pGossipsubDataColumnSidecarBatch) Input() proto.Input { return proto.Input{ {Name: "updated_date_time", Data: &b.UpdatedDateTime}, - {Name: "version", Data: &b.Version}, {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "slot", Data: &b.Slot}, {Name: "slot_start_date_time", Data: &b.SlotStartDateTime}, @@ -142,7 +134,6 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) Input() proto.Input { {Name: "topic_name", Data: &b.TopicName}, {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -155,14 +146,12 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } func (b *libp2pGossipsubDataColumnSidecarBatch) Reset() { b.UpdatedDateTime.Reset() - b.Version.Reset() b.EventDateTime.Reset() b.Slot.Reset() b.SlotStartDateTime.Reset() @@ -187,7 +176,6 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) Reset() { b.TopicName.Reset() b.TopicEncoding.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -200,7 +188,6 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -210,9 +197,8 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 41) + row := make(map[string]any, 38) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() - row["version"] = b.Version.Row(i) row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) row["slot_start_date_time"] = b.SlotStartDateTime.Row(i).Unix() @@ -237,7 +223,6 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) Snapshot() []map[string]any { row["topic_name"] = b.TopicName.Row(i) row["topic_encoding"] = b.TopicEncoding.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -270,7 +255,6 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_gossipsub_data_column_sidecar.go b/pkg/consumoor/route/libp2p/libp2p_gossipsub_data_column_sidecar.go index 228eb8d14..2264257fb 100644 --- a/pkg/consumoor/route/libp2p/libp2p_gossipsub_data_column_sidecar.go +++ b/pkg/consumoor/route/libp2p/libp2p_gossipsub_data_column_sidecar.go @@ -149,7 +149,7 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.MessageID.Append("") b.MessageSize.Append(0) b.TopicLayer.Append("") @@ -172,7 +172,7 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) appendClientAdditionalData( b.WallclockEpoch.Append(0) b.WallclockEpochStartDateTime.Append(time.Time{}) b.PropagationSlotStartDiff.Append(0) - b.Version.Append(4294967295) + b.MessageID.Append("") b.MessageSize.Append(0) b.TopicLayer.Append("") @@ -185,8 +185,6 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) appendClientAdditionalData( } // Extract slot/epoch/wallclock/propagation fields. - var propagationSlotStartDiff uint32 - setGossipsubSlotEpochFields(additional, func(f gossipsubSlotEpochResult) { b.Slot.Append(f.Slot) b.SlotStartDateTime.Append(time.Unix(f.SlotStartDateTime, 0)) @@ -197,12 +195,8 @@ func (b *libp2pGossipsubDataColumnSidecarBatch) appendClientAdditionalData( b.WallclockEpoch.Append(f.WallclockEpoch) b.WallclockEpochStartDateTime.Append(time.Unix(f.WallclockEpochStartDateTime, 0)) b.PropagationSlotStartDiff.Append(f.PropagationSlotStartDiff) - propagationSlotStartDiff = f.PropagationSlotStartDiff }) - // Compute version for ReplacingMergeTree dedup. - b.Version.Append(4294967295 - propagationSlotStartDiff) - // Extract message fields. b.MessageID.Append(wrappedStringValue(additional.GetMessageId())) diff --git a/pkg/consumoor/route/libp2p/libp2p_graft.gen.go b/pkg/consumoor/route/libp2p/libp2p_graft.gen.go index b90754858..e5befa392 100644 --- a/pkg/consumoor/route/libp2p/libp2p_graft.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_graft.gen.go @@ -21,7 +21,6 @@ type libp2pGraftBatch struct { TopicEncoding proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -34,7 +33,6 @@ type libp2pGraftBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -57,7 +55,6 @@ func (b *libp2pGraftBatch) Rows() int { func (b *libp2pGraftBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -70,13 +67,11 @@ func (b *libp2pGraftBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -89,7 +84,6 @@ func (b *libp2pGraftBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -103,7 +97,6 @@ func (b *libp2pGraftBatch) Input() proto.Input { {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -116,7 +109,6 @@ func (b *libp2pGraftBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -130,7 +122,6 @@ func (b *libp2pGraftBatch) Reset() { b.TopicEncoding.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -143,7 +134,6 @@ func (b *libp2pGraftBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -153,7 +143,7 @@ func (b *libp2pGraftBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 23) + row := make(map[string]any, 21) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["topic_layer"] = b.TopicLayer.Row(i) @@ -162,7 +152,6 @@ func (b *libp2pGraftBatch) Snapshot() []map[string]any { row["topic_encoding"] = b.TopicEncoding.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -195,7 +184,6 @@ func (b *libp2pGraftBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_handle_metadata.gen.go b/pkg/consumoor/route/libp2p/libp2p_handle_metadata.gen.go index 7fbde4bf3..591e1855a 100644 --- a/pkg/consumoor/route/libp2p/libp2p_handle_metadata.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_handle_metadata.gen.go @@ -18,14 +18,13 @@ type libp2pHandleMetadataBatch struct { PeerIDUniqueKey proto.ColInt64 Error *proto.ColNullable[string] Protocol proto.ColStr - Direction *proto.ColNullable[string] + Direction proto.ColStr Attnets proto.ColStr SeqNumber proto.ColUInt64 Syncnets proto.ColStr CustodyGroupCount *proto.ColNullable[uint8] LatencyMilliseconds proto.ColDecimal64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -38,7 +37,6 @@ type libp2pHandleMetadataBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -47,7 +45,6 @@ func newlibp2pHandleMetadataBatch() *libp2pHandleMetadataBatch { return &libp2pHandleMetadataBatch{ EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), Error: new(proto.ColStr).Nullable(), - Direction: new(proto.ColStr).Nullable(), CustodyGroupCount: new(proto.ColUInt8).Nullable(), MetaClientIP: new(proto.ColIPv6).Nullable(), MetaClientGeoLongitude: new(proto.ColFloat64).Nullable(), @@ -64,7 +61,6 @@ func (b *libp2pHandleMetadataBatch) Rows() int { func (b *libp2pHandleMetadataBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -77,13 +73,11 @@ func (b *libp2pHandleMetadataBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -96,7 +90,6 @@ func (b *libp2pHandleMetadataBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -107,14 +100,13 @@ func (b *libp2pHandleMetadataBatch) Input() proto.Input { {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "error", Data: b.Error}, {Name: "protocol", Data: &b.Protocol}, - {Name: "direction", Data: b.Direction}, + {Name: "direction", Data: &b.Direction}, {Name: "attnets", Data: &b.Attnets}, {Name: "seq_number", Data: &b.SeqNumber}, {Name: "syncnets", Data: &b.Syncnets}, {Name: "custody_group_count", Data: b.CustodyGroupCount}, {Name: "latency_milliseconds", Data: &route.TypedColInput{ColInput: &b.LatencyMilliseconds, CHType: "Decimal(10, 3)"}}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -127,7 +119,6 @@ func (b *libp2pHandleMetadataBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -145,7 +136,6 @@ func (b *libp2pHandleMetadataBatch) Reset() { b.CustodyGroupCount.Reset() b.LatencyMilliseconds.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -158,7 +148,6 @@ func (b *libp2pHandleMetadataBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -168,7 +157,7 @@ func (b *libp2pHandleMetadataBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 27) + row := make(map[string]any, 25) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) @@ -178,11 +167,7 @@ func (b *libp2pHandleMetadataBatch) Snapshot() []map[string]any { row["error"] = nil } row["protocol"] = b.Protocol.Row(i) - if v := b.Direction.Row(i); v.Set { - row["direction"] = v.Value - } else { - row["direction"] = nil - } + row["direction"] = b.Direction.Row(i) row["attnets"] = b.Attnets.Row(i) row["seq_number"] = b.SeqNumber.Row(i) row["syncnets"] = b.Syncnets.Row(i) @@ -193,7 +178,6 @@ func (b *libp2pHandleMetadataBatch) Snapshot() []map[string]any { } row["latency_milliseconds"] = route.FormatDecimal(int64(b.LatencyMilliseconds.Row(i)), 3) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -226,7 +210,6 @@ func (b *libp2pHandleMetadataBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_handle_metadata.go b/pkg/consumoor/route/libp2p/libp2p_handle_metadata.go index 7d68c600b..de720da5e 100644 --- a/pkg/consumoor/route/libp2p/libp2p_handle_metadata.go +++ b/pkg/consumoor/route/libp2p/libp2p_handle_metadata.go @@ -73,12 +73,7 @@ func (b *libp2pHandleMetadataBatch) appendPayload( b.Protocol.Append(wrappedStringValue(payload.GetProtocolId())) - // Direction (nullable string). - if dir := wrappedStringValue(payload.GetDirection()); dir != "" { - b.Direction.Append(proto.NewNullable[string](dir)) - } else { - b.Direction.Append(proto.Nullable[string]{}) - } + b.Direction.Append(wrappedStringValue(payload.GetDirection())) // Latency: proto stores seconds as float64; convert to Decimal(10,3) ms. // Truncate (not round) to match Vector's VRL behaviour. diff --git a/pkg/consumoor/route/libp2p/libp2p_handle_status.gen.go b/pkg/consumoor/route/libp2p/libp2p_handle_status.gen.go index ff2cfad41..6f04bb29a 100644 --- a/pkg/consumoor/route/libp2p/libp2p_handle_status.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_handle_status.gen.go @@ -18,7 +18,7 @@ type libp2pHandleStatusBatch struct { PeerIDUniqueKey proto.ColInt64 Error *proto.ColNullable[string] Protocol proto.ColStr - Direction *proto.ColNullable[string] + Direction proto.ColStr RequestFinalizedEpoch *proto.ColNullable[uint32] RequestFinalizedRoot *proto.ColNullable[string] RequestForkDigest proto.ColStr @@ -33,7 +33,6 @@ type libp2pHandleStatusBatch struct { ResponseEarliestAvailableSlot *proto.ColNullable[uint32] LatencyMilliseconds proto.ColDecimal64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -46,7 +45,6 @@ type libp2pHandleStatusBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -55,7 +53,6 @@ func newlibp2pHandleStatusBatch() *libp2pHandleStatusBatch { return &libp2pHandleStatusBatch{ EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), Error: new(proto.ColStr).Nullable(), - Direction: new(proto.ColStr).Nullable(), RequestFinalizedEpoch: new(proto.ColUInt32).Nullable(), RequestFinalizedRoot: new(proto.ColStr).Nullable(), RequestHeadRoot: route.NewNullableFixedStr(66), @@ -81,7 +78,6 @@ func (b *libp2pHandleStatusBatch) Rows() int { func (b *libp2pHandleStatusBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -94,13 +90,11 @@ func (b *libp2pHandleStatusBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -113,7 +107,6 @@ func (b *libp2pHandleStatusBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -124,7 +117,7 @@ func (b *libp2pHandleStatusBatch) Input() proto.Input { {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "error", Data: b.Error}, {Name: "protocol", Data: &b.Protocol}, - {Name: "direction", Data: b.Direction}, + {Name: "direction", Data: &b.Direction}, {Name: "request_finalized_epoch", Data: b.RequestFinalizedEpoch}, {Name: "request_finalized_root", Data: b.RequestFinalizedRoot}, {Name: "request_fork_digest", Data: &b.RequestForkDigest}, @@ -139,7 +132,6 @@ func (b *libp2pHandleStatusBatch) Input() proto.Input { {Name: "response_earliest_available_slot", Data: b.ResponseEarliestAvailableSlot}, {Name: "latency_milliseconds", Data: &route.TypedColInput{ColInput: &b.LatencyMilliseconds, CHType: "Decimal(10, 3)"}}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -152,7 +144,6 @@ func (b *libp2pHandleStatusBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -178,7 +169,6 @@ func (b *libp2pHandleStatusBatch) Reset() { b.ResponseEarliestAvailableSlot.Reset() b.LatencyMilliseconds.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -191,7 +181,6 @@ func (b *libp2pHandleStatusBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -201,7 +190,7 @@ func (b *libp2pHandleStatusBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 35) + row := make(map[string]any, 33) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) @@ -211,11 +200,7 @@ func (b *libp2pHandleStatusBatch) Snapshot() []map[string]any { row["error"] = nil } row["protocol"] = b.Protocol.Row(i) - if v := b.Direction.Row(i); v.Set { - row["direction"] = v.Value - } else { - row["direction"] = nil - } + row["direction"] = b.Direction.Row(i) if v := b.RequestFinalizedEpoch.Row(i); v.Set { row["request_finalized_epoch"] = v.Value } else { @@ -270,7 +255,6 @@ func (b *libp2pHandleStatusBatch) Snapshot() []map[string]any { } row["latency_milliseconds"] = route.FormatDecimal(int64(b.LatencyMilliseconds.Row(i)), 3) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -303,7 +287,6 @@ func (b *libp2pHandleStatusBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_handle_status.go b/pkg/consumoor/route/libp2p/libp2p_handle_status.go index ec960dd86..6dc825dc1 100644 --- a/pkg/consumoor/route/libp2p/libp2p_handle_status.go +++ b/pkg/consumoor/route/libp2p/libp2p_handle_status.go @@ -73,12 +73,7 @@ func (b *libp2pHandleStatusBatch) appendPayload( b.Protocol.Append(wrappedStringValue(payload.GetProtocolId())) - // Direction (nullable string). - if dir := wrappedStringValue(payload.GetDirection()); dir != "" { - b.Direction.Append(proto.NewNullable[string](dir)) - } else { - b.Direction.Append(proto.Nullable[string]{}) - } + b.Direction.Append(wrappedStringValue(payload.GetDirection())) // Latency: proto stores seconds as float64; convert to Decimal(10,3) ms. // Truncate (not round) to match Vector's VRL behaviour. diff --git a/pkg/consumoor/route/libp2p/libp2p_identify.gen.go b/pkg/consumoor/route/libp2p/libp2p_identify.gen.go index 715033301..11e64a407 100644 --- a/pkg/consumoor/route/libp2p/libp2p_identify.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_identify.gen.go @@ -46,7 +46,6 @@ type libp2pIdentifyBatch struct { Direction proto.ColStr RemoteMultiaddr proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -59,7 +58,6 @@ type libp2pIdentifyBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -90,7 +88,6 @@ func (b *libp2pIdentifyBatch) Rows() int { func (b *libp2pIdentifyBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -103,13 +100,11 @@ func (b *libp2pIdentifyBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -122,7 +117,6 @@ func (b *libp2pIdentifyBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -161,7 +155,6 @@ func (b *libp2pIdentifyBatch) Input() proto.Input { {Name: "direction", Data: &b.Direction}, {Name: "remote_multiaddr", Data: &b.RemoteMultiaddr}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -174,7 +167,6 @@ func (b *libp2pIdentifyBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -213,7 +205,6 @@ func (b *libp2pIdentifyBatch) Reset() { b.Direction.Reset() b.RemoteMultiaddr.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -226,7 +217,6 @@ func (b *libp2pIdentifyBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -236,7 +226,7 @@ func (b *libp2pIdentifyBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 48) + row := make(map[string]any, 46) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["remote_peer_id_unique_key"] = b.RemotePeerIDUniqueKey.Row(i) @@ -294,7 +284,6 @@ func (b *libp2pIdentifyBatch) Snapshot() []map[string]any { row["direction"] = b.Direction.Row(i) row["remote_multiaddr"] = b.RemoteMultiaddr.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -327,7 +316,6 @@ func (b *libp2pIdentifyBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_join.gen.go b/pkg/consumoor/route/libp2p/libp2p_join.gen.go index 5e6fbe70e..398316da9 100644 --- a/pkg/consumoor/route/libp2p/libp2p_join.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_join.gen.go @@ -21,7 +21,6 @@ type libp2pJoinBatch struct { TopicEncoding proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -34,7 +33,6 @@ type libp2pJoinBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -57,7 +55,6 @@ func (b *libp2pJoinBatch) Rows() int { func (b *libp2pJoinBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -70,13 +67,11 @@ func (b *libp2pJoinBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -89,7 +84,6 @@ func (b *libp2pJoinBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -103,7 +97,6 @@ func (b *libp2pJoinBatch) Input() proto.Input { {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -116,7 +109,6 @@ func (b *libp2pJoinBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -130,7 +122,6 @@ func (b *libp2pJoinBatch) Reset() { b.TopicEncoding.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -143,7 +134,6 @@ func (b *libp2pJoinBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -153,7 +143,7 @@ func (b *libp2pJoinBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 23) + row := make(map[string]any, 21) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["topic_layer"] = b.TopicLayer.Row(i) @@ -162,7 +152,6 @@ func (b *libp2pJoinBatch) Snapshot() []map[string]any { row["topic_encoding"] = b.TopicEncoding.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -195,7 +184,6 @@ func (b *libp2pJoinBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_leave.gen.go b/pkg/consumoor/route/libp2p/libp2p_leave.gen.go index 67cb64edc..3c05a39e6 100644 --- a/pkg/consumoor/route/libp2p/libp2p_leave.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_leave.gen.go @@ -21,7 +21,6 @@ type libp2pLeaveBatch struct { TopicEncoding proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -34,7 +33,6 @@ type libp2pLeaveBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -57,7 +55,6 @@ func (b *libp2pLeaveBatch) Rows() int { func (b *libp2pLeaveBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -70,13 +67,11 @@ func (b *libp2pLeaveBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -89,7 +84,6 @@ func (b *libp2pLeaveBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -103,7 +97,6 @@ func (b *libp2pLeaveBatch) Input() proto.Input { {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -116,7 +109,6 @@ func (b *libp2pLeaveBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -130,7 +122,6 @@ func (b *libp2pLeaveBatch) Reset() { b.TopicEncoding.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -143,7 +134,6 @@ func (b *libp2pLeaveBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -153,7 +143,7 @@ func (b *libp2pLeaveBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 23) + row := make(map[string]any, 21) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["topic_layer"] = b.TopicLayer.Row(i) @@ -162,7 +152,6 @@ func (b *libp2pLeaveBatch) Snapshot() []map[string]any { row["topic_encoding"] = b.TopicEncoding.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -195,7 +184,6 @@ func (b *libp2pLeaveBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_peer.gen.go b/pkg/consumoor/route/libp2p/libp2p_peer.gen.go index aee18cc71..1648acc8d 100644 --- a/pkg/consumoor/route/libp2p/libp2p_peer.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_peer.gen.go @@ -14,7 +14,6 @@ type libp2pPeerBatch struct { UniqueKey proto.ColInt64 UpdatedDateTime proto.ColDateTime PeerID proto.ColStr - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -29,12 +28,10 @@ func (b *libp2pPeerBatch) Rows() int { func (b *libp2pPeerBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -43,7 +40,6 @@ func (b *libp2pPeerBatch) Input() proto.Input { {Name: "unique_key", Data: &b.UniqueKey}, {Name: "updated_date_time", Data: &b.UpdatedDateTime}, {Name: "peer_id", Data: &b.PeerID}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -52,7 +48,6 @@ func (b *libp2pPeerBatch) Reset() { b.UniqueKey.Reset() b.UpdatedDateTime.Reset() b.PeerID.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -62,11 +57,10 @@ func (b *libp2pPeerBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 5) + row := make(map[string]any, 4) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["peer_id"] = b.PeerID.Row(i) - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_prune.gen.go b/pkg/consumoor/route/libp2p/libp2p_prune.gen.go index 00d965558..088856fba 100644 --- a/pkg/consumoor/route/libp2p/libp2p_prune.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_prune.gen.go @@ -21,7 +21,6 @@ type libp2pPruneBatch struct { TopicEncoding proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -34,7 +33,6 @@ type libp2pPruneBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -57,7 +55,6 @@ func (b *libp2pPruneBatch) Rows() int { func (b *libp2pPruneBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -70,13 +67,11 @@ func (b *libp2pPruneBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -89,7 +84,6 @@ func (b *libp2pPruneBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -103,7 +97,6 @@ func (b *libp2pPruneBatch) Input() proto.Input { {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -116,7 +109,6 @@ func (b *libp2pPruneBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -130,7 +122,6 @@ func (b *libp2pPruneBatch) Reset() { b.TopicEncoding.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -143,7 +134,6 @@ func (b *libp2pPruneBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -153,7 +143,7 @@ func (b *libp2pPruneBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 23) + row := make(map[string]any, 21) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["topic_layer"] = b.TopicLayer.Row(i) @@ -162,7 +152,6 @@ func (b *libp2pPruneBatch) Snapshot() []map[string]any { row["topic_encoding"] = b.TopicEncoding.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -195,7 +184,6 @@ func (b *libp2pPruneBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_publish_message.gen.go b/pkg/consumoor/route/libp2p/libp2p_publish_message.gen.go index 1053ea2be..4b5efd78c 100644 --- a/pkg/consumoor/route/libp2p/libp2p_publish_message.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_publish_message.gen.go @@ -21,7 +21,6 @@ type libp2pPublishMessageBatch struct { TopicEncoding proto.ColStr MessageID proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -34,7 +33,6 @@ type libp2pPublishMessageBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -57,7 +55,6 @@ func (b *libp2pPublishMessageBatch) Rows() int { func (b *libp2pPublishMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -70,13 +67,11 @@ func (b *libp2pPublishMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -89,7 +84,6 @@ func (b *libp2pPublishMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -103,7 +97,6 @@ func (b *libp2pPublishMessageBatch) Input() proto.Input { {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "message_id", Data: &b.MessageID}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -116,7 +109,6 @@ func (b *libp2pPublishMessageBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -130,7 +122,6 @@ func (b *libp2pPublishMessageBatch) Reset() { b.TopicEncoding.Reset() b.MessageID.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -143,7 +134,6 @@ func (b *libp2pPublishMessageBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -153,7 +143,7 @@ func (b *libp2pPublishMessageBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 23) + row := make(map[string]any, 21) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["topic_layer"] = b.TopicLayer.Row(i) @@ -162,7 +152,6 @@ func (b *libp2pPublishMessageBatch) Snapshot() []map[string]any { row["topic_encoding"] = b.TopicEncoding.Row(i) row["message_id"] = b.MessageID.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -195,7 +184,6 @@ func (b *libp2pPublishMessageBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_recv_rpc.gen.go b/pkg/consumoor/route/libp2p/libp2p_recv_rpc.gen.go index d596aa15e..d9130b5ba 100644 --- a/pkg/consumoor/route/libp2p/libp2p_recv_rpc.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_recv_rpc.gen.go @@ -18,7 +18,6 @@ type libp2pRecvRpcBatch struct { EventDateTime proto.ColDateTime64 PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -31,7 +30,6 @@ type libp2pRecvRpcBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -54,7 +52,6 @@ func (b *libp2pRecvRpcBatch) Rows() int { func (b *libp2pRecvRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -67,13 +64,11 @@ func (b *libp2pRecvRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -86,7 +81,6 @@ func (b *libp2pRecvRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -97,7 +91,6 @@ func (b *libp2pRecvRpcBatch) Input() proto.Input { {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -110,7 +103,6 @@ func (b *libp2pRecvRpcBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -121,7 +113,6 @@ func (b *libp2pRecvRpcBatch) Reset() { b.EventDateTime.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -134,7 +125,6 @@ func (b *libp2pRecvRpcBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -144,13 +134,12 @@ func (b *libp2pRecvRpcBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 20) + row := make(map[string]any, 18) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -183,7 +172,6 @@ func (b *libp2pRecvRpcBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_reject_message.gen.go b/pkg/consumoor/route/libp2p/libp2p_reject_message.gen.go index 768670b7a..dd98381b0 100644 --- a/pkg/consumoor/route/libp2p/libp2p_reject_message.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_reject_message.gen.go @@ -26,7 +26,6 @@ type libp2pRejectMessageBatch struct { MessageSize proto.ColUInt32 Reason proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -39,7 +38,6 @@ type libp2pRejectMessageBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -62,7 +60,6 @@ func (b *libp2pRejectMessageBatch) Rows() int { func (b *libp2pRejectMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -75,13 +72,11 @@ func (b *libp2pRejectMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -94,7 +89,6 @@ func (b *libp2pRejectMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -113,7 +107,6 @@ func (b *libp2pRejectMessageBatch) Input() proto.Input { {Name: "message_size", Data: &b.MessageSize}, {Name: "reason", Data: &b.Reason}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -126,7 +119,6 @@ func (b *libp2pRejectMessageBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -145,7 +137,6 @@ func (b *libp2pRejectMessageBatch) Reset() { b.MessageSize.Reset() b.Reason.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -158,7 +149,6 @@ func (b *libp2pRejectMessageBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -168,7 +158,7 @@ func (b *libp2pRejectMessageBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 28) + row := make(map[string]any, 26) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["topic_layer"] = b.TopicLayer.Row(i) @@ -182,7 +172,6 @@ func (b *libp2pRejectMessageBatch) Snapshot() []map[string]any { row["message_size"] = b.MessageSize.Row(i) row["reason"] = b.Reason.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -215,7 +204,6 @@ func (b *libp2pRejectMessageBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_remove_peer.gen.go b/pkg/consumoor/route/libp2p/libp2p_remove_peer.gen.go index 9bf586562..ed287e399 100644 --- a/pkg/consumoor/route/libp2p/libp2p_remove_peer.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_remove_peer.gen.go @@ -17,7 +17,6 @@ type libp2pRemovePeerBatch struct { EventDateTime proto.ColDateTime64 PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -30,7 +29,6 @@ type libp2pRemovePeerBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -53,7 +51,6 @@ func (b *libp2pRemovePeerBatch) Rows() int { func (b *libp2pRemovePeerBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -66,13 +63,11 @@ func (b *libp2pRemovePeerBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -85,7 +80,6 @@ func (b *libp2pRemovePeerBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -95,7 +89,6 @@ func (b *libp2pRemovePeerBatch) Input() proto.Input { {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -108,7 +101,6 @@ func (b *libp2pRemovePeerBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -118,7 +110,6 @@ func (b *libp2pRemovePeerBatch) Reset() { b.EventDateTime.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -131,7 +122,6 @@ func (b *libp2pRemovePeerBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -141,12 +131,11 @@ func (b *libp2pRemovePeerBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 19) + row := make(map[string]any, 17) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -179,7 +168,6 @@ func (b *libp2pRemovePeerBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_rpc_data_column_custody_probe.gen.go b/pkg/consumoor/route/libp2p/libp2p_rpc_data_column_custody_probe.gen.go index c804c24b2..42dcaf13e 100644 --- a/pkg/consumoor/route/libp2p/libp2p_rpc_data_column_custody_probe.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_rpc_data_column_custody_probe.gen.go @@ -31,7 +31,6 @@ type libp2pRpcDataColumnCustodyProbeBatch struct { ResponseTimeMs proto.ColInt32 Error *proto.ColNullable[string] MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -44,9 +43,7 @@ type libp2pRpcDataColumnCustodyProbeBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -60,7 +57,6 @@ func newlibp2pRpcDataColumnCustodyProbeBatch() *libp2pRpcDataColumnCustodyProbeB MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -71,7 +67,6 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) Rows() int { func (b *libp2pRpcDataColumnCustodyProbeBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -84,14 +79,11 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) appendMetadata(event *xatu.Decora b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -104,13 +96,7 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) appendMetadata(event *xatu.Decora b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *libp2pRpcDataColumnCustodyProbeBatch) Input() proto.Input { @@ -133,7 +119,6 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) Input() proto.Input { {Name: "response_time_ms", Data: &b.ResponseTimeMs}, {Name: "error", Data: b.Error}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -146,9 +131,7 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -171,7 +154,6 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) Reset() { b.ResponseTimeMs.Reset() b.Error.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -184,9 +166,7 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -195,7 +175,7 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 34) + row := make(map[string]any, 31) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -218,7 +198,6 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) Snapshot() []map[string]any { row["error"] = nil } row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -251,9 +230,7 @@ func (b *libp2pRpcDataColumnCustodyProbeBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_graft.gen.go b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_graft.gen.go index 5dae35664..60b0dad60 100644 --- a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_graft.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_graft.gen.go @@ -24,7 +24,6 @@ type libp2pRpcMetaControlGraftBatch struct { TopicEncoding proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -37,7 +36,6 @@ type libp2pRpcMetaControlGraftBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -60,7 +58,6 @@ func (b *libp2pRpcMetaControlGraftBatch) Rows() int { func (b *libp2pRpcMetaControlGraftBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -73,13 +70,11 @@ func (b *libp2pRpcMetaControlGraftBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -92,7 +87,6 @@ func (b *libp2pRpcMetaControlGraftBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -109,7 +103,6 @@ func (b *libp2pRpcMetaControlGraftBatch) Input() proto.Input { {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -122,7 +115,6 @@ func (b *libp2pRpcMetaControlGraftBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -139,7 +131,6 @@ func (b *libp2pRpcMetaControlGraftBatch) Reset() { b.TopicEncoding.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -152,7 +143,6 @@ func (b *libp2pRpcMetaControlGraftBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -162,7 +152,7 @@ func (b *libp2pRpcMetaControlGraftBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 26) + row := make(map[string]any, 24) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() @@ -174,7 +164,6 @@ func (b *libp2pRpcMetaControlGraftBatch) Snapshot() []map[string]any { row["topic_encoding"] = b.TopicEncoding.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -207,7 +196,6 @@ func (b *libp2pRpcMetaControlGraftBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_idontwant.gen.go b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_idontwant.gen.go index 20ccf8226..f73c18dff 100644 --- a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_idontwant.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_idontwant.gen.go @@ -22,7 +22,6 @@ type libp2pRpcMetaControlIdontwantBatch struct { MessageID proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -35,7 +34,6 @@ type libp2pRpcMetaControlIdontwantBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -58,7 +56,6 @@ func (b *libp2pRpcMetaControlIdontwantBatch) Rows() int { func (b *libp2pRpcMetaControlIdontwantBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -71,13 +68,11 @@ func (b *libp2pRpcMetaControlIdontwantBatch) appendMetadata(event *xatu.Decorate b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -90,7 +85,6 @@ func (b *libp2pRpcMetaControlIdontwantBatch) appendMetadata(event *xatu.Decorate b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -105,7 +99,6 @@ func (b *libp2pRpcMetaControlIdontwantBatch) Input() proto.Input { {Name: "message_id", Data: &b.MessageID}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -118,7 +111,6 @@ func (b *libp2pRpcMetaControlIdontwantBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -133,7 +125,6 @@ func (b *libp2pRpcMetaControlIdontwantBatch) Reset() { b.MessageID.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -146,7 +137,6 @@ func (b *libp2pRpcMetaControlIdontwantBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -156,7 +146,7 @@ func (b *libp2pRpcMetaControlIdontwantBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 24) + row := make(map[string]any, 22) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() @@ -166,7 +156,6 @@ func (b *libp2pRpcMetaControlIdontwantBatch) Snapshot() []map[string]any { row["message_id"] = b.MessageID.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -199,7 +188,6 @@ func (b *libp2pRpcMetaControlIdontwantBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_ihave.gen.go b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_ihave.gen.go index 15c1822d9..458049ae2 100644 --- a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_ihave.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_ihave.gen.go @@ -26,7 +26,6 @@ type libp2pRpcMetaControlIhaveBatch struct { MessageID proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -39,7 +38,6 @@ type libp2pRpcMetaControlIhaveBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -62,7 +60,6 @@ func (b *libp2pRpcMetaControlIhaveBatch) Rows() int { func (b *libp2pRpcMetaControlIhaveBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -75,13 +72,11 @@ func (b *libp2pRpcMetaControlIhaveBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -94,7 +89,6 @@ func (b *libp2pRpcMetaControlIhaveBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -113,7 +107,6 @@ func (b *libp2pRpcMetaControlIhaveBatch) Input() proto.Input { {Name: "message_id", Data: &b.MessageID}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -126,7 +119,6 @@ func (b *libp2pRpcMetaControlIhaveBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -145,7 +137,6 @@ func (b *libp2pRpcMetaControlIhaveBatch) Reset() { b.MessageID.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -158,7 +149,6 @@ func (b *libp2pRpcMetaControlIhaveBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -168,7 +158,7 @@ func (b *libp2pRpcMetaControlIhaveBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 28) + row := make(map[string]any, 26) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() @@ -182,7 +172,6 @@ func (b *libp2pRpcMetaControlIhaveBatch) Snapshot() []map[string]any { row["message_id"] = b.MessageID.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -215,7 +204,6 @@ func (b *libp2pRpcMetaControlIhaveBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_iwant.gen.go b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_iwant.gen.go index 221dc5577..4d8973b6c 100644 --- a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_iwant.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_iwant.gen.go @@ -22,7 +22,6 @@ type libp2pRpcMetaControlIwantBatch struct { MessageID proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -35,7 +34,6 @@ type libp2pRpcMetaControlIwantBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -58,7 +56,6 @@ func (b *libp2pRpcMetaControlIwantBatch) Rows() int { func (b *libp2pRpcMetaControlIwantBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -71,13 +68,11 @@ func (b *libp2pRpcMetaControlIwantBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -90,7 +85,6 @@ func (b *libp2pRpcMetaControlIwantBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -105,7 +99,6 @@ func (b *libp2pRpcMetaControlIwantBatch) Input() proto.Input { {Name: "message_id", Data: &b.MessageID}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -118,7 +111,6 @@ func (b *libp2pRpcMetaControlIwantBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -133,7 +125,6 @@ func (b *libp2pRpcMetaControlIwantBatch) Reset() { b.MessageID.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -146,7 +137,6 @@ func (b *libp2pRpcMetaControlIwantBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -156,7 +146,7 @@ func (b *libp2pRpcMetaControlIwantBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 24) + row := make(map[string]any, 22) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() @@ -166,7 +156,6 @@ func (b *libp2pRpcMetaControlIwantBatch) Snapshot() []map[string]any { row["message_id"] = b.MessageID.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -199,7 +188,6 @@ func (b *libp2pRpcMetaControlIwantBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_prune.gen.go b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_prune.gen.go index 0fefd40c8..720c6860a 100644 --- a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_prune.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_control_prune.gen.go @@ -26,7 +26,6 @@ type libp2pRpcMetaControlPruneBatch struct { TopicName proto.ColStr TopicEncoding proto.ColStr MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -39,7 +38,6 @@ type libp2pRpcMetaControlPruneBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -63,7 +61,6 @@ func (b *libp2pRpcMetaControlPruneBatch) Rows() int { func (b *libp2pRpcMetaControlPruneBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -76,13 +73,11 @@ func (b *libp2pRpcMetaControlPruneBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -95,7 +90,6 @@ func (b *libp2pRpcMetaControlPruneBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -114,7 +108,6 @@ func (b *libp2pRpcMetaControlPruneBatch) Input() proto.Input { {Name: "topic_name", Data: &b.TopicName}, {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -127,7 +120,6 @@ func (b *libp2pRpcMetaControlPruneBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -146,7 +138,6 @@ func (b *libp2pRpcMetaControlPruneBatch) Reset() { b.TopicName.Reset() b.TopicEncoding.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -159,7 +150,6 @@ func (b *libp2pRpcMetaControlPruneBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -169,7 +159,7 @@ func (b *libp2pRpcMetaControlPruneBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 28) + row := make(map[string]any, 26) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() @@ -187,7 +177,6 @@ func (b *libp2pRpcMetaControlPruneBatch) Snapshot() []map[string]any { row["topic_name"] = b.TopicName.Row(i) row["topic_encoding"] = b.TopicEncoding.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -220,7 +209,6 @@ func (b *libp2pRpcMetaControlPruneBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_message.gen.go b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_message.gen.go index 7481c4981..aaa39b493 100644 --- a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_message.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_message.gen.go @@ -25,7 +25,6 @@ type libp2pRpcMetaMessageBatch struct { TopicEncoding proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -38,7 +37,6 @@ type libp2pRpcMetaMessageBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -61,7 +59,6 @@ func (b *libp2pRpcMetaMessageBatch) Rows() int { func (b *libp2pRpcMetaMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -74,13 +71,11 @@ func (b *libp2pRpcMetaMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -93,7 +88,6 @@ func (b *libp2pRpcMetaMessageBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -111,7 +105,6 @@ func (b *libp2pRpcMetaMessageBatch) Input() proto.Input { {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -124,7 +117,6 @@ func (b *libp2pRpcMetaMessageBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -142,7 +134,6 @@ func (b *libp2pRpcMetaMessageBatch) Reset() { b.TopicEncoding.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -155,7 +146,6 @@ func (b *libp2pRpcMetaMessageBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -165,7 +155,7 @@ func (b *libp2pRpcMetaMessageBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 27) + row := make(map[string]any, 25) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() @@ -178,7 +168,6 @@ func (b *libp2pRpcMetaMessageBatch) Snapshot() []map[string]any { row["topic_encoding"] = b.TopicEncoding.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -211,7 +200,6 @@ func (b *libp2pRpcMetaMessageBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_subscription.gen.go b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_subscription.gen.go index 46461d2d6..add5efa77 100644 --- a/pkg/consumoor/route/libp2p/libp2p_rpc_meta_subscription.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_rpc_meta_subscription.gen.go @@ -25,7 +25,6 @@ type libp2pRpcMetaSubscriptionBatch struct { TopicEncoding proto.ColStr PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -38,7 +37,6 @@ type libp2pRpcMetaSubscriptionBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -61,7 +59,6 @@ func (b *libp2pRpcMetaSubscriptionBatch) Rows() int { func (b *libp2pRpcMetaSubscriptionBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -74,13 +71,11 @@ func (b *libp2pRpcMetaSubscriptionBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -93,7 +88,6 @@ func (b *libp2pRpcMetaSubscriptionBatch) appendMetadata(event *xatu.DecoratedEve b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -111,7 +105,6 @@ func (b *libp2pRpcMetaSubscriptionBatch) Input() proto.Input { {Name: "topic_encoding", Data: &b.TopicEncoding}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -124,7 +117,6 @@ func (b *libp2pRpcMetaSubscriptionBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -142,7 +134,6 @@ func (b *libp2pRpcMetaSubscriptionBatch) Reset() { b.TopicEncoding.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -155,7 +146,6 @@ func (b *libp2pRpcMetaSubscriptionBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -165,7 +155,7 @@ func (b *libp2pRpcMetaSubscriptionBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 27) + row := make(map[string]any, 25) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() @@ -178,7 +168,6 @@ func (b *libp2pRpcMetaSubscriptionBatch) Snapshot() []map[string]any { row["topic_encoding"] = b.TopicEncoding.Row(i) row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -211,7 +200,6 @@ func (b *libp2pRpcMetaSubscriptionBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_send_rpc.gen.go b/pkg/consumoor/route/libp2p/libp2p_send_rpc.gen.go index 61f6222cc..cfcf6804d 100644 --- a/pkg/consumoor/route/libp2p/libp2p_send_rpc.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_send_rpc.gen.go @@ -18,7 +18,6 @@ type libp2pSendRpcBatch struct { EventDateTime proto.ColDateTime64 PeerIDUniqueKey proto.ColInt64 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -31,7 +30,6 @@ type libp2pSendRpcBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -54,7 +52,6 @@ func (b *libp2pSendRpcBatch) Rows() int { func (b *libp2pSendRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -67,13 +64,11 @@ func (b *libp2pSendRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -86,7 +81,6 @@ func (b *libp2pSendRpcBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -97,7 +91,6 @@ func (b *libp2pSendRpcBatch) Input() proto.Input { {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "peer_id_unique_key", Data: &b.PeerIDUniqueKey}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -110,7 +103,6 @@ func (b *libp2pSendRpcBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -121,7 +113,6 @@ func (b *libp2pSendRpcBatch) Reset() { b.EventDateTime.Reset() b.PeerIDUniqueKey.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -134,7 +125,6 @@ func (b *libp2pSendRpcBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -144,13 +134,12 @@ func (b *libp2pSendRpcBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 20) + row := make(map[string]any, 18) row["unique_key"] = b.UniqueKey.Row(i) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["peer_id_unique_key"] = b.PeerIDUniqueKey.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -183,7 +172,6 @@ func (b *libp2pSendRpcBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/libp2p/libp2p_synthetic_heartbeat.gen.go b/pkg/consumoor/route/libp2p/libp2p_synthetic_heartbeat.gen.go index 7554da8c9..082fbf738 100644 --- a/pkg/consumoor/route/libp2p/libp2p_synthetic_heartbeat.gen.go +++ b/pkg/consumoor/route/libp2p/libp2p_synthetic_heartbeat.gen.go @@ -38,7 +38,6 @@ type libp2pSyntheticHeartbeatBatch struct { RemoteGeoAutonomousSystemNumber *proto.ColNullable[uint32] RemoteGeoAutonomousSystemOrganization *proto.ColNullable[string] MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -51,7 +50,6 @@ type libp2pSyntheticHeartbeatBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr rows int } @@ -83,7 +81,6 @@ func (b *libp2pSyntheticHeartbeatBatch) Rows() int { func (b *libp2pSyntheticHeartbeatBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -96,13 +93,11 @@ func (b *libp2pSyntheticHeartbeatBatch) appendMetadata(event *xatu.DecoratedEven b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -115,7 +110,6 @@ func (b *libp2pSyntheticHeartbeatBatch) appendMetadata(event *xatu.DecoratedEven b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) } @@ -146,7 +140,6 @@ func (b *libp2pSyntheticHeartbeatBatch) Input() proto.Input { {Name: "remote_geo_autonomous_system_number", Data: b.RemoteGeoAutonomousSystemNumber}, {Name: "remote_geo_autonomous_system_organization", Data: b.RemoteGeoAutonomousSystemOrganization}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -159,7 +152,6 @@ func (b *libp2pSyntheticHeartbeatBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, } } @@ -190,7 +182,6 @@ func (b *libp2pSyntheticHeartbeatBatch) Reset() { b.RemoteGeoAutonomousSystemNumber.Reset() b.RemoteGeoAutonomousSystemOrganization.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -203,7 +194,6 @@ func (b *libp2pSyntheticHeartbeatBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() b.rows = 0 } @@ -213,7 +203,7 @@ func (b *libp2pSyntheticHeartbeatBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 40) + row := make(map[string]any, 38) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["remote_peer_id_unique_key"] = b.RemotePeerIDUniqueKey.Row(i) @@ -271,7 +261,6 @@ func (b *libp2pSyntheticHeartbeatBatch) Snapshot() []map[string]any { row["remote_geo_autonomous_system_organization"] = nil } row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -304,7 +293,6 @@ func (b *libp2pSyntheticHeartbeatBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/mev/mev_relay_bid_trace.gen.go b/pkg/consumoor/route/mev/mev_relay_bid_trace.gen.go index f6c70b7c8..2c7665c25 100644 --- a/pkg/consumoor/route/mev/mev_relay_bid_trace.gen.go +++ b/pkg/consumoor/route/mev/mev_relay_bid_trace.gen.go @@ -40,7 +40,6 @@ type mevRelayBidTraceBatch struct { TimestampMs proto.ColInt64 OptimisticSubmission proto.ColBool MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -54,7 +53,6 @@ type mevRelayBidTraceBatch struct { MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] MetaNetworkName proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -69,7 +67,6 @@ func newmevRelayBidTraceBatch() *mevRelayBidTraceBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -80,7 +77,6 @@ func (b *mevRelayBidTraceBatch) Rows() int { func (b *mevRelayBidTraceBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -94,12 +90,10 @@ func (b *mevRelayBidTraceBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) b.MetaNetworkName.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -113,11 +107,6 @@ func (b *mevRelayBidTraceBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *mevRelayBidTraceBatch) Input() proto.Input { @@ -149,7 +138,6 @@ func (b *mevRelayBidTraceBatch) Input() proto.Input { {Name: "timestamp_ms", Data: &b.TimestampMs}, {Name: "optimistic_submission", Data: &b.OptimisticSubmission}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -163,7 +151,6 @@ func (b *mevRelayBidTraceBatch) Input() proto.Input { {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -195,7 +182,6 @@ func (b *mevRelayBidTraceBatch) Reset() { b.TimestampMs.Reset() b.OptimisticSubmission.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -209,7 +195,6 @@ func (b *mevRelayBidTraceBatch) Reset() { b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() b.MetaNetworkName.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -218,7 +203,7 @@ func (b *mevRelayBidTraceBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 42) + row := make(map[string]any, 40) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -246,7 +231,6 @@ func (b *mevRelayBidTraceBatch) Snapshot() []map[string]any { row["timestamp_ms"] = b.TimestampMs.Row(i) row["optimistic_submission"] = b.OptimisticSubmission.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -280,7 +264,6 @@ func (b *mevRelayBidTraceBatch) Snapshot() []map[string]any { row["meta_client_geo_autonomous_system_organization"] = nil } row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/mev/mev_relay_proposer_payload_delivered.gen.go b/pkg/consumoor/route/mev/mev_relay_proposer_payload_delivered.gen.go index faddc663d..622787a23 100644 --- a/pkg/consumoor/route/mev/mev_relay_proposer_payload_delivered.gen.go +++ b/pkg/consumoor/route/mev/mev_relay_proposer_payload_delivered.gen.go @@ -34,7 +34,6 @@ type mevRelayProposerPayloadDeliveredBatch struct { Value proto.ColUInt256 NumTx proto.ColUInt32 MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -48,7 +47,6 @@ type mevRelayProposerPayloadDeliveredBatch struct { MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] MetaNetworkName proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -62,7 +60,6 @@ func newmevRelayProposerPayloadDeliveredBatch() *mevRelayProposerPayloadDelivere MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -73,7 +70,6 @@ func (b *mevRelayProposerPayloadDeliveredBatch) Rows() int { func (b *mevRelayProposerPayloadDeliveredBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -87,12 +83,10 @@ func (b *mevRelayProposerPayloadDeliveredBatch) appendMetadata(event *xatu.Decor b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) b.MetaNetworkName.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -106,11 +100,6 @@ func (b *mevRelayProposerPayloadDeliveredBatch) appendMetadata(event *xatu.Decor b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *mevRelayProposerPayloadDeliveredBatch) Input() proto.Input { @@ -136,7 +125,6 @@ func (b *mevRelayProposerPayloadDeliveredBatch) Input() proto.Input { {Name: "value", Data: &b.Value}, {Name: "num_tx", Data: &b.NumTx}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -150,7 +138,6 @@ func (b *mevRelayProposerPayloadDeliveredBatch) Input() proto.Input { {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -176,7 +163,6 @@ func (b *mevRelayProposerPayloadDeliveredBatch) Reset() { b.Value.Reset() b.NumTx.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -190,7 +176,6 @@ func (b *mevRelayProposerPayloadDeliveredBatch) Reset() { b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() b.MetaNetworkName.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -199,7 +184,7 @@ func (b *mevRelayProposerPayloadDeliveredBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 36) + row := make(map[string]any, 34) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["slot"] = b.Slot.Row(i) @@ -221,7 +206,6 @@ func (b *mevRelayProposerPayloadDeliveredBatch) Snapshot() []map[string]any { row["value"] = route.UInt256ToString(b.Value.Row(i)) row["num_tx"] = b.NumTx.Row(i) row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -255,7 +239,6 @@ func (b *mevRelayProposerPayloadDeliveredBatch) Snapshot() []map[string]any { row["meta_client_geo_autonomous_system_organization"] = nil } row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/mev/mev_relay_validator_registration.gen.go b/pkg/consumoor/route/mev/mev_relay_validator_registration.gen.go index e1723e4a7..f092939aa 100644 --- a/pkg/consumoor/route/mev/mev_relay_validator_registration.gen.go +++ b/pkg/consumoor/route/mev/mev_relay_validator_registration.gen.go @@ -29,7 +29,6 @@ type mevRelayValidatorRegistrationBatch struct { WallclockEpoch proto.ColUInt32 WallclockEpochStartDateTime proto.ColDateTime MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -43,7 +42,6 @@ type mevRelayValidatorRegistrationBatch struct { MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] MetaNetworkName proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -55,7 +53,6 @@ func newmevRelayValidatorRegistrationBatch() *mevRelayValidatorRegistrationBatch MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -66,7 +63,6 @@ func (b *mevRelayValidatorRegistrationBatch) Rows() int { func (b *mevRelayValidatorRegistrationBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -80,12 +76,10 @@ func (b *mevRelayValidatorRegistrationBatch) appendMetadata(event *xatu.Decorate b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) b.MetaNetworkName.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -99,11 +93,6 @@ func (b *mevRelayValidatorRegistrationBatch) appendMetadata(event *xatu.Decorate b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *mevRelayValidatorRegistrationBatch) Input() proto.Input { @@ -124,7 +113,6 @@ func (b *mevRelayValidatorRegistrationBatch) Input() proto.Input { {Name: "wallclock_epoch", Data: &b.WallclockEpoch}, {Name: "wallclock_epoch_start_date_time", Data: &b.WallclockEpochStartDateTime}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -138,7 +126,6 @@ func (b *mevRelayValidatorRegistrationBatch) Input() proto.Input { {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -159,7 +146,6 @@ func (b *mevRelayValidatorRegistrationBatch) Reset() { b.WallclockEpoch.Reset() b.WallclockEpochStartDateTime.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -173,7 +159,6 @@ func (b *mevRelayValidatorRegistrationBatch) Reset() { b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() b.MetaNetworkName.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -182,7 +167,7 @@ func (b *mevRelayValidatorRegistrationBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 31) + row := make(map[string]any, 29) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["timestamp"] = b.Timestamp.Row(i) @@ -199,7 +184,6 @@ func (b *mevRelayValidatorRegistrationBatch) Snapshot() []map[string]any { row["wallclock_epoch"] = b.WallclockEpoch.Row(i) row["wallclock_epoch_start_date_time"] = b.WallclockEpochStartDateTime.Row(i).Unix() row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -233,7 +217,6 @@ func (b *mevRelayValidatorRegistrationBatch) Snapshot() []map[string]any { row["meta_client_geo_autonomous_system_organization"] = nil } row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/node/node_record_consensus.gen.go b/pkg/consumoor/route/node/node_record_consensus.gen.go index 565562ad9..824a19d12 100644 --- a/pkg/consumoor/route/node/node_record_consensus.gen.go +++ b/pkg/consumoor/route/node/node_record_consensus.gen.go @@ -17,7 +17,7 @@ type nodeRecordConsensusBatch struct { UpdatedDateTime proto.ColDateTime EventDateTime proto.ColDateTime64 Enr proto.ColStr - NodeID *proto.ColNullable[string] + NodeID proto.ColStr PeerIDUniqueKey *proto.ColNullable[int64] Timestamp proto.ColInt64 Name proto.ColStr @@ -49,7 +49,6 @@ type nodeRecordConsensusBatch struct { GeoAutonomousSystemNumber *proto.ColNullable[uint32] GeoAutonomousSystemOrganization *proto.ColNullable[string] MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -62,16 +61,13 @@ type nodeRecordConsensusBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } func newnodeRecordConsensusBatch() *nodeRecordConsensusBatch { return &nodeRecordConsensusBatch{ EventDateTime: func() proto.ColDateTime64 { var c proto.ColDateTime64; c.WithPrecision(proto.Precision(3)); return c }(), - NodeID: new(proto.ColStr).Nullable(), PeerIDUniqueKey: new(proto.ColInt64).Nullable(), NextForkDigest: new(proto.ColStr).Nullable(), Cgc: new(proto.ColStr).Nullable(), @@ -90,7 +86,6 @@ func newnodeRecordConsensusBatch() *nodeRecordConsensusBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -101,7 +96,6 @@ func (b *nodeRecordConsensusBatch) Rows() int { func (b *nodeRecordConsensusBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -114,14 +108,11 @@ func (b *nodeRecordConsensusBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -134,13 +125,7 @@ func (b *nodeRecordConsensusBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *nodeRecordConsensusBatch) Input() proto.Input { @@ -148,7 +133,7 @@ func (b *nodeRecordConsensusBatch) Input() proto.Input { {Name: "updated_date_time", Data: &b.UpdatedDateTime}, {Name: "event_date_time", Data: &b.EventDateTime}, {Name: "enr", Data: &b.Enr}, - {Name: "node_id", Data: b.NodeID}, + {Name: "node_id", Data: &b.NodeID}, {Name: "peer_id_unique_key", Data: b.PeerIDUniqueKey}, {Name: "timestamp", Data: &b.Timestamp}, {Name: "name", Data: &b.Name}, @@ -180,7 +165,6 @@ func (b *nodeRecordConsensusBatch) Input() proto.Input { {Name: "geo_autonomous_system_number", Data: b.GeoAutonomousSystemNumber}, {Name: "geo_autonomous_system_organization", Data: b.GeoAutonomousSystemOrganization}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -193,9 +177,7 @@ func (b *nodeRecordConsensusBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -235,7 +217,6 @@ func (b *nodeRecordConsensusBatch) Reset() { b.GeoAutonomousSystemNumber.Reset() b.GeoAutonomousSystemOrganization.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -248,9 +229,7 @@ func (b *nodeRecordConsensusBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -259,15 +238,11 @@ func (b *nodeRecordConsensusBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 51) + row := make(map[string]any, 48) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["enr"] = b.Enr.Row(i) - if v := b.NodeID.Row(i); v.Set { - row["node_id"] = v.Value - } else { - row["node_id"] = nil - } + row["node_id"] = b.NodeID.Row(i) if v := b.PeerIDUniqueKey.Row(i); v.Set { row["peer_id_unique_key"] = v.Value } else { @@ -351,7 +326,6 @@ func (b *nodeRecordConsensusBatch) Snapshot() []map[string]any { row["geo_autonomous_system_organization"] = nil } row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -384,9 +358,7 @@ func (b *nodeRecordConsensusBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row } diff --git a/pkg/consumoor/route/node/node_record_consensus.go b/pkg/consumoor/route/node/node_record_consensus.go index a8d86ba41..257f8884e 100644 --- a/pkg/consumoor/route/node/node_record_consensus.go +++ b/pkg/consumoor/route/node/node_record_consensus.go @@ -89,13 +89,7 @@ func (b *nodeRecordConsensusBatch) appendPayload( consensus := event.GetNodeRecordConsensus() b.Enr.Append(nodeStringValue(consensus.GetEnr())) - // NodeID is Nullable[string]. - nodeID := nodeStringValue(consensus.GetNodeId()) - if nodeID != "" { - b.NodeID.Append(chProto.NewNullable[string](nodeID)) - } else { - b.NodeID.Append(chProto.Nullable[string]{}) - } + b.NodeID.Append(nodeStringValue(consensus.GetNodeId())) // PeerIDUniqueKey: hash of peerID + network. peerID := nodeStringValue(consensus.GetPeerId()) diff --git a/pkg/consumoor/route/node/node_record_execution.gen.go b/pkg/consumoor/route/node/node_record_execution.gen.go index d699c455e..912c98b93 100644 --- a/pkg/consumoor/route/node/node_record_execution.gen.go +++ b/pkg/consumoor/route/node/node_record_execution.gen.go @@ -43,7 +43,6 @@ type nodeRecordExecutionBatch struct { GeoAutonomousSystemNumber *proto.ColNullable[uint32] GeoAutonomousSystemOrganization *proto.ColNullable[string] MetaClientName proto.ColStr - MetaClientID proto.ColStr MetaClientVersion proto.ColStr MetaClientImplementation proto.ColStr MetaClientOS proto.ColStr @@ -56,9 +55,7 @@ type nodeRecordExecutionBatch struct { MetaClientGeoLatitude *proto.ColNullable[float64] MetaClientGeoAutonomousSystemNumber *proto.ColNullable[uint32] MetaClientGeoAutonomousSystemOrganization *proto.ColNullable[string] - MetaNetworkID proto.ColInt32 MetaNetworkName proto.ColStr - MetaLabels *proto.ColMap[string, string] rows int } @@ -78,7 +75,6 @@ func newnodeRecordExecutionBatch() *nodeRecordExecutionBatch { MetaClientGeoLatitude: new(proto.ColFloat64).Nullable(), MetaClientGeoAutonomousSystemNumber: new(proto.ColUInt32).Nullable(), MetaClientGeoAutonomousSystemOrganization: new(proto.ColStr).Nullable(), - MetaLabels: proto.NewMap[string, string](new(proto.ColStr), new(proto.ColStr)), } } @@ -89,7 +85,6 @@ func (b *nodeRecordExecutionBatch) Rows() int { func (b *nodeRecordExecutionBatch) appendMetadata(event *xatu.DecoratedEvent) { if event == nil || event.GetMeta() == nil { b.MetaClientName.Append("") - b.MetaClientID.Append("") b.MetaClientVersion.Append("") b.MetaClientImplementation.Append("") b.MetaClientOS.Append("") @@ -102,14 +97,11 @@ func (b *nodeRecordExecutionBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.Nullable[float64]{}) b.MetaClientGeoAutonomousSystemNumber.Append(proto.Nullable[uint32]{}) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.Nullable[string]{}) - b.MetaNetworkID.Append(0) b.MetaNetworkName.Append("") - b.MetaLabels.Append(nil) return } b.MetaClientName.Append(event.GetMeta().GetClient().GetName()) - b.MetaClientID.Append(event.GetMeta().GetClient().GetId()) b.MetaClientVersion.Append(event.GetMeta().GetClient().GetVersion()) b.MetaClientImplementation.Append(event.GetMeta().GetClient().GetImplementation()) b.MetaClientOS.Append(event.GetMeta().GetClient().GetOs()) @@ -122,13 +114,7 @@ func (b *nodeRecordExecutionBatch) appendMetadata(event *xatu.DecoratedEvent) { b.MetaClientGeoLatitude.Append(proto.NewNullable[float64](event.GetMeta().GetServer().GetClient().GetGeo().GetLatitude())) b.MetaClientGeoAutonomousSystemNumber.Append(proto.NewNullable[uint32](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemNumber())) b.MetaClientGeoAutonomousSystemOrganization.Append(proto.NewNullable[string](event.GetMeta().GetServer().GetClient().GetGeo().GetAutonomousSystemOrganization())) - b.MetaNetworkID.Append(int32(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetId())) b.MetaNetworkName.Append(event.GetMeta().GetClient().GetEthereum().GetNetwork().GetName()) - if labels := event.GetMeta().GetClient().GetLabels(); labels != nil { - b.MetaLabels.Append(labels) - } else { - b.MetaLabels.Append(map[string]string{}) - } } func (b *nodeRecordExecutionBatch) Input() proto.Input { @@ -163,7 +149,6 @@ func (b *nodeRecordExecutionBatch) Input() proto.Input { {Name: "geo_autonomous_system_number", Data: b.GeoAutonomousSystemNumber}, {Name: "geo_autonomous_system_organization", Data: b.GeoAutonomousSystemOrganization}, {Name: "meta_client_name", Data: &b.MetaClientName}, - {Name: "meta_client_id", Data: &b.MetaClientID}, {Name: "meta_client_version", Data: &b.MetaClientVersion}, {Name: "meta_client_implementation", Data: &b.MetaClientImplementation}, {Name: "meta_client_os", Data: &b.MetaClientOS}, @@ -176,9 +161,7 @@ func (b *nodeRecordExecutionBatch) Input() proto.Input { {Name: "meta_client_geo_latitude", Data: b.MetaClientGeoLatitude}, {Name: "meta_client_geo_autonomous_system_number", Data: b.MetaClientGeoAutonomousSystemNumber}, {Name: "meta_client_geo_autonomous_system_organization", Data: b.MetaClientGeoAutonomousSystemOrganization}, - {Name: "meta_network_id", Data: &b.MetaNetworkID}, {Name: "meta_network_name", Data: &b.MetaNetworkName}, - {Name: "meta_labels", Data: b.MetaLabels}, } } @@ -213,7 +196,6 @@ func (b *nodeRecordExecutionBatch) Reset() { b.GeoAutonomousSystemNumber.Reset() b.GeoAutonomousSystemOrganization.Reset() b.MetaClientName.Reset() - b.MetaClientID.Reset() b.MetaClientVersion.Reset() b.MetaClientImplementation.Reset() b.MetaClientOS.Reset() @@ -226,9 +208,7 @@ func (b *nodeRecordExecutionBatch) Reset() { b.MetaClientGeoLatitude.Reset() b.MetaClientGeoAutonomousSystemNumber.Reset() b.MetaClientGeoAutonomousSystemOrganization.Reset() - b.MetaNetworkID.Reset() b.MetaNetworkName.Reset() - b.MetaLabels.Reset() b.rows = 0 } @@ -237,7 +217,7 @@ func (b *nodeRecordExecutionBatch) Snapshot() []map[string]any { out := make([]map[string]any, n) for i := 0; i < n; i++ { - row := make(map[string]any, 46) + row := make(map[string]any, 43) row["updated_date_time"] = b.UpdatedDateTime.Row(i).Unix() row["event_date_time"] = b.EventDateTime.Row(i).UnixMilli() row["enr"] = b.Enr.Row(i) @@ -296,7 +276,6 @@ func (b *nodeRecordExecutionBatch) Snapshot() []map[string]any { row["geo_autonomous_system_organization"] = nil } row["meta_client_name"] = b.MetaClientName.Row(i) - row["meta_client_id"] = b.MetaClientID.Row(i) row["meta_client_version"] = b.MetaClientVersion.Row(i) row["meta_client_implementation"] = b.MetaClientImplementation.Row(i) row["meta_client_os"] = b.MetaClientOS.Row(i) @@ -329,9 +308,7 @@ func (b *nodeRecordExecutionBatch) Snapshot() []map[string]any { } else { row["meta_client_geo_autonomous_system_organization"] = nil } - row["meta_network_id"] = b.MetaNetworkID.Row(i) row["meta_network_name"] = b.MetaNetworkName.Row(i) - row["meta_labels"] = b.MetaLabels.Row(i) out[i] = row }