Skip to content
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

refactor(rooch-da): refactor indexing logic in DA commands #3199

Merged
merged 13 commits into from
Jan 19, 2025

Conversation

popcnt1
Copy link
Collaborator

@popcnt1 popcnt1 commented Jan 15, 2025

Summary

Refactored data indexing and management, improving modularity and simplifying the DA execution flow.

Updated the functionality to fetch execution info using transaction hash instead of order. This includes renaming the command, updating related logic, and adapting parameters to handle transaction hashes.
Removed the DumpTxRootCommand and its references from the codebase as it is no longer needed. This simplifies the db module and reduces unnecessary maintenance overhead.
Updated `execute` methods in `GetExecutionInfoByHashCommand` and `GetChangesetByOrderCommand` to return `Option` types directly. This simplifies the implementation by removing unnecessary logging and streamlining the return process.
Refactored `has_executed` method to streamline logic and avoid redundant calls. Removed unused `get_execution_info_by_order` method for cleaner code maintenance.
Cleaned up the code by removing an unused import for DumpTxRootCommand. This improves maintainability and eliminates unnecessary dependencies.
Introduce an LMDB-based transaction indexing mechanism to replace the file-based approach, significantly optimizing storage and performance. Added reset functionality and enforced stricter handling of tx_order continuity.
Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2025 4:24pm
rooch-portal-v2.1 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2025 4:24pm
test-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2025 4:24pm

Copy link

vercel bot commented Jan 15, 2025

@popcnt1 is attempting to deploy a commit to the Rooch Team on Vercel.

A member of the Team first needs to authorize it.

Introduced a new `--max-block-number` flag to indexer to define the maximum block number to index. Updated loop logic to respect the limit and adjusted dependencies in Cargo.lock.
Introduce the ability to load and verify transaction indices from a file-based source. This includes adding CLI options `--load-from` and `--verify` to support initialization and validation against the original index file.
Add functionality to load, dump, and verify transaction indices from file-based sources. This implementation includes new CLI options such as `--file`, `--dump`, and improved validations to enhance index initialization, verification, and stats reporting.
Extracted Indexer and TxPosition into separate files and modules, improving code organization and reusability. This change reduces redundancy and streamlines dependencies within the `da` commands.
Refactored data indexing and management by introducing TxMetaStore and TxPositionIndexer. Removed legacy TxDAIndexer and associated structures, improving modularity and simplifying the DA execution flow.
@popcnt1 popcnt1 marked this pull request as ready for review January 19, 2025 16:17
@popcnt1 popcnt1 changed the title feat(rooch-da): implement LMDB-backed indexer for transactions refactor(rooch-da): refactor indexing logic in DA commands Jan 19, 2025
@popcnt1 popcnt1 merged commit 2b1ff0b into rooch-network:main Jan 19, 2025
10 checks passed
@popcnt1 popcnt1 deleted the refactor/da/index branch January 19, 2025 22:47
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.

1 participant