Zilliqa / zq2

Zilliqa 2.0 code base
Apache License 2.0
9 stars 0 forks source link

Avoid cloning the `TransactionPool`, especially when building blocks #1404

Closed JamesHinshelwood closed 1 month ago

JamesHinshelwood commented 2 months ago

As pointed out by @bzawisto (https://github.com/Zilliqa/zq2/pull/1393#issuecomment-2329124425), we are cloning the transaction pool when we construct a block. Not only is this probably bad for performance, but its also a bit of a vulnerability. A user is perfectly able to fill up the transaction pool with a bunch of transactions that are not (yet) mineable, which we end up having to make clones of every time we want to propose a block.

shawn-zil commented 2 months ago

I will try to work on this while investigating #1322 , which it may be related to.