Fixed stale indices bug in SMT implementation and improve pruner#3811
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR fixes the pruner end-to-end workflow by addressing a critical stale indices bug and improving test infrastructure. The changes span TypeScript test code, Rust pruner implementation, Move smart contracts, and CI workflows. The fix ensures newly created SMT nodes are never incorrectly marked as stale, preventing premature deletion that caused transaction failures.
Key changes:
- Fixed stale indices bug in SMT implementation that caused new nodes to be deleted
- Unified test configuration with simpler environment variables
- Improved retry logic for Move function calls with timeout detection
- Enhanced logging, metrics collection, and test reporting
- Updated pruner configuration to use
protection_ordersinstead ofwindow_days
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
moveos/smt/src/lib.rs |
Fixed critical bug: populate stale_indices only from stale_node_index_batch, not node_batch |
moveos/smt/src/tests.rs |
Added regression tests for stale indices correctness |
moveos/moveos-store/src/tests/test_incremental_sweep.rs |
Updated integration test to verify refcount mechanism |
sdk/typescript/test-suite/src/testbox.ts |
Added environment-based temp dir control, improved CLI env handling, added retry logic |
sdk/typescript/rooch-pruner-e2e/src/case/pruner-e2e.spec.ts |
Unified test config, added retry with exponential backoff, improved metrics tracking |
examples/pruner_test/sources/object_lifecycle.move |
Added deterministic object ID functions for testing |
crates/rooch-pruner/src/pruner.rs |
Replaced window_days with protection_orders, renamed running to is_running |
crates/rooch-pruner/src/sweep_expired.rs |
Added debug refcount guard, fixed shutdown signal logic |
.github/workflows/pruner_long_term_test.yml |
Updated to use unified env vars, improved metrics extraction |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| // Process already dead, ignore | ||
| } | ||
| }, 2000) | ||
| }, 10000) |
There was a problem hiding this comment.
[nitpick] The timeout value increased from 2000ms to 10000ms (5x increase) seems excessive. Consider using a more moderate value like 5000ms to balance responsiveness with reliability.
| }, 10000) | |
| }, 5000) |
Summary
Summary about this PR