Skip to content
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

New setting ETHEREUM_LOGS_FILTER_AVAILABLE to use filters #15

Merged
merged 4 commits into from
Mar 31, 2022

Conversation

gnarvaja
Copy link
Contributor

The original code was iterating through all the TX and blocks. If web3.eth.filter it's available, we can do much faster filtering the blocks and TX that contain specific events.

Also fixes the potential error of two lists of addresses, topics when it should be a list of pairs.

Previous design was storing two independent lists that might allow incorrect
combinations:
Monitoring (address1, topic1), (address2, topic2)
And the previous code will process events with (address1, topic2)

Now I store monitored_events as a dict with key (address, topic).

Also removes the mixed between class and instance attributes in the
Decoder object.

Also, I add Django 3.1 to the tox suite. Still getting an error with
3.2, need to analyze...
Instead of fetching every block and transaction, if
ETHEREUM_LOGS_FILTER_AVAILABLE = True
uses log filters to fetch the logs.
Copy link
Owner

@artemistomaras artemistomaras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution.

Good catch on the potential bug on the decoder.

@artemistomaras artemistomaras merged commit c03aa48 into artemistomaras:master Mar 31, 2022
@artemistomaras
Copy link
Owner

@gnarvaja I just published version 4.2.0 with your changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants