Commit ab272e8
fix(sync): reduce quorum to 1 and add orphan-triggered re-sync
Fixes two critical bugs identified in chaos test analysis:
1. Quorum Requirement (config.rs): Reduced min_peer_quorum from 2 to 1
- In 2-node networks, a quorum of 2 blocked gap detection since only
1 peer existed
- Single peer height reports are now trusted for recovery
2. Orphan-Triggered Re-sync (handlers.rs): Added gap check after caching
orphan blocks
- If orphan gap >= 5 blocks, triggers ForceResync immediately
- Handles case where gossipsub delivers blocks but Active Height
Monitoring fails to detect the gap
- Example: Node 2 receives orphan block 68 while at height 47,
gap of 21 triggers immediate re-sync
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 4d56a9d commit ab272e8
2 files changed
+45
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
870 | 913 | | |
871 | 914 | | |
872 | 915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
0 commit comments