Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0 -> main] Normally process blocks from the forkdb on startup #591

Merged
merged 7 commits into from
Aug 19, 2024

Conversation

heifner
Copy link
Member

@heifner heifner commented Aug 19, 2024

In Spring 1.0.0, unlike Leap, we process blocks into the fork database immediately. This can cause the fork database to grow very large when syncing and shutdown due to hitting the new max-reversible-blocks limit (before #545). When a node is shutdown, in Leap, it was assumed that when restarting a node if that node did not receive any blocks from the network it would be at the same height as when it was shutdown. The existing tests/nodeos_read_terminate_at_block_test.py integration test verifies this behavior.

However, if the node shutdown because of max-reversible-blocks you would like on restart for the node to process blocks out of the fork database potentially allowing LIB to progress and reversible blocks to be consumed and shrink in size. This is at odds with the expected behavior of a node starting up after a terminate-at-block. A user might find it very odd to terminate a node at a block, but find on restart that the node is actually beyond that block.

To fix the issue reported in #565, we would like to process blocks out of the fork database on restart. However, we want to maintain the existing expectations of starting a node after a shutdown via terminate-at-block being at the same block height on restart.

Therefore, this PR modifies nodeos to normally process blocks out of the fork database on startup unless the node has no configured peers. The idea being that if a user has terminated a node with terminate-at-block and wants the node to remain at that block, they will restart the node without any p2p-peer-address configured. This is a bit of a hack until #570 can be added. Since #570 is a new feature, it will not come until a future release and will not be part of Spring 1.0.0.

Merges release/1.0 into main including #572

Resolves #565

…a node that was terminated with many blocks in the forkdb
… attempt to request the next range of block instead of ignoring the request.
…s from the fork database. This allows a block stuck in a condition where it has too many blocks in the forkdb to process new blocks to attempt to apply those blocks on startup.
[1.0] Normally process blocks from the forkdb on startup
@heifner heifner requested review from greg7mdp and arhag August 19, 2024 21:51
@heifner heifner added the OCI Work exclusive to OCI team label Aug 19, 2024
@heifner heifner merged commit fa53ec9 into main Aug 19, 2024
36 checks passed
@heifner heifner deleted the GH-565-sync-stuck-main branch August 19, 2024 22:36
@ericpassmore
Copy link
Contributor

Note:start
group: STABILITY
category: INTERNALS
summary: Until pause at block height is available this fix enables use of forkdb to advance LIB on startup when connected to peers, but does not read from forkdb on startup when no peers are connected.
Note:end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2P: Sync mode stuck after hitting max-reversible-blocks, after restart
4 participants