Skip to content

Commit

Permalink
Merge branch 'v3.21.0' into IS-495-catchup-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Jan 3, 2025
2 parents b5a13d3 + 20f93f9 commit 293fdbe
Show file tree
Hide file tree
Showing 11 changed files with 193 additions and 37 deletions.
24 changes: 4 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ list( APPEND CMAKE_MODULE_PATH ${ETH_CMAKE_DIR} )
set( CMAKE_MAP_IMPORTED_CONFIG_DEBUG Release )
set( CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO Release )

set( HUNTER_CONFIGURATION_TYPES Release )
set( HUNTER_JOBS_NUMBER 4 )

find_program( CCACHE_FOUND ccache )
if( CCACHE_FOUND )
set_property( GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache )
Expand All @@ -93,11 +90,6 @@ if( "$ENV{CI}" AND NOT "$ENV{GITHUB_USER_PASSWORD}" STREQUAL "" )
else()
set( run_upload NO )
endif()
option( HUNTER_RUN_UPLOAD "Upload binaries to the cache server" ${run_upload} )

include( HunterGate )
#HunterGate( URL "https://github.com/ruslo/hunter/archive/v0.23.76.tar.gz" SHA1 "c7b60993e841850e2c449afd454f5d5aa4ec04e4" LOCAL )
HunterGate( URL "https://github.com/ruslo/hunter/archive/v0.23.214.tar.gz" SHA1 "e14bc153a7f16d6a5eeec845fb0283c8fad8c358" LOCAL ) #leveldb 1.22

set( CMAKE_CXX_STANDARD 17 )

Expand Down Expand Up @@ -135,36 +127,28 @@ include( FindClangFormat )

set( Boost_USE_STATIC_LIBS ON )
set( Boost_USE_MULTITHREADED ON )
hunter_add_package( Boost COMPONENTS program_options filesystem system thread context fiber log chrono test)
find_package( Boost CONFIG REQUIRED program_options filesystem system thread context fiber log chrono)

set( SKALE_HAVE_BOOST_FROM_HUNTER true )
set( Boost_NO_BOOST_CMAKE ON )
find_package( Boost MODULE REQUIRED program_options filesystem system thread context fiber log chrono)

option( BUILD_LEVELDB "Build leveldb from leveldb directory" OFF )

if( BUILD_LEVELDB )
add_subdirectory( leveldb )
else()
hunter_add_package( leveldb )
find_package( leveldb CONFIG REQUIRED )
endif()

#hunter_add_package( jsoncpp )
#find_package( jsoncpp PATHS "${DEPS_INSTALL_ROOT}/libs/cmake" ) #( jsoncpp CONFIG REQUIRED )

hunter_add_package( Snappy )
find_package( Snappy CONFIG REQUIRED )
find_package( Crc32c CONFIG REQUIRED )

set( LIB_NAME_cryptopp "cryptopp" )

#set( MHD_DIR "${DEPS_INSTALL_ROOT}" )
#find_package( MHD PATHS "${DEPS_INSTALL_ROOT}/libs/cmake" )
#find_library( MHD microhttpd )

hunter_add_package( libscrypt )
find_package( libscrypt CONFIG REQUIRED )
find_library( SCRYPT_LIBRARIES NAMES scrypt HINTS "${DEPS_INSTALL_ROOT}/lib")

hunter_add_package( ethash )
find_package( ethash CONFIG REQUIRED )

include( ProjectSecp256k1 )
Expand Down
178 changes: 175 additions & 3 deletions deps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ setup_variable WITH_WANGLE "yes"
setup_variable WITH_GTEST "yes"
setup_variable WITH_FIZZ "yes"
setup_variable WITH_PROXYGEN "yes"
setup_variable WITH_SNAPPY "yes"
setup_variable WITH_LIBSCRYPT "yes"
setup_variable WITH_ETHASH "yes"
setup_variable WITH_YAML "yes"

