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

Closed
Tracked by #1138
lorbax opened this issue Apr 10, 2024 · 1 comment · Fixed by #1239
Closed
Tracked by #1138

Custom transactions from JDC removed from mempool during update #840

lorbax opened this issue Apr 10, 2024 · 1 comment · Fixed by #1239
Assignees
Labels
bug Something isn't working job-declarator-client
Milestone

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
Contributor

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

@plebhash plebhash moved this from Todo 📝 to Ready For Review 🔍 in SV2 Roadmap 🛣️ Jun 4, 2024
@plebhash plebhash added this to the 1.0.2 milestone Jun 4, 2024
@plebhash plebhash moved this from Ready For Review 🔍 to In Progress 🏗️ in SV2 Roadmap 🛣️ Jun 4, 2024
@plebhash plebhash moved this from In Progress 🏗️ to Ready For Review 🔍 in SV2 Roadmap 🛣️ Jul 9, 2024
NonsoAmadi10 added a commit to NonsoAmadi10/stratum that referenced this issue Jul 17, 2024
Modify the update_mempool function to update the jds mempool to save transactions declared by the downstream and get rid of others.
Create a clear_declared_mining_job to remove old fat transactions before a new mining job is declared.
Manage every unwrap by returning the proper error class and error message
NonsoAmadi10 added a commit to NonsoAmadi10/stratum that referenced this issue Jul 17, 2024
Modify the update_mempool function to update the jds mempool to save transactions declared by the downstream and get rid of others.
Create a clear_declared_mining_job to remove old fat transactions before a new mining job is declared.
Manage every unwrap by returning the proper error class and error message
jbesraa pushed a commit to jbesraa/stratum that referenced this issue Jul 19, 2024
Modify the update_mempool function to update the jds mempool to save transactions declared by the downstream and get rid of others.
Create a clear_declared_mining_job to remove old fat transactions before a new mining job is declared.
Manage every unwrap by returning the proper error class and error message
NonsoAmadi10 added a commit to NonsoAmadi10/stratum that referenced this issue Aug 9, 2024
Modify the update_mempool function to update the jds mempool to save transactions declared by the downstream and get rid of others.
Create a clear_declared_mining_job to remove old fat transactions before a new mining job is declared.
Manage every unwrap by returning the proper error class and error message
@pavlenex pavlenex modified the milestones: 1.0.2, 1.0.3 Aug 13, 2024
@plebhash plebhash added the bug Something isn't working label Aug 20, 2024
@plebhash plebhash removed this from the 1.0.3 milestone Aug 20, 2024
@GitGab19 GitGab19 added this to the 1.2.0 milestone Oct 23, 2024
@GitGab19 GitGab19 moved this from Ready For Review 🔍 to Todo 📝 in SV2 Roadmap 🛣️ Oct 23, 2024
@GitGab19 GitGab19 moved this from Todo 📝 to Ready For Review 🔍 in SV2 Roadmap 🛣️ Nov 5, 2024
@github-project-automation github-project-automation bot moved this from Ready For Review 🔍 to Done ✅ in SV2 Roadmap 🛣️ Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment