Skip to content

Commit 710e3b5

Browse files
committed
Merge branch 'testnet' into collated-data-opt
2 parents 3be416e + a401b75 commit 710e3b5

Some content is hidden

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

76 files changed

+4368
-336
lines changed

CMakeLists.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ option(TONLIB_ENABLE_JNI "Use \"ON\" to enable JNI-compatible TonLib API.")
6565
option(TON_USE_ASAN "Use \"ON\" to enable AddressSanitizer." OFF)
6666
option(TON_USE_TSAN "Use \"ON\" to enable ThreadSanitizer." OFF)
6767
option(TON_USE_UBSAN "Use \"ON\" to enable UndefinedBehaviorSanitizer." OFF)
68+
option(TON_USE_COVERAGE "Use \"ON\" to enable code coverage with gcov." OFF)
6869
set(TON_ARCH "native" CACHE STRING "Architecture, will be passed to -march=")
6970

7071
option(TON_PRINT_BACKTRACE_ON_CRASH "Attempt to print a backtrace when a fatal signal is caught" ON)
@@ -266,7 +267,7 @@ elseif (CLANG OR GCC)
266267
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL")
267268
endif()
268269
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
269-
if (NOT TON_USE_ASAN AND NOT TON_USE_TSAN AND NOT MEMPROF)
270+
if (NOT TON_USE_ASAN AND NOT TON_USE_TSAN AND NOT TON_USE_COVERAGE AND NOT MEMPROF)
270271
if (NOT USE_EMSCRIPTEN)
271272
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--exclude-libs,ALL")
272273
endif()
@@ -350,6 +351,23 @@ if (TON_USE_UBSAN)
350351
add_compile_options(-fsanitize=undefined)
351352
add_link_options(-fsanitize=undefined)
352353
endif()
354+
if (TON_USE_COVERAGE)
355+
add_cxx_compiler_flag("-fprofile-arcs")
356+
add_cxx_compiler_flag("-ftest-coverage")
357+
add_cxx_compiler_flag("--coverage")
358+
add_cxx_compiler_flag("-O0")
359+
add_cxx_compiler_flag("-g")
360+
add_cxx_compiler_flag("-fno-inline")
361+
add_cxx_compiler_flag("-fno-inline-small-functions")
362+
add_cxx_compiler_flag("-fno-default-inline")
363+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage --coverage")
364+
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage --coverage")
365+
endif()
366+
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
367+
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
368+
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
369+
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak")
370+
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -finstrument-functions")
353371

354372
#Compilation database
355373
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
@@ -562,6 +580,7 @@ add_test(test-cells test-cells ${TEST_OPTIONS})
562580
add_test(test-smartcont test-smartcont)
563581
add_test(test-net test-net)
564582
add_test(test-actors test-tdactor)
583+
add_test(test-actors-coro tdactor/test/test-coro)
565584
add_test(test-emulator test-emulator)
566585

567586
#BEGIN tonlib

assembly/native/build-macos-portable.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ if [ "$with_tests" = true ]; then
155155
lite-client validator-engine-console generate-random-id json2tlo dht-server dht-ping-servers dht-resolve \
156156
http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator \
157157
test-ed25519 test-bigint test-vm test-fift test-cells test-smartcont \
158-
test-net test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp \
158+
test-net test-tdactor test-coro test-tdutils test-tonlib-offline test-adnl test-dht test-rldp \
159159
test-rldp2 test-catchain test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver
160160
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }
161161
else

assembly/native/build-macos-shared.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ if [ "$with_tests" = true ]; then
9393
lite-client validator-engine-console generate-random-id json2tlo dht-server dht-ping-servers dht-resolve \
9494
http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator \
9595
test-ed25519 test-bigint test-vm test-fift test-cells test-smartcont \
96-
test-net test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp \
96+
test-net test-tdactor test-coro test-tdutils test-tonlib-offline test-adnl test-dht test-rldp \
9797
test-rldp2 test-catchain test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver
9898
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }
9999
else