if [ -z "${PARALLEL_COUNT}" ];
then
Expand Down Expand Up @@ -607,6 +611,10 @@ echo -e "${COLOR_VAR_NAME}WITH_WANGLE${COLOR_DOTS}............${COLOR_VAR_DESC}L
echo -e "${COLOR_VAR_NAME}WITH_GTEST${COLOR_DOTS}.............${COLOR_VAR_DESC}LibGTEST${COLOR_DOTS}...............................${COLOR_VAR_VAL}$WITH_GTEST${COLOR_RESET}"
echo -e "${COLOR_VAR_NAME}WITH_FIZZ${COLOR_DOTS}..............${COLOR_VAR_DESC}LibFIZZ${COLOR_DOTS}................................${COLOR_VAR_VAL}$WITH_FIZZ${COLOR_RESET}"
echo -e "${COLOR_VAR_NAME}WITH_PROXYGEN${COLOR_DOTS}..........${COLOR_VAR_DESC}LibProxygen${COLOR_DOTS}............................${COLOR_VAR_VAL}$WITH_PROXYGEN${COLOR_RESET}"
echo -e "${COLOR_VAR_NAME}WITH_SNAPPY${COLOR_DOTS}............${COLOR_VAR_DESC}LibSnappy${COLOR_DOTS}..............................${COLOR_VAR_VAL}$WITH_SNAPPY${COLOR_RESET}"
echo -e "${COLOR_VAR_NAME}WITH_LIBSCRYPT${COLOR_DOTS}.........${COLOR_VAR_DESC}LibSCRYPT${COLOR_DOTS}..............................${COLOR_VAR_VAL}$WITH_LIBSCRYPT${COLOR_RESET}"
echo -e "${COLOR_VAR_NAME}WITH_ETHASH${COLOR_DOTS}.........${COLOR_VAR_DESC}LibEthash${COLOR_DOTS}..............................${COLOR_VAR_VAL}$WITH_ETHASH${COLOR_RESET}"
echo -e "${COLOR_VAR_NAME}WITH_YAML${COLOR_DOTS}.........${COLOR_VAR_DESC}LibYAMLCPP${COLOR_DOTS}..............................${COLOR_VAR_VAL}$WITH_YAML${COLOR_RESET}"

#
#
Expand Down Expand Up @@ -2320,9 +2328,9 @@ then
then
echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}"
eval git clone https://github.com/facebook/proxygen.git --recursive
cd proxygen
eval git checkout f666fe2d938a1b06a3281c958cdeb46743a2fa49
cd ..
cd proxygen
eval git checkout f666fe2d938a1b06a3281c958cdeb46743a2fa49
cd ..
echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -czf proxygen-from-git.tar.gz ./proxygen
else
Expand Down Expand Up @@ -2358,6 +2366,170 @@ then
fi
fi

if [ "$WITH_SNAPPY" = "yes" ];
then
echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}libSnappy${COLOR_SEPARATOR} ==================================${COLOR_RESET}"
if [ ! -f "$INSTALL_ROOT/lib/libsnappy.a" ];
then
env_restore
cd "$SOURCES_ROOT"
if [ ! -d "snappy" ];
then
if [ ! -f "snappy-from-git.tar.gz" ];
then
echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}"
eval git clone https://github.com/google/snappy.git --recursive
cd snappy
eval git checkout 1.1.7
cd ..
echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -czf snappy-from-git.tar.gz ./snappy
else
echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -xzf snappy-from-git.tar.gz
fi
echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
cd snappy
eval mkdir -p build
cd build
eval "$CMAKE" "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \
-DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF ..
cd ..
else
cd snappy
fi
echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}"
cd build
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}"
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}" install
cd "$SOURCES_ROOT"
else
echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}"
fi
fi

if [ "$WITH_LIBSCRYPT" = "yes" ];
then
echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}libScrypt${COLOR_SEPARATOR} ==================================${COLOR_RESET}"
if [ ! -f "$INSTALL_ROOT/lib/libscrypt.a" ];
then
env_restore
cd "$SOURCES_ROOT"
if [ ! -d "libscrypt" ];
then
if [ ! -f "libscrypt-from-git.tar.gz" ];
then
echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}"
eval git clone https://github.com/technion/libscrypt.git --recursive
cd libscrypt
eval git checkout v1.22
cd ..
echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -czf libscrypt-from-git.tar.gz ./libscrypt
else
echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -xzf libscrypt-from-git.tar.gz
fi
echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
cd libscrypt
else
cd libscrypt
fi
echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}"
eval "$MAKE" install "${PARALLEL_MAKE_OPTIONS}" PREFIX="$INSTALL_ROOT" LIBDIR="${INSTALL_ROOT}/lib" INCLUDEDIR="${INSTALL_ROOT}/include"
eval "$MAKE" install-static "${PARALLEL_MAKE_OPTIONS}" PREFIX="$INSTALL_ROOT" LIBDIR="${INSTALL_ROOT}/lib" INCLUDEDIR="${INSTALL_ROOT}/include"
echo ${INSTALL_ROOT}
rm "${INSTALL_ROOT}/lib/libscrypt.so.0" "${INSTALL_ROOT}/lib/libscrypt.so"
cd "$SOURCES_ROOT"
else
echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}"
fi
fi

