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

Optimize block processing - Part 1 #619

Merged
merged 60 commits into from
Sep 26, 2024
Merged

Conversation

heifner
Copy link
Member

@heifner heifner commented Aug 22, 2024

Change set already large, going to finish the rest of the work for #529 in separate PRs. See #688

  • Renamed controller::push_block and controller::maybe_switch_forks to controller::apply_blocks as they now do the same thing.
  • Renamed create_block_handle to accept_block. create_block_handle does more than just create a block_handle. It is often paired with apply_blocks, so I think accept_block(b) .. apply_blocks() is better. Removed create_block_handle_future as it is no longer needed.
  • Removed net_plugin unlinkable_block_state_cache. I don't think unlinkable blocks should happen normally anymore (especially after Node stuck in infinite loop on startup with full fork database #634 is fixed). This was only an optimization/work-around for the unknown possible unlinkable block posted to the main thread. Since unlinkable blocks are no longer posted to the main thread, this is no longer needed.
  • Added work-around in net_plugin for not being able to add proper savanna blocks to fork database until savanna transition is complete.
  • Modified fork_database::add to return a boolean indicating if the added block became the new best head.
  • Refactored handling of block_report. It no longer is passed around, but instead is tracked and reported from pending_block.
  • Moved Produced block log into log_applied along with related Received block log message.
  • Renamed replay_push_block to replay_irreversible_block and simplified as it is only used for replaying irreversible blocks now.
  • Removed info log Block not applied to head. All blocks are processed into the fork database immediately and only the best head at any given time is applied. We report fork switching which is a better indication of what this originally was trying to communicate.

Partially resolves #529
Resolves #821

@heifner heifner added the OCI Work exclusive to OCI team label Aug 22, 2024
…tely and processed later almost all blocks would not be immediately applied to head. We report fork switches which is a better indication of what this is telling the user.
libraries/chain/controller.cpp Outdated Show resolved Hide resolved
libraries/chain/controller.cpp Outdated Show resolved Hide resolved
libraries/chain/include/eosio/chain/controller.hpp Outdated Show resolved Hide resolved
libraries/chain/include/eosio/chain/controller.hpp Outdated Show resolved Hide resolved
libraries/chain/controller.cpp Outdated Show resolved Hide resolved
libraries/chain/controller.cpp Show resolved Hide resolved
libraries/chain/controller.cpp Outdated Show resolved Hide resolved
libraries/chain/fork_database.cpp Outdated Show resolved Hide resolved
libraries/chain/include/eosio/chain/fork_database.hpp Outdated Show resolved Hide resolved
libraries/testing/tester.cpp Outdated Show resolved Hide resolved
plugins/net_plugin/net_plugin.cpp Show resolved Hide resolved
@ericpassmore
Copy link
Contributor

Note:start
category: Other
component: Internal
summary: Optimize block processing - Part 1.
Note:end

… need to serialize those through the dispatcher strand. Check for LIB on processing block. Test failed because the dispatcher strand was way behind all other threads.
…s nice on startup when there are many blocks in the forkdb.
@heifner heifner merged commit 56b08a3 into main Sep 26, 2024
36 checks passed
@heifner heifner deleted the GH-529-optimize-block-processing branch September 26, 2024 18:43
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.

Test failure: p2p_sync_throttle_test Optimize processing of incoming blocks
4 participants