From 2a02b547868a4eb2fa69f44d4197ec46e919dc8d Mon Sep 17 00:00:00 2001 From: Andrey Tvorozhkov Date: Mon, 27 Jan 2025 14:22:00 +0500 Subject: [PATCH 1/5] Fix `advance_ext` (#746) --- crypto/vm/cells/CellSlice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/vm/cells/CellSlice.cpp b/crypto/vm/cells/CellSlice.cpp index 466bcd8d1..4d8c3c5ad 100644 --- a/crypto/vm/cells/CellSlice.cpp +++ b/crypto/vm/cells/CellSlice.cpp @@ -264,7 +264,7 @@ bool CellSlice::advance_ext(unsigned bits, unsigned refs) { } bool CellSlice::advance_ext(unsigned bits_refs) { - return advance_ext(bits_refs >> 16, bits_refs & 0xffff); + return advance_ext(bits_refs & 0xffff, bits_refs >> 16); } // (PRIVATE) From 8ffa3dd9dcab9135fe14a02f712c315bdd3079ed Mon Sep 17 00:00:00 2001 From: SpyCheese Date: Mon, 27 Jan 2025 09:55:00 +0000 Subject: [PATCH 2/5] Fix printing TLB NatWidth (#1501) --- crypto/tl/tlblib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/tl/tlblib.cpp b/crypto/tl/tlblib.cpp index ee05d371a..05ea8e1c2 100644 --- a/crypto/tl/tlblib.cpp +++ b/crypto/tl/tlblib.cpp @@ -45,7 +45,7 @@ bool Bool::print_skip(PrettyPrinter& pp, vm::CellSlice& cs) const { } bool NatWidth::print_skip(PrettyPrinter& pp, vm::CellSlice& cs) const { - long long value = (long long)cs.fetch_ulong(32); + long long value = (long long)cs.fetch_ulong(n); return value >= 0 && pp.out_int(value); } From 6f1feb43d5941f964e40691be8185c747f385793 Mon Sep 17 00:00:00 2001 From: EmelyanenkoK Date: Mon, 27 Jan 2025 12:58:54 +0300 Subject: [PATCH 3/5] Update Changelogs --- Changelog.md | 14 ++++++++++++++ recent_changelog.md | 21 ++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Changelog.md b/Changelog.md index fd513bc81..fa713e7e0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,17 @@ +## 2025.02 Update +1. Series of improvement/fixes for `Config8.version >= 9`, check [GlobalVersion.md](./doc/GlobalVersion.md) +2. Fix for better discovery of updated nodes' (validators') IPs: retry dht queries +3. Series of improvements for extra currency adoption: fixed c7 in rungetmethod, reserve modes +4. TVM Fix: saving ret on deep jump +5. A few fixes of tl-b schemes: crc computation, incorrect tag for merkle proofs, advance_ext, NatWidth print +6. Emulator improvements: fix setting libraries, extracurrency support +7. Increase of gas limit for unlocking highload-v2 wallets locked in the beginning of 2024 +8. Validator console improvement: dashed names, better shard formats + + +Besides the work of the core team, this update is based on the efforts of @dbaranovstonfi from StonFi(libraries in emulator), @Rexagon (ret on deep jumps), @tvorogme from DTon (`advance_ext`), Nan from Zellic (`stk_und` and JNI) + + ## 2024.12 Update 1. FunC 0.4.6: Fix in try/catch handling, fixing pure flag for functions stored in variables diff --git a/recent_changelog.md b/recent_changelog.md index cc877c2ce..0ec085832 100644 --- a/recent_changelog.md +++ b/recent_changelog.md @@ -1,13 +1,12 @@ -## 2024.12 Update +## 2025.02 Update +1. Series of improvement/fixes for `Config8.version >= 9`, check [GlobalVersion.md](./doc/GlobalVersion.md) +2. Fix for better discovery of updated nodes' (validators') IPs: retry dht queries +3. Series of improvements for extra currency adoption: fixed c7 in rungetmethod, reserve modes +4. TVM Fix: saving ret on deep jump +5. A few fixes of tl-b schemes: crc computation, incorrect tag for merkle proofs, advance_ext, NatWidth print +6. Emulator improvements: fix setting libraries, extracurrency support +7. Increase of gas limit for unlocking highload-v2 wallets locked in the beginning of 2024 +8. Validator console improvement: dashed names, better shard formats -1. FunC 0.4.6: Fix in try/catch handling, fixing pure flag for functions stored in variables -2. Merging parts of Accelerator: support of specific shard monitoring, archive/liteserver slice format, support for partial liteservers, proxy liteserver, on-demand neighbour queue loading -3. Fix of asynchronous cell loading -4. Various improvements: caching certificates checks, better block overloading detection, `_malloc` in emulator -5. Introduction of telemetry in overlays -6. Use non-null local-id for tonlib-LS interaction - mitigates MitM attack. -7. Adding `SECP256K1_XONLY_PUBKEY_TWEAK_ADD`, `SETCONTCTRMANY` instructions to TVM (activated by `Config8.version >= 9`) -8. Private keys export via validator-engine-console - required for better backups -9. Fix proof checking in tonlib, `hash` in `raw.Message` in tonlib_api -Besides the work of the core team, this update is based on the efforts of OtterSec and LayerZero (FunC), tg:@throwunless (FunC), Aviv Frenkel and Dima Kogan from Fordefi (LS MitM), @hacker-volodya (Tonlib), OKX team (async cell loading), @krigga (emulator) +Besides the work of the core team, this update is based on the efforts of @dbaranovstonfi from StonFi(libraries in emulator), @Rexagon (ret on deep jumps), @tvorogme from DTon (`advance_ext`), Nan from Zellic (`stk_und` and JNI) From 294db6922717b88689fae4797804f953008cdb19 Mon Sep 17 00:00:00 2001 From: EmelyanenkoK Date: Mon, 27 Jan 2025 14:33:52 +0300 Subject: [PATCH 4/5] Fix typos in changelog --- Changelog.md | 5 ++--- recent_changelog.md | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Changelog.md b/Changelog.md index fa713e7e0..34195f74e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,8 +1,8 @@ ## 2025.02 Update -1. Series of improvement/fixes for `Config8.version >= 9`, check [GlobalVersion.md](./doc/GlobalVersion.md) +1. Series of improvement/fixes for `Config8.version >= 9`, check [GlobalVersions.md](./doc/GlobalVersions.md) 2. Fix for better discovery of updated nodes' (validators') IPs: retry dht queries 3. Series of improvements for extra currency adoption: fixed c7 in rungetmethod, reserve modes -4. TVM Fix: saving ret on deep jump +4. TVM: Fix processing continuation control data on deep jump 5. A few fixes of tl-b schemes: crc computation, incorrect tag for merkle proofs, advance_ext, NatWidth print 6. Emulator improvements: fix setting libraries, extracurrency support 7. Increase of gas limit for unlocking highload-v2 wallets locked in the beginning of 2024 @@ -11,7 +11,6 @@ Besides the work of the core team, this update is based on the efforts of @dbaranovstonfi from StonFi(libraries in emulator), @Rexagon (ret on deep jumps), @tvorogme from DTon (`advance_ext`), Nan from Zellic (`stk_und` and JNI) - ## 2024.12 Update 1. FunC 0.4.6: Fix in try/catch handling, fixing pure flag for functions stored in variables diff --git a/recent_changelog.md b/recent_changelog.md index 0ec085832..dfa39aa67 100644 --- a/recent_changelog.md +++ b/recent_changelog.md @@ -1,8 +1,8 @@ ## 2025.02 Update -1. Series of improvement/fixes for `Config8.version >= 9`, check [GlobalVersion.md](./doc/GlobalVersion.md) +1. Series of improvement/fixes for `Config8.version >= 9`, check [GlobalVersions.md](./doc/GlobalVersions.md) 2. Fix for better discovery of updated nodes' (validators') IPs: retry dht queries 3. Series of improvements for extra currency adoption: fixed c7 in rungetmethod, reserve modes -4. TVM Fix: saving ret on deep jump +4. TVM: Fix processing continuation control data on deep jump 5. A few fixes of tl-b schemes: crc computation, incorrect tag for merkle proofs, advance_ext, NatWidth print 6. Emulator improvements: fix setting libraries, extracurrency support 7. Increase of gas limit for unlocking highload-v2 wallets locked in the beginning of 2024 From c720204199d1615f1cffa00db6d376830dc8603d Mon Sep 17 00:00:00 2001 From: Marat <98183742+dungeon-master-666@users.noreply.github.com> Date: Mon, 27 Jan 2025 12:34:21 +0100 Subject: [PATCH 5/5] Fix BUILD_SHARED_LIBS issue (#1496) --- CMakeLists.txt | 1 + emulator/CMakeLists.txt | 16 ++++++---------- tonlib/CMakeLists.txt | 12 +++++------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af2640367..cea3fc7ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE) set(CMAKE_CXX_EXTENSIONS FALSE) #BEGIN internal +option(BUILD_SHARED_LIBS "Use \"ON\" to build shared libraries instead of static where it's not specified (not recommended)" OFF) option(USE_EMSCRIPTEN "Use \"ON\" for config building wasm." OFF) option(TON_ONLY_TONLIB "Use \"ON\" to build only tonlib." OFF) if (USE_EMSCRIPTEN) diff --git a/emulator/CMakeLists.txt b/emulator/CMakeLists.txt index 66d8309a5..a07995414 100644 --- a/emulator/CMakeLists.txt +++ b/emulator/CMakeLists.txt @@ -1,7 +1,5 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -option(BUILD_SHARED_LIBS "Use \"OFF\" for a static build." ON) - if (NOT OPENSSL_FOUND) find_package(OpenSSL REQUIRED) endif() @@ -11,11 +9,6 @@ set(EMULATOR_STATIC_SOURCE tvm-emulator.hpp ) -set(EMULATOR_HEADERS - transaction-emulator.h - emulator-extern.h -) - set(EMULATOR_SOURCE emulator-extern.cpp ) @@ -29,10 +22,10 @@ include(GenerateExportHeader) add_library(emulator_static STATIC ${EMULATOR_STATIC_SOURCE}) target_link_libraries(emulator_static PUBLIC ton_crypto smc-envelope) -if (NOT USE_EMSCRIPTEN AND BUILD_SHARED_LIBS) - add_library(emulator SHARED ${EMULATOR_SOURCE} ${EMULATOR_HEADERS}) +if (USE_EMSCRIPTEN) + add_library(emulator STATIC ${EMULATOR_SOURCE}) else() - add_library(emulator STATIC ${EMULATOR_SOURCE} ${EMULATOR_HEADERS}) + add_library(emulator SHARED ${EMULATOR_SOURCE}) endif() if (PORTABLE AND NOT APPLE) @@ -42,6 +35,9 @@ else() endif() generate_export_header(emulator EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/emulator_export.h) +if (USE_EMSCRIPTEN) + target_compile_definitions(emulator PUBLIC EMULATOR_STATIC_DEFINE) +endif() target_include_directories(emulator PUBLIC $ $) diff --git a/tonlib/CMakeLists.txt b/tonlib/CMakeLists.txt index 9a56e5119..eb5383614 100644 --- a/tonlib/CMakeLists.txt +++ b/tonlib/CMakeLists.txt @@ -1,7 +1,5 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -option(BUILD_SHARED_LIBS "Use \"OFF\" for a static build." ON) - if (NOT OPENSSL_FOUND) find_package(OpenSSL REQUIRED) endif() @@ -92,10 +90,10 @@ set(TONLIB_JSON_HEADERS tonlib/tonlib_client_json.h) set(TONLIB_JSON_SOURCE tonlib/tonlib_client_json.cpp) include(GenerateExportHeader) -if (NOT USE_EMSCRIPTEN AND BUILD_SHARED_LIBS) - add_library(tonlibjson SHARED ${TONLIB_JSON_SOURCE} ${TONLIB_JSON_HEADERS}) +if (USE_EMSCRIPTEN) + add_library(tonlibjson STATIC ${TONLIB_JSON_SOURCE}) else() - add_library(tonlibjson STATIC ${TONLIB_JSON_SOURCE} ${TONLIB_JSON_HEADERS}) + add_library(tonlibjson SHARED ${TONLIB_JSON_SOURCE}) endif() if (PORTABLE AND NOT APPLE) @@ -105,7 +103,7 @@ else() endif() generate_export_header(tonlibjson EXPORT_FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/tonlib/tonlibjson_export.h) -if (!BUILD_SHARED_LIBS) +if (USE_EMSCRIPTEN) target_compile_definitions(tonlibjson PUBLIC TONLIBJSON_STATIC_DEFINE) endif() target_include_directories(tonlibjson PUBLIC @@ -159,7 +157,7 @@ endif() install(FILES ${TONLIB_JSON_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/tonlib/tonlibjson_export.h DESTINATION include/tonlib/) -if (NOT USE_EMSCRIPTEN AND BUILD_SHARED_LIBS) +if (NOT USE_EMSCRIPTEN) install(EXPORT Tonlib FILE TonlibTargets.cmake NAMESPACE Tonlib::