This PR is a follow-up to fix review comments and a bugfix from #28385
The PR
-
Updated
DisconnectedBlockTransactions
’sMAX_DISCONNECTED_TX_POOL
from kb to bytes. -
Moved
DisconnectedBlockTransactions
implementation code tokernel/disconnected_transactions.cpp
. -
AddTransactionsFromBlock
now assume duplicate transactions are not passed by asserting after inserting each transaction toiters_by_txid
. -
Included a Bug fix: In the current master we are underestimating the memory usage of
DisconnectedBlockTransactions
.- When adding and subtracting
cachedInnerUsage
we callRecursiveDynamicUsage
withCTransaction
which invokes thisRecursiveDynamicUsage(const CTransaction& tx)
version ofRecursiveDynamicUsage
, the output of that call only account for the memory usage of the inputs and outputs of theCTransaction
, this omits the memory usage of theCTransaction
object and the control block. - This PR fixes this bug by calling
RecursiveDynamicUsage
withCTransactionRef
when adding and subtractingcachedInnerUsage
which invokesRecursiveDynamicUsage(const std::shared_ptr<X>& p)
version ofRecursiveDynamicUsage
the output of the calculation accounts for theCTransaction
object, the control blocks, inputs and outputs memory usage. - see comment
- When adding and subtracting
-
Added test for DisconnectedBlockTransactions memory limit.