Skip to content

Commit ea0dc16

Browse files
authored
Merge pull request #1427 from ton-blockchain/testnet
Merge developer branch
2 parents 7151ff2 + 540d1fb commit ea0dc16

File tree

199 files changed

+7257
-2153
lines changed

Some content is hidden

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

199 files changed

+7257
-2153
lines changed

.github/workflows/build-ton-linux-android-tonlib.yml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
2222
- name: Build TON
2323
run: |
24+
git submodule sync --recursive
25+
git submodule update
2426
cp assembly/android/build-android-tonlib.sh .
2527
chmod +x build-android-tonlib.sh
2628
./build-android-tonlib.sh -a

.github/workflows/build-ton-linux-x86-64-shared.yml

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
3636
- name: Build TON
3737
run: |
38+
git submodule sync --recursive
39+
git submodule update
3840
cp assembly/native/build-ubuntu-shared.sh .
3941
chmod +x build-ubuntu-shared.sh
4042
./build-ubuntu-shared.sh -t -a

.github/workflows/build-ton-macos-15-arm64-shared.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414

1515
- name: Build TON
1616
run: |
17+
git submodule sync --recursive
18+
git submodule update
1719
cp assembly/native/build-macos-shared.sh .
1820
chmod +x build-macos-shared.sh
1921
./build-macos-shared.sh -t -a

.github/workflows/build-ton-macos-arm64-shared.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414

1515
- name: Build TON
1616
run: |
17+
git submodule sync --recursive
18+
git submodule update
1719
cp assembly/native/build-macos-shared.sh .
1820
chmod +x build-macos-shared.sh
1921
./build-macos-shared.sh -t -a

.github/workflows/build-ton-macos-x86-64-shared.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push,workflow_dispatch,workflow_call]
44

55
jobs:
66
build:
7-
runs-on: macos-12
7+
runs-on: macos-13
88

99
steps:
1010
- name: Check out repository
@@ -14,12 +14,14 @@ jobs:
1414

1515
- name: Build TON
1616
run: |
17+
git submodule sync --recursive
18+
git submodule update
1719
cp assembly/native/build-macos-shared.sh .
1820
chmod +x build-macos-shared.sh
1921
./build-macos-shared.sh -t -a
2022
2123
- name: Upload artifacts
2224
uses: actions/upload-artifact@master
2325
with:
24-
name: ton-binaries-macos-12
26+
name: ton-binaries-macos-13
2527
path: artifacts

.github/workflows/build-ton-wasm-emscripten.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ jobs:
1515
- name: Install system libraries
1616
run: |
1717
sudo apt-get update
18-
sudo apt-get install -y build-essential git openssl cmake ninja-build zlib1g-dev libssl-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev
18+
sudo apt-get install -y build-essential git openssl cmake ninja-build zlib1g-dev libssl-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev
1919
2020
- name: Build TON WASM artifacts
2121
run: |
22+
git submodule sync --recursive
23+
git submodule update
2224
cp assembly/wasm/fift-func-wasm-build-ubuntu.sh .
2325
chmod +x fift-func-wasm-build-ubuntu.sh
2426
./fift-func-wasm-build-ubuntu.sh -a

.github/workflows/create-release.yml

+42-10
Original file line numberDiff line numberDiff line change
@@ -12,79 +12,79 @@ jobs:
1212
- uses: actions/checkout@v3
1313

1414
- name: Download Linux x86-64 artifacts
15-
uses: dawidd6/action-download-artifact@v2
15+
uses: dawidd6/action-download-artifact@v6
1616
with:
1717
workflow: ton-x86-64-linux.yml
1818
path: artifacts
1919
workflow_conclusion: success
2020
skip_unpack: true
2121

2222
- name: Download and unzip Linux x86-64 artifacts
23-
uses: dawidd6/action-download-artifact@v2
23+
uses: dawidd6/action-download-artifact@v6
2424
with:
2525
workflow: ton-x86-64-linux.yml
2626
path: artifacts
2727
workflow_conclusion: success
2828
skip_unpack: false
2929

3030
- name: Download Mac x86-64 artifacts
31-
uses: dawidd6/action-download-artifact@v2
31+
uses: dawidd6/action-download-artifact@v6
3232
with:
3333
workflow: ton-x86-64-macos.yml
3434
path: artifacts
3535
workflow_conclusion: success
3636
skip_unpack: true
3737

3838
- name: Download Mac arm64 artifacts
39-
uses: dawidd6/action-download-artifact@v2
39+
uses: dawidd6/action-download-artifact@v6
4040
with:
4141
workflow: ton-arm64-macos.yml
4242
path: artifacts
4343
workflow_conclusion: success
4444
skip_unpack: true
4545

4646
- name: Download and unzip Mac x86-64 artifacts
47-
uses: dawidd6/action-download-artifact@v2
47+
uses: dawidd6/action-download-artifact@v6
4848
with:
4949
workflow: ton-x86-64-macos.yml
5050
path: artifacts
5151
workflow_conclusion: success
5252
skip_unpack: false
5353

5454
- name: Download and unzip arm64 artifacts
55-
uses: dawidd6/action-download-artifact@v2
55+
uses: dawidd6/action-download-artifact@v6
5656
with:
5757
workflow: ton-arm64-macos.yml
5858
path: artifacts
5959
workflow_conclusion: success
6060
skip_unpack: false
6161

6262
- name: Download Windows artifacts
63-
uses: dawidd6/action-download-artifact@v2
63+
uses: dawidd6/action-download-artifact@v6
6464
with:
6565
workflow: ton-x86-64-windows.yml
6666
path: artifacts
6767
workflow_conclusion: success
6868
skip_unpack: true
6969

7070
- name: Download and unzip Windows artifacts
71-
uses: dawidd6/action-download-artifact@v2
71+
uses: dawidd6/action-download-artifact@v6
7272
with:
7373
workflow: ton-x86-64-windows.yml
7474
path: artifacts
7575
workflow_conclusion: success
7676
skip_unpack: false
7777

7878
- name: Download WASM artifacts
79-
uses: dawidd6/action-download-artifact@v2
79+
uses: dawidd6/action-download-artifact@v6
8080
with:
8181
workflow: build-ton-wasm-emscripten.yml
8282
path: artifacts
8383
workflow_conclusion: success
8484
skip_unpack: true
8585

8686
- name: Download Android Tonlib artifacts
87-
uses: dawidd6/action-download-artifact@v2
87+
uses: dawidd6/action-download-artifact@v6
8888
with:
8989
workflow: build-ton-linux-android-tonlib.yml
9090
path: artifacts
@@ -183,6 +183,14 @@ jobs:
183183
asset_name: lite-client.exe
184184
tag: ${{ steps.tag.outputs.TAG }}
185185

186+
- name: Upload Windows 2019 single artifact - proxy-liteserver
187+
uses: svenstaro/upload-release-action@v2
188+
with:
189+
repo_token: ${{ secrets.GITHUB_TOKEN }}
190+
file: artifacts/ton-win-binaries/proxy-liteserver.exe
191+
asset_name: proxy-liteserver.exe
192+
tag: ${{ steps.tag.outputs.TAG }}
193+
186194
- name: Upload Windows 2019 single artifact - rldp-http-proxy
187195
uses: svenstaro/upload-release-action@v2
188196
with:
@@ -281,6 +289,14 @@ jobs:
281289
asset_name: lite-client-mac-x86-64
282290
tag: ${{ steps.tag.outputs.TAG }}
283291

292+
- name: Upload Mac x86-64 single artifact - proxy-liteserver
293+
uses: svenstaro/upload-release-action@v2
294+
with:
295+
repo_token: ${{ secrets.GITHUB_TOKEN }}
296+
file: artifacts/ton-x86_64-macos-binaries/proxy-liteserver
297+
asset_name: proxy-liteserver-mac-x86-64
298+
tag: ${{ steps.tag.outputs.TAG }}
299+
284300
- name: Upload Mac x86-64 single artifact - rldp-http-proxy
285301
uses: svenstaro/upload-release-action@v2
286302
with:
@@ -380,6 +396,14 @@ jobs:
380396
asset_name: lite-client-mac-arm64
381397
tag: ${{ steps.tag.outputs.TAG }}
382398

399+
- name: Upload Mac arm64 single artifact - proxy-liteserver
400+
uses: svenstaro/upload-release-action@v2
401+
with:
402+
repo_token: ${{ secrets.GITHUB_TOKEN }}
403+
file: artifacts/ton-arm64-macos-binaries/proxy-liteserver
404+
asset_name: proxy-liteserver-mac-arm64
405+
tag: ${{ steps.tag.outputs.TAG }}
406+
383407
- name: Upload Mac arm64 single artifact - rldp-http-proxy
384408
uses: svenstaro/upload-release-action@v2
385409
with:
@@ -478,6 +502,14 @@ jobs:
478502
asset_name: lite-client-linux-x86_64
479503
tag: ${{ steps.tag.outputs.TAG }}
480504

505+
- name: Upload Linux x86-64 single artifact - proxy-liteserver
506+
uses: svenstaro/upload-release-action@v2
507+
with:
508+
repo_token: ${{ secrets.GITHUB_TOKEN }}
509+
file: artifacts/ton-x86_64-linux-binaries/proxy-liteserver
510+
asset_name: proxy-liteserver-linux-x86_64
511+
tag: ${{ steps.tag.outputs.TAG }}
512+
481513
- name: Upload Linux x86-64 single artifact - rldp-http-proxy
482514
uses: svenstaro/upload-release-action@v2
483515
with:

.github/workflows/docker-ubuntu-branch-image.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
id: docker_build
4242
uses: docker/build-push-action@v6
4343
with:
44-
platforms: linux/amd64
44+
platforms: linux/amd64,linux/arm64
4545
push: true
4646
context: ./
4747
tags: |

.github/workflows/ton-arm64-macos.yml

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
1919
- name: Build TON
2020
run: |
21+
git submodule sync --recursive
22+
git submodule update
2123
cp assembly/nix/build-macos-nix.sh .
2224
chmod +x build-macos-nix.sh
2325
./build-macos-nix.sh -t

.github/workflows/ton-x86-64-linux.yml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
2323
- name: Build TON
2424
run: |
25+
git submodule sync --recursive
26+
git submodule update
2527
cp assembly/nix/build-linux-x86-64-nix.sh .
2628
chmod +x build-linux-x86-64-nix.sh
2729
./build-linux-x86-64-nix.sh -t

.github/workflows/ton-x86-64-macos.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push,workflow_dispatch,workflow_call]
44

55
jobs:
66
build:
7-
runs-on: macos-12
7+
runs-on: macos-13
88

99
steps:
1010
- uses: actions/checkout@v3
@@ -18,6 +18,8 @@ jobs:
1818
1919
- name: Build TON
2020
run: |
21+
git submodule sync --recursive
22+
git submodule update
2123
cp assembly/nix/build-macos-nix.sh .
2224
chmod +x build-macos-nix.sh
2325
./build-macos-nix.sh -t

.github/workflows/ton-x86-64-windows.yml

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323

2424
- name: Build TON
2525
run: |
26+
git submodule sync --recursive
27+
git submodule update
2628
copy assembly\native\build-windows-github-2019.bat .
2729
copy assembly\native\build-windows-2019.bat .
2830
build-windows-github-2019.bat Enterprise

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ zlib/
1919
libsodium/
2020
libmicrohttpd-0.9.77-w32-bin/
2121
readline-5.0-1-lib/
22-
secp256k1/
2322
openssl-3.1.4/
2423
libsodium-1.0.18-stable-msvc.zip
2524
libmicrohttpd-0.9.77-w32-bin.zip

.gitmodules

+4
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@
1313
[submodule "third-party/blst"]
1414
path = third-party/blst
1515
url = https://github.com/supranational/blst.git
16+
[submodule "third-party/secp256k1"]
17+
path = third-party/secp256k1
18+
url = https://github.com/bitcoin-core/secp256k1
19+
branch = v0.3.2

