diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0bbaac16..24b85e38 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -60,41 +60,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - build-ubuntu16: - name: Ubuntu 16.04 - runs-on: ubuntu-16.04 - steps: - - uses: actions/checkout@master - - - name: Build - id: build - run: | - sudo apt-get update - sudo apt-get install -y libboost-all-dev - build_folder="build/debug" - ccx_ver=${GITHUB_SHA::7} - ccx_ver_folder=$(echo $ccx_ver | sed 's/\.//g') - release_name=ccx-cli-ubuntu-1604-dev"$ccx_ver" - mkdir -p "$build_folder" - cd "$build_folder" - cmake ../.. -DCMAKE_BUILD_TYPE=Debug - make -j2 - mkdir -p "$release_name" - exeFiles=() - for f in src/*; do [[ -x $f && -f $f ]] && exeFiles+=( "$f" ); done - strip "${exeFiles[@]}" - cp "${exeFiles[@]}" "$release_name/" - echo "::set-output name=release_name::${release_name}.zip" - echo "::set-output name=artifact_path::$build_folder/$release_name" - - - name: Upload To GH Artifacts - uses: actions/upload-artifact@v1.0.0 - with: - name: ${{ steps.build.outputs.release_name }} - path: ${{ steps.build.outputs.artifact_path }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - build-ubuntu18: name: Ubuntu 18.04 runs-on: ubuntu-18.04 @@ -181,7 +146,7 @@ jobs: brew install gcc boost mkdir "$build_folder" cd "$build_folder" - cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" .. + cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -DSTATIC=ON .. make -j2 mkdir "$release_name" exeFiles=() diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index 51fe605f..4cfae662 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -21,7 +21,7 @@ jobs: brew install gcc boost mkdir "$build_folder" cd "$build_folder" - cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" .. + cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -DSTATIC=ON .. make -j2 mkdir "$release_name" exeFiles=() diff --git a/.github/workflows/ubuntu16.yml b/.github/workflows/ubuntu16.yml deleted file mode 100644 index b387202e..00000000 --- a/.github/workflows/ubuntu16.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Ubuntu 16.04 - -on: - push: - tags: - - "*" - -jobs: - build-ubuntu16: - name: Ubuntu 16.04 - runs-on: ubuntu-16.04 - steps: - - uses: actions/checkout@master - - - name: Build - id: build - run: | - sudo apt-get update - sudo apt-get install -y libboost-all-dev - build_folder="build/debug" - ccx_ver=$(echo "$GITHUB_REF" | sed 's|refs/tags/||') - ccx_ver_folder=$(echo $ccx_ver | sed 's/\.//g') - release_name=ccx-cli-ubuntu-1604-v"$ccx_ver" - mkdir -p "$build_folder" - cd "$build_folder" - cmake ../.. - make -j2 - mkdir -p "$release_name/$ccx_ver_folder" - exeFiles=() - for f in src/*; do [[ -x $f && -f $f ]] && exeFiles+=( "$f" ); done - cp "${exeFiles[@]}" "$release_name/$ccx_ver_folder" - cd "$release_name" - tar -czf "$release_name".tar.gz "$ccx_ver_folder" - sha256=$(shasum -a 256 "$release_name".tar.gz | awk '{print toupper($1)}') - asset_path="./$build_folder/$release_name/$release_name.tar.gz" - echo "::set-output name=sha256::${sha256}" - echo "::set-output name=release_name::${release_name}.tar.gz" - echo "::set-output name=asset_path::${asset_path}" - echo "::set-output name=ccx_ver::${ccx_ver}" - - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - files: ${{ steps.build.outputs.asset_path }} - name: Conceal Core CLI v${{ steps.build.outputs.ccx_ver }} - body: | - **${{ steps.build.outputs.release_name }}** - ${{ steps.build.outputs.sha256 }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.vscode/settings.json b/.vscode/settings.json index c959bf34..b8deb0a1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -76,26 +76,6 @@ "xthread": "cpp", "sparse_hash_map": "cpp", "sparse_hash_set": "cpp", - "sparsetable": "cpp", - "bitset": "cpp", - "clocale": "cpp", - "codecvt": "cpp", - "complex": "cpp", - "csignal": "cpp", - "cstdarg": "cpp", - "cwctype": "cpp", - "locale": "cpp", - "optional": "cpp", - "regex": "cpp", - "scoped_allocator": "cpp", - "shared_mutex": "cpp", - "string_view": "cpp", - "strstream": "cpp", - "typeindex": "cpp", - "valarray": "cpp", - "variant": "cpp", - "xlocbuf": "cpp", - "xlocmes": "cpp", - "*.ipp": "cpp" + "sparsetable": "cpp" } } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 27a1df69..d6b9e272 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 2.8.6) include(CheckCXXCompilerFlag) -set(VERSION "0.2") +set(VERSION "6.4.9") +set(VERSION_BUILD_NO "Poseidon") # Packaged from main commits set(COMMIT 72946d9) set(REFS " (HEAD -> master)") @@ -250,6 +251,7 @@ if(ARM) endif() if(STATIC) + set(Boost_NO_BOOST_CMAKE ON) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) endif() @@ -279,18 +281,25 @@ if (NOT COMMIT_ID_IN_VERSION) set(VERSION "${VERSION}-unknown") configure_file("src/version.h.in" "version/version.h") add_custom_target(version ALL) -elseif(DEFINED COMMIT) - string(REPLACE "." "\\." VERSION_RE "${VERSION}") - if(NOT REFS MATCHES "(\\(|, )tag: v${VERSION_RE}(\\)|, )") - set(VERSION "${VERSION}-g${COMMIT}") - endif() - configure_file("src/version.h.in" "version/version.h") - add_custom_target(version ALL) else() find_package(Git QUIET) if(Git_FOUND OR GIT_FOUND) message(STATUS "Found Git: ${GIT_EXECUTABLE}") - add_custom_target(version ALL "${CMAKE_COMMAND}" "-D" "VERSION=${VERSION}" "-D" "GIT=${GIT_EXECUTABLE}" "-D" "TO=${CMAKE_BINARY_DIR}/version/version.h" "-P" "src/version.cmake" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}") + execute_process( + COMMAND git log -1 --format=%h + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + configure_file("src/version.h.in" "version/version.h") + add_custom_target(version ALL) + elseif(DEFINED COMMIT) + string(REPLACE "." "\\." VERSION_RE "${VERSION}") + if(NOT REFS MATCHES "(\\(|, )tag: v${VERSION_RE}(\\)|, )") + set(VERSION "${VERSION}-g${COMMIT}") + endif() + configure_file("src/version.h.in" "version/version.h") + add_custom_target(version ALL) else() message(STATUS "WARNING: Git was not found!") set(VERSION "${VERSION}-unknown") diff --git a/src/CryptoNoteConfig.h b/src/CryptoNoteConfig.h index e94fb4ae..44f43864 100644 --- a/src/CryptoNoteConfig.h +++ b/src/CryptoNoteConfig.h @@ -150,6 +150,7 @@ namespace CryptoNote const size_t BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT = 10000; // by default, blocks ids count in synchronizing const size_t BLOCKS_SYNCHRONIZING_DEFAULT_COUNT = 128; // by default, blocks count in blocks downloading const size_t COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT = 1000; + const size_t COMMAND_RPC_GET_OBJECTS_MAX_COUNT = 1000; const int P2P_DEFAULT_PORT = 15000; const int RPC_DEFAULT_PORT = 16000; @@ -282,4 +283,4 @@ namespace CryptoNote } // namespace CryptoNote -#define ALLOW_DEBUG_COMMANDS \ No newline at end of file +#define ALLOW_DEBUG_COMMANDS diff --git a/src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp b/src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp index 13753b89..5a163fdf 100644 --- a/src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp +++ b/src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp @@ -395,11 +395,19 @@ int CryptoNoteProtocolHandler::handle_notify_new_transactions(int command, NOTIF int CryptoNoteProtocolHandler::handle_request_get_objects(int command, NOTIFY_REQUEST_GET_OBJECTS::request &arg, CryptoNoteConnectionContext &context) { logger(Logging::TRACE) << context << "NOTIFY_REQUEST_GET_OBJECTS"; + if(arg.blocks.size() > COMMAND_RPC_GET_OBJECTS_MAX_COUNT || arg.txs.size() > COMMAND_RPC_GET_OBJECTS_MAX_COUNT) + { + logger(Logging::ERROR) << context << "GET_OBJECTS_MAX_COUNT exceeded blocks: " << arg.blocks.size() << " txes: " << arg.txs.size(); + context.m_state = CryptoNoteConnectionContext::state_shutdown; + return 1; + } + NOTIFY_RESPONSE_GET_OBJECTS::request rsp; if (!m_core.handle_get_objects(arg, rsp)) { logger(Logging::ERROR) << context << "failed to handle request NOTIFY_REQUEST_GET_OBJECTS, dropping connection"; context.m_state = CryptoNoteConnectionContext::state_shutdown; + return 1; } logger(Logging::TRACE) << context << "-->>NOTIFY_RESPONSE_GET_OBJECTS: blocks.size()=" << rsp.blocks.size() << ", txs.size()=" << rsp.txs.size() << ", rsp.m_current_blockchain_height=" << rsp.current_blockchain_height << ", missed_ids.size()=" << rsp.missed_ids.size(); diff --git a/src/version.h.in b/src/version.h.in index 4fad8ff6..b3bbbc6f 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -1,4 +1,4 @@ -#define BUILD_COMMIT_ID "@VERSION@" -#define PROJECT_VERSION "6.4.9" -#define PROJECT_VERSION_BUILD_NO "Poseidon" -#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")" +#define BUILD_COMMIT_ID "@COMMIT@" +#define PROJECT_VERSION "@VERSION@" +#define PROJECT_VERSION_BUILD_NO "@VERSION_BUILD_NO@" +#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" PROJECT_VERSION "-" BUILD_COMMIT_ID ")"