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

Custom transactions from JDC removed from mempool during update #840

Open
lorbax opened this issue Apr 10, 2024 · 1 comment
Open

Custom transactions from JDC removed from mempool during update #840

lorbax opened this issue Apr 10, 2024 · 1 comment

Comments

@lorbax
Copy link
Collaborator

lorbax commented Apr 10, 2024

The declared transaction in declared mining job are stored as a whole in the JDS mempool. The transactions in in declared jobs are recognized because they have this form (like txid: Txid <-- Some(Transaction) in the hashmap). In JDsMemppol::update_mempool() we create a new hashmap mempool_ordered. Inside the task spawned, the node's mempool is stored in in the variable mempool: Vec<Txid>. For every entry txid of this vector, if there was a transaction in the mutex mempool of the form txid: Txid <-- Some(Transaction), then the whole transaction is stored in mempool_ordered. The other transactions in mempool are stored in mempool_ordered as txid: Txid <-- None. Then JDS mempool is updated with mempool_ordered
#833
As a consequence of that, if the downstream declares a transaction which is unknown to the node, then it gets lost during the update of the JDS mempool. If the mempool is updated frequently this may prevent to the block propagation for the JDS, which is not good.

If this is fixed, we must also remove the transactions of old declared jobs, otherwise the there is (very remote) risk of overflow.

Fix this issue after merging of PR833.

@NonsoAmadi10
Copy link

Alright @lorbax i will take this issue up. Let me make the requested changes on #833

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants