Skip to content

Tun #1666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 152 commits into
base: testnet-tunnel
Choose a base branch
from
Open

Tun #1666

wants to merge 152 commits into from

Conversation

xssnick
Copy link
Contributor

@xssnick xssnick commented May 12, 2025

No description provided.

EmelyanenkoK and others added 30 commits March 5, 2025 17:21
* Ignore clangd .cache directory

With the in-tree build, clangd likes to put its cache files inside of
/.cache. Thus, put the directory to .gitignore.

* Remove redundant cmake_minimum_required calls

There is no need to repeat the same information in all subprojects, the
call in the root CMakeLists.txt is more than enough.

* Bump minimum CMake version to 3.16

This avoids deprecation warnings on newer CMake versions. 3.16 was
chosen as a version easily available on Ubuntu 20.04 -- the oldest
distributive we support.

* Do not automatically add -stdlib=libc++ when sanitizers are requested

In my experience, adding -stdlib=libc++ during compilation of a project
with C++ dependencies which are not consistently using libc++ never
works. In this particular case, modern enough stdlibc++ works just fine
when compiled with Clang and sanitizers, while using libc++ results in
obscure linker errors.

* Do not fall back to -O2 if CMAKE_BUILD_TYPE == RelWithDebInfo

* Use CMAKE_{C,CXX}_COMPILER_LAUNCHER for enabling ccache

Additionally, if user has already specified either of these two
variables, don't override their choices.

As per documentation, RULE_LAUNCH_{COMPILE,LINK} are only supposed to be
used in internal CMake code. More importantly, the previous approach
appended ccache two times if CMAKE_CXX_COMPILER_LAUNCHER was provided in
command line or via an environment variable.

* Remove unused crypto/openssl/digest.h
Along with hex 0x, 0b is also parsed.
Example: 0b1010101010101010 == 43690.
Trailing comma is now allowed in:
* tensors
* tuples
* function calls
* function parameters

Note, that `(5)` is not a tensor, it's just integer `5`.
With a trailing comma `(5,)` it's still `(5)`.
Introduces fixed-size integer types:
* intN for signed integers (0 < N ≤ 256)
* uintN for unsigned integers (0 < N ≤ 257)

The generic `int` type remains unchanged and can be
implicitly cast to and from any `intN`.
* arithmetic operations on `intN` degrade to `int`
* numeric literals (like 0, 100) are just `int`
* direct assignment between `intN` and `intM`
  is disallowed (as a probable error)

There is no runtime overflow. A variable is declared as `int8`
can hold any 257-bit value during execution.
Overflow will occur when packing to a cell (in the future).
Constant evaluator has been rewritten to utilize
type inferring mechanism. Now,
> const a = 1 as int8;
is valid, and constants can not only be int/slice, but
also intN/uintN and bool.
A new compile-time function is introduced.
It converts a constant floating-point string to nanotoncoins.
Example: `ton("0.05")` is equal to 50000000.
It requires a constant string; `ton(some_var)` is an error.

Type of its return value is `coins`, not `int`.
Like `intN`, it's backed by a general int at TVM level,
all arithmetics (except addition) degrade to int.
Type `coins` will be serialized as varint16 in the future.
Their purpose is exactly like `intN`: future serialization,
to specify fixed-size binary fields (like TL/B bits256).

Note, that unlike intN, explicit casting is required.
> fun calcHash(raw: bits512) { }
> calcHash(someSlice); // error
> calcHash(someSlice as bits512); // ok
This commit reorganizes tests for the compiler.
Before, they all were places in a single folder.
Now, they negative tests are separated.
Negative tests are named just `err-XXXX`, for quick
file search in IDE.

Tolk-tester can now execute tests by "contains" pattern:
> tolk-tester tests catch
will find "tests/**/*catch*.tolk"
With the introduction function `ton("0.05")`, I decided to
remove old FunC-style string postfixes "..."c, "..."H, etc.
in favor of a clearer and more flexible approach.

"..."c -> stringCrc32("...")
no way -> stringCrc16("...")
"..."H -> stringSha256("...")
"..."h -> stringSha256_32("...")
"..."a -> stringAddressToSlice("...")
"..."s -> stringHexToSlice("...")
"..."u -> stringToBase256("...")

