-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Replace single course grained filter with batch request of fine grained topic filters #12361
Commits on Apr 25, 2024
-
Replace single course grained filter with batch request of fine grain…
…ed topic filters This replaces Filter() with EthGetLogsReqs(), adding fetchLogsByBlockHash, sendBatchRequests, and a handful of other helper methods to support this It also replaces these fields in logPoller struct: lp.filter lp.filterDirty lp.cachedEventSigs lp.cachedAddresses With new fields, used for implementing caching and indexing of a collection of batch requests, insetad of a single filter: lp.newFilters map[string]struct{} // Set of filter names which have been added since cached reqs indices were last rebuilt lp.removedFilters []Filter // Slice of filters which have been removed or replaced since cached reqs indices were last rebuilt lp.cachedReqsByAddress map[common.Address][]*GetLogsBatchElem // Index of cached GetLogs requests, by contract address lp.cachedReqsByEventsTopicsKey map[string]*GetLogsBatchElem // Index of cached GetLogs requests, by eventTopicsKey
Configuration menu - View commit details
-
Copy full SHA for 90196c9 - Browse repository at this point
Copy the full SHA 90196c9View commit details -
Trace -> Debug for BatchCallContext()
Configuration menu - View commit details
-
Copy full SHA for 226ad58 - Browse repository at this point
Copy the full SHA 226ad58View commit details -
Pass fromBlock & toBlock as strings instead of *big.Int
Production rpc servers will fail if these are passed as *big.Int instead of a string, so our SimultaedBackedClient was giving a false positive PASS by handling the conversion. Must be converted in the code before calling BatchCallContext() to work on live networks; now will also be required for simulated geth
Configuration menu - View commit details
-
Copy full SHA for 7999d65 - Browse repository at this point
Copy the full SHA 7999d65View commit details -
Configuration menu - View commit details
-
Copy full SHA for b38c957 - Browse repository at this point
Copy the full SHA b38c957View commit details -
Configuration menu - View commit details
-
Copy full SHA for 51d1ad7 - Browse repository at this point
Copy the full SHA 51d1ad7View commit details -
Don't ever keep trailing nils in outer topics slice
Instead of always being length 4, it needs to be the same length (or less) than the number of topics emitted by logs it matches
Configuration menu - View commit details
-
Copy full SHA for aea6fd1 - Browse repository at this point
Copy the full SHA aea6fd1View commit details -
Remove deletion of trailing nils from SimulatedBackendClient
This can cause false positives, since it's not done by production rpc servers
Configuration menu - View commit details
-
Copy full SHA for 75311a8 - Browse repository at this point
Copy the full SHA 75311a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 697b8cb - Browse repository at this point
Copy the full SHA 697b8cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca70228 - Browse repository at this point
Copy the full SHA ca70228View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ffc705 - Browse repository at this point
Copy the full SHA 6ffc705View commit details -
Configuration menu - View commit details
-
Copy full SHA for 784965a - Browse repository at this point
Copy the full SHA 784965aView commit details -
There's a case where Keepers registers a filter with one name, then unregisters it, then re-registers a filter with the same name. There was an optimization where instead of computing the hash of the events & topics for a filter in two different for loops, it saves it the first time and looks it up in a map the second time. But the keys for the map were the filter names. The first loop deals with removed filters and the second with new filters. They both had the same filter name, but different addresses & topics. This might be a bug in Keepers, but I can at least make this code more robust since it should be possible to update a filter's topics & addresses but keep the name the same.
Configuration menu - View commit details
-
Copy full SHA for 1b6d8c0 - Browse repository at this point
Copy the full SHA 1b6d8c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d8ab99 - Browse repository at this point
Copy the full SHA 8d8ab99View commit details