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

Add protection on Archive that avoids the Duplicate batch issue #27

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tiagoicp
Copy link

No description provided.

@tiagoicp
Copy link
Author

Fixes Issue: #23

@tiagoicp
Copy link
Author

Opened an issue on Mops to better understand the desired new behaviour.
ZenVoich/mops#195

@tiagoicp
Copy link
Author

Hi @tomijaga , think this is ready for review.

I have added specs that showcase it's allowing to be duplicated. The original problem is exposed on the issue (#23), and in short, because it's an intercanister call, you may have multiple transactions in Ledger while it waits for the callback that clears the SB (Stable Buffer - transactions).

So, this is an issue that typically arises in a peak transactions moment.

This fix was tested, it's not greedy, and tried for it to be fully compatible to any state of the archive. Example: that it already has duplicated txs, and therefore can't use total_txs - 1 to be the last_tx_index.

Demo of tests failing and passing:
Screenshot 2023-12-29 at 18 28 35
Screenshot 2023-12-29 at 18 28 54
Screenshot 2023-12-30 at 09 23 01

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.

1 participant