* Accelerator: partial fullnodes
1) Node can monitor a subset of shards
2) New archive slice format (sharded)
3) Validators are still required to have all shards
4) Support partial liteservers in lite-client, blockchain explorer, tonlib
5) Proxy liteserver
* Fix compilation error
This is a very big change.
If FunC has `.methods()` and `~methods()`, Tolk has only dot,
one and only way to call a `.method()`.
A method may mutate an object, or may not.
It's a behavioral and semantic difference from FunC.
- `cs.loadInt(32)` modifies a slice and returns an integer
- `b.storeInt(x, 32)` modifies a builder
- `b = b.storeInt()` also works, since it not only modifies, but returns
- chained methods also work, they return `self`
- everything works exactly as expected, similar to JS
- no runtime overhead, exactly same Fift instructions
- custom methods are created with ease
- tilda `~` does not exist in Tolk at all
- split stdlib.tolk into multiple files (tolk-stdlib/ folder)
(the "core" common.tolk is auto-imported, the rest are
needed to be explicitly imported like "@stdlib/tvm-dicts.tolk")
- all functions were renamed to long and clear names
- new naming is camelCase
Lots of changes, actually. Most noticeable are:
- traditional //comments
- #include -> import
- a rule "import what you use"
- ~ found -> !found (for -1/0)
- null() -> null
- is_null?(v) -> v == null
- throw is a keyword
- catch with swapped arguments
- throw_if, throw_unless -> assert
- do until -> do while
- elseif -> else if
- drop ifnot, elseifnot
- drop rarely used operators
A testing framework also appears here. All tests existed earlier,
but due to significant syntax changes, their history is useless.
Since I've implemented AST, now I can drop forward declarations.
Instead, I traverse AST of all files and register global symbols
(functions, constants, global vars) as a separate step, in advance.
That's why, while converting AST to Expr/Op, all available symbols are
already registered.
This greatly simplifies "intermediate state" of yet unknown functions
and checking them afterward.
Redeclaration of local variables (inside the same scope)
is now also prohibited.
Several related changes:
- stdlib.tolk is embedded into a distribution (deb package or tolk-js),
the user won't have to download it and store as a project file;
it's an important step to maintain correct language versioning
- stdlib.tolk is auto-included, that's why all its functions are
available out of the box
- strict includes: you can't use symbol `f` from another file
unless you've #include'd this file
- drop all C++ global variables holding compilation state,
merge them into a single struct CompilerState located at
compiler-state.h; for instance, stdlib filename is also there
A new lexer is noticeably faster and memory efficient
(although splitting a file to tokens is negligible in a whole pipeline).
But the purpose of rewriting lexer was not just to speed up,
but to allow writing code without spaces:
`2+2` is now 4, not a valid identifier as earlier.
The variety of symbols allowed in identifier has greatly reduced
and is now similar to other languages.
SrcLocation became 8 bytes on stack everywhere.
Command-line flags were also reworked:
- the input for Tolk compiler is only a single file now, it's parsed, and parsing continues while new #include are resolved
- flags like -A -P and so on are no more needed, actually
As it turned out, PSTRING() created a buffer of 128K.
If asm_code exceeded this buffer, it was truncated.
I've just dropped PSTRING() from there in favor of std::string.
All changes from PR "FunC v0.5.0":
https://github.com/ton-blockchain/ton/pull/1026
Instead of developing FunC, we decided to fork it.
BTW, the first Tolk release will be v0.6,
a metaphor of FunC v0.5 that missed a chance to occur.
The Tolk Language will be positioned as "next-generation FunC".
It's literally a fork of a FunC compiler,
introducing familiar syntax similar to TypeScript,
but leaving all low-level optimizations untouched.
Note, that FunC sources are partially stored
in the parser/ folder (shared with TL/B).
In Tolk, nothing is shared.
Everything from parser/ is copied into tolk/ folder.
* Parallel write in celldb
* Add TD_PERF_COUNTER to gc_cell and store_cell
* More error handling
* Tests for prepare_commit_async
* Install g++11 for ubuntu 20.04
---------
Co-authored-by: SpyCheese <mikle98@yandex.ru>
* getactorstats query for validator-engine-console
* celldb in-memory mode (--celldb-in-memory option)
* rldp2: bugfix - do not estimate speed while nothing is sent
* add simple ed25519 benchmark
* fix compilation errors of different platforms and move to c++20
* fix some warnings
* turn on TON_USE_ABSEIL for glibc 2.27 nix build
---------
Co-authored-by: birydrad <>
This commit contains some parts of https://github.com/ton-blockchain/ton/tree/accelerator
This is auxiliary code that mostly does not change node behavior.
1) Semiprivate overlays and other improvements in overlays code
2) Rename actual_min_split -> monitor_min_split, fix building shard overlays
3) Loading block candidates by block id from DB, fix accept_block after validator restart
4) Cells: ProofStorageStat and changes in CellUsageTree
5) Remove some unused code, other minor changes
* add github action for macOS 14 (arm64, M1)
* add github action (portable) for macOS 14 (arm64, M1)
* rename macOS arm64 output artifact
* Update libsodium on windows
* Compile libsodium
* Update build-windows.bat
* use upgraded libsodium 1.0.20; use compiled static libsodium for Windows instead of precompiled;
* revert libsodium 1.0.20; use compiled static libsodium for Windows instead of precompiled;
* use upgraded libsodium 1.0.20; use compiled static libsodium for Windows instead of precompiled;
* fix libsodium version 1.0.19; use compiled static libsodium for Windows instead of precompiled;
* try 1.0.20 libsodium precompiled on github
* try 1.0.18 libsodium precompiled on github
* try windows build on win server 2019
* and use PlatformToolset=v142
* use cmake -G "Visual Studio 16 2019"
* fix path to msvc 2019 on github
* separate github windows build on win server 2019 and build on win server 2022
* Update assembly/native/build-windows-2019.bat
add retry mechanism
Co-authored-by: Dr. Awesome Doge <doge@ton.org>
* add test-emulator; disable test groovy pipeline
* trigger all gh actions
* fix win build
* call test-emulator
* remove usage of rocksdb in fift-lib
* put back some code for test-db
* fix test-emulator
* remove usage of db-path parameter in fift
* some func adjustments
* fix checkout of openssl in fift-func-wasm-build-ubuntu.sh
* typo
* improve wasm build script for quicker turn around
* remove sENVIRONMENT=web,worker for funcfiftlib. will be added later.
* remove sENVIRONMENT=web,worker for funcfiftlib. will be added later.
* remove sENVIRONMENT=web,worker for funcfiftlib. will be added later.
* minor adjustments
* remove -d option in fift; optimize fift-lib usage
* reduce tondb usage
---------
Co-authored-by: neodiX <neodix42@ton.org>
Co-authored-by: Dr. Awesome Doge <doge@ton.org>
Co-authored-by: ms <dungeon666master@protonmail.com>
* Set collator options from validator console
* Fix compilation error in manager-disk
* Defer all messages if out msg queue is too big
* Fix checking queue size in collator
---------
Co-authored-by: SpyCheese <mikle98@yandex.ru>
* Deferred messages and msg metadata
* Store out msg queue size in state
* Add checks for queue processing
1. Collator must process at least one message from AccountDispatchQueue (unless block is full)
2. The first message from a transaction is not counted, it cannot be deferred (unless AccountDispatchQueue is not empty)
* Return msg metadata from LS in listBlockTransactions[Ext]
* Enable new features by capabilities
* Changes in deferred messages
* Process deferred messages via new_msgs in collator
* Rework setting deferred_lt, bring back check_message_processing_order, check order of deferred_lt in validator
* Use have_unprocessed_account_dispatch_queue_ in collator
* Fix setting transaction lt for deferred messages
* Fix lite-client compilation error
* Changes in process_dispatch_queue, rename deferred_lt -> emitted_lt
* Fix compilation error
* Use uint64 for msg queue size
* Add liteServer.getBlockOutMsgQueueSize
* Fix compilation error
* Fix typos in comments
---------
Co-authored-by: SpyCheese <mikle98@yandex.ru>
* add github action for macOS 14 (arm64, M1)
* add github action (portable) for macOS 14 (arm64, M1)
* rename macOS arm64 output artifact
* Colon cannot be used as a path separator for FIFTPATH or -I argument in fift on Windows when absolute paths are used (e.g. C:\path\lib:C:\path\smartcont).
Suggestion to use @ as a new path separator on Windows.
---------
Co-authored-by: neodiX <neodix42@ton.org>