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.1.0] Do not allow replay-blockchain without snapshot #1156

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

heifner
Copy link
Member

@heifner heifner commented Feb 10, 2025

Do not allow --replay-blockchain option without --snapshot option unless a full block log is available as it will fail and leave the blockchain in a non-recoverable state.

While attempting to reproduce #1152, I kicked off a --replay-blockchain but forgot to add the --snapshot option. I didn't have a full block log. This resulted in the following:

info  2025-02-08T13:32:56.675 nodeos    chain_plugin.cpp:778          plugin_initialize    ] Replay requested: deleting state database
info  2025-02-08T13:32:57.062 nodeos    chain_plugin.cpp:933          plugin_initialize    ] Starting fresh blockchain state using default genesis state.
...
info  2025-02-08T13:32:57.915 nodeos    listener.hpp:150              log_listening        ] start listening on 127.0.0.1:7777 resolved from 127.0.0.1:7777 for API categories: all
warn  2025-02-08T13:32:57.916 nodeos    controller.cpp:4379           apply_blocks         ] 3020001 fork_db_block_not_found: Block can not be found
block 000000017c8ae6fcc236a1254b032f9b375971d88025e717fcba43aeee9aa41a does not exist
    {"id":"000000017c8ae6fcc236a1254b032f9b375971d88025e717fcba43aeee9aa41a"}
    nodeos  fork_database.cpp:509 fetch_branch_from_impl

warn  2025-02-08T13:32:57.916 nodeos    controller.cpp:4379           apply_blocks         ] 3020001 fork_db_block_not_found: Block can not be found
block 000000017c8ae6fcc236a1254b032f9b375971d88025e717fcba43aeee9aa41a does not exist
    {"id":"000000017c8ae6fcc236a1254b032f9b375971d88025e717fcba43aeee9aa41a"}
    nodeos  fork_database.cpp:509 fetch_branch_from_impl

error 2025-02-08T13:32:57.916 nodeos    producer_plugin.cpp:949       on_incoming_block    ] Cannot recover from 3020001 fork_db_block_not_found: Block can not be found
block 000000017c8ae6fcc236a1254b032f9b375971d88025e717fcba43aeee9aa41a does not exist
    {"id":"000000017c8ae6fcc236a1254b032f9b375971d88025e717fcba43aeee9aa41a"}
    nodeos  fork_database.cpp:509 fetch_branch_from_impl
rethrow
    {}
    nodeos  controller.cpp:4380 apply_blocks
. Shutting down.

At this point the the state directory has to be removed and restart is required from the snapshot.

@heifner heifner requested review from greg7mdp and linh2931 February 10, 2025 16:03
@heifner heifner added the OCI Work exclusive to OCI team label Feb 10, 2025
@heifner heifner added this to the Spring v1.1.0 milestone Feb 10, 2025
@@ -1516,6 +1529,16 @@ namespace eosio { namespace chain {
} , *context);
}

// static
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add a comment saying returning 0 if block logs do not exist. This comment is optional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there are no comments on any of the methods, including first_block_num(). I think I'll leave it as is to avoid having to wait on another ci/cd run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just leave as is.

@heifner heifner merged commit 828c9b9 into release/1.1 Feb 10, 2025
71 checks passed
@heifner heifner deleted the replay-without-snapshot-1.1 branch February 10, 2025 19:06
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.

3 participants