1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Bigger batch for tunnel write to debug

This commit is contained in:
Oleg Baranov 2025-02-26 14:39:18 +04:00
parent 6382cd3962
commit 73e01f6361
2 changed files with 21 additions and 3 deletions

View file

@ -149,3 +149,19 @@ Linux and MacOS binaries are available for both x86-64 and arm64 architectures.
## Running tests
Tests are executed by running `ctest` in the build directory. See `doc/Tests.md` for more information.
## Using ADNL tunnel
### Before node compilation
1. Clone https://github.com/ton-blockchain/adnl-tunnel and install golang 1.23 or newer
* `cd adnl-tunnel`
* `make library`
* It will build `libtunnel.a`
2. Copy `libtunnel.a` to ton src directory root (usually `/usr/src/ton`)
3. On the first step of ton node compilation run cmake with option `-DTON_USE_GO_TUNNEL=ON` to enable tunnel.
4. Build ton node as usual.
### Before startup
1. Create `tunnel-config.json` in any place.
2. Fill it with desired tunnel configuration and wallet keys. See example.
3Add `--tunnel-config /path/to/tunnel-config.json` argument to validator-engine startup command.

View file

@ -46,7 +46,7 @@ class UdpServerTunnelImpl : public UdpServer {
private:
td::Promise<td::IPAddress> on_ready_;
uint8_t out_buf_[(16+2+1500)*100];
uint8_t out_buf_[(16+2+1500)*300];
size_t out_buf_offset_ = 0;
size_t out_buf_msg_num_ = 0;
size_t tunnel_index_;
@ -85,8 +85,10 @@ void UdpServerTunnelImpl::send(td::UdpMessage &&message) {
out_buf_msg_num_++;
if (out_buf_msg_num_ == 3) {
if (out_buf_msg_num_ == 300) {
td::Timer timer;
WriteTunnel(tunnel_index_, out_buf_, out_buf_msg_num_);
LOG(ERROR) << "Sending messages by num " << out_buf_msg_num_ << " | " << timer.elapsed();
out_buf_offset_ = 0;
out_buf_msg_num_ = 0;
@ -98,7 +100,7 @@ void UdpServerTunnelImpl::alarm() {
if (out_buf_msg_num_ > 0 && Time::now()-last_batch_at_ >= 0.02) {
td::Timer timer;
WriteTunnel(tunnel_index_, out_buf_, out_buf_msg_num_);
// LOG(ERROR) << "Sending messages from alarm " << out_buf_msg_num_ << " | " << timer.elapsed();
LOG(ERROR) << "Sending messages from alarm " << out_buf_msg_num_ << " | " << timer.elapsed();
out_buf_offset_ = 0;
out_buf_msg_num_ = 0;