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 rework #1958

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

jellymlg
Copy link
Collaborator

Eliminated transactionsRegistry to simplify the code

Closes #1952

@kushti
Copy link
Member

kushti commented Feb 27, 2023

Very interesting line of work, I mean elimination of transactionsRegistry.

I think the next step is to merge "WeightedTxId" and "UnconfirmedTransaction" by moving fee into UnconfirmedTransaction and also put txSize there, then weight can be calculated on the fly even

@kushti
Copy link
Member

kushti commented Mar 1, 2023

@jellymlg I think it makes sense to rework orderedTransactions: TreeMap[WeightedTxId, UnconfirmedTransaction] into orderedTransactions: TreeMap[ModifierId, UnconfirmedTransaction], not set. Then you can have efficient contains / get checks

@jellymlg
Copy link
Collaborator Author

jellymlg commented Mar 1, 2023

@kushti Having ModifierId as key in TreeMap means it cant be sorted by weight, only id

@jellymlg
Copy link
Collaborator Author

jellymlg commented Mar 31, 2023

@kushti

Current 50 txs in pool 500 txs in pool 1000 txs in pool
1 txs in block 1.7ms 14.5ms 37.8ms
10 txs in block 14.9ms 133.5ms 310.5ms
100 txs in block 136.0ms 1961.7ms 4059.9ms
1000 txs in block 1794.0ms 38960.9ms 87944.2ms
New 50 txs in pool 500 txs in pool 1000 txs in pool
1 txs in block 1.6ms 13.5ms 27.3ms
10 txs in block 12.9ms 128.2ms 276.9ms
100 txs in block 131.9ms 1747.6ms 3878.6ms
1000 txs in block 1743.4ms 38327.9ms 85165.8ms
Difference 50 txs in pool 500 txs in pool 1000 txs in pool
1 txs in block -4.89% -6.81% -27.67%
10 txs in block -13.45% -3.96% -10.84%
100 txs in block -2.99% -10.91% -4.47%
1000 txs in block -2.82% -1.62% -3.16%

These tests were run with avg case generator (Random.shuffle tx order) and Xmx8G

@jellymlg jellymlg requested a review from kushti April 10, 2023 22:22
jellymlg and others added 7 commits April 11, 2023 16:11
# Conflicts:
#	src/main/scala/org/ergoplatform/mining/CandidateGenerator.scala
#	src/main/scala/org/ergoplatform/network/ErgoNodeViewSynchronizer.scala
#	src/main/scala/org/ergoplatform/nodeView/state/UtxoStateReader.scala
#	src/test/scala/org/ergoplatform/mining/ErgoMinerSpec.scala
#	src/test/scala/org/ergoplatform/nodeView/NodeViewSynchronizerTests.scala
#	src/test/scala/org/ergoplatform/nodeView/mempool/ErgoMemPoolSpec.scala
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

Successfully merging this pull request may close these issues.

OrderedTxPool inconsistency
2 participants