Pruner service…#114
Conversation
…embly to cleanup service
|
🤖 Claude Code Review Status: Complete Current ReviewThis PR successfully refactors UTXO cleanup functionality from BlockAssembly into a dedicated Pruner service. The architecture is well-designed with proper separation of concerns. Key improvements made:
No critical issues found. The code follows project conventions, includes comprehensive documentation, and handles edge cases appropriately. History:
|
…o stu/cleanup-service
|
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
…o stu/cleanup-service
Old news - sorted already |
| @@ -0,0 +1,22 @@ | |||
| package config | |||
There was a problem hiding this comment.
Why is this in a new config folder? Shouldn't this just be in the service folder in the interface.go?
There was a problem hiding this comment.
agree - FF brain fart I didn't spot
|
|
||
| // Safety check before DAH pruner phase | ||
| // Recheck block assembly state to ensure it hasn't changed (e.g., to reorg) | ||
| state, err = s.blockAssemblyClient.GetBlockAssemblyState(ctx) |
There was a problem hiding this comment.
Is this not a duplicate of line 52?
There was a problem hiding this comment.
Read the comment - its re-checking
I'm not convinced it should re-check anyway now I'm looking through the logic again
Add complete documentation for the Pruner service, a standalone microservice extracted from Block Assembly (PR bsv-blockchain#114) responsible for UTXO data pruning operations. New Documentation: - docs/topics/services/pruner.md: Main service documentation * Description and architecture (Container/Component diagrams) * Two-phase pruning process (parent preservation + DAH pruning) * Event-driven trigger mechanism (BlockPersisted notifications) * Coordination with Block Persister * Job queue management (LIFO pattern) * Migration guide from embedded cleanup * Configuration and deployment - docs/references/services/pruner_reference.md: API reference * gRPC API (HealthGRPC endpoint) * Prometheus metrics (pruner_*, utxo_cleanup_*) * Internal interfaces * Event subscriptions * Error codes and troubleshooting - docs/references/settings/services/pruner_settings.md: Settings reference * Service control (startPruner) * Network settings (gRPC ports and addresses) * Job management (pruner_jobTimeout) * UTXO store settings (retention, preservation, workers) * Context-specific configuration examples Diagrams (PlantUML): - C4 Container diagram (PNG) - C4 Component diagram (PNG) - Service initialization sequence (SVG) - BlockPersisted trigger mechanism (SVG) - Fallback trigger mechanism (SVG) - Two-phase pruning process (SVG) - Parent preservation detail (SVG) - DAH pruning detail (SVG) - Job queue management (LIFO) (SVG) - Block Persister coordination (SVG) - Detailed component diagram (SVG) Updated Documentation: - mkdocs.yml: Add Pruner to navigation (Topics, Reference, Settings) - docs/references/projectStructure.md: Add Pruner service entry - docs/topics/stores/utxo.md: Expand Data Pruning section * Link to Pruner service documentation * Explain two-phase safety mechanism * Document event-driven architecture All markdown files validated with markdownlint and validate-markdown.py.
Update Block Assembly documentation to reflect that UTXO pruning functionality was extracted to the standalone Pruner service (PR bsv-blockchain#114). Changes to docs/topics/services/blockAssembly.md: - Remove section 2.7 "Unmined Transaction Cleanup" (now handled by Pruner) - Renumber section 2.8 "Resetting the Block Assembly" to 2.7 - Update table of contents to remove cleanup section - Replace item 9 in description: "Periodic Unmined Transaction Cleanup" with "Coordination with Pruner Service" and link to pruner.md Changes to docs/references/services/blockassembly_reference.md: - Remove cleanup-related struct fields documentation: * cleanupService * cleanupServiceLoaded * cleanupQueueCh * cleanupQueueWorkerStarted * unminedCleanupTicker - Add note explaining removal in PR bsv-blockchain#114 with link to Pruner service docs - Update lastPersistedHeight comment (remove "coordinate with cleanup") All markdown files validated with markdownlint and validate-markdown.py.
- Standardize "How to Run" section to match other services format - Add comprehensive Migration Guide section (section 8) covering: - Architectural changes from PR bsv-blockchain#114 extraction - Configuration changes (new vs unchanged settings) - Verification steps for operators - Backward compatibility notes - Troubleshooting common migration issues - Fix TOC link fragments to correctly reference all sections - Remove verbose standalone execution examples in favor of simple format The format now matches blockPersister.md and other service documentation patterns for consistency.
move preserve parent and utxo cleanup from blockassembly to cleanup service