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

Testutil: Can generate attestation at epoch boundary #8265

Merged
merged 2 commits into from Jan 14, 2021

Conversation

terencechain
Copy link
Member

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

Fixes a bug in GenerateAttestations in pkg testutil. GenerateAttestations works by decreasing input slot (n) by 1 (n-1), this ensures computed attestation has the on time property for the current slot. The currentEpoch which is used to calculate target root should respect the (n-1) property, or else at the epoch boundary slot we will be getting epoch out of bound. (ex: input slot 32, attestation slot 31, the epoch suppose to be 0 but it's 1)

Which issues(s) does this PR fix?

No issue. Discovered while writing blockchain unit tests.

Other notes for review

Only touches test code

@terencechain terencechain added the Ready For Review A pull request ready for code review label Jan 14, 2021
@terencechain terencechain self-assigned this Jan 14, 2021
@terencechain terencechain requested a review from a team as a code owner January 14, 2021 18:03
@terencechain terencechain merged commit 40155c9 into develop Jan 14, 2021
@terencechain terencechain deleted the fix-generate-att branch February 15, 2021 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants