-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
perf: api: add indexes to event topics and emitter addr #11477
perf: api: add indexes to event topics and emitter addr #11477
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.
LGTM
Given that there have been a few reports of people running
The downside of this is that you lose history. Though you could back-fill; it just might take time.
This is probably the cleanest form, although I haven't tried this but it should work. Stop lotus and with
Similar to option 2, but a little more light-touch, run |
This wont work because of
So when we move the row from version 3 to version 2, it violates the uniqueness constraint. |
good catch, updated comment and replaced |
Is there more info on how this is breaking nodes? We were able upgrade to and run with this on a full archive node. |
Hey @i-norden This will only break for nodes migrating from master to the current release. |
Ah got it, thanks! Another option would be to cherry-pick this on-top of the release, but there will be issues again if the version 3 that makes it into a release does not match this one. Could put any new changes to the events db schema into a version 4, but having affected parties drop the version 3 meta keeps things cleaner for everybody else. Agree that it is unlikely things will conflict with the lingering indexes. Reapplication of this version 3 won't throw since it uses IF NOT EXISTS and I can't think of any migration that conflicts on an index other than trying to create one that already exists or delete one that doesn't. |
Related Issues
Proposed Changes
Add indexes to the events.db
event_entry.key
column andevent.emitter_addr
column.Additional Info
These indexes significantly improve the performance of
eth_getLog
queries with filters that contain multiple contract addresses or topics to search against, which is often the case forgetLog
consumers coming from the ethereum domain. In our tests a query filter with 10 topics saw a >100x improvement in response time (from ~45s to ~0.4s). Applying these indexes increased the size of our archive node events.db from 383 MB to 428 MB.Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, testarea
, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps