Commit 2f3d83b
fix: bound fork-recovery replay to the nearest snapshot, never from genesis
reconcile_state_after_rollback fell back to a full replay from height 0 under
the global state lock on every rollback, freezing the node for minutes and
turning a transient one-block fork into a permanent network halt. Root: commit
337ca43 switched the boundary snapshot writer to full_snap_, but the recovery
reader (load_state_snapshot_by_height) only read the legacy state_snap_ key, so
no snapshot was ever found.
- add Storage::decode_snapshot_accounts: format-aware decoder that reads the
canonical full_snap_ (Format A, raw accounts-CF dump) and the legacy
state_snap_ (Format B, bincode Vec) into the account list
- reconcile now decodes the snapshot bytes already fetched by
find_snapshot_at_or_before (no second state_snap_-only read), restoring from
the freshest snapshot <= target so replay is bounded to <= the snapshot
interval instead of a genesis replay
- refuse a from-0 replay above the genesis window: no usable snapshot and
target > interval returns Err so the caller re-syncs from the canonical
2f+1 chain instead of freezing
A transient fork above finality is now bounded and self-heals via re-sync.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 337ca43 commit 2f3d83b
2 files changed
Lines changed: 73 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3500 | 3500 | | |
3501 | 3501 | | |
3502 | 3502 | | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
3503 | 3506 | | |
3504 | 3507 | | |
3505 | | - | |
3506 | | - | |
3507 | | - | |
3508 | | - | |
3509 | | - | |
3510 | | - | |
3511 | | - | |
3512 | | - | |
3513 | | - | |
3514 | | - | |
3515 | | - | |
3516 | | - | |
3517 | | - | |
3518 | | - | |
3519 | | - | |
3520 | | - | |
3521 | | - | |
3522 | | - | |
3523 | | - | |
3524 | | - | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
3525 | 3511 | | |
3526 | | - | |
3527 | | - | |
3528 | | - | |
3529 | | - | |
| 3512 | + | |
3530 | 3513 | | |
3531 | 3514 | | |
3532 | 3515 | | |
3533 | 3516 | | |
3534 | | - | |
3535 | | - | |
3536 | | - | |
3537 | | - | |
3538 | | - | |
3539 | | - | |
3540 | | - | |
| 3517 | + | |
3541 | 3518 | | |
3542 | 3519 | | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
3543 | 3530 | | |
3544 | 3531 | | |
3545 | 3532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7852 | 7852 | | |
7853 | 7853 | | |
7854 | 7854 | | |
| 7855 | + | |
| 7856 | + | |
| 7857 | + | |
| 7858 | + | |
| 7859 | + | |
| 7860 | + | |
| 7861 | + | |
| 7862 | + | |
| 7863 | + | |
| 7864 | + | |
| 7865 | + | |
| 7866 | + | |
| 7867 | + | |
| 7868 | + | |
| 7869 | + | |
| 7870 | + | |
| 7871 | + | |
| 7872 | + | |
| 7873 | + | |
| 7874 | + | |
| 7875 | + | |
| 7876 | + | |
| 7877 | + | |
| 7878 | + | |
| 7879 | + | |
| 7880 | + | |
| 7881 | + | |
| 7882 | + | |
| 7883 | + | |
| 7884 | + | |
| 7885 | + | |
| 7886 | + | |
| 7887 | + | |
| 7888 | + | |
| 7889 | + | |
| 7890 | + | |
| 7891 | + | |
| 7892 | + | |
| 7893 | + | |
| 7894 | + | |
| 7895 | + | |
| 7896 | + | |
| 7897 | + | |
| 7898 | + | |
| 7899 | + | |
| 7900 | + | |
| 7901 | + | |
| 7902 | + | |
| 7903 | + | |
| 7904 | + | |
| 7905 | + | |
| 7906 | + | |
| 7907 | + | |
| 7908 | + | |
| 7909 | + | |
7855 | 7910 | | |
7856 | 7911 | | |
7857 | 7912 | | |
| |||
0 commit comments