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

OrderedTxPool inconsistency #1952

Open
kushti opened this issue Feb 14, 2023 · 3 comments · May be fixed by #1958
Open

OrderedTxPool inconsistency #1952

kushti opened this issue Feb 14, 2023 · 3 comments · May be fixed by #1958
Assignees

Comments

@kushti
Copy link
Member

kushti commented Feb 14, 2023

Sometimes OrderedTxPool is inconsistent, a transaction (wrapped in WeightedTxId and UnconfirmedTransaction) is sitting in orderedTransactions, but not present in transactionsRegistry.

Supposedly happens with transactions replaced by others (double-spends paying more maybe).

Find how this could happen, write a test and fix the issue.

@jellymlg
Copy link
Collaborator

@kushti
I cant reproduce the inconsistency, but noticed double spending multiple times leads to incorrect behaviour. It happens because the put and remove should be in reverse in

val p = pool.put(unconfirmedTransaction, feeF).remove(doubleSpendingTxs)

Is it acceptable if I just eliminate transactionsRegistry altogether?

@kushti
Copy link
Member Author

kushti commented Feb 21, 2023

@jellymlg good catch, the order is seemingly wrong, yes.

Wdym by eliminating transactionsRegistry ?

@jellymlg
Copy link
Collaborator

jellymlg commented Feb 21, 2023

@jellymlg jellymlg linked a pull request Feb 25, 2023 that will close this issue
@jellymlg jellymlg self-assigned this Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants