Skip to content

Commit baf553d

Browse files
Updated submodules for testnet branch
1 parent 07e10d6 commit baf553d

7 files changed

Lines changed: 160 additions & 15 deletions

File tree

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ RUN DEBIAN_FRONTEND=noninteractive wget https://apt.llvm.org/llvm.sh && \
2020
ENTRYPOINT [ "/bin/bash" ]
2121

2222
FROM builder-base AS builder
23+
# build openssl 3.5
24+
RUN git clone --recursive --branch openssl-3.5 https://github.com/openssl/openssl /openssl && cd /openssl \
25+
&& ./Configure && make -j$(nproc)
26+
27+
ENV OPENSSL_ROOT_DIR=/openssl/
28+
ENV OPENSSL_INCLUDE_DIR=/openssl/include
29+
ENV OPENSSL_CRYPTO_LIBRARY=/openssl/libcrypto.so
2330

2431
ENV CC=/usr/bin/clang-21
2532
ENV CXX=/usr/bin/clang++-21
@@ -46,14 +53,17 @@ RUN if [ -n "${BUILD_WITH_TON_REPO}" ]; then \
4653
fi
4754

4855
WORKDIR /app/build
49-
RUN cmake -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -GNinja .. && ninja -j$(nproc)
56+
RUN touch /app/suppression_mappings.txt && cmake -DCMAKE_BUILD_TYPE=Release -DPORTABLE=1 -GNinja .. && ninja -j$(nproc)
5057
# end builder
5158

5259

