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

Don't return non-contiguous rounds #78

Open
iFrostizz opened this issue Sep 12, 2024 · 0 comments
Open

Don't return non-contiguous rounds #78

iFrostizz opened this issue Sep 12, 2024 · 0 comments

Comments

@iFrostizz
Copy link
Contributor

See #64 (comment).
Events are allowed to be imported out of order. The issue is that the assumption is different from the original Chainlink contracts.
We should still store them even if the rounds are not contiguous, it's just that they should not be returned from the getRoundData function.
It is actually slightly harder than thought first and will leave it for later. Here is one solution though:

Write a library that stores 256 bits maps, and everytime a new round is added, add it to the bitmap and check if there is any missing round. If no, then store the latest roundID as a validRoundID.
In the getRoundData, make sure that the requested roundID is less than or equal the validRoundId.

@iFrostizz iFrostizz mentioned this issue Sep 12, 2024
2 tasks
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

No branches or pull requests

1 participant