Skip to content

Commit

Permalink
txpool TransactionBucket turn off (FISCO-BCOS#4038)
Browse files Browse the repository at this point in the history
wenlinlee authored Nov 13, 2023
1 parent f3f97d1 commit 773c82d
Showing 11 changed files with 18 additions and 42 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/workflow-self-hosted-arm-static-bulid.yml
Original file line number Diff line number Diff line change
@@ -43,8 +43,7 @@ jobs:
- name: Remove cache if correspond dir change
run: ./tools/.ci/clear_build_cache.sh

- name: Config vcpkg registry proxy
run: sed -i "s/https:\/\/github.com/http:\/\/ghproxy.com\/https:\/\/github.com/g" vcpkg-configuration.json


- name: update vcpkg
run: |
@@ -59,5 +58,5 @@ jobs:
. /opt/rh/llvm-toolset-7.0/enable
alias cmake='cmake3'
mkdir -p build && cd build
cmake3 -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Debug -DWITH_LIGHTNODE=ON -DWITH_TIKV=Off -DURL_BASE=ghproxy.com/github.com .. || cat *.log
cmake3 -DBUILD_STATIC=ON -DCMAKE_BUILD_TYPE=Debug -DWITH_LIGHTNODE=ON -DWITH_TIKV=Off .. || cat *.log
make -j3
5 changes: 1 addition & 4 deletions .github/workflows/workflow-self-hosted-arm.yml
Original file line number Diff line number Diff line change
@@ -53,9 +53,6 @@ jobs:
- name: Remove cache if correspond dir change
run: ./tools/.ci/clear_build_cache.sh

- name: Config vcpkg registry proxy
run: sed -i "s/https:\/\/github.com/http:\/\/ghproxy.com\/https:\/\/github.com/g" vcpkg-configuration.json

- name: update vcpkg
run: |
cd ${{ env.VCPKG_ROOT }} && git checkout master && git pull
@@ -69,7 +66,7 @@ jobs:
. /opt/rh/llvm-toolset-7.0/enable
alias cmake='cmake3'
mkdir -p build && cd build
cmake3 -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DWITH_CPPSDK=ON -DWITH_TARS_SERVICES=ON -DWITH_TIKV=OFF -DWITH_TARS_SERVICES=ON -DURL_BASE=ghproxy.com/github.com .. || cat *.log
cmake3 -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DWITH_CPPSDK=ON -DWITH_TARS_SERVICES=ON -DWITH_TIKV=OFF -DWITH_TARS_SERVICES=ON .. || cat *.log
make -j8
- name: Test
run:
Original file line number Diff line number Diff line change
@@ -45,9 +45,6 @@ jobs:
- name: Remove cache if correspond dir change
run: ./tools/.ci/clear_build_cache.sh

- name: Config vcpkg registry proxy
run: sed -i "s/https:\/\/github.com/http:\/\/ghproxy.com\/https:\/\/github.com/g" vcpkg-configuration.json

- name: update vcpkg
run: |
cd ${{ env.VCPKG_ROOT }} && git checkout master #&& git pull
@@ -61,5 +58,5 @@ jobs:
export LIBCLANG_PATH=/opt/rh/llvm-toolset-7.0/root/lib64/
. /opt/rh/llvm-toolset-7.0/enable
alias cmake='cmake3'
cd build && cmake3 -DCMAKE_BUILD_TYPE=Debug -DBUILD_STATIC=ON -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=On -DWITH_TARS_SERVICES=ON -DURL_BASE=ghproxy.com/github.com .. || cat *.log
cd build && cmake3 -DCMAKE_BUILD_TYPE=Debug -DBUILD_STATIC=ON -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=On -DWITH_TARS_SERVICES=ON .. || cat *.log
make -j4
4 changes: 1 addition & 3 deletions .github/workflows/workflow-self-hosted-centos.yml
Original file line number Diff line number Diff line change
@@ -62,8 +62,6 @@ jobs:
- name: Remove cache if correspond dir change
run: ./tools/.ci/clear_build_cache.sh

- name: Config vcpkg registry proxy
run: sed -i "s/https:\/\/github.com/http:\/\/ghproxy.com\/https:\/\/github.com/g" vcpkg-configuration.json

- name: update vcpkg
run: |
@@ -77,7 +75,7 @@ jobs:
export LIBCLANG_PATH=/opt/rh/llvm-toolset-7.0/root/lib64/
. /opt/rh/llvm-toolset-7.0/enable
alias cmake='cmake3'
cd build && cmake3 -DALLOCATOR=jemalloc -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DTESTS=ON -DCOVERAGE=ON -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=OFF -DWITH_TARS_SERVICES=ON -DURL_BASE=ghproxy.com/github.com .. || cat *.log
cd build && cmake3 -DALLOCATOR=jemalloc -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DTESTS=ON -DCOVERAGE=ON -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=OFF -DWITH_TARS_SERVICES=ON .. || cat *.log
make -j8
- name: Test
run:
2 changes: 1 addition & 1 deletion .github/workflows/workflow-self-hosted-mac.yml
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ jobs:
- name: Build for mac
run: |
mkdir -p build && cd build && rm -rf CMakeCache.txt
cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCOVERAGE=OFF -DVCPKG_HOST_TRIPLET=arm64-osx -DVCPKG_TARGET_TRIPLET=arm64-osx -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=OFF -DWITH_TARS_SERVICES=ON -DURL_BASE=ghproxy.com/github.com .. || cat *.log
cmake -DCMAKE_BUILD_TYPE=Release -DTESTS=ON -DCOVERAGE=OFF -DVCPKG_HOST_TRIPLET=arm64-osx -DVCPKG_TARGET_TRIPLET=arm64-osx -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=OFF -DWITH_TARS_SERVICES=ON .. || cat *.log
cmake --build . --parallel 8
- name: Test
Original file line number Diff line number Diff line change
@@ -54,8 +54,7 @@ jobs:
- name: Remove cache if correspond dir change
run: ./tools/.ci/clear_build_cache.sh

- name: Config vcpkg registry proxy
run: sed -i "s/https:\/\/github.com/http:\/\/ghproxy.com\/https:\/\/github.com/g" vcpkg-configuration.json


- name: update vcpkg
run: |
@@ -65,6 +64,6 @@ jobs:
- name: Build for linux
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_STATIC=On -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=ON -DWITH_TARS_SERVICES=ON -DURL_BASE=ghproxy.com/github.com .. || cat *.log
cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_STATIC=On -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=ON -DWITH_TARS_SERVICES=ON .. || cat *.log
make -j4
5 changes: 1 addition & 4 deletions .github/workflows/workflow-self-hosted-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -62,9 +62,6 @@ jobs:
- name: Remove cache if correspond dir change
run: ./tools/.ci/clear_build_cache.sh

- name: Config vcpkg registry proxy
run: sed -i "s/https:\/\/github.com/http:\/\/ghproxy.com\/https:\/\/github.com/g" vcpkg-configuration.json

- name: update vcpkg
run: |
cd ${{ env.VCPKG_ROOT }} && git checkout master #&& git pull
@@ -73,7 +70,7 @@ jobs:
- name: Build for linux
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
cd build && cmake -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -DLINKER=gold -DTESTS=ON -DCOVERAGE=OFF -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=ON -DWITH_TARS_SERVICES=ON -DTOOLS=ON -DURL_BASE=ghproxy.com/github.com .. || cat *.log
cd build && cmake -DCMAKE_TOOLCHAIN_FILE=${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -DLINKER=gold -DTESTS=ON -DCOVERAGE=OFF -DWITH_LIGHTNODE=ON -DWITH_CPPSDK=ON -DWITH_TIKV=ON -DWITH_TARS_SERVICES=ON -DTOOLS=ON .. || cat *.log
make -j6
- name: Test
run: |
19 changes: 4 additions & 15 deletions bcos-txpool/bcos-txpool/txpool/storage/MemoryStorage.cpp
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion bcos-txpool/bcos-txpool/txpool/storage/MemoryStorage.h
Original file line number Diff line number Diff line change
@@ -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>>;
4 changes: 2 additions & 2 deletions tools/.ci/console_ci_test.sh
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ download_console()
if [ $? -ne 0 ]; then
cd ..
rm -rf ${console_file}
git clone -b ${console_branch} https://ghproxy.com/github.com/FISCO-BCOS/console.git
git clone -b ${console_branch} https://github.com/FISCO-BCOS/console.git
fi
git pull
else
rm -rf ${console_file}
git clone -b ${console_branch} https://ghproxy.com/github.com/FISCO-BCOS/console.git
git clone -b ${console_branch} https://github.com/FISCO-BCOS/console.git
fi
}

4 changes: 2 additions & 2 deletions tools/.ci/java_sdk_ci_test.sh
Original file line number Diff line number Diff line change
@@ -28,12 +28,12 @@ download_java_sdk()
if [ $? -ne 0 ]; then
cd ..
rm -rf ${java_sdk_file}
git clone -b ${java_sdk_branch} https://ghproxy.com/github.com/FISCO-BCOS/java-sdk.git
git clone -b ${java_sdk_branch} https://github.com/FISCO-BCOS/java-sdk.git
fi
git pull
else
rm -rf ${java_sdk_file}
git clone -b ${java_sdk_branch} https://ghproxy.com/github.com/FISCO-BCOS/java-sdk.git
git clone -b ${java_sdk_branch} https://github.com/FISCO-BCOS/java-sdk.git
fi
}

0 comments on commit 773c82d

Please sign in to comment.