if [ "$WITH_ETHASH" = "yes" ];
then
echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}libEthash${COLOR_SEPARATOR} ==================================${COLOR_RESET}"
if [ ! -f "$INSTALL_ROOT/lib/libethash.a" ];
then
env_restore
cd "$SOURCES_ROOT"
if [ ! -d "ethash" ];
then
if [ ! -f "ethash-from-git.tar.gz" ];
then
echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}"
eval git clone https://github.com/chfast/ethash.git --recursive
cd ethash
eval git checkout v0.5.0
cd ..
echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -czf ethash-from-git.tar.gz ./ethash
else
echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -xzf ethash-from-git.tar.gz
fi
echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
cd ethash
eval mkdir -p build
cd build
eval "$CMAKE" "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" \
-DETHASH_BUILD_TESTS=OFF ..
cd ..
else
cd ethash
fi
echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}"
cd build
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}"
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}" install
cd "$SOURCES_ROOT"
else
echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}"
fi
fi

if [ "$WITH_YAML" = "yes" ];
then
echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}libYamlCpp${COLOR_SEPARATOR} ==================================${COLOR_RESET}"
if [ ! -f "$INSTALL_ROOT/lib/libyaml-cpp.a" ];
then
env_restore
cd "$SOURCES_ROOT"
if [ ! -d "yaml-cpp" ];
then
if [ ! -f "yaml-cpp-from-git.tar.gz" ];
then
echo -e "${COLOR_INFO}getting it from git${COLOR_DOTS}...${COLOR_RESET}"
eval git clone https://github.com/jbeder/yaml-cpp.git --recursive
cd yaml-cpp
eval git checkout yaml-cpp-0.6.2
cd ..
echo -e "${COLOR_INFO}archiving it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -czf yaml-cpp-from-git.tar.gz ./yaml-cpp
else
echo -e "${COLOR_INFO}unpacking it${COLOR_DOTS}...${COLOR_RESET}"
eval tar -xzf yaml-cpp-from-git.tar.gz
fi
echo -e "${COLOR_INFO}configuring it${COLOR_DOTS}...${COLOR_RESET}"
cd yaml-cpp
eval mkdir -p build
cd build
eval "$CMAKE" "${CMAKE_CROSSCOMPILING_OPTS}" -DCMAKE_INSTALL_PREFIX="$INSTALL_ROOT" -DCMAKE_BUILD_TYPE="$TOP_CMAKE_BUILD_TYPE" \
-DYAML_BUILD_SHARED_LIBS=OFF -DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF ..
cd ..
else
cd yaml-cpp
fi
echo -e "${COLOR_INFO}building it${COLOR_DOTS}...${COLOR_RESET}"
cd build
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}"
eval "$MAKE" "${PARALLEL_MAKE_OPTIONS}" install
cd "$SOURCES_ROOT"
else
echo -e "${COLOR_SUCCESS}SKIPPED${COLOR_RESET}"
fi
fi

echo -e "${COLOR_SEPARATOR}===================================================================${COLOR_RESET}"
echo -e "${COLOR_YELLOW}SKALED dependencies build actions...${COLOR_RESET}"
echo -e "${COLOR_SEPARATOR}==================== ${COLOR_PROJECT_NAME}FINISH${COLOR_SEPARATOR} =======================================${COLOR_RESET}"
Expand Down
2 changes: 1 addition & 1 deletion libdevcrypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ target_link_libraries( devcrypto
${DEPS_INSTALL_ROOT}/lib/libff.a
${DEPS_INSTALL_ROOT}/lib/libgmp.a
${LIB_NAME_cryptopp}
libscrypt::scrypt
${SCRYPT_LIBRARIES}
)

