-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cl-mimicry): Add LIBP2P_GOSSIPSUB_BLOB_SIDECAR (#323)
* Finish coding * Finish configurations * bug fixes
- Loading branch information
1 parent
0b54e39
commit d0a85d4
Showing
14 changed files
with
2,412 additions
and
1,625 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
deploy/migrations/clickhouse/037_libp2p_gossipsub_blob_sidecar.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DROP TABLE IF EXISTS libp2p_gossipsub_blob_sidecar ON CLUSTER '{cluster}'; | ||
DROP TABLE IF EXISTS libp2p_gossipsub_blob_sidecar_local ON CLUSTER '{cluster}'; |
88 changes: 88 additions & 0 deletions
88
deploy/migrations/clickhouse/037_libp2p_gossipsub_blob_sidecar.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.