Skip to content

Commit

Permalink
Merge pull request #1427 from ton-blockchain/testnet
Browse files Browse the repository at this point in the history
Merge developer branch
  • Loading branch information
EmelyanenkoK authored Dec 11, 2024
2 parents 7151ff2 + 540d1fb commit ea0dc16
Show file tree
Hide file tree
Showing 199 changed files with 7,257 additions and 2,153 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-ton-linux-android-tonlib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- name: Build TON
run: |
git submodule sync --recursive
git submodule update
cp assembly/android/build-android-tonlib.sh .
chmod +x build-android-tonlib.sh
./build-android-tonlib.sh -a
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-ton-linux-x86-64-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
- name: Build TON
run: |
git submodule sync --recursive
git submodule update
cp assembly/native/build-ubuntu-shared.sh .
chmod +x build-ubuntu-shared.sh
./build-ubuntu-shared.sh -t -a
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-ton-macos-15-arm64-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

- name: Build TON
run: |
git submodule sync --recursive
git submodule update
cp assembly/native/build-macos-shared.sh .
chmod +x build-macos-shared.sh
./build-macos-shared.sh -t -a
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-ton-macos-arm64-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

- name: Build TON
run: |
git submodule sync --recursive
git submodule update
cp assembly/native/build-macos-shared.sh .
chmod +x build-macos-shared.sh
./build-macos-shared.sh -t -a
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-ton-macos-x86-64-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push,workflow_dispatch,workflow_call]

jobs:
build:
runs-on: macos-12
runs-on: macos-13

steps:
- name: Check out repository
Expand All @@ -14,12 +14,14 @@ jobs:

- name: Build TON
run: |
git submodule sync --recursive
git submodule update
cp assembly/native/build-macos-shared.sh .
chmod +x build-macos-shared.sh
./build-macos-shared.sh -t -a
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: ton-binaries-macos-12
name: ton-binaries-macos-13
path: artifacts
4 changes: 3 additions & 1 deletion .github/workflows/build-ton-wasm-emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ jobs:
- name: Install system libraries
run: |
sudo apt-get update
sudo apt-get install -y build-essential git openssl cmake ninja-build zlib1g-dev libssl-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev
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
- name: Build TON WASM artifacts
run: |
git submodule sync --recursive
git submodule update
cp assembly/wasm/fift-func-wasm-build-ubuntu.sh .
chmod +x fift-func-wasm-build-ubuntu.sh
./fift-func-wasm-build-ubuntu.sh -a
Expand Down
52 changes: 42 additions & 10 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,79 +12,79 @@ jobs:
- uses: actions/checkout@v3

- name: Download Linux x86-64 artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-x86-64-linux.yml
path: artifacts
workflow_conclusion: success
skip_unpack: true

- name: Download and unzip Linux x86-64 artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-x86-64-linux.yml
path: artifacts
workflow_conclusion: success
skip_unpack: false

- name: Download Mac x86-64 artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-x86-64-macos.yml
path: artifacts
workflow_conclusion: success
skip_unpack: true

- name: Download Mac arm64 artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-arm64-macos.yml
path: artifacts
workflow_conclusion: success
skip_unpack: true

- name: Download and unzip Mac x86-64 artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-x86-64-macos.yml
path: artifacts
workflow_conclusion: success
skip_unpack: false

- name: Download and unzip arm64 artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-arm64-macos.yml
path: artifacts
workflow_conclusion: success
skip_unpack: false

- name: Download Windows artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-x86-64-windows.yml
path: artifacts
workflow_conclusion: success
skip_unpack: true

- name: Download and unzip Windows artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: ton-x86-64-windows.yml
path: artifacts
workflow_conclusion: success
skip_unpack: false

- name: Download WASM artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-ton-wasm-emscripten.yml
path: artifacts
workflow_conclusion: success
skip_unpack: true

- name: Download Android Tonlib artifacts
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow: build-ton-linux-android-tonlib.yml
path: artifacts
Expand Down Expand Up @@ -183,6 +183,14 @@ jobs:
asset_name: lite-client.exe
tag: ${{ steps.tag.outputs.TAG }}

- name: Upload Windows 2019 single artifact - proxy-liteserver
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-win-binaries/proxy-liteserver.exe
asset_name: proxy-liteserver.exe
tag: ${{ steps.tag.outputs.TAG }}

- name: Upload Windows 2019 single artifact - rldp-http-proxy
uses: svenstaro/upload-release-action@v2
with:
Expand Down Expand Up @@ -281,6 +289,14 @@ jobs:
asset_name: lite-client-mac-x86-64
tag: ${{ steps.tag.outputs.TAG }}

- name: Upload Mac x86-64 single artifact - proxy-liteserver
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-x86_64-macos-binaries/proxy-liteserver
asset_name: proxy-liteserver-mac-x86-64
tag: ${{ steps.tag.outputs.TAG }}

- name: Upload Mac x86-64 single artifact - rldp-http-proxy
uses: svenstaro/upload-release-action@v2
with:
Expand Down Expand Up @@ -380,6 +396,14 @@ jobs:
asset_name: lite-client-mac-arm64
tag: ${{ steps.tag.outputs.TAG }}

- name: Upload Mac arm64 single artifact - proxy-liteserver
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-arm64-macos-binaries/proxy-liteserver
asset_name: proxy-liteserver-mac-arm64
tag: ${{ steps.tag.outputs.TAG }}

- name: Upload Mac arm64 single artifact - rldp-http-proxy
uses: svenstaro/upload-release-action@v2
with:
Expand Down Expand Up @@ -478,6 +502,14 @@ jobs:
asset_name: lite-client-linux-x86_64
tag: ${{ steps.tag.outputs.TAG }}

- name: Upload Linux x86-64 single artifact - proxy-liteserver
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: artifacts/ton-x86_64-linux-binaries/proxy-liteserver
asset_name: proxy-liteserver-linux-x86_64
tag: ${{ steps.tag.outputs.TAG }}

- name: Upload Linux x86-64 single artifact - rldp-http-proxy
uses: svenstaro/upload-release-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-ubuntu-branch-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
push: true
context: ./
tags: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ton-arm64-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
- name: Build TON
run: |
git submodule sync --recursive
git submodule update
cp assembly/nix/build-macos-nix.sh .
chmod +x build-macos-nix.sh
./build-macos-nix.sh -t
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ton-x86-64-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
- name: Build TON
run: |
git submodule sync --recursive
git submodule update
cp assembly/nix/build-linux-x86-64-nix.sh .
chmod +x build-linux-x86-64-nix.sh
./build-linux-x86-64-nix.sh -t
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ton-x86-64-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push,workflow_dispatch,workflow_call]

jobs:
build:
runs-on: macos-12
runs-on: macos-13

steps:
- uses: actions/checkout@v3
Expand All @@ -18,6 +18,8 @@ jobs:
- name: Build TON
run: |
git submodule sync --recursive
git submodule update
cp assembly/nix/build-macos-nix.sh .
chmod +x build-macos-nix.sh
./build-macos-nix.sh -t
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ton-x86-64-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:

- name: Build TON
run: |
git submodule sync --recursive
git submodule update
copy assembly\native\build-windows-github-2019.bat .
copy assembly\native\build-windows-2019.bat .
build-windows-github-2019.bat Enterprise
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ zlib/
libsodium/
libmicrohttpd-0.9.77-w32-bin/
readline-5.0-1-lib/
secp256k1/
openssl-3.1.4/
libsodium-1.0.18-stable-msvc.zip
libmicrohttpd-0.9.77-w32-bin.zip
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
[submodule "third-party/blst"]
path = third-party/blst
url = https://github.com/supranational/blst.git
[submodule "third-party/secp256k1"]
path = third-party/secp256k1
url = https://github.com/bitcoin-core/secp256k1
branch = v0.3.2
55 changes: 55 additions & 0 deletions CMake/BuildSECP256K1.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
if (NOT SECP256K1_LIBRARY)

set(SECP256K1_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party/secp256k1)
set(SECP256K1_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/third-party/secp256k1)
set(SECP256K1_INCLUDE_DIR ${SECP256K1_BINARY_DIR}/include)

file(MAKE_DIRECTORY ${SECP256K1_BINARY_DIR})
file(MAKE_DIRECTORY "${SECP256K1_BINARY_DIR}/include")

if (MSVC)
set(SECP256K1_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party/secp256k1)
set(SECP256K1_LIBRARY ${SECP256K1_SOURCE_DIR}/build/src/Release/libsecp256k1.lib)
set(SECP256K1_INCLUDE_DIR ${SECP256K1_BINARY_DIR}/include)
add_custom_command(
WORKING_DIRECTORY ${SECP256K1_SOURCE_DIR}
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
COMMAND cmake --build build --config Release
COMMENT "Build Secp256k1"
DEPENDS ${SECP256K1_SOURCE_DIR}
OUTPUT ${SECP256K1_LIBRARY}
)
elseif (EMSCRIPTEN)
set(SECP256K1_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third-party/secp256k1)
set(SECP256K1_LIBRARY ${SECP256K1_BINARY_DIR}/.libs/libsecp256k1.a)
set(SECP256K1_INCLUDE_DIR ${SECP256K1_SOURCE_DIR}/include)
add_custom_command(
WORKING_DIRECTORY ${SECP256K1_SOURCE_DIR}
COMMAND ./autogen.sh
COMMAND emconfigure ./configure --enable-module-recovery --enable-module-extrakeys --disable-tests --disable-benchmark
COMMAND emmake make clean
COMMAND emmake make
COMMENT "Build Secp256k1 with emscripten"
DEPENDS ${SECP256K1_SOURCE_DIR}
OUTPUT ${SECP256K1_LIBRARY}
)
else()
if (NOT NIX)
set(SECP256K1_LIBRARY ${SECP256K1_BINARY_DIR}/lib/libsecp256k1.a)
add_custom_command(
WORKING_DIRECTORY ${SECP256K1_SOURCE_DIR}
COMMAND ./autogen.sh
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
COMMAND make -j16
COMMAND make install
COMMENT "Build secp256k1"
DEPENDS ${SECP256K1_SOURCE_DIR}
OUTPUT ${SECP256K1_LIBRARY}
)
endif()
endif()
else()
message(STATUS "Use Secp256k1: ${SECP256K1_LIBRARY}")
endif()

add_custom_target(secp256k1 DEPENDS ${SECP256K1_LIBRARY})
7 changes: 3 additions & 4 deletions CMake/FindSecp256k1.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# - Try to find SECP256K1
# - Try to find Secp256k1
# Once done this will define
#
# SECP256K1_FOUND - system has SECP256K1
# SECP256K1_INCLUDE_DIR - the SECP256K1 include directory
# SECP256K1_LIBRARY - Link these to use SECP256K1
# SECP256K1_INCLUDE_DIR - the Secp256k1 include directory
# SECP256K1_LIBRARY - Link these to use Secp256k1

if (NOT SECP256K1_LIBRARY)
find_path(
Expand Down
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ message("Add ton")
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})

include(BuildBLST)
include(BuildSECP256K1)

# Configure CCache if available
find_program(CCACHE_FOUND ccache)
Expand Down Expand Up @@ -237,6 +238,11 @@ if (TON_USE_JEMALLOC)
find_package(jemalloc REQUIRED)
endif()

if (NIX)
find_package(Secp256k1 REQUIRED)
endif()


set(MEMPROF "" CACHE STRING "Use one of \"ON\", \"FAST\" or \"SAFE\" to enable memory profiling. \
Works under macOS and Linux when compiled using glibc. \
In FAST mode stack is unwinded only using frame pointers, which may fail. \
Expand Down
Loading

0 comments on commit ea0dc16

Please sign in to comment.