Skip to content

Commit

Permalink
feat(inclusion_monitor): add geo to alert
Browse files Browse the repository at this point in the history
  • Loading branch information
blombern committed Sep 4, 2024
1 parent f7007c3 commit 379fd80
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/phoenix/inclusion_monitor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ struct DeliveredPayload {
inserted_at: DateTime<Utc>,
proposer_pubkey: String,
slot: i64,
geo: String,
}

async fn get_delivered_payloads(
Expand All @@ -51,6 +52,7 @@ async fn get_delivered_payloads(
SELECT
inserted_at,
slot,
geo,
block_hash,
block_number,
proposer_pubkey
Expand All @@ -73,6 +75,7 @@ async fn get_delivered_payloads(
inserted_at: Utc.from_utc_datetime(&row.get("inserted_at")),
proposer_pubkey: row.get("proposer_pubkey"),
slot: row.get("slot"),
geo: row.get("geo"),
})
.collect()
})
Expand Down Expand Up @@ -152,6 +155,7 @@ async fn report_missing_payload(
let explorer_url = APP_CONFIG.env.to_beacon_explorer_url();

let slot = payload.slot;
let geo = &payload.geo;
let payload_block_hash = &payload.block_hash;
let on_chain_block_hash = telegram::escape_str(found_block_hash.as_deref().unwrap_or("-"));

Expand All @@ -161,6 +165,7 @@ async fn report_missing_payload(
[beaconcha\\.in/slot/{slot}]({explorer_url}/slot/{slot})
slot: {slot}
geo: {geo}
payload\\_block\\_hash: {payload_block_hash}
on\\_chain\\_block\\_hash: {on_chain_block_hash}
"
Expand Down

0 comments on commit 379fd80

Please sign in to comment.