2 changes: 1 addition & 1 deletion libethcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ target_include_directories( ethcore PRIVATE
target_link_libraries( ethcore PUBLIC
devcrypto
devcore
skale
skale
)
2 changes: 1 addition & 1 deletion libethereum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ target_include_directories( ethereum PRIVATE "${UTILS_INCLUDE_DIR}" ${SKUTILS_IN
${CMAKE_SOURCE_DIR}/libconsensus/jsoncpp/include
${CMAKE_SOURCE_DIR}/libconsensus/spdlog/include
${CMAKE_SOURCE_DIR}/libconsensus/libjson/include)
target_link_libraries( ethereum PUBLIC evm ethcore p2p devcrypto devcore skale PRIVATE historic skutils Snappy::snappy
target_link_libraries( ethereum PUBLIC evm ethcore p2p devcrypto devcore skale PRIVATE historic skutils snappy
jsoncpp # ${CMAKE_SOURCE_DIR}/libconsensus/jsoncpp/build/src/lib_json/libjsoncpp.a
Boost::fiber Boost::context Boost::chrono
batched-io
Expand Down
2 changes: 1 addition & 1 deletion libhistoric/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ target_include_directories( historic PRIVATE "${UTILS_INCLUDE_DIR}" ${SKUTILS_IN
${CMAKE_SOURCE_DIR}/libconsensus/jsoncpp/include
${CMAKE_SOURCE_DIR}/libconsensus/spdlog/include
${CMAKE_SOURCE_DIR}/libconsensus/libjson/include)
target_link_libraries( historic PRIVATE evm ethcore p2p devcrypto devcore skale skutils Snappy::snappy
target_link_libraries( historic PRIVATE evm ethcore p2p devcrypto devcore skale skutils snappy
jsoncpp # ${CMAKE_SOURCE_DIR}/libconsensus/jsoncpp/build/src/lib_json/libjsoncpp.a
Boost::fiber Boost::context Boost::chrono
batched-io
Expand Down
2 changes: 1 addition & 1 deletion libskale-interpreter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set(
set(
dependencies
skale-buildinfo
ethash::ethash
ethash
evmc::evmc
evmc::instructions
Boost::boost
Expand Down
2 changes: 1 addition & 1 deletion libskale/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ target_include_directories( skale PUBLIC
${CMAKE_SOURCE_DIR}/libconsensus/libzmq/include
${CMAKE_SOURCE_DIR}/libconsensus/jsoncpp/include
)
#target_link_libraries(skale PUBLIC evm ethcore p2p devcrypto devcore ethereum PRIVATE jsoncpp Snappy::snappy Boost::fiber Boost::context)

target_link_libraries(skale PRIVATE ethereum web3jsonrpc historic skutils
"${DEPS_INSTALL_ROOT}/lib/libzmq.a"
"${DEPS_INSTALL_ROOT}/lib/libsodium.a"
Expand Down
4 changes: 2 additions & 2 deletions libweb3jsonrpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ target_link_libraries( web3jsonrpc
consensus
# bls
ethashseal
skutils
skutils
jsonrpccpp-client # ${CMAKE_SOURCE_DIR}/libconsensus/libjson-rpc-cpp/build/lib/libjsonrpccpp-client.a
jsonrpccpp-server # ${CMAKE_SOURCE_DIR}/libconsensus/libjson-rpc-cpp/build/lib/libjsonrpccpp-server.a
jsonrpccpp-common # ${CMAKE_SOURCE_DIR}/libconsensus/libjson-rpc-cpp/build/lib/libjsonrpccpp-common.a
jsoncpp # ${CMAKE_SOURCE_DIR}/libconsensus/jsoncpp/build/src/lib_json/libjsoncpp.a
jsoncpp # ${CMAKE_SOURCE_DIR}/libconsensus/jsoncpp/build/src/lib_json/libjsoncpp.a
${DEPS_INSTALL_ROOT}/lib/libmicrohttpd.a
${DEPS_INSTALL_ROOT}/lib/libcurl.a
${DEPS_INSTALL_ROOT}/lib/libssl.a
Expand Down
7 changes: 4 additions & 3 deletions scripts/skale_build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ RUN apt-get -q update && \
software-properties-common \
curl \
wget \
libgmp-dev \
libleveldb-dev \
nettle-bin \
gnutls-bin \
libleveldb-dev \
libgoogle-perftools-dev \
python3 \
python3-pip \
btrfs-progs

RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb && \
dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-net && \
echo 'Acquire::http::Timeout "20";' >> /etc/apt/apt.conf.d/80-net
Expand All @@ -28,5 +28,6 @@ RUN mkdir /skaled
COPY ./executable /skaled
WORKDIR /skaled
RUN chmod +x skaled
RUN ldd skaled

ENTRYPOINT ["/skaled/skaled"]
5 changes: 2 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ foreach(file ${sources})
endforeach(test_raw)
endforeach(file)

hunter_add_package(yaml-cpp)
find_package(yaml-cpp CONFIG REQUIRED)
find_library( YAML_CPP_LIBRARIES NAMES yaml-cpp HINTS "${DEPS_INSTALL_ROOT}/lib")

add_executable(testeth ${sources} unittests/libethereum/InstanceMonitorTest.cpp)
target_compile_options( testeth PRIVATE
Expand All @@ -73,7 +72,7 @@ if( APPLE )
endif()
target_include_directories(testeth PRIVATE ${UTILS_INCLUDE_DIR} ../libconsensus/spdlog/include)
target_link_libraries(testeth PRIVATE
ethereum historic ethashseal web3jsonrpc devcrypto devcore skale-buildinfo ${LIB_NAME_cryptopp} yaml-cpp::yaml-cpp binaryen::binaryen
ethereum historic ethashseal web3jsonrpc devcrypto devcore skale-buildinfo ${LIB_NAME_cryptopp} yaml-cpp binaryen::binaryen
skutils
Boost::system Boost::program_options
jsonrpccpp-client # ${CMAKE_SOURCE_DIR}/libconsensus/libjson-rpc-cpp/build/lib/libjsonrpccpp-client.a
Expand Down

0 comments on commit 293fdbe

Please sign in to comment.