-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve eth_getBlockByNumber
query performance.
#20
Comments
At a high level I think we can boil down the issues underpinning this and #19 to three missing indexes:
|
Naively, I envision we could also add to this table a |
The skiplist implementation introduced in this PR improved the But, with this skiplist all in cache, does that address this |
Relevant to filecoin-project/lotus#10807 |
Thanks @fridrik01, warming up the cache did work (once we were running the right version of lotus 🙃). We are going to test the PR that warms-up on node standup too, haven't done that yet. I still think using the msgindex.db table to go from epoch=>tipsetkey could bypass needing the cache entirely and that that would be preferable in cases where we already have msgindex.db enabled. Also running into some general syncing issues, described in greater detail here which are limiting us from testing historical msg and receipt stuff. |
This API endpoint is a wrapper around the EthModule.EthGetBlockByNumber method. This method calls parseBlkParam which is where I believe the problem occurs. When we pass in a blocknumber, that methods falls through to this switch statement, which calls ChainGetTipSetByHeight which calls GetTipsetByHeight. Importantly, it appears that no matter how far back we are looking for a tipset it passes the
head
(heaviest) tipset to these methods as the starting point for a backwards walk. Inside theGetTipsetByHeight
method we call "ChainIndex".GetTipSetByHeight, but this method doesn't appear to actually use anepoch => tipset
index, rather it is a hot cache wrapped around a very slow iterative search backwards through every tipset starting from thehead
until we find the tipset with the desired epoch: https://github.com/filecoin-project/lotus/blob/master/chain/store/index.go#L103.The text was updated successfully, but these errors were encountered: