Commit 92f2089
fix(sync): cold-join wedge — hold chain_height >= snapshot anchor on every path
A fork-recovery rollback could strand the contiguous apply-frontier (get_chain_height) below the monotonic snapshot/finality floor (SNAPSHOT_ANCHOR_MB). The apply-dedup gate skips every block at/below the anchor while the sync coordinator re-requests from chain_height+1 -> permanent re-request livelock (frozen apply, growing future_drop). Clean snapshot cold-join was safe (fast_sync sets chain_height=snapshot_height); the wedge needed a rollback below an already-raised anchor.
Maintain get_chain_height() >= SNAPSHOT_ANCHOR_MB*90: adopt_snapshot_finality sets chain_height with the floor (atomic adoption); reload_snapshot_anchor heals it at boot; fork-recovery clamps rollback_to = fork_h.max(anchor_floor); sync coordinator floors apply_tip by the anchor (keystone self-heal).
Close the cross-attempt discard edge: a rejected snapshot after a prior adopt left a high anchor over wiped state. AnchorReset guard caps the restored anchor by live chain_height; discard_snapshot_state resets the runtime floors + deletes the persisted anchor before the CF wipes.
Genesis-inert (anchor=0). cargo check clean, 185 lib tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 5255cc5 commit 92f2089
3 files changed
Lines changed: 72 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
1087 | 1099 | | |
1088 | 1100 | | |
1089 | 1101 | | |
| |||
1115 | 1127 | | |
1116 | 1128 | | |
1117 | 1129 | | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
1118 | 1136 | | |
1119 | 1137 | | |
1120 | 1138 | | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1121 | 1156 | | |
1122 | 1157 | | |
1123 | 1158 | | |
| |||
13894 | 13929 | | |
13895 | 13930 | | |
13896 | 13931 | | |
13897 | | - | |
13898 | | - | |
13899 | | - | |
| 13932 | + | |
| 13933 | + | |
| 13934 | + | |
| 13935 | + | |
| 13936 | + | |
| 13937 | + | |
| 13938 | + | |
| 13939 | + | |
| 13940 | + | |
| 13941 | + | |
| 13942 | + | |
| 13943 | + | |
13900 | 13944 | | |
13901 | 13945 | | |
13902 | 13946 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9752 | 9752 | | |
9753 | 9753 | | |
9754 | 9754 | | |
9755 | | - | |
| 9755 | + | |
| 9756 | + | |
| 9757 | + | |
| 9758 | + | |
| 9759 | + | |
| 9760 | + | |
| 9761 | + | |
| 9762 | + | |
| 9763 | + | |
| 9764 | + | |
9756 | 9765 | | |
9757 | 9766 | | |
9758 | 9767 | | |
| |||
10056 | 10065 | | |
10057 | 10066 | | |
10058 | 10067 | | |
| 10068 | + | |
| 10069 | + | |
| 10070 | + | |
| 10071 | + | |
| 10072 | + | |
10059 | 10073 | | |
10060 | 10074 | | |
10061 | 10075 | | |
| |||
10066 | 10080 | | |
10067 | 10081 | | |
10068 | 10082 | | |
| 10083 | + | |
| 10084 | + | |
| 10085 | + | |
10069 | 10086 | | |
10070 | 10087 | | |
10071 | 10088 | | |
10072 | 10089 | | |
10073 | 10090 | | |
10074 | 10091 | | |
10075 | 10092 | | |
10076 | | - | |
10077 | 10093 | | |
10078 | 10094 | | |
10079 | 10095 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
596 | | - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
597 | 603 | | |
598 | 604 | | |
599 | 605 | | |
| |||
0 commit comments