Skip to content

node: recover the mainchain task - #149

Open
octobocto wants to merge 5 commits into
LayerTwo-Labs:masterfrom
octobocto:2026-09-05-mainchain-task-recovery
Open

node: recover the mainchain task#149
octobocto wants to merge 5 commits into
LayerTwo-Labs:masterfrom
octobocto:2026-09-05-mainchain-task-recovery

Conversation

@octobocto

@octobocto octobocto commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The ancestor walk took end_height from main_block_hash_to_height and start_height from BlockHeaderInfo.height. Commit 7abd8ae fixed an error of one in the first value, so an archive written before it holds a height one too big.

get_nth_main_ancestor counts real parent links from the tip, so a bigger end_height lands one block lower. With a tip at 100 and 50 connected, the walk asks for 51 and gets 51..82. An old archive stores 101 for the tip, so it gets 50..81 and offers block 50 again. connect_mainchain_tip sees a parent of 49 where it wants 50, and returns InvalidMainchainParent.

The mainchain task died at startup, the net task died with it, and the node accepted no peer. The task now starts again after any error, and the node waits for the mainchain services at start.

@octobocto
octobocto force-pushed the 2026-09-05-mainchain-task-recovery branch from 9b90b8c to 452779f Compare September 5, 2026 05:45
@octobocto
octobocto force-pushed the 2026-09-05-mainchain-task-recovery branch from 452779f to 3484928 Compare September 5, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant