Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boost 1.87.0 #2349

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ hunter_config(
CMAKE_ARGS WITH_GFLAGS=OFF USE_RTTI=ON
)

hunter_config(
Boost
VERSION 1.85.0
)

if ("${WASM_COMPILER}" STREQUAL "WasmEdge")
hunter_config(
fmt
Expand Down Expand Up @@ -104,17 +99,6 @@ hunter_config(
SECP256K1_ENABLE_MODULE_RECOVERY=ON
)

hunter_config(
libp2p
URL https://github.com/libp2p/cpp-libp2p/archive/c3e6cce18335c989c9bbf3485885630a6ba463e4.zip
SHA1 32698ef4c3d373a39f87e7acb60eb7dc39399653
)

hunter_config(
scale
VERSION 1.1.4
)

hunter_config(
erasure_coding_crust
VERSION 0.0.9
Expand Down
4 changes: 2 additions & 2 deletions cmake/Hunter/hunter-gate-url.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HunterGate(
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm26.zip
SHA1 21e8e29f562962e97fc8bcd35a4ad5244794c7fc
URL https://github.com/qdrvm/hunter/archive/refs/tags/v0.25.3-qdrvm29.tar.gz
SHA1 025920fa980ba81a150deaa534a0248dde25fd54
LOCAL
)
2 changes: 1 addition & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif ()

# https://docs.hunter.sh/en/latest/packages/pkg/Boost.html
hunter_add_package(Boost COMPONENTS random filesystem program_options date_time)
find_package(Boost CONFIG REQUIRED random filesystem program_options date_time)
find_package(Boost CONFIG REQUIRED random filesystem program_options date_time process)

hunter_add_package(qtils)
find_package(qtils CONFIG REQUIRED)
Expand Down
9 changes: 4 additions & 5 deletions core/application/impl/app_configuration_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,11 @@ namespace {

static constexpr std::array<std::string_view,
1 + KAGOME_WASM_COMPILER_WASM_EDGE>
interpreters {
interpreters{
#if KAGOME_WASM_COMPILER_WASM_EDGE == 1
"WasmEdge",
"WasmEdge",
#endif
"Binaryen"
};
"Binaryen"};

static const std::string interpreters_str =
fmt::format("[{}]", fmt::join(interpreters, ", "));
Expand Down Expand Up @@ -601,7 +600,7 @@ namespace kagome::application {
boost::asio::ip::tcp::endpoint endpoint;
boost::system::error_code err;

endpoint.address(boost::asio::ip::address::from_string(host, err));
endpoint.address(boost::asio::ip::make_address(host, err));
if (err.failed()) {
SL_ERROR(logger_, "RPC address '{}' is invalid", host);
exit(EXIT_FAILURE);
Expand Down
9 changes: 4 additions & 5 deletions core/offchain/impl/http_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace kagome::offchain {

if (!ec) {
SL_TRACE(self->log_, "Resolved hostname {}", self->uri_.Host);
self->resolver_iterator_ = it;
self->resolver_iterator_ = it.begin();
self->connect();
return;
}
Expand All @@ -155,9 +155,9 @@ namespace kagome::offchain {
resolver_iterator_->endpoint().port());

auto &stream = secure_ ? boost::beast::get_lowest_layer(
*boost::relaxed_get<SslStreamPtr>(stream_))
*boost::relaxed_get<SslStreamPtr>(stream_))
: boost::beast::get_lowest_layer(
*boost::relaxed_get<TcpStreamPtr>(stream_));
*boost::relaxed_get<TcpStreamPtr>(stream_));

auto connect_handler = [wp{weak_from_this()}](const auto &ec,
const auto &it) {
Expand All @@ -182,8 +182,7 @@ namespace kagome::offchain {
SL_ERROR(self->log_, "Connection failed: {}", ec);

// Try to connect next endpoint if any
if (++self->resolver_iterator_
!= boost::asio::ip::tcp::resolver::iterator{}) {
if (++self->resolver_iterator_ != resolver_iterator{}) {
SL_TRACE(self->log_, "Trying next endpoint…");
self->connect();
} else {
Expand Down
4 changes: 3 additions & 1 deletion core/offchain/impl/http_request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ namespace kagome::offchain {
std::string error_message_;
boost::beast::flat_buffer buffer_;
boost::asio::steady_timer deadline_timer_;
boost::asio::ip::tcp::resolver::iterator resolver_iterator_;
using resolver_iterator =
boost::asio::ip::tcp::resolver::results_type::const_iterator;
resolver_iterator resolver_iterator_;
boost::beast::http::request<boost::beast::http::string_body> request_;
boost::beast::http::response_parser<boost::beast::http::string_body>
parser_;
Expand Down
1 change: 1 addition & 0 deletions core/parachain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ add_library(validator_parachain
)

target_link_libraries(validator_parachain
Boost::process
grid_tracker
key_store
dispute_coordinator
Expand Down
1 change: 0 additions & 1 deletion core/parachain/approval/approval_distribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <boost/asio/executor_work_guard.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/io_service.hpp>
#include <boost/asio/post.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/variant.hpp>
Expand Down
6 changes: 3 additions & 3 deletions core/scale/encoder/primitives.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,17 @@ namespace kagome::scale {
}

void encodeCompact(const Invocable auto &func, uint64_t val) {
if (val < ::scale::compact::EncodingCategoryLimits::kMinUint16) {
if (val < ::scale::detail::kMinUint16) {
kagome::scale::encodeCompactSmall(func, static_cast<uint8_t>(val));
return;
}

if (val < ::scale::compact::EncodingCategoryLimits::kMinUint32) {
if (val < ::scale::detail::kMinUint32) {
kagome::scale::encodeCompactSmall(func, static_cast<uint16_t>(val));
return;
}

if (val < ::scale::compact::EncodingCategoryLimits::kMinBigInteger) {
if (val < ::scale::detail::kMinBigInteger) {
kagome::scale::encodeCompactSmall(func, static_cast<uint32_t>(val));
return;
}
Expand Down
4 changes: 2 additions & 2 deletions core/utils/asio_ssl_context_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once

#include <boost/asio/ssl/context.hpp>
#include <boost/asio/ssl/rfc2818_verification.hpp>
#include <boost/asio/ssl/host_name_verification.hpp>
#include <filesystem>

namespace kagome {
Expand Down Expand Up @@ -47,7 +47,7 @@ namespace kagome {
| context::no_tlsv1_2 | context::single_dh_use);
set_default_verify_paths();
set_verify_mode(boost::asio::ssl::verify_peer);
set_verify_callback(boost::asio::ssl::rfc2818_verification{host});
set_verify_callback(boost::asio::ssl::host_name_verification{host});
}
};
} // namespace kagome
3 changes: 2 additions & 1 deletion core/utils/pool_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#pragma once

#include <boost/asio/io_context.hpp>
#include <boost/asio/post.hpp>

#include "injector/inject.hpp"

Expand Down Expand Up @@ -43,7 +44,7 @@ namespace kagome {
template <typename F>
void execute(F &&func) {
if (is_active_.load(std::memory_order_acquire)) {
ioc_->post(std::forward<F>(func));
post(*ioc_, std::forward<F>(func));
} else if (not started_) {
throw std::logic_error{"PoolHandler lost callback before start()"};
}
Expand Down
6 changes: 4 additions & 2 deletions core/utils/pool_handler_ready.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <deque>

#include <boost/asio/post.hpp>

#include "utils/pool_handler.hpp"
#include "utils/safe_object.hpp"

Expand Down Expand Up @@ -59,7 +61,7 @@ namespace kagome {
pending_.reset();
if (not stopped_.test()) {
for (auto &f : pending) {
io_->post(std::move(f));
post(*io_, std::move(f));
}
}
}
Expand All @@ -73,7 +75,7 @@ namespace kagome {
}

void postAlways(auto &&f) {
io_->post(std::forward<decltype(f)>(f));
post(*io_, std::forward<decltype(f)>(f));
}

friend void post(PoolHandlerReady &self, auto &&f) {
Expand Down
4 changes: 2 additions & 2 deletions test/core/api/transport/http_listener_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ TEST_F(HttpListenerTest, EchoSuccess) {

std::unique_ptr<std::thread> client_thread;

main_context->post([&] {
post(*main_context, [&] {
client_thread = std::make_unique<std::thread>(
[&](Endpoint endpoint, std::string request, std::string response) {
soralog::util::setThreadName("client");
Expand All @@ -58,7 +58,7 @@ TEST_F(HttpListenerTest, EchoSuccess) {
bool time_is_out;

std::this_thread::sleep_for(1s); // Gives chance app to be started
local_context->post([&] {
post(*local_context, [&] {
auto client = std::make_shared<HttpClient>(*local_context);

ASSERT_OUTCOME_SUCCESS_TRY(client->connect(endpoint));
Expand Down
2 changes: 1 addition & 1 deletion test/core/api/transport/listener_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct ListenerTest : public ::testing::Test {
std::chrono::system_clock::now().time_since_epoch().count());
auto rand = rand_r(&seed);

endpoint.address(boost::asio::ip::address::from_string("127.0.0.1"));
endpoint.address(boost::asio::ip::make_address("127.0.0.1"));
endpoint.port(1024 + rand % (65536 - 1024)); // random non-sudo port
ON_CALL(app_config, rpcEndpoint()).WillByDefault(ReturnRef(endpoint));
ON_CALL(app_config, maxWsConnections()).WillByDefault(Return(100));
Expand Down
4 changes: 2 additions & 2 deletions test/core/api/transport/ws_listener_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ TEST_F(WsListenerTest, EchoSuccess) {

std::unique_ptr<std::thread> client_thread;

main_context->post([&] {
post(*main_context, [&] {
client_thread = std::make_unique<std::thread>(
[&](Endpoint endpoint, std::string request, std::string response) {
soralog::util::setThreadName("client");
Expand All @@ -59,7 +59,7 @@ TEST_F(WsListenerTest, EchoSuccess) {

std::this_thread::sleep_for(1s); // Gives chance app to be started

local_context->post([&] {
post(*local_context, [&] {
auto client = std::make_shared<WsClient>(*local_context);

ASSERT_OUTCOME_SUCCESS_TRY(client->connect(endpoint));
Expand Down
2 changes: 1 addition & 1 deletion test/core/application/app_config_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class AppConfigurationTest : public testing::Test {
boost::asio::ip::tcp::endpoint get_endpoint(const char *host, uint16_t port) {
boost::asio::ip::tcp::endpoint endpoint;
boost::system::error_code err;
endpoint.address(boost::asio::ip::address::from_string(host, err));
endpoint.address(boost::asio::ip::make_address(host, err));
endpoint.port(port);
return endpoint;
}
Expand Down
5 changes: 3 additions & 2 deletions test/core/consensus/beefy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <gtest/gtest.h>

#include <boost/asio/bind_executor.hpp>
#include <libp2p/basic/scheduler.hpp>

#include "common/main_thread_pool.hpp"
Expand Down Expand Up @@ -183,7 +184,7 @@ struct BeefyTest : testing::Test {
justifications_.emplace(j.commitment.block_number, *jr);
peer.justifications_.emplace_back(j.commitment.block_number);
}
io_->post([&, m] {
post(*io_, [&, m] {
for (auto &peer2 : peers_) {
if (&peer2 != &peer and peer2.listen_) {
peer2.beefy_->onMessage(*m);
Expand All @@ -192,7 +193,7 @@ struct BeefyTest : testing::Test {
});
});
EXPECT_CALL(*peer.fetch_, fetchJustification(_))
.WillRepeatedly(io_->wrap([&](BlockNumber block) {
.WillRepeatedly(bind_executor(*io_, [&](BlockNumber block) {
auto it = justifications_.find(block);
if (it == justifications_.end()) {
return;
Expand Down
5 changes: 2 additions & 3 deletions test/core/host_api/storage_extension_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,8 @@ TEST_F(StorageExtensionTest, ExtStorageAppendTestCompactLenChanged) {

// @when vals contains (2^6 - 1) elements (high limit for one-byte compact
// integers)
std::vector<scale::EncodeOpaqueValue> vals(
scale::compact::EncodingCategoryLimits::kMinUint16 - 1,
scale::EncodeOpaqueValue{value1});
std::vector<scale::EncodeOpaqueValue> vals(scale::detail::kMinUint16 - 1,
scale::EncodeOpaqueValue{value1});
Buffer vals_encoded = Buffer(scale::encode(vals).value());

{
Expand Down
4 changes: 2 additions & 2 deletions test/core/metrics/service_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class HttpClient {
HttpClient()
: ioc_{},
stream_{ioc_},
endpoint_{boost::asio::ip::address::from_string("0.0.0.0"), 9955} {}
endpoint_{boost::asio::ip::make_address("0.0.0.0"), 9955} {}

~HttpClient() {
boost::system::error_code ec;
Expand Down Expand Up @@ -110,7 +110,7 @@ TEST(ServiceTest, CreateMetricsExposer) {
di::bind<application::AppStateManager>.template to<application::AppStateManagerImpl>(),
di::bind<metrics::Exposer::Configuration>.to([](const auto &) {
return metrics::Exposer::Configuration{
{boost::asio::ip::address::from_string("0.0.0.0"), 9955}};
{boost::asio::ip::make_address("0.0.0.0"), 9955}};
}),
di::bind<metrics::Session::Configuration>.to([](const auto &injector) {
return metrics::Session::Configuration{};
Expand Down
Loading