These functions are compile-time only.
They can be used in constant initialization.
Tolk v0.10: preparing for serialization; types `intN`, `bytesN`, `coins`
SHA256_* family avoids a (gigantic) overhead of OpenSSL's EVP interface.
Locally, this gives 6% performance boost for block verification.
Implement SHA256 hasher using the deprecated SHA256_* function family
…h for tonlib (ton-blockchain#1557)

* Update stack_limit

* Added external-in normalized hash and increased stack depth for tonlib

* Removed debug logs
Whenever git watcher decides that the git state has changed, it spends
multiple seconds trying to retrieve information about this changed
state. This is incredibly annoying as it slows down edit-compile-run
cycle for no reason.
* Update collator.cpp

* Update Stack.fif

* Update parse-func.cpp
…ain#1582)

* improve github actions by utilizing github cache and ccache.

* download libmicrohttpd from ftp

* minor fix

* no cache

* no cache 2

* no cache test 3

* with cache test 1

* with cache test 2

* test without gh cache

* test with gh cache
* celldb: version 2

- thread safe cache
- parallel commit
- multiple optimizations
- support of key-value merge operations
- improved tests and benchmarks
- in-memory version won't read from key value after start - uses vector in-memory table now
- use rocksdb::WALRecoveryMode::kTolerateCorruptedTailRecords - do not silently ignore errors during recovery

* celldb: add test for load nonexisting cell, test thread safeness of CellUsageTree, fixes

---------

Co-authored-by: birydrad <>
EmelyanenkoK and others added 30 commits June 12, 2025 08:41
Tolk v0.99: universal message composition
The parameter will be used in later commits to denote number of parts we
split archived shard states into.
For now, we only make implementation ready for them without changing
public API in any way. In particular, it is not possible to create a
split state or request it.
What are we, an enterprise?

More seriously, the commit makes it a responsibility of (indirect) users
of ArchiveManager to pass PersistentStateType. For now, we still
hardcode UnsplitStateType everywhere.
No functional change. This will make next commit easier to review.
This will allow us to omit preparePersistentState query in the future.
We introduce two additional ADNL requests that can be made between
nodes: downloadPersistentStateSliceV2 and getPersistentStateSizeV2. They
differ from "V1" versions by inclusion of "effective shard" parameter.
The parameter denotes a split account state if block.shard is a proper
ancestor of effective_shard. If block.shard == effective_shard, we treat
this as a request for split state header, and if it is 0 (or invalid),
we serve an unsplit state.

Old requests are wired to call V2 with effective shard set to 0.
* not always gh mac runners have nproc utility

* deprecate Ubuntu 20.04

* fix linking issues of portable tonlibjson.dylib

* Upgrade gh action win-2019->win-2022

* adjust gh path to MSVC
This way, we propagate hardcoding UnsplitStateType one layer up.
This is the actor which will merge separate parts of a persistent state
into a single one in the future commits.
... and let DownloadShardState do nothing with it.

With this commit, we are expecting DownloadShardState to pass correct
PersistentStateType from one side and are passing split depth from the
other side. So, only state merging in that single actor remains to be
done.
We don't yet store state parts in DB as this requires yet another
instance of "change every single actor in the observable universe".
This way, we don't need to keep full shard state at any point during
deserialization.
* Enable colored diagnostics

A well-known limitation of using ninja is that it requires the user to
pass -fcolor-diagnostics=always flag to the compiler to get colored
diagnostics. Starting from version 3.24, CMake can do this for us if we
set CMAKE_COLOR_DIAGNOSTICS flag to a truthful value.

* Add CMake option to disable GDB backtrace on fatal signal

Backtraces we produce are very verbose and somewhat useless. They also
are sometimes so long that they fill all of terminal scrollback and hide
the actual error.

* Add an off-by-default CMake option for using LLD as a linker

Using LLD gives a 3-fold link-time improvement on my machine.
* SmartContract: try fetch config from c7 if it's not set

* feat: Added tvm_emulator_emulate_run_method clone with logs available

* free

* fix cast warning

* bf

---------

Co-authored-by: Marat S <[email protected]>
Co-authored-by: Yma Het <[email protected]>
…#1653)

* celldb: version 2

- thread safe cache
- parallel commit
- multiple optimizations
- support of key-value merge operations
- improved tests and benchmarks
- in-memory version won't read from key value after start - uses vector in-memory table now
- use rocksdb::WALRecoveryMode::kTolerateCorruptedTailRecords - do not silently ignore errors during recovery

* celldb: add test for load nonexisting cell, test thread safeness of CellUsageTree, fixes

* Cache validator sets for create_shard_state

* Permanent celldb, improve importing archive slices, new flags for validator-engine

* Fix persistent state lookup

* Tool for generating liteserver desc for global config

* Import proof for initial block

* Perf timer for archive import

* Do not recompute validator set in MasterchainStateQ::mc_reinit

This does not improve performance (as unpack_validator_set result is
cached regardless) but makes the code clearer.

* Remove debug logs

* Fix downloading initial proof

* Fix error processing in CellDbIn::store_block_state_permanent_bulk

* Improve some logs

---------

Co-authored-by: birydrad <>
Co-authored-by: Dan Klishch <[email protected]>
* not always gh mac runners have nproc utility

* deprecate Ubuntu 20.04

* fix linking issues of portable tonlibjson.dylib

* bind libgsl and libblas into portable binaries
…#1685)

* not always gh mac runners have nproc utility

* deprecate Ubuntu 20.04

* fix linking issues of portable tonlibjson.dylib

* add dht-ping-servers and dht-resolve utilities to artifacts

* test gh builds

* minor win fix

* minor win fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.