Skip to content

Fixed stale indices bug in SMT implementation and improve pruner#3811

Merged
jolestar merged 13 commits into
mainfrom
pruner_e2e_test_workflow
Nov 25, 2025
Merged

Fixed stale indices bug in SMT implementation and improve pruner#3811
jolestar merged 13 commits into
mainfrom
pruner_e2e_test_workflow

Conversation

@jolestar

Copy link
Copy Markdown
Contributor

Summary

Summary about this PR

  • Closes #issue

@vercel

vercel Bot commented Nov 24, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rooch-portal-v2.1 Ready Ready Preview Comment Nov 25, 2025 0:45am
test-portal Ready Ready Preview Comment Nov 25, 2025 0:45am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rooch Ignored Ignored Preview Nov 25, 2025 0:45am

@github-actions

github-actions Bot commented Nov 24, 2025

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_orders instead of window_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)

Copilot AI Nov 25, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
}, 10000)
}, 5000)

Copilot uses AI. Check for mistakes.
@jolestar jolestar changed the title fix pruner e2e workflow improve pruner Nov 25, 2025
@jolestar jolestar changed the title improve pruner Fixed stale indices bug in SMT implementation and improve pruner Nov 25, 2025
@jolestar jolestar merged commit cde1268 into main Nov 25, 2025
19 of 20 checks passed
@jolestar jolestar deleted the pruner_e2e_test_workflow branch November 25, 2025 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants