Return pruned entry count from prune_live_chain()#153
Conversation
The other two prune methods (prune_gossip_signatures, prune_aggregated_payloads) already returned usize. Now all three are consistent and the caller logs all three counts together.
🤖 Kimi Code ReviewReview SummaryThe changes in this PR are correct and improve observability of the pruning process. No security vulnerabilities or correctness issues found. Positive Changes
Minor SuggestionsLine 375: Consider using consistent naming for the return variable: let pruned_chain_count = self.prune_live_chain(finalized.slot);This would make the logging line clearer: Verification
The PR is ready to merge. Automated review by Kimi (Moonshot AI) · custom prompt |
🤖 Codex Code ReviewFindings
Looks good
No issues found for consensus-layer logic Suggested next steps
Automated review by OpenAI Codex · custom prompt |
🤖 Claude Code ReviewThe PR is small, targeted, and clean. Here is the review: Review: Return pruned entry count from
|
| Function | Condition | Prunes finalized slot itself? |
|---|---|---|
prune_live_chain |
slot < finalized_slot |
No |
prune_gossip_signatures |
stored.slot <= finalized_slot |
Yes |
prune_aggregated_payloads |
p.slot > finalized_slot (keep) |
Yes |
prune_live_chain retains the entry at exactly finalized_slot, while the other two remove it. The intent in the doc comment — "only the LiveChain index is pruned" — is consistent with conservative pruning, so this may be deliberate (the finalized block itself stays reachable in the live index). But the asymmetry could cause confusion if a future caller expects uniform behaviour. Worth a clarifying comment at the boundary condition (store.rs:435) if this is intentional.
No blocking issues
The change is correct. No new bugs are introduced. The function signature change is purely additive and there is only one call site.
Automated review by Claude (Anthropic) · custom prompt
Greptile SummaryThis PR refactors
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| crates/storage/src/store.rs | Changed prune_live_chain() return type from void to usize for consistency with other pruning methods; updated caller to log all three pruned counts together |
Last reviewed commit: 4a98524
Summary
prune_live_chain()returnusize(number of entries pruned) to matchprune_gossip_signatures()andprune_aggregated_payloads()update_checkpoints()to log all three pruned counts togetherTest plan
cargo checkpasses