CMake/BuildSECP256K1.cmake

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
if (NOT SECP256K1_LIBRARY)
2+
3+
set(SECP256K1_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party/secp256k1)
4+
set(SECP256K1_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/third-party/secp256k1)
5+
set(SECP256K1_INCLUDE_DIR ${SECP256K1_BINARY_DIR}/include)
6+
7+
file(MAKE_DIRECTORY ${SECP256K1_BINARY_DIR})
8+
file(MAKE_DIRECTORY "${SECP256K1_BINARY_DIR}/include")
9+
10+
if (MSVC)
11+
set(SECP256K1_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party/secp256k1)
12+
set(SECP256K1_LIBRARY ${SECP256K1_SOURCE_DIR}/build/src/Release/libsecp256k1.lib)
13+
set(SECP256K1_INCLUDE_DIR ${SECP256K1_BINARY_DIR}/include)
14+
add_custom_command(
15+
WORKING_DIRECTORY ${SECP256K1_SOURCE_DIR}
16+
COMMAND cmake -E env CFLAGS="/WX" cmake -A x64 -B build -DSECP256K1_ENABLE_MODULE_RECOVERY=ON -DSECP256K1_ENABLE_MODULE_EXTRAKEYS=ON -DSECP256K1_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF
17+
COMMAND cmake --build build --config Release
18+
COMMENT "Build Secp256k1"
19+
DEPENDS ${SECP256K1_SOURCE_DIR}
20+
OUTPUT ${SECP256K1_LIBRARY}
21+
)
22+
elseif (EMSCRIPTEN)
23+
set(SECP256K1_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party/secp256k1)
24+
set(SECP256K1_LIBRARY ${SECP256K1_BINARY_DIR}/.libs/libsecp256k1.a)
25+
set(SECP256K1_INCLUDE_DIR ${SECP256K1_SOURCE_DIR}/include)
26+
add_custom_command(
27+
WORKING_DIRECTORY ${SECP256K1_SOURCE_DIR}
28+
COMMAND ./autogen.sh
29+
COMMAND emconfigure ./configure --enable-module-recovery --enable-module-extrakeys --disable-tests --disable-benchmark
30+
COMMAND emmake make clean
31+
COMMAND emmake make
32+
COMMENT "Build Secp256k1 with emscripten"
33+
DEPENDS ${SECP256K1_SOURCE_DIR}
34+
OUTPUT ${SECP256K1_LIBRARY}
35+
)
36+
else()
37+
if (NOT NIX)
38+
set(SECP256K1_LIBRARY ${SECP256K1_BINARY_DIR}/lib/libsecp256k1.a)
39+
add_custom_command(
40+
WORKING_DIRECTORY ${SECP256K1_SOURCE_DIR}
41+
COMMAND ./autogen.sh
42+
COMMAND ./configure -q --disable-option-checking --enable-module-recovery --enable-module-extrakeys --prefix ${SECP256K1_BINARY_DIR} --with-pic --disable-shared --enable-static --disable-tests --disable-benchmark
43+
COMMAND make -j16
44+
COMMAND make install
45+
COMMENT "Build secp256k1"
46+
DEPENDS ${SECP256K1_SOURCE_DIR}
47+
OUTPUT ${SECP256K1_LIBRARY}
48+
)
49+
endif()
50+
endif()
51+
else()
52+
message(STATUS "Use Secp256k1: ${SECP256K1_LIBRARY}")
53+
endif()
54+
55+
add_custom_target(secp256k1 DEPENDS ${SECP256K1_LIBRARY})

CMake/FindSecp256k1.cmake

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# - Try to find SECP256K1
1+
# - Try to find Secp256k1
22
# Once done this will define
33
#
4-
# SECP256K1_FOUND - system has SECP256K1
5-
# SECP256K1_INCLUDE_DIR - the SECP256K1 include directory
6-
# SECP256K1_LIBRARY - Link these to use SECP256K1
4+
# SECP256K1_INCLUDE_DIR - the Secp256k1 include directory
5+
# SECP256K1_LIBRARY - Link these to use Secp256k1
76

87
if (NOT SECP256K1_LIBRARY)
98
find_path(

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ message("Add ton")
183183
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
184184

185185
include(BuildBLST)
186+
include(BuildSECP256K1)
186187

187188
# Configure CCache if available
188189
find_program(CCACHE_FOUND ccache)
@@ -237,6 +238,11 @@ if (TON_USE_JEMALLOC)
237238
find_package(jemalloc REQUIRED)
238239
endif()
239240

241+
if (NIX)
242+
find_package(Secp256k1 REQUIRED)
243+
endif()
244+
245+
240246
set(MEMPROF "" CACHE STRING "Use one of \"ON\", \"FAST\" or \"SAFE\" to enable memory profiling. \
241247
Works under macOS and Linux when compiled using glibc. \
242248
In FAST mode stack is unwinded only using frame pointers, which may fail. \

0 commit comments

Comments
 (0)