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

[CLI] Support Indexer cli for rebuild indexer from statedb #1725

Merged
merged 5 commits into from
May 22, 2024
Merged

Conversation

baichuan3
Copy link
Collaborator

@baichuan3 baichuan3 commented May 22, 2024

Summary

  1. Indexer cli for rebuild UTXO and Inscription indexer from statedb
  2. When rebuilding the indexer, we need to write the tx_order and state_index of the UTXO and Inscription corresponding transactions, but there is no transaction when importing data. In order to ensure the consistency of rebuilding the indexer after different nodes import data, prepare to use a fixed tx_order, for example, tx_order = 0
  3. Remove key_str in FiledState indexer

TODO

  1. After having ChildObject encountered a problem. UTXO and Inscription are both ChildObject and are stored according to Object filed. They will be classified into FiledState in the indexer. In order to provide query for UTXO and Inscription, consider redundantly storing UTXO and Inscription in ObjectState.
  • Closes

@baichuan3 baichuan3 requested a review from popcnt1 May 22, 2024 10:51
Copy link

vercel bot commented May 22, 2024

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

Name Status Preview Comments Updated (UTC)
rooch-rooch-portal-v1 ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 11:02am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Visit Preview May 22, 2024 11:02am

@jolestar
Copy link
Contributor

  ✔  Then cmd: "rpc request --method rooch_queryTransactions --params '[{"tx_order_range":{"from_order":0,"to_order":2}}, null, "1", {"descending": true,"showDisplay":false}]'"
   ✔  Then assert: "{{$.rpc[-1].data[0].transaction.sequence_info.tx_order}} == 1"
   ✔  Then assert: "{{$.rpc[-1].next_cursor}} == 1"
   ✘  Then assert: "{{$.rpc[-1].has_next_page}} == true"
      Step failed:
      Defined: features/cmd.feature:114:5
      Matched: crates/testsuite/tests/integration.rs:512:1
      Step panicked. Captured output: assertion `left == right` failed: Assert "false" == "true" failed

@baichuan3
Copy link
Collaborator Author

  ✔  Then cmd: "rpc request --method rooch_queryTransactions --params '[{"tx_order_range":{"from_order":0,"to_order":2}}, null, "1", {"descending": true,"showDisplay":false}]'"
   ✔  Then assert: "{{$.rpc[-1].data[0].transaction.sequence_info.tx_order}} == 1"
   ✔  Then assert: "{{$.rpc[-1].next_cursor}} == 1"
   ✘  Then assert: "{{$.rpc[-1].has_next_page}} == true"
      Step failed:
      Defined: features/cmd.feature:114:5
      Matched: crates/testsuite/tests/integration.rs:512:1
      Step panicked. Captured output: assertion `left == right` failed: Assert "false" == "true" failed
  ✔  Then cmd: "rpc request --method rooch_queryTransactions --params '[{"tx_order_range":{"from_order":0,"to_order":2}}, null, "1", {"descending": true,"showDisplay":false}]'"
   ✔  Then assert: "{{$.rpc[-1].data[0].transaction.sequence_info.tx_order}} == 1"
   ✔  Then assert: "{{$.rpc[-1].next_cursor}} == 1"
   ✘  Then assert: "{{$.rpc[-1].has_next_page}} == true"
      Step failed:
      Defined: features/cmd.feature:114:5
      Matched: crates/testsuite/tests/integration.rs:512:1
      Step panicked. Captured output: assertion `left == right` failed: Assert "false" == "true" failed

Reserve tx_order = 0 for data import transaction and indexer rebuild, I will fixup the relative testcase.

@jolestar jolestar merged commit 323db68 into main May 22, 2024
8 of 9 checks passed
@jolestar jolestar deleted the indexer_cli branch May 22, 2024 14:38
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