-
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
Conversation
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
* 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]>
…2657) * retry database lost connection * log context cancellation * address review
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.
@aarshkshah1992 failure in CI is legitimate - itest-gateway:
Error Trace: /home/runner/work/lotus/lotus/itests/kit/ensemble.go:486
/home/runner/work/lotus/lotus/itests/gateway_test.go:318
/home/runner/work/lotus/lotus/itests/gateway_test.go:56
Error: Received unexpected error:
starting node:
github.com/filecoin-project/lotus/node.New
/home/runner/work/lotus/lotus/node/builder.go:[359](https://github.com/filecoin-project/lotus/actions/runs/11605901734/job/32317064511?pr=12421#step:9:360)
- missing dependencies for function "reflect".makeFuncStub
/home/runner/work/_tool/go/1.22.8/x64/src/reflect/asm_amd64.s:28:
missing type:
- full.ChainIndexerAPI (did you mean to use index.Indexer?)
@rvagg Checking. |
28d23b3
to
16575e3
Compare
bot is stuck
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