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

genMaciStateFromContract does not fetch any events if fromBlock and endBlock is the same #1044

Closed
3 tasks done
yuetloo opened this issue Jan 17, 2024 · 0 comments · Fixed by #1050
Closed
3 tasks done
Assignees

Comments

@yuetloo
Copy link
Contributor

yuetloo commented Jan 17, 2024

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am not running a deprecated version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected Behavior

The function should process events even though the fromBlock and endBlock is the same. This is a minor issue as this situation only occurs in test environment when all events occurred in 1 block.

Current Behavior

As seen in this line https://github.com/privacy-scaling-explorations/maci/blob/dev/contracts/ts/genMaciState.ts#L62, the code does not enter the for loop if fromBlock === lastBlock

for (let i = fromBlock; i < lastBlock; i += blocksPerRequest + 1) {

Failure Information

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1
  2. step 2
  3. you get it...

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • MACI version:
  • Firmware Version:
  • Operating System:
  • SDK version:
  • Toolchain version:

Failure Logs

Please include any relevant log snippets or files here.

@ctrlc03 ctrlc03 self-assigned this Jan 18, 2024
ctrlc03 added a commit that referenced this issue Jan 18, 2024
Ensure the start block is not overriden by the tx hash check. Also ensure we fetch logs at least for
1 block if fromBlock is equal to lastBlock

fix #1043 fix #1044
@ctrlc03 ctrlc03 added this to MACI Jan 18, 2024
@ctrlc03 ctrlc03 moved this to In Progress in MACI Jan 18, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in MACI Jan 18, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in MACI Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants