CodeChain-io/codechain

Mempool fail to calculate next sequence on heavy load

majecty opened this issue · 1 comments

When we run TPS checker, a few seconds later CodeChain move transactions to future queue, but it should not use the future queue.

I'm suspecting the usage of the best block. The mempool::add code read the best block's state multiple times. If the best block is changed while running the mempool::add code it can make a bug that hard to find.

I made mempool::add to acquire importer lock and the bug does not appear.
ed1571b

#1977 fixes this issue in the master branch.
#1976 fixes this issue in the 2.2.x branch.