dominant-strategies / go-quai

Official Go Implementation of the Quai Network
GNU General Public License v3.0
2.38k stars 466 forks source link

Sorting Qi / Quai Properly #1958

Open mibuono opened 3 months ago

mibuono commented 3 months ago

Having sets of quai and sets of qi transactions, we need to order the transactions based on the tip from both sets.

mibuono commented 3 months ago

Should have an async process to sort the pool - and it should be doing it with an algorithm that you dont need completion and can just do it with rounds to get approximate sorting.

The tx pool is shared with worker and state processor. We can't lock up the pool because it will lock up the state processor. In order to fix this, we may need to copy the tx pool to run this sortition situation.

mibuono commented 2 months ago

Notes from SPIKE:

Refactor the mempool: (Hussam) Worker - needs to read the pending Pending is getting sorting by a partial sorting function (new) So we can have a finite time for locking pending transactions Everytime transactions are added to pending, the sorting function should run every so often to sort them.

rileystephens28 commented 1 month ago

To do this properly we need to unify the tx pool. What we should be doing is creating a limited set which is what we should consume then sort in the worker.