Skip to content

Commit 8b45d35

Browse files
build: upgrade grpc to 1.54.3 (#1619)
Co-authored-by: battlmonstr <[email protected]>
1 parent c398249 commit 8b45d35

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+603
-736
lines changed

cmake/cmake_format.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ parse:
55
PATH_OR_REFERENCE: '*'
66
INSTALL_FOLDER: '*'
77
BUILD: '*'
8+
OPTIONS: '*'
89
PROFILE: '*'
10+
CONF: '*'
911
silkworm_library:
1012
flags:
1113
- NO_TEST

cmake/compiler_settings.cmake

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
limitations under the License.
1515
]]
1616

17+
include(${CMAKE_CURRENT_LIST_DIR}/compiler_settings_sanitize.cmake)
18+
1719
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
1820

1921
message("MSVC_VERSION = ${MSVC_VERSION}")
@@ -91,10 +93,7 @@ else()
9193
message(WARNING "${CMAKE_CXX_COMPILER_ID} is not a supported compiler. Use at your own risk.")
9294
endif()
9395

94-
if(SILKWORM_SANITIZE)
95-
set(SILKWORM_SANITIZE_COMPILER_OPTIONS -fno-omit-frame-pointer -fno-sanitize-recover=all
96-
-fsanitize=${SILKWORM_SANITIZE}
97-
)
96+
if(SILKWORM_SANITIZE_COMPILER_OPTIONS)
9897
add_compile_options(${SILKWORM_SANITIZE_COMPILER_OPTIONS})
9998
add_link_options(${SILKWORM_SANITIZE_COMPILER_OPTIONS})
10099
add_compile_definitions(SILKWORM_SANITIZE)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#[[
2+
Copyright 2024 The Silkworm Authors
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
]]
16+
17+
if(SILKWORM_SANITIZE)
18+
# cmake-format: off
19+
set(SILKWORM_SANITIZE_COMPILER_OPTIONS
20+
-fno-omit-frame-pointer
21+
-fno-sanitize-recover=all
22+
-fsanitize=${SILKWORM_SANITIZE}
23+
)
24+
# cmake-format: on
25+
endif()

cmake/conan.cmake

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
limitations under the License.
1515
]]
1616

17+
include(${CMAKE_CURRENT_LIST_DIR}/compiler_settings_sanitize.cmake)
18+
1719
function(guess_conan_profile)
1820
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "")
1921
set(ARCH_NAME "")
@@ -64,9 +66,39 @@ if(NOT DEFINED CONAN_PROFILE)
6466
endif()
6567
message(STATUS "CONAN_PROFILE: ${CONAN_PROFILE}")
6668

