-
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
Better Lotus indices #10326
Comments
We (@raulk @jennijuju @vyzo @Stebalien @magik6k @Kubuxu ) had an extended discussion on this today. We emerged with the following chief themes:
Given that, the concrete proposal is to:
|
Is this what we landed on? My recollection is that we agreed on having a
EDIT: after writing this I realise that message receipts are not addressable by CID, so instead of the receipt CID we'd need to store the message exec index, so we can omit 1-4. |
I thought that's what we landed on, and that's definitely what I would encourage us to do. We can add more indices later, but I want to make this work with the minimal indexing. I suspect that with the msgCid -> inclusionTipset mapping, this will be sufficiently fast (with some perf improvements to the EthAPI itself), because it's in essence:
If this isn't workable, we can discuss adding more indices, but I strongly think we should build up as needed.
|
@arajasek I want to reconcile this discussion with the latest drive to avoid state computation on Eth paths, and reuse saved receipts instead. To make that approach work, we will need the originally proposed index ( |
Context
Lotus’ chain and state storage revolves around a monolithic blockstore that contains raw chain and state data, referred to by CID. There exists a skiplist of size 10 for chain lookbacks (which was known to be flaky in the past, probably fixed now? would help to have utilisation stats to confirm).
However, there are no indices to facilitate common chain queries. For example, loading a tipset by height, finding the tipset/blocks where a message was included, finding messages involving specific actors within a particular time range, etc. are costly operations. Most of these queries involve walking chain history and/or performing a number of sequential queries through traversals.
Goal
Lotus optimizes common data access patterns to reduce latency, disk I/O and computational cost, for a better developer and node operator experience.
Change motivation
With FEVM about to be launch, we expect the programmatic usage of Lotus' API is going to increase. Wallets, dapps, libraries, and utilities will all start consuming Lotus' API through both the Eth JSON-RPC API, and its Filecoin-specific API.
Asks
Introduce indices and support data structures to enable these access patterns.
High-prio
Medium-prio
Considerations
The text was updated successfully, but these errors were encountered: