diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b96bef885..049183b252 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,7 +105,7 @@ set(Boost_USE_MULTITHREADED ON) set( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" ) # Most boost deps get implictly picked up via fc, as just about everything links to fc. In addition we pick up # the pthread dependency through fc. -find_package(Boost 1.70 REQUIRED COMPONENTS program_options unit_test_framework system) +find_package(Boost 1.71 REQUIRED COMPONENTS program_options unit_test_framework system) if( APPLE AND UNIX ) # Apple Specific Options Here diff --git a/libraries/chain/include/eosio/chain/types.hpp b/libraries/chain/include/eosio/chain/types.hpp index b0089f3a15..5481cea3e1 100644 --- a/libraries/chain/include/eosio/chain/types.hpp +++ b/libraries/chain/include/eosio/chain/types.hpp @@ -76,15 +76,12 @@ namespace eosio::chain { using public_key_type = fc::crypto::public_key; using private_key_type = fc::crypto::private_key; using signature_type = fc::crypto::signature; -#if BOOST_VERSION >= 107100 - // configurable boost deque performs much better than std::deque in our use cases - using block_1024_option_t = boost::container::deque_options< boost::container::block_size<1024u> >::type; - template - using deque = boost::container::deque< T, void, block_1024_option_t >; -#else - template - using deque = std::deque; -#endif + + // configurable boost deque (for boost >= 1.71) performs much better than std::deque in our use cases + using block_1024_option_t = boost::container::deque_options< boost::container::block_size<1024u> >::type; + template + using deque = boost::container::deque< T, void, block_1024_option_t >; + struct void_t{}; using chainbase::allocator; diff --git a/scripts/0001-beast-fix-moved-from-executor.patch b/scripts/0001-beast-fix-moved-from-executor.patch deleted file mode 100644 index 4ceb88f6e3..0000000000 --- a/scripts/0001-beast-fix-moved-from-executor.patch +++ /dev/null @@ -1,89 +0,0 @@ -diff -Naur a/boost/beast/websocket/impl/ping.hpp b/boost/beast/websocket/impl/ping.hpp ---- a/boost/beast/websocket/impl/ping.hpp 2019-05-06 22:01:43.435117251 -0400 -+++ b/boost/beast/websocket/impl/ping.hpp 2019-05-06 22:02:37.949433556 -0400 -@@ -176,7 +176,8 @@ - impl.op_idle_ping.emplace(std::move(*this)); - impl.wr_block.lock(this); - BOOST_ASIO_CORO_YIELD -- net::post(this->get(), std::move(*this)); -+ net::post( -+ this->get_executor(), std::move(*this)); - BOOST_ASSERT(impl.wr_block.is_locked(this)); - } - if(impl.check_stop_now(ec)) -diff -Naur a/libs/beast/CHANGELOG.md b/libs/beast/CHANGELOG.md ---- a/libs/beast/CHANGELOG.md 2019-05-06 22:02:54.332528615 -0400 -+++ b/libs/beast/CHANGELOG.md 2019-05-06 22:03:05.896595711 -0400 -@@ -1,3 +1,10 @@ -+Version 248-hf1: -+ -+* Add idle ping suspend test -+* Fix moved-from executor in idle ping timeout -+ -+-------------------------------------------------------------------------------- -+ - Version 248: - - * Don't use a moved-from handler -diff -Naur a/libs/beast/test/beast/websocket/ping.cpp b/libs/beast/test/beast/websocket/ping.cpp ---- a/libs/beast/test/beast/websocket/ping.cpp 2019-05-06 22:02:54.342528673 -0400 -+++ b/libs/beast/test/beast/websocket/ping.cpp 2019-05-06 22:03:05.908595781 -0400 -@@ -10,8 +10,11 @@ - // Test that header file is self-contained. - #include - -+#include -+ - #include "test.hpp" - -+#include - #include - #include - -@@ -366,6 +369,46 @@ - BEAST_EXPECT(count == 3); - }); - -+ // suspend idle ping -+ { -+ using socket_type = -+ net::basic_stream_socket< -+ net::ip::tcp, -+ net::executor>; -+ net::io_context ioc; -+ stream ws1(ioc); -+ stream ws2(ioc); -+ ws1.set_option(stream_base::timeout{ -+ stream_base::none(), -+ std::chrono::seconds(0), -+ true}); -+ test::connect( -+ ws1.next_layer(), -+ ws2.next_layer()); -+ ws1.async_handshake("localhost", "/", -+ [](error_code){}); -+ ws2.async_accept([](error_code){}); -+ ioc.run(); -+ ioc.restart(); -+ flat_buffer b1; -+ auto mb = b1.prepare(65536); -+ std::memset(mb.data(), 0, mb.size()); -+ b1.commit(65536); -+ ws1.async_write(b1.data(), -+ [&](error_code, std::size_t){}); -+ BEAST_EXPECT( -+ ws1.impl_->wr_block.is_locked()); -+ ws1.async_read_some(net::mutable_buffer{}, -+ [&](error_code, std::size_t){}); -+ ioc.run(); -+ ioc.restart(); -+ flat_buffer b2; -+ ws2.async_read(b2, -+ [&](error_code, std::size_t){}); -+ ioc.run(); -+ } -+ //); -+ - { - echo_server es{log, kind::async}; - net::io_context ioc; diff --git a/scripts/pinned_build.sh b/scripts/pinned_build.sh index 5735ce3c2c..c57257e957 100755 --- a/scripts/pinned_build.sh +++ b/scripts/pinned_build.sh @@ -30,8 +30,8 @@ DEP_DIR="$(realpath "$1")" LEAP_DIR="$2" JOBS="$3" CLANG_VER=11.0.1 -BOOST_VER=1.70.0 -LLVM_VER=7.1.0 +BOOST_VER=1.82.0 +LLVM_VER=11.0.1 SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; START_DIR="$(pwd)" @@ -107,11 +107,10 @@ install_boost() { if [ ! -d "${BOOST_DIR}" ]; then echo "Installing Boost ${BOOST_VER} @ ${BOOST_DIR}" try wget -O "boost_${BOOST_VER//\./_}.tar.gz" "https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VER}/source/boost_${BOOST_VER//\./_}.tar.gz" - try tar --transform="s:^boost_${BOOST_VER//\./_}:boost_${BOOST_VER//\./_}patched:" -xvzf "boost_${BOOST_VER//\./_}.tar.gz" -C "${DEP_DIR}" + try tar -xvzf "boost_${BOOST_VER//\./_}.tar.gz" -C "${DEP_DIR}" pushdir "${BOOST_DIR}" - patch -p1 < "${SCRIPT_DIR}/0001-beast-fix-moved-from-executor.patch" try ./bootstrap.sh -with-toolset=clang --prefix="${BOOST_DIR}/bin" - ./b2 toolset=clang cxxflags="-stdlib=libc++ -D__STRICT_ANSI__ -nostdinc++ -I\${CLANG_DIR}/include/c++/v1 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fPIE" linkflags='-stdlib=libc++ -pie' link=static threading=multi --with-iostreams --with-date_time --with-filesystem --with-system --with-program_options --with-chrono --with-test -q -j "${JOBS}" install + ./b2 toolset=clang cxxflags="-stdlib=libc++ -D__STRICT_ANSI__ -nostdinc++ -I\${CLANG_DIR}/include/c++/v1 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fPIE" linkflags='-stdlib=libc++ -pie' link=static threading=multi --with-iostreams --with-date_time --with-system --with-program_options --with-chrono --with-test -q -j "${JOBS}" install popdir "${DEP_DIR}" rm "boost_${BOOST_VER//\./_}.tar.gz" fi @@ -122,7 +121,7 @@ pushdir "${DEP_DIR}" install_clang "${DEP_DIR}/clang-${CLANG_VER}" install_llvm "${DEP_DIR}/llvm-${LLVM_VER}" -install_boost "${DEP_DIR}/boost_${BOOST_VER//\./_}patched" +install_boost "${DEP_DIR}/boost_${BOOST_VER//\./_}" # go back to the directory where the script starts popdir "${START_DIR}"