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

Mempool Queue Out-of-Sync with Updated Transactions #203

Open
aszepieniec opened this issue Oct 11, 2024 · 0 comments
Open

Mempool Queue Out-of-Sync with Updated Transactions #203

aszepieniec opened this issue Oct 11, 2024 · 0 comments

Comments

@aszepieniec
Copy link
Contributor

The mempool contains a PriorityQueue which contains transaction IDs rank ordered by fee density. The transaction ID is the hash of the transaction. When a new block is received, the mempool runs the Update program on all transactions, as a result of which they get new kernels (because the mutator set hash has been updated) and new proofs (because the kernel is new). Presently there isn't any code that updates the priority queue by updating the transaction IDs. So the miner is left chasing after void references to the fee-densest transactions.

After discussing with @Sword-Smith we came up with three potential solutions:

  1. Write logic to update the priority queue to point to the retained updated transactions. This could be as simple as clearing the priority queue and inserting (references to) the updated transactions.
  2. Derive the transaction ID from the transaction kernel without the mutator set hash. In this way, the ID is invariant under updates.
  3. Delay and defer updating transactions to the miner. As a rule, mempools never Update transactions. The miner makes a selection of (potentially out-of-date) transactions, and runs the right sequence of Update and Merge, before merging in the coinbase transaction.

As far as I can tell, these solutions are mutually compatible and independently desirable.

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

No branches or pull requests

1 participant