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

Check for an existing start epoch before creating one #864

Merged
merged 4 commits into from
Apr 1, 2024

Conversation

jessepinho
Copy link
Contributor

@jessepinho jessepinho commented Mar 31, 2024

This fixes a bug we had before where, for some reason (probably related to exponential back-off), the start epoch with index 0 was being saved multiple times. This threw off the count for epochs, making delegate actions fail (since they use epoch indexes). To fix this, we create epoch 0 outside of the syncAndStore method, at DB initialization.

Closes #865

This fixes a bug we had before where, for some reason (probably related to exponential back-off), the start epoch with index 0 was being saved multiple times. This threw off the count for epochs, making delegate actions fail (since they use epoch indexes).
@jessepinho jessepinho marked this pull request as ready for review March 31, 2024 23:27
@@ -1,6 +1,6 @@

PRAX=lkpmkhpnhknhmibgnmmhdhgdilepfghe
IDB_VERSION=31
IDB_VERSION=32
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anyone who has duplicate epochs in their database already will need to regenerate their data from scratch — hence the version bump.

@TalDerei TalDerei self-requested a review April 1, 2024 14:46
@TalDerei
Copy link
Contributor

TalDerei commented Apr 1, 2024

LGTM. I'm not seeing any duplicate nullifiers in indexDB, but what does different epochs with the same startHeight mean in this context? sync delay?

Screenshot 2024-04-01 at 7 45 51 AM

@jessepinho jessepinho merged commit 6e4c8d1 into main Apr 1, 2024
6 checks passed
@jessepinho jessepinho deleted the jessepinho/fix-duplicate-start-epochs branch April 1, 2024 16:09
@jessepinho
Copy link
Contributor Author

@TalDerei different epochs with the same start height is a duplicate epoch — it means we saved more than one epoch (with different indexes) at the same start height.

And yeah, I think it's due to a sync delay. We use a backOff() function to repeatedly call the block processor's syncAndStore method if it fails at first. I think it must have been creating the 0th epoch multiple times as a result.

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.

Delegations failing on testnet
2 participants