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

Avoid processing same block by using a cache #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jeremy-then
Copy link
Contributor

@jeremy-then jeremy-then commented Apr 17, 2024

For some reason, the this.currentBlockNumber++ line doesn't really update that state variable immediately as expected, so, randomly, when the next call to check() was done, the this.currentBlockNumber would have a stale value, making the tool process the same block twice.

To fix this, instead of updating an instance variable I'm now passing the currentBlockNumber to the check function and I'm using a cache to avoid processing the same block twice.

@jeremy-then jeremy-then self-assigned this Apr 17, 2024
@jeremy-then jeremy-then requested a review from a team as a code owner April 17, 2024 00:14
@marcos-iov
Copy link
Contributor

@jeremy-then could you add some detail in the PR description to understand what this change is about please? Thanks!

Copy link

@wilmerrootstock wilmerrootstock left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link

@apancorb apancorb left a comment

Choose a reason for hiding this comment

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

LGTM

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.

None yet

4 participants