Skip to content

feat(state): Write performance improvements#10447

Draft
arya2 wants to merge 11 commits intosyncer-performancefrom
state-writer-performance
Draft

feat(state): Write performance improvements#10447
arya2 wants to merge 11 commits intosyncer-performancefrom
state-writer-performance

Conversation

@arya2
Copy link
Copy Markdown
Contributor

@arya2 arya2 commented Apr 2, 2026

Based On: #10442

AI Disclosure

  • No AI tools were used in this PR
  • AI tools were used: Claude did almost everything here.

arya2 and others added 11 commits April 3, 2026 17:15
…ize for improved performance

fix(sync): reduce fanout for peer requests and adjust download retry probability
…he tip block context without mutation

fix(chain): expose treestate method for public access
…int processing

- Implemented a mechanism to check if the last checkpoint block has been committed to either the finalized or non-finalized state before proceeding with block writes.
- Added a new function `lookup_spent_utxos` in `ZebraDb` to retrieve spent UTXOs and output locations for finalized blocks, enhancing the efficiency of UTXO lookups.
- Updated the `write_block` method to accept pre-fetched spent UTXOs, allowing for more efficient block writing.
- Introduced a pipeline for processing checkpoint-verified blocks, separating the tasks of committing to the non-finalized state and writing to disk to improve performance.
- Added tests to verify the behavior of the new UTXO lookup functionality and ensure correct block writing when provided with spent UTXOs.
- Created a default configuration file for `zebrad`, providing a skeleton for user customization.
…ck, and peek_finalize_tip

- Test commit_checkpoint_block with genesis and sequential blocks
- Test finalize() correctly pops root blocks after checkpoint commits
- Test peek_finalize_tip returns tip without mutating state
- Test full pipeline: checkpoint commit to NFS then finalize to disk
- Test lookup_spent_utxos and write_block with provided UTXOs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@arya2 arya2 force-pushed the state-writer-performance branch from c5c7a1a to 4aab170 Compare April 3, 2026 22:37
@arya2 arya2 added the I-slow Problems with performance or responsiveness label Apr 3, 2026
@arya2 arya2 added the A-state Area: State / database changes label Apr 3, 2026
@arya2 arya2 changed the title State write performance improvements feat(state): Write performance improvements Apr 3, 2026
@oxarbitrage
Copy link
Copy Markdown
Contributor

Related: #10447 We might want to add benchmarks to this instead or in addition of some of the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-state Area: State / database changes I-slow Problems with performance or responsiveness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants