-
Notifications
You must be signed in to change notification settings - Fork 20
check block subtrees optimisation #199
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
base: main
Are you sure you want to change the base?
check block subtrees optimisation #199
Conversation
|
🤖 Claude Code Review Status: Complete Current Review: This PR implements block subtree validation optimizations with batch UTXO prefetching and pipelined transaction processing. Most critical issues from previous reviews have been fixed. Issues Found:
History:
|
|
New inline comment added for line 367 in check_block_subtrees.go: Critical Bug: Chunking breaks transaction dependencies The chunking logic splits transactions across chunk boundaries without considering dependencies. A child transaction in chunk 2 may try to validate before its parent from chunk 1 is committed to the UTXO store. Example: If tx3 in chunk 1 hasn't been committed when chunk 2 starts, tx4 (which spends from tx3) will fail validation. Fix: Remove the chunking or implement dependency-aware chunking that keeps dependent transactions together. |
|
🤖 Claude Code Review Status: Complete SummaryThis PR implements a significant performance optimization for block subtree validation, achieving 2-5x throughput improvements through batch UTXO prefetching and adaptive processing strategies. The implementation is well-architected with comprehensive tests and benchmarks. HighlightsPerformance improvements:
Code quality:
Review NotesAll previously reported critical bugs have been fixed in the current code:
The optimization approach is sound and follows best practices for high-throughput transaction processing. History:
|
| } | ||
|
|
||
| // Sort by level (stable sort maintains original order within same level) | ||
| for i := 0; i < len(sortedTxs); i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Critical Performance Issue: O(n²) bubble sort
This bubble sort (lines 1204-1209) has O(n²) complexity. For 8M transactions, this performs ~64 trillion comparisons.
Fix: Use standard library sort:
sort.Slice(sortedTxs, func(i, j int) bool {
return sortedTxs[i].level < sortedTxs[j].level
})…o stu/transaction-processing-pipeline
No description provided.