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

Meros will crash after syncing ~1 billion Transactions. #156

Open
kayabaNerve opened this issue Mar 10, 2020 · 3 comments
Open

Meros will crash after syncing ~1 billion Transactions. #156

kayabaNerve opened this issue Mar 10, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@kayabaNerve
Copy link
Member

kayabaNerve commented Mar 10, 2020

After syncing 1 million Transactions, and the accompanying 1 million VerificationPackets, Meros will overflow the counter it uses for SyncRequests (a counter used to give each request an unique ID). Nim will then have its checks kill the program. The solution is two-fold:

  1. Confirm IDs can be re-used if the old request has completed. Using every ID would then require creating 2 billion sync requests in less than 5 seconds. This should be okay thanks to a mix of table-indexing and because I believe we cleanup the metadata (as to not cause a memory leak).

  2. Change the int to an uint. Not only does this double our space, Nim doesn't mind if uints are overflown.

@kayabaNerve kayabaNerve added the bug Something isn't working label Mar 10, 2020
@kayabaNerve
Copy link
Member Author

This bug is notoriously hard to test. Therefore, DT4S's goal is to theoretically fix this, giving it the untested label.

@kayabaNerve
Copy link
Member Author

This same issue exists with peer IDs.

@kayabaNerve kayabaNerve removed this from the Developer Testnet 4 Stable milestone May 15, 2020
@kayabaNerve kayabaNerve changed the title Meros will crash after syncing ~1 million Transactions. Meros will crash after syncing ~1 billion Transactions. Jun 5, 2020
@kayabaNerve
Copy link
Member Author

For some reason, my mind thinks 2^32 is 4 million; not 4 billion (rounded, of course).

I'm not sure this is feasible to test with such a large quantity, not to mention it'd take years to trigger naturally. I do want to theoretically fix it, but I don't see any value in doing more than that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant