# Slashings Comparing MigaLabs data vs Xatu. - https://gist.githubusercontent.com/samcm/6534158d275a8ee9ac615d07683a39e4/raw/f2b7c9c73b78c62456b1997deb4311e48c8fc7d5/xatu.csv ```sql WITH -- CTE for attester slashings with intersection of attesting indices attester_slashings AS ( SELECT arrayIntersect(attestation_1_attesting_indices, attestation_2_attesting_indices) AS intersected_indices, meta_network_name FROM default.canonical_beacon_block_attester_slashing FINAL WHERE meta_network_name = 'mainnet' ), -- CTE for proposer slashings proposer_slashings AS ( SELECT signed_header_1_message_proposer_index AS proposer_index, meta_network_name FROM default.canonical_beacon_block_proposer_slashing FINAL WHERE meta_network_name = 'mainnet' ) -- Combine attester and proposer slashings SELECT validator_index, slashing_type, FROM ( SELECT arrayJoin(intersected_indices) AS validator_index, 'attester_slashing' AS slashing_type FROM attester_slashings UNION ALL SELECT proposer_index AS validator_index, 'proposer_slashing' AS slashing_type FROM proposer_slashings ) GROUP BY validator_index, slashing_type ORDER BY validator_index ``` ```python import csv # Extract validator indexes from xatu.csv, skipping the header with open('xatu.csv', 'r') as file: reader = csv.reader(file) next(reader) # Skip header xatu_indexes = [row[0] for row in reader] # Extract validator indexes from miga.csv, skipping the header and extracting the first column with open('miga.csv', 'r') as file: reader = csv.reader(file) next(reader) # Skip header miga_indexes = [row[0] for row in reader] print("Xatu:", len(xatu_indexes)) print("Miga:", len(miga_indexes)) # Find indexes that are in xatu.csv but not in miga.csv print("Indexes in xatu.csv but not in miga.csv:") for index in xatu_indexes: if index not in miga_indexes: print(index) # Find indexes that are in miga.csv but not in xatu.csv print("Indexes in miga.csv but not in xatu.csv:") for index in miga_indexes: if index not in xatu_indexes: print(index) ``` ```shell Xatu: 438 Miga: 438 Indexes in xatu.csv but not in miga.csv: Indexes in miga.csv but not in xatu.csv: ```