Skip to content

Commit 140320b

Browse files
authored
Merge pull request ton-blockchain#1099 from ton-blockchain/testnet
Merge developer branch
2 parents 5c392e0 + 7cbe20c commit 140320b

File tree

130 files changed

+5285
-973
lines changed

Some content is hidden

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

130 files changed

+5285
-973
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
os: [ubuntu-20.04, ubuntu-22.04]
10+
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
1111
runs-on: ${{ matrix.os }}
1212

1313
steps:
@@ -21,7 +21,7 @@ jobs:
2121
sudo apt-get update
2222
sudo apt-get install -y build-essential git cmake ninja-build zlib1g-dev libsecp256k1-dev libmicrohttpd-dev libsodium-dev liblz4-dev libjemalloc-dev
2323
24-
- name: Install clang-16
24+
- if: matrix.os != 'ubuntu-24.04'
2525
run: |
2626
wget https://apt.llvm.org/llvm.sh
2727
chmod +x llvm.sh

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
2020
- name: Build TON WASM artifacts
2121
run: |
22-
cd assembly/wasm
22+
cp assembly/wasm/fift-func-wasm-build-ubuntu.sh .
2323
chmod +x fift-func-wasm-build-ubuntu.sh
2424
./fift-func-wasm-build-ubuntu.sh -a
2525

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

+32-5
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,49 @@ jobs:
2020
submodules: 'recursive'
2121

2222
- name: Set up QEMU
23-
uses: docker/setup-qemu-action@v1
23+
uses: docker/setup-qemu-action@v3
2424

2525
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v1
26+
uses: docker/setup-buildx-action@v3
2727

2828
- name: Login to GitHub Container Registry
29-
uses: docker/login-action@v1
29+
uses: docker/login-action@v3
3030
with:
3131
registry: ${{ env.REGISTRY }}
3232
username: ${{ github.repository_owner }}
3333
password: ${{ secrets.GITHUB_TOKEN }}
3434

35+
- name: Build and export to Docker
36+
uses: docker/build-push-action@v6
37+
with:
38+
load: true
39+
context: ./
40+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
41+
42+
- name: Test
43+
run: |
44+
docker run --rm -e "TEST=1" ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
45+
46+
- name: Get next tag
47+
id: tag
48+
run: |
49+
git fetch --all --tags
50+
git tag -l
51+
NEW_TAG=v$(date +'%Y.%m')
52+
FOUND=$(git tag -l | grep $NEW_TAG | wc -l)
53+
if [ $FOUND -eq 0 ]; then
54+
echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT
55+
else
56+
echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT
57+
fi
58+
3559
- name: Build and push
3660
id: docker_build
37-
uses: docker/build-push-action@v2
61+
uses: docker/build-push-action@v6
3862
with:
63+
platforms: linux/amd64,linux/arm64
3964
push: true
4065
context: ./
41-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
66+
tags: |
67+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
68+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defaults:
99
jobs:
1010
build:
1111

12-
runs-on: windows-2022
12+
runs-on: windows-2019
1313

1414
steps:
1515
- name: Get Current OS version
@@ -23,9 +23,9 @@ jobs:
2323

2424
- name: Build TON
2525
run: |
26-
copy assembly\native\build-windows-github.bat .
27-
copy assembly\native\build-windows.bat .
28-
build-windows-github.bat Enterprise
26+
copy assembly\native\build-windows-github-2019.bat .
27+
copy assembly\native\build-windows-2019.bat .
28+
build-windows-github-2019.bat Enterprise
2929
3030
- name: Upload artifacts
3131
uses: actions/upload-artifact@master

CMake/FindSodium.cmake

+9-7
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@ if (NOT DEFINED SODIUM_USE_STATIC_LIBS)
3737
option(SODIUM_USE_STATIC_LIBS "enable to statically link against sodium" OFF)
3838
endif()
3939
if(NOT (SODIUM_USE_STATIC_LIBS EQUAL SODIUM_USE_STATIC_LIBS_LAST))
40-
unset(sodium_LIBRARY CACHE)
41-
unset(SODIUM_LIBRARY_DEBUG CACHE)
42-
unset(SODIUM_LIBRARY_RELEASE CACHE)
43-
unset(sodium_DLL_DEBUG CACHE)
44-
unset(sodium_DLL_RELEASE CACHE)
45-
set(SODIUM_USE_STATIC_LIBS_LAST ${SODIUM_USE_STATIC_LIBS} CACHE INTERNAL "internal change tracking variable")
40+
if (NOT SODIUM_LIBRARY_RELEASE)
41+
unset(sodium_LIBRARY CACHE)
42+
unset(SODIUM_LIBRARY_DEBUG CACHE)
43+
unset(SODIUM_LIBRARY_RELEASE CACHE)
44+
unset(sodium_DLL_DEBUG CACHE)
45+
unset(sodium_DLL_RELEASE CACHE)
46+
set(SODIUM_USE_STATIC_LIBS_LAST ${SODIUM_USE_STATIC_LIBS} CACHE INTERNAL "internal change tracking variable")
47+
endif()
4648
endif()
4749

4850

@@ -295,4 +297,4 @@ else()
295297
)
296298
endif()
297299
endif()
298-
endif()
300+
endif()

CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,9 @@ target_link_libraries(test-ton-collator overlay tdutils tdactor adnl tl_api dht
539539
add_executable(test-http test/test-http.cpp)
540540
target_link_libraries(test-http PRIVATE tonhttp)
541541

542+
add_executable(test-emulator test/test-td-main.cpp emulator/test/emulator-tests.cpp)
543+
target_link_libraries(test-emulator PRIVATE emulator)
544+
542545
get_directory_property(HAS_PARENT PARENT_DIRECTORY)
543546
if (HAS_PARENT)
544547
set(ALL_TEST_SOURCE
@@ -570,6 +573,7 @@ add_test(test-cells test-cells ${TEST_OPTIONS})
570573
add_test(test-smartcont test-smartcont)
571574
add_test(test-net test-net)
572575
add_test(test-actors test-tdactor)
576+
add_test(test-emulator test-emulator)
573577

574578
#BEGIN tonlib
575579
add_test(test-tdutils test-tdutils)

Changelog.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 2024.08 Update
2+
3+
1. Introduction of dispatch queues, message envelopes with transaction chain metadata, and explicitly stored msg_queue size, which will be activated by `Config8.version >= 8` and new `Config8.capabilities` bits: `capStoreOutMsgQueueSize`, `capMsgMetadata`, `capDeferMessages`.
4+
2. A number of changes to transcation executor which will activated for `Config8.version >= 8`:
5+
- Check mode on invalid `action_send_msg`. Ignore action if `IGNORE_ERROR` (+2) bit is set, bounce if `BOUNCE_ON_FAIL` (+16) bit is set.
6+
- Slightly change random seed generation to fix mix of `addr_rewrite` and `addr`.
7+
- Fill in `skipped_actions` for both invalid and valid messages with `IGNORE_ERROR` mode that can't be sent.
8+
- Allow unfreeze through external messages.
9+
- Don't use user-provided `fwd_fee` and `ihr_fee` for internal messages.
10+
3. A few issues with broadcasts were fixed: stop on receiving last piece, response to AdnlMessageCreateChannel
11+
4. A number of fixes and improvements for emulator and tonlib: correct work with config_addr, not accepted externals, bounces, debug ops gas consumption, added version and c5 dump, fixed tonlib crashes
12+
5. Added new flags and commands to the node, in particular `--fast-state-serializer`, `getcollatoroptionsjson`, `setcollatoroptionsjson`
13+
14+
Besides the work of the core team, this update is based on the efforts of @krigga (emulator), stonfi team, in particular @dbaranovstonfi and @hey-researcher (emulator), and @loeul, @xiaoxianBoy, @simlecode (typos in comments and docs).
15+
16+
17+
118
## 2024.06 Update
219

320
1. Make Jemalloc default allocator

Dockerfile

+19-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
FROM ubuntu:22.04 as builder
1+
FROM ubuntu:22.04 AS builder
22
RUN apt-get update && \
3-
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git ninja-build libsecp256k1-dev libsodium-dev libmicrohttpd-dev liblz4-dev pkg-config autoconf automake libtool libjemalloc-dev && \
4-
rm -rf /var/lib/apt/lists/*
5-
ENV CC clang
6-
ENV CXX clang++
7-
ENV CCACHE_DISABLE 1
3+
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake clang openssl libssl-dev zlib1g-dev gperf wget git ninja-build libsecp256k1-dev libsodium-dev libmicrohttpd-dev liblz4-dev pkg-config autoconf automake libtool libjemalloc-dev lsb-release software-properties-common gnupg
4+
5+
RUN wget https://apt.llvm.org/llvm.sh && \
6+
chmod +x llvm.sh && \
7+
./llvm.sh 16 all && \
8+
rm -rf /var/lib/apt/lists/*
9+
10+
ENV CC=/usr/bin/clang-16
11+
ENV CXX=/usr/bin/clang++-16
12+
ENV CCACHE_DISABLE=1
813

914
WORKDIR /
1015
RUN mkdir ton
@@ -13,17 +18,16 @@ WORKDIR /ton
1318
COPY ./ ./
1419

1520
RUN mkdir build && \
16-
cd build && \
17-
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DTON_ARCH= -DTON_USE_JEMALLOC=ON .. && \
18-
ninja storage-daemon storage-daemon-cli tonlibjson fift func validator-engine validator-engine-console generate-random-id dht-server lite-client
21+
cd build && \
22+
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -DTON_ARCH= -DTON_USE_JEMALLOC=ON .. && \
23+
ninja storage-daemon storage-daemon-cli tonlibjson fift func validator-engine validator-engine-console generate-random-id dht-server lite-client
1924

2025
FROM ubuntu:22.04
2126
RUN apt-get update && \
22-
apt-get install -y wget libatomic1 openssl libsecp256k1-dev libsodium-dev libmicrohttpd-dev liblz4-dev libjemalloc-dev && \
27+
apt-get install -y wget curl libatomic1 openssl libsecp256k1-dev libsodium-dev libmicrohttpd-dev liblz4-dev libjemalloc-dev htop net-tools netcat iptraf-ng jq tcpdump pv plzip && \
2328
rm -rf /var/lib/apt/lists/*
2429

25-
RUN mkdir -p /var/ton-work/db && \
26-
mkdir -p /var/ton-work/db/static
30+
RUN mkdir -p /var/ton-work/db /var/ton-work/scripts
2731

2832
COPY --from=builder /ton/build/storage/storage-daemon/storage-daemon /usr/local/bin/
2933
COPY --from=builder /ton/build/storage/storage-daemon/storage-daemon-cli /usr/local/bin/
@@ -33,7 +37,7 @@ COPY --from=builder /ton/build/validator-engine-console/validator-engine-console
3337
COPY --from=builder /ton/build/utils/generate-random-id /usr/local/bin/
3438

3539
WORKDIR /var/ton-work/db
36-
COPY ./docker/init.sh ./docker/control.template ./
37-
RUN chmod +x init.sh
40+
COPY ./docker/init.sh ./docker/control.template /var/ton-work/scripts/
41+
RUN chmod +x /var/ton-work/scripts/init.sh
3842

39-
ENTRYPOINT ["/var/ton-work/db/init.sh"]
43+
ENTRYPOINT ["/var/ton-work/scripts/init.sh"]

adnl/adnl-ext-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ td::Status AdnlInboundConnection::process_custom_packet(td::BufferSlice &data, b
9191
auto F = fetch_tl_object<ton_api::tcp_authentificate>(data.clone(), true);
9292
if (F.is_ok()) {
9393
if (nonce_.size() > 0 || !remote_id_.is_zero()) {
94-
return td::Status::Error(ErrorCode::protoviolation, "duplicate authentificate");
94+
return td::Status::Error(ErrorCode::protoviolation, "duplicate authenticate");
9595
}
9696
auto f = F.move_as_ok();
9797
nonce_ = td::SecureString{f->nonce_.size() + 256};

adnl/adnl-peer.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,12 @@ void AdnlPeerPairImpl::create_channel(pubkeys::Ed25519 pub, td::uint32 date) {
504504

505505
void AdnlPeerPairImpl::process_message(const adnlmessage::AdnlMessageCreateChannel &message) {
506506
create_channel(message.key(), message.date());
507+
if (respond_to_channel_create_after_.is_in_past()) {
508+
respond_to_channel_create_after_ = td::Timestamp::in(td::Random::fast(1.0, 2.0));
509+
std::vector<OutboundAdnlMessage> messages;
510+
messages.emplace_back(adnlmessage::AdnlMessageNop{}, 0);
511+
send_messages(std::move(messages));
512+
}
507513
}
508514

509515
void AdnlPeerPairImpl::process_message(const adnlmessage::AdnlMessageConfirmChannel &message) {

adnl/adnl-peer.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ class AdnlPeerPairImpl : public AdnlPeerPair {
214214
pubkeys::Ed25519 channel_pub_;
215215
td::int32 channel_pk_date_;
216216
td::actor::ActorOwn<AdnlChannel> channel_;
217+
td::Timestamp respond_to_channel_create_after_;
217218

218219
td::uint64 in_seqno_ = 0;
219220
td::uint64 out_seqno_ = 0;

assembly/cicd/jenkins/test-builds.groovy

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pipeline {
2+
23
agent none
34
stages {
45
stage('Run Builds') {
@@ -12,7 +13,7 @@ pipeline {
1213
sh '''
1314
cp assembly/native/build-ubuntu-shared.sh .
1415
chmod +x build-ubuntu-shared.sh
15-
./build-ubuntu-shared.sh -t -a
16+
./build-ubuntu-shared.sh -a
1617
'''
1718
sh '''
1819
cd artifacts
@@ -31,7 +32,7 @@ pipeline {
3132
sh '''
3233
cp assembly/nix/build-linux-x86-64-nix.sh .
3334
chmod +x build-linux-x86-64-nix.sh
34-
./build-linux-x86-64-nix.sh -t
35+
./build-linux-x86-64-nix.sh
3536
'''
3637
sh '''
3738
cd artifacts
@@ -50,7 +51,7 @@ pipeline {
5051
sh '''
5152
cp assembly/native/build-ubuntu-shared.sh .
5253
chmod +x build-ubuntu-shared.sh
53-
./build-ubuntu-shared.sh -t -a
54+
./build-ubuntu-shared.sh -a
5455
'''
5556
sh '''
5657
cd artifacts
@@ -69,7 +70,7 @@ pipeline {
6970
sh '''
7071
cp assembly/nix/build-linux-arm64-nix.sh .
7172
chmod +x build-linux-arm64-nix.sh
72-
./build-linux-arm64-nix.sh -t
73+
./build-linux-arm64-nix.sh
7374
'''
7475
sh '''
7576
cd artifacts
@@ -88,7 +89,7 @@ pipeline {
8889
sh '''
8990
cp assembly/native/build-macos-shared.sh .
9091
chmod +x build-macos-shared.sh
91-
./build-macos-shared.sh -t -a
92+
./build-macos-shared.sh -a
9293
'''
9394
sh '''
9495
cd artifacts
@@ -107,7 +108,7 @@ pipeline {
107108
sh '''
108109
cp assembly/nix/build-macos-nix.sh .
109110
chmod +x build-macos-nix.sh
110-
./build-macos-nix.sh -t
111+
./build-macos-nix.sh
111112
'''
112113
sh '''
113114
cd artifacts
@@ -126,7 +127,7 @@ pipeline {
126127
sh '''
127128
cp assembly/native/build-macos-shared.sh .
128129
chmod +x build-macos-shared.sh
129-
./build-macos-shared.sh -t -a
130+
./build-macos-shared.sh -a
130131
'''
131132
sh '''
132133
cd artifacts
@@ -145,7 +146,7 @@ pipeline {
145146
sh '''
146147
cp assembly/nix/build-macos-nix.sh .
147148
chmod +x build-macos-nix.sh
148-
./build-macos-nix.sh -t
149+
./build-macos-nix.sh
149150
'''
150151
sh '''
151152
cd artifacts
@@ -164,7 +165,7 @@ pipeline {
164165
sh '''
165166
cp assembly/native/build-macos-shared.sh .
166167
chmod +x build-macos-shared.sh
167-
./build-macos-shared.sh -t -a
168+
./build-macos-shared.sh -a
168169
'''
169170
sh '''
170171
cd artifacts
@@ -182,7 +183,7 @@ pipeline {
182183
timeout(time: 180, unit: 'MINUTES') {
183184
bat '''
184185
copy assembly\\native\\build-windows.bat .
185-
build-windows.bat -t
186+
build-windows.bat
186187
'''
187188
bat '''
188189
cd artifacts
@@ -218,7 +219,7 @@ pipeline {
218219
steps {
219220
timeout(time: 180, unit: 'MINUTES') {
220221
sh '''
221-
cd assembly/wasm
222+
cp assembly/wasm/fift-func-wasm-build-ubuntu.sh .
222223
chmod +x fift-func-wasm-build-ubuntu.sh
223224
./fift-func-wasm-build-ubuntu.sh -a
224225
'''

assembly/native/build-macos-portable.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ if [ "$with_tests" = true ]; then
158158
http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator \
159159
test-ed25519 test-ed25519-crypto test-bigint test-vm test-fift test-cells test-smartcont \
160160
test-net test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp \
161-
test-rldp2 test-catchain test-fec test-tddb test-db test-validator-session-state
161+
test-rldp2 test-catchain test-fec test-tddb test-db test-validator-session-state test-emulator
162162
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }
163163
else
164164
ninja storage-daemon storage-daemon-cli blockchain-explorer \

assembly/native/build-macos-shared.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if [ "$with_tests" = true ]; then
8686
http-proxy rldp-http-proxy adnl-proxy create-state create-hardfork tlbc emulator \
8787
test-ed25519 test-ed25519-crypto test-bigint test-vm test-fift test-cells test-smartcont \
8888
test-net test-tdactor test-tdutils test-tonlib-offline test-adnl test-dht test-rldp \
89-
test-rldp2 test-catchain test-fec test-tddb test-db test-validator-session-state
89+
test-rldp2 test-catchain test-fec test-tddb test-db test-validator-session-state test-emulator
9090
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }
9191
else
9292
ninja storage-daemon storage-daemon-cli blockchain-explorer \

assembly/native/build-ubuntu-portable.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \
150150
adnl-proxy create-state emulator test-ed25519 test-ed25519-crypto test-bigint \
151151
test-vm test-fift test-cells test-smartcont test-net test-tdactor test-tdutils \
152152
test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain \
153-
test-fec test-tddb test-db test-validator-session-state
153+
test-fec test-tddb test-db test-validator-session-state test-emulator
154154
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }
155155
else
156156
ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \

assembly/native/build-ubuntu-shared.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \
5858
adnl-proxy create-state emulator test-ed25519 test-ed25519-crypto test-bigint \
5959
test-vm test-fift test-cells test-smartcont test-net test-tdactor test-tdutils \
6060
test-tonlib-offline test-adnl test-dht test-rldp test-rldp2 test-catchain \
61-
test-fec test-tddb test-db test-validator-session-state
61+
test-fec test-tddb test-db test-validator-session-state test-emulator
6262
test $? -eq 0 || { echo "Can't compile ton"; exit 1; }
6363
else
6464
ninja storage-daemon storage-daemon-cli fift func tonlib tonlibjson tonlib-cli \

0 commit comments

Comments
 (0)