Commit 3188e33
fix(consensus,p2p,storage): autonomous cold-join (GALC) + live churn/apply-stall fixes
Cold-join / weak-subjectivity (genesis-anchored, no manual pin rotation):
- galc.rs: genesis-multisigned live-checkpoint capsule (mb_index, mb_hash, per-
macroblock committee digests) as a self-authenticating weak-subjectivity trust
root; verified against embedded genesis PKs, 2f+1, monotonic adoption.
- snapshot completeness: flush in-RAM accounts to the accounts CF before the dump;
PinnedDbSnapshot exposes one consistent point-in-time view across all CFs.
- persist-before-evict: account-cache eviction persists to CF first, drops only on
success.
- bind the per-macroblock committee digest in the by-hash pin branch.
- raise MAX_WS_WALK_MB + MB_FETCH_MAX_ATTEMPTS for mature-chain cold-join.
Live liveness (root-caused from the running genesis net):
- eviction + desync reference the convergent QC-verified finalized frontier, not the
produced-tip peer median: stops false eviction of healthy peers and the
one-rotation (gap=30) redundant syncs; cold-join path unchanged (frontier==0).
- height-eviction applies only to directly-connected peers; gossip-only nodes are
reaped by the last_seen TTL (no false eviction at scale).
- apply dedup is O(1) on the applied-frontier atomic; storage read only on a
re-delivery (no hot-path RocksDB lookup).
- periodic WAL flush runs off the consensus runtime via spawn_blocking with
set_wait(false): no longer stalls block apply behind compaction.
- producer publishes LOCAL_BLOCKCHAIN_HEIGHT immediately after save (dedup invariant
holds across both writers).
Validated: cargo check + 184 lib tests green (qnet-integration).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent e0e29bb commit 3188e33
10 files changed
Lines changed: 929 additions & 113 deletions
File tree
- core/qnet-state/src
- development/qnet-integration/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
786 | 786 | | |
787 | 787 | | |
788 | 788 | | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
789 | 797 | | |
790 | 798 | | |
791 | 799 | | |
| |||
1052 | 1060 | | |
1053 | 1061 | | |
1054 | 1062 | | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
1055 | 1085 | | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
1063 | 1095 | | |
1064 | 1096 | | |
1065 | 1097 | | |
| |||
2244 | 2276 | | |
2245 | 2277 | | |
2246 | 2278 | | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
2247 | 2286 | | |
2248 | 2287 | | |
2249 | 2288 | | |
| |||
2306 | 2345 | | |
2307 | 2346 | | |
2308 | 2347 | | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
2309 | 2408 | | |
2310 | 2409 | | |
2311 | 2410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2391 | 2391 | | |
2392 | 2392 | | |
2393 | 2393 | | |
2394 | | - | |
2395 | | - | |
2396 | | - | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
2400 | | - | |
2401 | | - | |
2402 | | - | |
2403 | | - | |
2404 | | - | |
2405 | | - | |
2406 | | - | |
2407 | | - | |
2408 | | - | |
2409 | | - | |
2410 | | - | |
2411 | | - | |
2412 | | - | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
2413 | 2421 | | |
2414 | | - | |
2415 | 2422 | | |
2416 | 2423 | | |
2417 | 2424 | | |
| |||
3063 | 3070 | | |
3064 | 3071 | | |
3065 | 3072 | | |
3066 | | - | |
3067 | | - | |
3068 | | - | |
3069 | | - | |
3070 | | - | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
3071 | 3079 | | |
3072 | 3080 | | |
3073 | | - | |
3074 | | - | |
3075 | | - | |
3076 | | - | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
| 3087 | + | |
| 3088 | + | |
| 3089 | + | |
| 3090 | + | |
| 3091 | + | |
| 3092 | + | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
3077 | 3097 | | |
3078 | | - | |
| 3098 | + | |
3079 | 3099 | | |
3080 | 3100 | | |
3081 | | - | |
| 3101 | + | |
3082 | 3102 | | |
3083 | 3103 | | |
3084 | 3104 | | |
| |||
0 commit comments