69+
set(CONAN_BUILD "missing")
70+
set(CONAN_CXXFLAGS_ARG)
71+
set(CONAN_OPTIONS)
72+
73+
if(SILKWORM_SANITIZE_COMPILER_OPTIONS)
74+
set(CONAN_CXXFLAGS ${SILKWORM_SANITIZE_COMPILER_OPTIONS})
75+
76+
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
77+
list(APPEND CONAN_CXXFLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
78+
endif()
79+
80+
list(JOIN CONAN_CXXFLAGS "\", \"" CONAN_CXXFLAGS_STR)
81+
set(CONAN_CXXFLAGS_STR "[\"${CONAN_CXXFLAGS_STR}\"]")
82+
set(CONAN_CXXFLAGS_ARG "tools.build:cxxflags=${CONAN_CXXFLAGS_STR}")
83+
84+
list(APPEND CONAN_OPTIONS "boost:zlib=False")
85+
86+
# libraries that needs to be rebuilt with sanitize flags
87+
# cmake-format: off
88+
set(CONAN_BUILD
89+
abseil
90+
boost
91+
grpc
92+
protobuf
93+
)
94+
# cmake-format: on
95+
endif()
96+
6797
conan_cmake_install(
6898
PATH_OR_REFERENCE "${CONAN_BINARY_DIR}"
6999
INSTALL_FOLDER "${CONAN_BINARY_DIR}"
70-
BUILD missing
71-
PROFILE "${CMAKE_SOURCE_DIR}/cmake/profiles/${CONAN_PROFILE}" OPTIONS "${CMAKE_CONAN_OPTIONS}"
100+
BUILD ${CONAN_BUILD}
101+
OPTIONS ${CONAN_OPTIONS}
102+
PROFILE "${CMAKE_SOURCE_DIR}/cmake/profiles/${CONAN_PROFILE}"
103+
CONF "${CONAN_CXXFLAGS_ARG}"
72104
)

conanfile.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ def requirements(self):
2525
self.requires('ms-gsl/4.0.0')
2626
self.requires('nlohmann_json/3.11.3')
2727
self.requires('tl-expected/1.1.0')
28-
self.requires('zlib/1.2.13')
28+
self.requires('zlib/1.3.1')
2929
if self.settings.arch == 'wasm':
3030
return
3131

32-
self.requires('abseil/20220623.0')
33-
self.requires('asio-grpc/2.4.0')
32+
self.requires('abseil/20230125.3')
33+
self.requires('asio-grpc/2.9.2')
3434
self.requires('benchmark/1.6.1')
35-
self.requires('boost/1.81.0')
35+
self.requires('boost/1.83.0')
3636
self.requires('cli11/2.2.0')
3737
self.requires('gmp/6.2.1')
38-
self.requires('grpc/1.48.0')
38+
self.requires('grpc/1.54.3')
3939
self.requires('gtest/1.12.1')
4040
self.requires('jwt-cpp/0.6.0')
4141
self.requires('mimalloc/2.1.2')
42-
self.requires('openssl/1.1.1s')
43-
self.requires('protobuf/3.21.4')
42+
self.requires('openssl/3.2.1')
43+
self.requires('protobuf/3.21.12')
4444
self.requires('roaring/1.1.2')
4545
self.requires('snappy/1.1.7')
4646
self.requires('spdlog/1.12.0')
@@ -63,6 +63,10 @@ def configure(self):
6363
self.options['mimalloc'].override = True
6464

6565
self.options['boost'].asio_no_deprecated = True
66+
if self.settings.os == 'Macos':
67+
CMAKE_OSX_DEPLOYMENT_TARGET = '10.13'
68+
os_version_min_flag = f'-mmacosx-version-min={CMAKE_OSX_DEPLOYMENT_TARGET}'
69+
self.options['boost'].extra_b2_flags = f'cxxflags="{os_version_min_flag}" linkflags="{os_version_min_flag}"'
6670

6771
# Disable building unused boost components
6872
# note: changing default options above forces a boost rebuild anyway

silkworm/core/execution/evm_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ TEST_CASE("Smart contract with storage", "[core][execution]") {
249249
CHECK(state.get_current_storage(contract_address, key0) == new_val);
250250
}
251251

252+
#if !(defined(SILKWORM_SANITIZE) && defined(__APPLE__))
252253
TEST_CASE("Maximum call depth", "[core][execution]") {
253254
Block block{};
254255
block.header.number = 1'431'916;
@@ -317,6 +318,7 @@ TEST_CASE("Maximum call depth", "[core][execution]") {
317318
CHECK(res.status == EVMC_INVALID_INSTRUCTION);
318319
CHECK(res.data.empty());
319320
}
321+
#endif // SILKWORM_SANITIZE
320322

321323
TEST_CASE("DELEGATECALL", "[core][execution]") {
322324
Block block{};

silkworm/infra/concurrency/awaitable_future.hpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AwaitableFuture {
4444
AwaitableFuture(AwaitableFuture&&) noexcept = default;
4545
AwaitableFuture& operator=(AwaitableFuture&&) noexcept = default;
4646

47-
Task<T> get_async() {
47+
Task<T> get() {
4848
try {
4949
std::optional<T> result = co_await channel_->async_receive(boost::asio::use_awaitable);
5050
co_return std::move(result.value());
@@ -54,14 +54,8 @@ class AwaitableFuture {
5454
}
5555
}
5656

57-
T get() {
58-
try {
59-
std::optional<T> result = channel_->async_receive(boost::asio::use_future).get();
60-
return std::move(result.value());
61-
} catch (const boost::system::system_error& ex) {
62-
close_and_throw_if_cancelled(ex);
63-
throw ex;
64-
}
57+
Task<T> get_async() {
58+
return get();
6559
}
6660

6761
private:

0 commit comments

Comments
 (0)