diff --git a/.github/workflows/workflow-self-hosted-centos.yml b/.github/workflows/workflow-self-hosted-centos.yml index 7cffcd107f..d6db7a5c93 100644 --- a/.github/workflows/workflow-self-hosted-centos.yml +++ b/.github/workflows/workflow-self-hosted-centos.yml @@ -73,8 +73,7 @@ jobs: . /opt/rh/rh-perl530/enable 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 .. || cat *.log + cd build && cmake -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: diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 1f1d62e03e..7122251aca 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -29,19 +29,17 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 5 - - uses: actions/cache@v2 + - uses: actions/cache@v3 id: cache with: path: | deps/ c:/vcpkg - c:/vcpkg/buildtrees - c:/vcpkg/packages - c:/vcpkg/downloads ccache - key: hunter-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} + key: vcpkg-msvc-v3-notest-${{ hashFiles('.github/workflows/workflow.yml') }} restore-keys: | - hunter-msvc-v3-notest-${{ runner.temp }}-${{ github.base_ref }}-${{ hashFiles('.github/workflows/workflow.yml') }} + vcpkg-msvc-v3-notest-${{ hashFiles('.github/workflows/workflow.yml') }} + vcpkg-msvc-v3-notest- - name: update vcpkg run: | cd ${{ env.VCPKG_ROOT }} && git fetch --all && git checkout master && git pull diff --git a/CMakeLists.txt b/CMakeLists.txt index dd7f9e5e3e..6f5531aa73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,8 +39,9 @@ if(NOT ONLY_CPP_SDK AND NOT WITH_SWIG_SDK) add_subdirectory(bcos-tars-protocol) endif () add_subdirectory(bcos-codec) -include(ProjectITTAPI) -include(ProjectSDF) +if(NOT ONLY_CPP_SDK AND NOT WITH_SWIG_SDK) + include(ProjectITTAPI) +endif () if(WITH_LIGHTNODE) add_subdirectory(lightnode) diff --git a/bcos-crypto/CMakeLists.txt b/bcos-crypto/CMakeLists.txt index 115951e1a9..ae79a4aabc 100644 --- a/bcos-crypto/CMakeLists.txt +++ b/bcos-crypto/CMakeLists.txt @@ -1,12 +1,13 @@ project(bcos-crypto VERSION ${VERSION}) file(GLOB_RECURSE ALL_SRCS bcos-crypto/*.cpp) -set(LIB_LIST OpenSSL::SSL OpenSSL::Crypto wedprcrypto::crypto wedprcrypto::zkp bcos-utilities bcos-concepts TBB::tbb SDF unofficial::secp256k1 unofficial::secp256k1_precomputed) +set(LIB_LIST OpenSSL::SSL OpenSSL::Crypto wedprcrypto::crypto wedprcrypto::zkp bcos-utilities bcos-concepts TBB::tbb HSM-CRYPTO::sdf-crypto unofficial::secp256k1 unofficial::secp256k1_precomputed) find_package(OpenSSL REQUIRED) find_package(TBB REQUIRED) find_package(wedprcrypto REQUIRED) find_package(unofficial-secp256k1 REQUIRED) +find_package(HSM-CRYPTO REQUIRED) add_library(bcos-crypto STATIC ${ALL_SRCS}) target_link_libraries(bcos-crypto PUBLIC ${LIB_LIST}) diff --git a/bcos-framework/CMakeLists.txt b/bcos-framework/CMakeLists.txt index 1b227913f7..eac1929f80 100644 --- a/bcos-framework/CMakeLists.txt +++ b/bcos-framework/CMakeLists.txt @@ -30,17 +30,16 @@ target_include_directories(bcos-framework INTERFACE $) if (PRECOMPILED_HEADER) - target_link_libraries(bcos-framework INTERFACE bcos-crypto bcos-task Microsoft.GSL::GSL precompiled-headers) + target_link_libraries(bcos-framework INTERFACE bcos-task Microsoft.GSL::GSL precompiled-headers) target_precompile_headers(bcos-framework REUSE_FROM precompiled-headers) else() - target_link_libraries(bcos-framework INTERFACE bcos-crypto bcos-task Microsoft.GSL::GSL fmt::fmt) + target_link_libraries(bcos-framework INTERFACE bcos-task Microsoft.GSL::GSL fmt::fmt) endif() if (TESTS) enable_testing() set(CTEST_OUTPUT_ON_FAILURE TRUE) add_subdirectory(test) - add_subdirectory(benchmark) endif() # for code coverage diff --git a/bcos-framework/benchmark/CMakeLists.txt b/bcos-framework/benchmark/CMakeLists.txt deleted file mode 100644 index 0982e137fa..0000000000 --- a/bcos-framework/benchmark/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -file(GLOB_RECURSE SOURCES "*.cpp") - -find_package(fmt REQUIRED) - -find_package(benchmark REQUIRED) -add_executable(benchmark-memory-storage ${SOURCES}) -target_link_libraries(benchmark-memory-storage bcos-framework benchmark::benchmark benchmark::benchmark_main fmt::fmt-header-only) \ No newline at end of file diff --git a/bcos-framework/test/CMakeLists.txt b/bcos-framework/test/CMakeLists.txt index d040829810..3a06454a25 100644 --- a/bcos-framework/test/CMakeLists.txt +++ b/bcos-framework/test/CMakeLists.txt @@ -23,7 +23,6 @@ set(TEST_BINARY_NAME test-bcos-framework) add_executable(${TEST_BINARY_NAME} ${SOURCES}) find_package(Boost REQUIRED serialization unit_test_framework) -find_package(fmt REQUIRED) -target_link_libraries(${TEST_BINARY_NAME} PRIVATE ${UTILITIES_TARGET} bcos-framework Boost::serialization fmt::fmt-header-only Boost::unit_test_framework) +target_link_libraries(${TEST_BINARY_NAME} PRIVATE ${UTILITIES_TARGET} bcos-framework Boost::serialization Boost::unit_test_framework) add_test(NAME test-framework WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${TEST_BINARY_NAME}) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 96e4dc4a2a..ad05346527 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -4,4 +4,9 @@ add_executable(merkleBench merkleBench.cpp) target_link_libraries(merkleBench ${TOOL_TARGET} ${PROTOCOL_TARGET} bcos-crypto Boost::program_options) add_executable(storageBenchmark storageBenchmark.cpp) -target_link_libraries(storageBenchmark bcos-framework) \ No newline at end of file +target_link_libraries(storageBenchmark bcos-framework) + +find_package(fmt REQUIRED) +find_package(benchmark REQUIRED) +add_executable(benchmark-memory-storage benchmarkMemoryStorage.cpp) +target_link_libraries(benchmark-memory-storage bcos-framework benchmark::benchmark benchmark::benchmark_main fmt::fmt-header-only) \ No newline at end of file diff --git a/bcos-framework/benchmark/benchmarkMemoryStorage.cpp b/benchmark/benchmarkMemoryStorage.cpp similarity index 97% rename from bcos-framework/benchmark/benchmarkMemoryStorage.cpp rename to benchmark/benchmarkMemoryStorage.cpp index 867c265273..2d354d612d 100644 --- a/bcos-framework/benchmark/benchmarkMemoryStorage.cpp +++ b/benchmark/benchmarkMemoryStorage.cpp @@ -1,12 +1,12 @@ -#include -#include -#include +#include "bcos-framework/bcos-framework/storage/Entry.h" +#include "bcos-framework/bcos-framework/storage2/MemoryStorage.h" +#include "bcos-framework/bcos-framework/transaction-executor/TransactionExecutor.h" +#include "libtask/bcos-task/Wait.h" #include #include #include #include #include -#include #include #include #include diff --git a/bcos-framework/test/unittests/interfaces/ConsensusNodeTest.cpp b/tests/unittest/ConsensusNodeTest.cpp similarity index 97% rename from bcos-framework/test/unittests/interfaces/ConsensusNodeTest.cpp rename to tests/unittest/ConsensusNodeTest.cpp index 45f3b11c96..035c3f8c5e 100644 --- a/bcos-framework/test/unittests/interfaces/ConsensusNodeTest.cpp +++ b/tests/unittest/ConsensusNodeTest.cpp @@ -17,11 +17,11 @@ * @file ConsensusNodeTest.cpp */ #include "bcos-framework/consensus/ConsensusNode.h" +#include "bcos-crypto/bcos-crypto/signature/key/KeyImpl.h" +#include "bcos-crypto/bcos-crypto/signature/secp256k1/Secp256k1Crypto.h" #include "bcos-framework/consensus/ConsensusNodeInterface.h" #include "bcos-framework/protocol/Protocol.h" -#include -#include -#include +#include "bcos-utilities/testutils/TestPromptFixture.h" #include using namespace bcos; using namespace bcos::consensus; diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index c3631a981f..fc4957a9a2 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -3,7 +3,7 @@ { "kind": "git", "repository": "https://github.com/FISCO-BCOS/registry", - "baseline": "a24727866a467378e73db194f43a8c0978093b62", + "baseline": "4e355080e2742a679e1ce5fddb8a3b9a7fd559fd", "packages": [ "openssl", "evmone", @@ -16,7 +16,8 @@ "wedprcrypto", "jemalloc", "secp256k1", - "tbb" + "tbb", + "hsm-crypto" ] } ] diff --git a/vcpkg.json b/vcpkg.json index c2e3d5d4fb..759c6e3007 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -46,7 +46,8 @@ "features": [] }, "wedprcrypto", - "range-v3" + "range-v3", + "hsm-crypto" ], "features": { "fullnode": { @@ -118,7 +119,8 @@ { "name": "tarscpp", "version>=": "3.0.3-1#1" - } + }, + "hsm-crypto" ] }, "etcd": {