-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat: a new ChainIndexer to index tipsets, messages and events #12421
Open
aarshkshah1992
wants to merge
122
commits into
master
Choose a base branch
from
feat/msg-eth-tx-index
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6,460
−5,407
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the PR title to match https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#pr-title-conventions
aarshkshah1992
changed the title
Chain index complete for msgs and txns
[WIP ]Chain index complete for msgs and txns
Aug 29, 2024
aarshkshah1992
changed the title
[WIP ]Chain index complete for msgs and txns
Chain index complete for msgs and txns
Aug 30, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Sep 2, 2024
rvagg
reviewed
Oct 16, 2024
rvagg
reviewed
Oct 17, 2024
rvagg
reviewed
Oct 17, 2024
rvagg
reviewed
Oct 17, 2024
rvagg
reviewed
Oct 18, 2024
rvagg
reviewed
Oct 18, 2024
…issing and not backfill parents (#12619) * fix backfilling UX * Update chain/index/api.go Co-authored-by: Rod Vagg <[email protected]> * address review --------- Co-authored-by: Rod Vagg <[email protected]>
rvagg
reviewed
Oct 21, 2024
rvagg
reviewed
Oct 21, 2024
* Followup to PR #12450 for doc updates This is being used to resolve the unresolved items in #12450 since that PR is unwieldly at this point. * Incorporated some items and added TODOs based on unresolved items from #12450 * Incorporating more feedback * Pointing to issue to learn about benefits * Formatting fixes * Apply most of the suggestions from @rvagg code review Co-authored-by: Rod Vagg <[email protected]> * Incorporating feedback from #12600 (comment) * Addressing #12600 (comment) and more * Moved chain-indexer docs to documentation Renamed Added ToC We can move to lotus-docs later * Update documentation/en/chain-indexer-overview-for-operators.md Co-authored-by: Rod Vagg <[email protected]> * Update documentation/en/chain-indexer-overview-for-operators.md Co-authored-by: Rod Vagg <[email protected]> * Added upgrade path when importing chain state from a snapshot. * Typo fixes * Update documentation/en/chain-indexer-overview-for-operators.md Co-authored-by: Rod Vagg <[email protected]> * chore(doc): "regular checks" section for chainindexer docs (#12612) * Apply suggestions from @rvagg code review Co-authored-by: Rod Vagg <[email protected]> * Incorporating @aarshkshah1992 feedback * Update documentation/en/chain-indexer-overview-for-operators.md Co-authored-by: Rod Vagg <[email protected]> --------- Co-authored-by: Rod Vagg <[email protected]> Co-authored-by: Aarsh Shah <[email protected]>
rvagg
approved these changes
Oct 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #12453.
Subsumes #12388 to implement the
ChainIndexer
.TODO
ChainIndexer
(tests are at feat: tests for the chain indexer #12521)Migration
Index "migration" will effectively involve re-indexing the chain state here. This is because the data in the old Indices isn't reliable (we're already aware of multiple bugs in the old Indices which motivated this PR in the first place) and the old Indices have never been gc'd/kept in sync with the chain state on nodes with splitstore enabled.
For Snapshot synced nodes with Splitstore enabled
ReConcileEmptyIndex
to true and setting theMaxReconcileTipsets
as needed.For archival nodes
If archival nodes want to backfill the index as part of daemon startup, they can always bootup the node with
ReConcileEmptyIndex
set to true andMaxReconcileTipsets
set to infinity. This will drastically slow down the node startup but will ensure that the node starts up with it's entire history indexed.The other option for users is to use the
Backfill
RPC API with a range of height they want backfilled. However, we need to handle race conditions here where backfilling races with new tipsets coming in and need to ensure that backfilling does not end up overwriting updates caused by new tipsets being indexed.Sqllite Query Plans
For looking up
MsgInfo
reverted != 0
and only one withreverted=0
for a givenmessage_cid
so no need to index byreverted
as well here.For looking up an eth tx hash
For checking if a tipset exists
For getting the minimum no-reverted height for reconciliation
reverted != 0
and only one entry withreverted=0
, this should be allright.Looking up a
message_id
to insert an eventLooking up events at a specific height
Looking up events in a height range
Looking up events for a specific tipset