Block found celebration + smarter ZMQ stale detection
Replace the subtle petal animation with a full block-found party: confetti rain, sakura petals, ember burst, and a dismissible banner showing block height and reward. Triggers on pool block finds (not every network block). Animations loop until the user clicks dismiss. Fix ZMQ stale banner false-positiving during long block intervals by comparing ZMQ age against tip-change age instead of a fixed 30-min threshold. Add tip_changed_age to the snapshot so the UI can tell "no blocks on the network" from "ZMQ is broken". Use solid background colors on health banners instead of transparent rgba.
This commit is contained in:
@@ -13,13 +13,17 @@
|
||||
return Math.max(0, (d.block_submit_attempts ?? 0) - (d.block_submits_confirmed ?? 0));
|
||||
});
|
||||
|
||||
// ZMQ stale = configured but no event in 30+ minutes. Bitcoin's avg
|
||||
// block interval is 10 min; 30 min covers normal variance without
|
||||
// false-alarming on quiet stretches.
|
||||
// ZMQ stale = the tip has advanced but ZMQ didn't fire. ZMQ
|
||||
// delivers within milliseconds, so if the tip changed recently
|
||||
// but the last ZMQ event is much older, the subscriber is broken.
|
||||
// When no block has been mined, both ages grow together → no alarm.
|
||||
const zmqStale = $derived.by(() => {
|
||||
const d = snap.data;
|
||||
if (!d || !d.zmq_enabled || !d.has_last_zmq_event) return false;
|
||||
return (d.last_zmq_event_age ?? 0) > 1800;
|
||||
const zmqAge = d.last_zmq_event_age ?? 0;
|
||||
const tipAge = d.tip_changed_age ?? 0;
|
||||
// Alarm when ZMQ is 3+ min older than the last tip change.
|
||||
return zmqAge > tipAge + 180;
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -67,8 +71,8 @@
|
||||
line-height: 1.4;
|
||||
}
|
||||
.banner.warn {
|
||||
background: rgba(220, 170, 60, 0.10);
|
||||
border-color: rgba(220, 170, 60, 0.40);
|
||||
background: rgb(50, 40, 15);
|
||||
border-color: rgb(220, 170, 60);
|
||||
color: rgb(220, 180, 100);
|
||||
}
|
||||
.icon {
|
||||
|
||||
Reference in New Issue
Block a user