assembly/native/build-ubuntu-appimages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ninja storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-
6363
validator-engine lite-client validator-engine-console blockchain-explorer \
6464
generate-random-id json2tlo dht-server http-proxy rldp-http-proxy dht-ping-servers dht-resolve \
6565
adnl-proxy create-state emulator test-ed25519 test-bigint \
66-
test-vm test-fift test-cells test-smartcont test-net test-tdactor test-tdutils \
66+
test-vm test-fift test-cells test-smartcont test-net test-tdactor test-coro test-tdutils \
6767
test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain \
6868
test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver
6969
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }

assembly/native/build-ubuntu-portable.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ ninja storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-
137137
validator-engine lite-client validator-engine-console blockchain-explorer \
138138
generate-random-id json2tlo dht-server http-proxy rldp-http-proxy dht-ping-servers dht-resolve \
139139
adnl-proxy create-state emulator test-ed25519 test-bigint \
140-
test-vm test-fift test-cells test-smartcont test-net test-tdactor test-tdutils \
140+
test-vm test-fift test-cells test-smartcont test-net test-tdactor test-coro test-tdutils \
141141
test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain \
142142
test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver
143143
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }

assembly/native/build-ubuntu-shared.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ninja storage-daemon storage-daemon-cli fift func tolk tonlib tonlibjson tonlib-
6666
validator-engine lite-client validator-engine-console blockchain-explorer \
6767
generate-random-id json2tlo dht-server http-proxy rldp-http-proxy dht-ping-servers dht-resolve \
6868
adnl-proxy create-state emulator test-ed25519 test-bigint \
69-
test-vm test-fift test-cells test-smartcont test-net test-tdactor test-tdutils \
69+
test-vm test-fift test-cells test-smartcont test-net test-tdactor test-coro test-tdutils \
7070
test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain \
7171
test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver
7272
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }

assembly/native/build-windows-2019.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonli
148148
tonlib-cli validator-engine lite-client validator-engine-console generate-random-id ^
149149
json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator ^
150150
test-ed25519 test-bigint test-vm test-fift test-cells test-smartcont test-net ^
151-
test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^
151+
test-tdactor test-coro test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^
152152
test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver dht-ping-servers dht-resolve
153153
IF %errorlevel% NEQ 0 (
154154
echo Can't compile TON

assembly/native/build-windows-2022.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonli
148148
tonlib-cli validator-engine lite-client validator-engine-console generate-random-id ^
149149
json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator ^
150150
test-ed25519 test-bigint test-vm test-fift test-cells test-smartcont test-net ^
151-
test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^
151+
test-tdactor test-coro test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^
152152
test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver
153153
IF %errorlevel% NEQ 0 (
154154
echo Can't compile TON

assembly/native/build-windows.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ninja storage-daemon storage-daemon-cli blockchain-explorer fift func tolk tonli
148148
tonlib-cli validator-engine lite-client validator-engine-console generate-random-id ^
149149
json2tlo dht-server http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork emulator ^
150150
test-ed25519 test-bigint test-vm test-fift test-cells test-smartcont test-net ^
151-
test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^
151+
test-tdactor test-coro test-tdutils test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain ^
152152
test-fec test-tddb test-db test-validator-session-state test-emulator proxy-liteserver dht-ping-servers dht-resolve
153153
IF %errorlevel% NEQ 0 (
154154
echo Can't compile TON

blockchain-explorer/blockchain-explorer-http.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ HttpAnswer& HttpAnswer::operator<<(AccountCell acc_c) {
366366
last_trans_hash.set_zero();
367367
block::CurrencyCollection balance = block::CurrencyCollection::zero();
368368
try {
369-
auto state_root = vm::MerkleProof::virtualize(acc_c.q_roots[1], 1);
369+
auto state_root = vm::MerkleProof::virtualize(acc_c.q_roots[1]);
370370
if (state_root.is_null()) {
371371
abort("account state proof is invalid");
372372
return *this;
@@ -474,7 +474,7 @@ HttpAnswer& HttpAnswer::operator<<(BlockHeaderCell head_c) {
474474
vm::CellSlice cs{vm::NoVm(), head_c.root};
475475
auto block_id = head_c.block_id;
476476
try {
477-
auto virt_root = vm::MerkleProof::virtualize(head_c.root, 1);
477+
auto virt_root = vm::MerkleProof::virtualize(head_c.root);
478478
if (virt_root.is_null()) {
479479
abort("invalid merkle proof");
480480
return *this;

0 commit comments

Comments
 (0)