5360
FROM ubuntu:24.04 AS http-api-cpp
5461
RUN DEBIAN_FRONTEND=noninteractive apt update -y \
5562
&& apt install -y curl libcurl4 libfmt9 libsodium23 libcctz2 libatomic1 libicu74 \
5663
&& rm -rf /var/lib/apt/lists/*
64+
COPY --from=builder /openssl/libcrypto.so.3 /usr/local/lib/libcrypto.so.3
65+
COPY --from=builder /openssl/libssl.so.3 /usr/local/lib/libssl.so.3
66+
RUN ln -s /usr/local/lib/libcrypto.so.3 /usr/local/lib/libcrypto.so && ln -s /usr/local/lib/libssl.so.3 /usr/local/lib/libssl.so && ldconfig
5767
COPY --from=builder /app/build/ton-http-api/ton-http-api-cpp /usr/bin/
5868
COPY ton-http-api/static/ /static/
5969
COPY config/static_config.yaml /app/static_config.yaml

config/static_config.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ components_manager:
7676
task_processor: main-task-processor
7777
dns-client:
7878
fs-task-processor: fs-task-processor
79-
http-client:
79+
http-client-middleware-pipeline:
80+
middlewares:
81+
http-client-middleware-disabled:
82+
enabled: false
83+
http-client-middleware-override:
84+
enabled: false
85+
http-client-core:
8086
pool-statistics-disable: true
8187
thread-name-prefix: http-client
8288
threads: $http_worker_threads
@@ -85,7 +91,9 @@ components_manager:
8591
destination-metrics-auto-max-size: 100
8692
user-agent: $http_worker_user_agent
8793
user-agent#fallback: empty
88-
jsonrpc-http-client:
94+
http-client:
95+
core-component: http-client-core
96+
jsonrpc-http-client-core:
8997
pool-statistics-disable: true
9098
thread-name-prefix: jsonrpc-http-client
9199
threads: $http_worker_threads
@@ -94,6 +102,8 @@ components_manager:
94102
destination-metrics-auto-max-size: 0
95103
user-agent: $http_worker_user_agent
96104
user-agent#fallback: empty
105+
jsonrpc-http-client:
106+
core-component: jsonrpc-http-client-core
97107
fs-cache-main:
98108
dir: $static_content_dir
99109
dir#fallback: /app/static/

ton-http-api/schemas/v2.yaml

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,7 +3262,8 @@ components:
32623262
- $ref: '#/components/schemas/NftCollectionData'
32633263
- $ref: '#/components/schemas/NftItemData'
32643264
- $ref: '#/components/schemas/MasterchainInfo'
3265-
- $ref: '#/components/schemas/MasterchainBlockSignatures'
3265+
- $ref: '#/components/schemas/BlockSignatures'
3266+
- $ref: '#/components/schemas/BlockSignaturesSimplex'
32663267
- $ref: '#/components/schemas/ShardBlockProof'
32673268
- $ref: '#/components/schemas/ConsensusBlock'
32683269
- $ref: '#/components/schemas/TonBlockIdExt'
@@ -3293,7 +3294,8 @@ components:
32933294
'ext.tokens.nftCollectionData': '#/components/schemas/NftCollectionData'
32943295
'ext.tokens.nftItemData': '#/components/schemas/NftItemData'
32953296
'blocks.masterchainInfo': '#/components/schemas/MasterchainInfo'
3296-
'blocks.blockSignatures': '#/components/schemas/MasterchainBlockSignatures'
3297+
'blocks.blockSignatures': '#/components/schemas/BlockSignatures'
3298+
'blocks.blockSignatures.simplex': '#/components/schemas/BlockSignaturesSimplex'
32973299
'blocks.shardBlockProof': '#/components/schemas/ShardBlockProof'
32983300
'ext.blocks.consensusBlock': '#/components/schemas/ConsensusBlock'
32993301
'ton.blockIdExt': '#/components/schemas/TonBlockIdExt'
@@ -3607,7 +3609,7 @@ components:
36073609
- last
36083610
- state_root_hash
36093611
- init
3610-
MasterchainBlockSignatures:
3612+
BlockSignatures:
36113613
type: object
36123614
additionalProperties: false
36133615
properties:
@@ -3626,6 +3628,44 @@ components:
36263628
- '@type'
36273629
- id
36283630
- signatures
3631+
BlockSignaturesSimplex:
3632+
type: object
3633+
additionalProperties: false
3634+
properties:
3635+
'@type':
3636+
type: string
3637+
enum:
3638+
- blocks.blockSignatures.simplex
3639+
default: blocks.blockSignatures.simplex
3640+
id:
3641+
$ref: '#/components/schemas/TonBlockIdExt'
3642+
signatures:
3643+
type: array
3644+
items:
3645+
$ref: '#/components/schemas/BlockSignature'
3646+
session_id:
3647+
$ref: '#/components/schemas/TonHash'
3648+
slot:
3649+
type: integer
3650+
format: int32
3651+
candidate:
3652+
$ref: '#/components/schemas/Bytes'
3653+
required:
3654+
- '@type'
3655+
- id
3656+
- signatures
3657+
- session_id
3658+
- slot
3659+
- candidate
3660+
MasterchainBlockSignatures:
3661+
oneOf:
3662+
- $ref: '#/components/schemas/BlockSignatures'
3663+
- $ref: '#/components/schemas/BlockSignaturesSimplex'
3664+
discriminator:
3665+
propertyName: '@type'
3666+
mapping:
3667+
blocks.blockSignatures: '#/components/schemas/BlockSignatures'
3668+
blocks.blockSignatures.simplex: '#/components/schemas/BlockSignaturesSimplex'
36293669
ShardBlockProof:
36303670
type: object
36313671
additionalProperties: false

ton-http-api/src/converters/blocks.hpp

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,33 @@ inline schemas::v2::BlockSignature Convert(const tonlib_api::object_ptr<tonlib_a
2424
}
2525

2626
inline schemas::v2::MasterchainBlockSignatures Convert(
27-
const tonlib_api::blocks_getMasterchainBlockSignatures::ReturnType& value
27+
const tonlib_api::object_ptr<tonlib_api::blocks_BlockSignatures>& value
2828
) {
2929
schemas::v2::MasterchainBlockSignatures result;
30-
result.id = Convert(value->id_);
31-
for (auto& sig : value->signatures_) {
32-
result.signatures.push_back(Convert(sig));
33-
}
30+
ton::tonlib_api::downcast_call(
31+
*value.get(),
32+
td::overloaded(
33+
[&](const tonlib_api::blocks_blockSignatures& val) {
34+
schemas::v2::BlockSignatures res;
35+
res.id = Convert(val.id_);
36+
for (auto& sig : val.signatures_) {
37+
res.signatures.push_back(Convert(sig));
38+
}
39+
result = res;
40+
},
41+
[&](const tonlib_api::blocks_blockSignatures_simplex& val) {
42+
schemas::v2::BlockSignaturesSimplex res;
43+
res.id = Convert(val.id_);
44+
for (auto& sig : val.signatures_) {
45+
res.signatures.push_back(Convert(sig));
46+
}
47+
res.session_id = types::ton_hash{val.session_id_.as_slice().str()};
48+
res.slot = val.slot_;
49+
res.candidate = types::bytes{val.candidate_};
50+
result = res;
51+
}
52+
)
53+
);
3454
return result;
3555
}
3656

ton-http-api/src/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "handlers/utils/DetectHashHandler.h"
4444
#include "handlers/utils/PackAddressHandler.h"
4545
#include "handlers/utils/UnpackAddressHandler.h"
46+
#include "userver/clients/http/middlewares/pipeline_component.hpp"
4647

4748

4849
int main(int argc, char* argv[]) {
@@ -52,7 +53,10 @@ int main(int argc, char* argv[]) {
5253
auto component_list = userver::components::MinimalServerComponentList();
5354
// components
5455
component_list.Append<userver::clients::dns::Component>();
56+
component_list.Append<userver::clients::http::MiddlewarePipelineComponent>();
57+
component_list.Append<userver::components::HttpClientCore>();
5558
component_list.Append<userver::components::HttpClient>();
59+
component_list.Append<userver::components::HttpClientCore>("jsonrpc-http-client-core");
5660
component_list.Append<userver::components::HttpClient>("jsonrpc-http-client");
5761
component_list.Append<userver::components::FsCache>("fs-cache-main");
5862
component_list.Append<ton_http::core::TonlibComponent>();

ton-http-api/src/utils/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#include "tl/tl_json.h"
99

1010
#include "common/refint.h"
11-
#include "overlay/overlay-broadcast.hpp"
1211
#include "td/utils/JsonBuilder.h"
1312
#include "td/utils/Status.h"
1413
#include "td/utils/logging.h"
14+
#include "td/utils/utf8.h"
1515
#include "td/utils/overloaded.h"
1616
#include "vm/boc.h"
1717
#include "vm/cells/CellSlice.h"

ton-http-api/static/openapi.json

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5241,7 +5241,10 @@
52415241
"$ref": "#/components/schemas/MasterchainInfo"
52425242
},
52435243
{
5244-
"$ref": "#/components/schemas/MasterchainBlockSignatures"
5244+
"$ref": "#/components/schemas/BlockSignatures"
5245+
},
5246+
{
5247+
"$ref": "#/components/schemas/BlockSignaturesSimplex"
52455248
},
52465249
{
52475250
"$ref": "#/components/schemas/ShardBlockProof"
@@ -5308,7 +5311,8 @@
53085311
"ext.tokens.nftCollectionData": "#/components/schemas/NftCollectionData",
53095312
"ext.tokens.nftItemData": "#/components/schemas/NftItemData",
53105313
"blocks.masterchainInfo": "#/components/schemas/MasterchainInfo",
5311-
"blocks.blockSignatures": "#/components/schemas/MasterchainBlockSignatures",
5314+
"blocks.blockSignatures": "#/components/schemas/BlockSignatures",
5315+
"blocks.blockSignatures.simplex": "#/components/schemas/BlockSignaturesSimplex",
53125316
"blocks.shardBlockProof": "#/components/schemas/ShardBlockProof",
53135317
"ext.blocks.consensusBlock": "#/components/schemas/ConsensusBlock",
53145318
"ton.blockIdExt": "#/components/schemas/TonBlockIdExt",
@@ -5747,7 +5751,7 @@
57475751
"init"
57485752
]
57495753
},
5750-
"MasterchainBlockSignatures": {
5754+
"BlockSignatures": {
57515755
"type": "object",
57525756
"additionalProperties": false,
57535757
"properties": {
@@ -5774,6 +5778,63 @@
57745778
"signatures"
57755779
]
57765780
},
5781+
"BlockSignaturesSimplex": {
5782+
"type": "object",
5783+
"additionalProperties": false,
5784+
"properties": {
5785+
"@type": {
5786+
"type": "string",
5787+
"enum": [
5788+
"blocks.blockSignatures.simplex"
5789+
],
5790+
"default": "blocks.blockSignatures.simplex"
5791+
},
5792+
"id": {
5793+
"$ref": "#/components/schemas/TonBlockIdExt"
5794+
},
5795+
"signatures": {
5796+
"type": "array",
5797+
"items": {
5798+
"$ref": "#/components/schemas/BlockSignature"
5799+
}
5800+
},
5801+
"session_id": {
5802+
"$ref": "#/components/schemas/TonHash"
5803+
},
5804+
"slot": {
5805+
"type": "integer",
5806+
"format": "int32"
5807+
},
5808+
"candidate": {
5809+
"$ref": "#/components/schemas/Bytes"
5810+
}
5811+
},
5812+
"required": [
5813+
"@type",
5814+
"id",
5815+
"signatures",
5816+
"session_id",
5817+
"slot",
5818+
"candidate"
5819+
]
5820+
},
5821+
"MasterchainBlockSignatures": {
5822+
"oneOf": [
5823+
{
5824+
"$ref": "#/components/schemas/BlockSignatures"
5825+
},
5826+
{
5827+
"$ref": "#/components/schemas/BlockSignaturesSimplex"
5828+
}
5829+
],
5830+
"discriminator": {
5831+
"propertyName": "@type",
5832+
"mapping": {
5833+
"blocks.blockSignatures": "#/components/schemas/BlockSignatures",
5834+
"blocks.blockSignatures.simplex": "#/components/schemas/BlockSignaturesSimplex"
5835+
}
5836+
}
5837+
},
57775838
"ShardBlockProof": {
57785839
"type": "object",
57795840
"additionalProperties": false,

0 commit comments

Comments
 (0)