Commit 317365a
committed
fix(p2p): improve validator heartbeat diagnostics and stale threshold
- Add WARN-level logs for heartbeat message rejections (was DEBUG)
- Add heartbeat_rejections_total counter metric for monitoring
- Make stale threshold configurable via VALIDATOR_STALE_THRESHOLD_MS env var
- Change default stale threshold from 90s to 300s (5 minutes)
- Add unit test for configurable threshold
Root cause: Validators were marked inactive after 90s without visible logs
showing why heartbeats were rejected. Now operators can diagnose P2P issues
and configure appropriate thresholds for their network conditions.
Fixes issue where all validators became inactive simultaneously due to
network hiccups or message validation failures going unnoticed.1 parent 6f22e9e commit 317365a
2 files changed
+73
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| 728 | + | |
| 729 | + | |
728 | 730 | | |
729 | 731 | | |
730 | 732 | | |
| |||
763 | 765 | | |
764 | 766 | | |
765 | 767 | | |
| 768 | + | |
766 | 769 | | |
767 | 770 | | |
768 | 771 | | |
| |||
797 | 800 | | |
798 | 801 | | |
799 | 802 | | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
800 | 812 | | |
801 | 813 | | |
802 | 814 | | |
| |||
1481 | 1493 | | |
1482 | 1494 | | |
1483 | 1495 | | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
1487 | 1500 | | |
1488 | 1501 | | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
1495 | 1525 | | |
1496 | 1526 | | |
1497 | 1527 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
110 | 121 | | |
111 | 122 | | |
112 | 123 | | |
113 | 124 | | |
114 | | - | |
| 125 | + | |
115 | 126 | | |
116 | 127 | | |
117 | 128 | | |
| |||
624 | 635 | | |
625 | 636 | | |
626 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
627 | 660 | | |
0 commit comments