Skip to content

Commit

Permalink
turn off transactionBucket (FISCO-BCOS#4044)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenlinlee authored Nov 14, 2023
1 parent ec31a2c commit 5d9163d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
19 changes: 4 additions & 15 deletions bcos-txpool/bcos-txpool/txpool/storage/MemoryStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,23 +782,12 @@ void MemoryStorage::batchFetchTxs(Block::Ptr _txsList, Block::Ptr _sysTxsList, s

if (_avoidDuplicate)
{
size_t eachBucketTxsLimit = 0;
// After performance testing, 0.25 had the best performance.
eachBucketTxsLimit = (_txsLimit / (0.25 * CPU_CORES)) + 1;
if (c_fileLogLevel == LogLevel::TRACE) [[unlikely]]
{
TXPOOL_LOG(TRACE) << LOG_DESC("batchFetchTxs")
<< LOG_KV("pendingTxs", m_txsTable.size())
<< LOG_KV("limit", _txsLimit)
<< LOG_KV("eachBucketTxsLimit", eachBucketTxsLimit);
}
m_txsTable.forEach<TxsMap::ReadAccessor>(
m_knownLatestSealedTxHash, eachBucketTxsLimit, [&](TxsMap::ReadAccessor::Ptr accessor) {
m_knownLatestSealedTxHash, [&](TxsMap::ReadAccessor::Ptr accessor) {
const auto& tx = accessor->value();
bool isTxValid = handleTx(tx);
bool needContinue = (_txsList->transactionsMetaDataSize() +
_sysTxsList->transactionsMetaDataSize()) < _txsLimit;
return std::pair<bool, bool>(needContinue, isTxValid);
handleTx(tx);
return (_txsList->transactionsMetaDataSize() +
_sysTxsList->transactionsMetaDataSize()) < _txsLimit;
});
}
else
Expand Down
2 changes: 1 addition & 1 deletion bcos-txpool/bcos-txpool/txpool/storage/MemoryStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class MemoryStorage : public TxPoolStorageInterface,
TxPoolConfig::Ptr m_config;

using TxsMap = BucketMap<bcos::crypto::HashType, bcos::protocol::Transaction::Ptr,
std::hash<bcos::crypto::HashType>, TransactionBucket>;
std::hash<bcos::crypto::HashType>>;
TxsMap m_txsTable, m_invalidTxs;

using HashSet = BucketSet<bcos::crypto::HashType, std::hash<bcos::crypto::HashType>>;
Expand Down

0 comments on commit 5d9163d

Please sign in to comment.