Commit f1b9f17
fix(node): push the startup head rewind to the execution node (PR review pass 67)
Codex review pass 67 raised one P1 on the issue #38 CI-stabilization branch.
The pass-66 startup reconciliation dragged the in-memory ForkchoiceState mirror
down to the persisted head and updated the database, but never sent
engine_forkchoiceUpdated to the execution node. Engine::new only stores the
mirror, ChainOrchestrator::new issues no forkchoice update, and the run loop
reissues a head FCU only in response to derivation/finalization/peer events — so
on a quiescent or non-producing node the execution client kept its canonical
head (and its RPC) on the discarded block indefinitely, letting remote followers
still import the block the repair intended to drop. The same latent gap existed
in the pre-existing repair loop whenever the execution node ran ahead of the
database above finalized.
Fix: capture the execution node's live head before any startup head-repair, and
after the engine is built, if a repair rewound the mirror BELOW that live head,
issue a checked forkchoice update to the execution node to actually rewind its
canonical head. A VALID answer confirms the rewind; INVALID (the execution node
rejecting a head recovered from the node's own persisted state) fails startup; a
SYNCING/ACCEPTED answer is left to be reasserted by later FCUs. Skipped when the
provider forkchoice could not be read (engine unreachable / genesis fallback),
since there is no live head to rewind. This covers both the pass-66 addition and
the pre-existing repair loop with a single push.
The lack of automated coverage for this startup-rewind path (it needs an e2e
restart with the execution node ahead of the database) is recorded in
.claude/vmark-pr-review-follow-ups.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 2246ea1 commit f1b9f17
2 files changed
Lines changed: 81 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
8 | 29 | | |
9 | 30 | | |
10 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
585 | 592 | | |
586 | 593 | | |
587 | 594 | | |
| |||
723 | 730 | | |
724 | 731 | | |
725 | 732 | | |
726 | | - | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
727 | 786 | | |
728 | 787 | | |
729 | 788 | | |
| |||
0 commit comments