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

Finalize blocks in parallel with contextual validation #9162

Open
arya2 opened this issue Jan 24, 2025 · 0 comments
Open

Finalize blocks in parallel with contextual validation #9162

arya2 opened this issue Jan 24, 2025 · 0 comments
Labels
A-concurrency Area: Async code, needs extra work to make it work properly. A-state Area: State / database changes I-slow Problems with performance or responsiveness P-Low ❄️

Comments

@arya2
Copy link
Contributor

arya2 commented Jan 24, 2025

Motivation

When non-checkpointed blocks are committed to a best chain in the non-finalized state with over 99 blocks (max_block_reorg_height), Zebra will remove the root of the non-finalized part of the best chain from the non-finalized state and will block contextual validation of the next block on adding it to the finalized state.

The write block task is often the critical constraint limiting initial sync performance, and is generally difficult to further parallelize as note commitment tree updates must happen in sequence.

Design

  • When a non-finalized best chain contains over 99 blocks, read its root block without removing it
  • Write the block to disk in a spawned thread
  • Remove blocks in the non-finalized state below the finalized tip height before committing more blocks
@arya2 arya2 added A-concurrency Area: Async code, needs extra work to make it work properly. A-state Area: State / database changes I-slow Problems with performance or responsiveness P-Low ❄️ labels Jan 24, 2025
@github-project-automation github-project-automation bot moved this to New in Zebra Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-concurrency Area: Async code, needs extra work to make it work properly. A-state Area: State / database changes I-slow Problems with performance or responsiveness P-Low ❄️
Projects
Status: New
Development

No branches or pull requests

1 participant