-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
eth/filters: retrieve logs in async #27135
Merged
+320
−153
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
78b2136
eth/filters: pendingLogs will not fail
jsvisa 58b35f7
eth/filters: pass a channel to recv logs
jsvisa 4cdd665
eth/filters: retrive logs in async mode
jsvisa 4d33109
eth/filters: backfilling it
jsvisa ece83c7
eth/filters: make LogsAsync private
jsvisa fc883c2
Revert "eth/filters: backfilling it"
jsvisa 9654751
eth/filters: close logChan and errChan inside producer's side
jsvisa be1f183
eth/filters: let's resolve special in the begining of the goroutine
jsvisa 7bcf58b
eth/filters: rename logsAsync to rangeLogsAsync
jsvisa 9093799
eth/filters: resolve block number in Logs
jsvisa 368d09c
eth/filters: handle pending logs outside async
jsvisa a2fcf1e
eth/filters: handle error
jsvisa 4ebecb2
add tests for single block and pending
s1na 23e1876
use logger contract in tests
s1na 5625439
test full logs output
s1na 9cf858e
expand tests
s1na 4353b09
add timeout case
s1na aa2cf79
Update eth/filters/filter.go
jsvisa a014cd3
Update eth/filters/filter.go
jsvisa eda6214
Update eth/filters/filter.go
jsvisa da62eac
eth/filters: fix typo
jsvisa 0ba4db0
eth/filters: no for loop
jsvisa 2df3c84
eth/filters: no need to check 10th context error
jsvisa 5000eb7
minor
s1na 5167b95
Update eth/filters/filter_test.go
s1na f54f906
eth/filters: pending logs maybe null
jsvisa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
I haven't reviewed this in any depth, so maybe I'm missing something... but it looks to me like this spins up two routines that may be stuck forever trying to deliver, in case the other side is no longer reading, for whatever reason.
Wouldn't it make sense it use the
ctx
to check if it's time to abort these routines?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.
Good point. But seems we have handled this issue inside the
indexedLogs
https://github.com/ethereum/go-ethereum/blob/101ac683e447a2c23fc0141d33bbb3f2e0e32607/eth/filters/filter.go#L266I wonder if I've lost something
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.
If we want to protect against potential receiver failure, we'd have to wrap every channel send with a select, as in:
I guess I'm just wondering if this has an impact on performance or that should be negligible