Repository navigation
Conversation
The worker runs these for every evm_rpc event. Three of them filtered by time only inside count(*) filter, so each read the endpoint's or provider's whole history, and the endpoint match used is not distinct from, which no index can serve. On the study database (650k rows) the worker fell behind the stream and stopped saving events. Bound the queries to their windows, compare a known endpoint hash with =, and index provider and wallet lookups. Results are unchanged.
This file contains hidden or 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
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.
The worker runs the threat context queries for every
evm_rpcevent. Three of them filtered by time only insidecount(*) filter, so each read the endpoint's or provider's whole history. The endpoint match usedis not distinct from, which no index can serve. On the study database (650k events) this pinned Postgres at ~650% CPU, and the worker fell behind the stream and stopped saving events.filterclause already sat inside those windows, so the results are unchanged.=. A null hash still matches only nulls.004_threat_context_indexes.sql: indexes for the provider and wallet lookups.Throttling query for one endpoint on the study DB: 1211 ms (parallel seq scan) down to 153 ms (index scan).
Tests:
npm test -w apps/workerwithHEIGHTPROOF_INTEGRATION=1against disposable Postgres and Redis: 81/81 pass.