1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-12 03:05:48 +00:00
Commit graph

862 commits

Author SHA1 Message Date
EmelyanenkoK
2a68c8610b
Merge pull request #1516 from ton-blockchain/fix-ls-capabilities
Fix get_prev_blocks_info() at LS getConfigParams [does not affect validators]
2025-02-06 11:32:01 +03:00
Marat S
aef538114a Fix get_prev_blocks_info() at LS getConfigParams 2025-02-06 11:29:55 +03:00
EmelyanenkoK
050a984163
Merge pull request #1512 from ton-blockchain/testnet
Merge developer branch
2025-02-04 12:27:03 +03:00
EmelyanenkoK
3c245c6146
Add forgotten highload-v2 to unlock (#1511) 2025-02-03 11:16:44 +03:00
neodix42
c7271d97ae
Add smartcont+lib folders to release (#1508)
* add folders smartcont and lib only to release for having a small download link

* allow usage of patter in file name

* upgrade upload-release-action@v2 to v3

* Revert "upgrade upload-release-action@v2 to v3"

This reverts commit 516126084a.

* use gh cli for upload smartcont_lib

* use gh cli for upload smartcont_lib

* gh requires gh_token

* clean up
2025-02-03 11:16:11 +03:00
EmelyanenkoK
e5feb76b90
Merge pull request #1503 from ton-blockchain/tolk-v0.8
Tolk v0.8: preparation for structures; indexed access `var.0`
2025-02-03 11:15:38 +03:00
tolk-vm
b1c9466df4
Suppress clang warning "ATOMIC_FLAG_INIT marked deprecated" (#1502)
In C++20, macro 'ATOMIC_FLAG_INIT' has been marked as deprecated.
We need still to use it to be able to compile for C++17.
For now, just suppress this warning.
2025-01-27 17:09:21 +03:00
tolk-vm
e9d8f1611b
[Tolk] Bump version to v0.8 2025-01-27 15:30:21 +03:00
tolk-vm
5b44e01455
[Tolk] Allow cell and slice be valid identifiers
They are not keywords anymore.
> var cell = ...;
> var cell: cell = ...;
Motivation: in the future, when structures are implemented, this obviously should be valid:
> struct a { ... }
> var a = ...;
Struct fields will also be allowed to have names int/slice/cell.
2025-01-27 15:30:21 +03:00
tolk-vm
7a1602f591
[Tolk] Support syntax tensorVar.0 and tupleVar.0
It works both for reading and writing:
> var t = (1, 2);
> t.0;      // 1
> t.0 = 5;
> t;        // (5, 2)

It also works for typed/untyped tuples, producing INDEX and SETINDEX.

Global tensors and tuples works. Nesting `t.0.1.2` works. `mutate` works.
Even mixing tuples inside tensors inside a global for writing works.
2025-01-27 15:30:21 +03:00
tolk-vm
565bc59735
[Tolk] Refactor: get rid of split_vars, construct valid LET ops
In FunC (and in Tolk before), tensor vars (actually occupying
several stack slots) were represented as a single var in terms
or IR vars (Ops):
> var a = (1, 2);
> LET (_i) = (_1, _2)

Now, every tensor of N stack slots is represented as N IR vars.
> LET (_i, _j) = (_1, _2)

This will give an ability to control access to parts of a tensor
when implementing `tensorVar.0` syntax.
2025-01-27 15:30:21 +03:00
tolk-vm
989629a832
[Tolk] Compiler built-in __expect_type() for testing purposes
Currently, tolk-tester can test various "output" of the compiler:
pass input and check output, validate fif codegen, etc.
But it can not test compiler internals and AST representation.

I've added an ability to have special functions to check/expose
internal compiler state. The first (and the only now) is:
> __expect_type(some_expr, "<type>");
Such a call has special treatment in a compilation process.
Compilation fails if this expression doesn't have requested type.

It's intended to be used in tests only. Not present in stdlib.
2025-01-27 15:30:21 +03:00
Marat
c720204199
Fix BUILD_SHARED_LIBS issue (#1496) 2025-01-27 14:34:21 +03:00
EmelyanenkoK
294db69227 Fix typos in changelog 2025-01-27 14:33:52 +03:00
EmelyanenkoK
6f1feb43d5 Update Changelogs 2025-01-27 12:58:54 +03:00
SpyCheese
8ffa3dd9dc
Fix printing TLB NatWidth (#1501) 2025-01-27 12:55:00 +03:00
Andrey Tvorozhkov
2a02b54786
Fix advance_ext (#746) 2025-01-27 12:22:00 +03:00
tuminzee
ed88f55a3d
fix broken link (#1497) 2025-01-27 10:35:56 +03:00
EmelyanenkoK
818a254126 Merge branch 'master' into testnet 2025-01-27 10:33:58 +03:00
Marat
99b78f78d7
build fix (#1495) 2025-01-27 10:20:20 +03:00
neodix42
7d9ef6e0bf
Fix wasm artifacts (#1499)
* put back emscripten 3.1.19

* add create-tolk-release.yml

* filter out master branch only
2025-01-27 10:18:51 +03:00
neodix42
59a8cf0ae5
create tolk release github action (#1490)
* add create-tolk-release.yml

* adjust create-tolk-release for old workflows

* use custom tag

* use old names

* use old names
2025-01-26 16:41:17 +03:00
Marat
e7e57f8e6d
add extra currencies support to emulator (#1494) 2025-01-26 16:39:05 +03:00
SpyCheese
da5644e758
Enable VmState::jump_to bugfix in version 9 (#1491) 2025-01-24 17:48:05 +03:00
Ivan Kalinin
0f6cf13d45
fix(vm): fix saving ret on deep jump (#1487) 2025-01-24 17:41:43 +03:00
EmelyanenkoK
fe46f0e238
Merge pull request #1482 from ton-blockchain/tvm-v9
Tvm v9
2025-01-22 11:13:49 +03:00
neodix42
e0605156de
Reworked TON portable artifacts (#1486)
* improve windows builds

* install nasm for openssl compilation on win

* install nasm for openssl compilation on win for github

* add create-state, proxy-liteserver, rldp-http-proxy, http-proxy, adnl-proxy, dht-server, libtonlibjson.so and libemulator.so to docker image

* build new artifacts inside Docker

* add files smartcont/auto/* to docker image

* build arm64 in docker branch build

* improve secp256k1 build

* adding natively portable binaries (all statically linked with libc++, without nixpkgs help) for x86-64 linux

* install missing headers on ubuntu 20.04

* use clang-16 on ubuntu 20.04

* remove gsl for portable artifacts; add -f key to generate-random-id in order to read addr_list from file;

* typo

* decode json

* decode json

* add github workflow for appimages creation

* add missing dependencies

* use libc++ for appimages artifacts

* typo

* appimages wihtout libc++

* appimages with libc++ and some checks

* add appimages to release (for testing)

* add appimages to release (for testing)

* add appimages to release (for testing)

* add appimages to release (for testing) 2

* add appimages to release (for testing) 3

* appimages only on ubuntu 22 with ssl-3 for now

* appimages only on ubuntu 20 with ssl-3 for now

* appimages only on ubuntu 20 with ssl-3 for now

* add export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}" to appimage AppRun

* create release

* appimages without jemalloc

* bind specific libraries to appimages

* add libreadline

* add plain portable libs

* add proper /lib/x86_64-linux-gnu/libreadline.so.8

* app images build with libc

* try to ensure ABI compatibility with older glibc

* try to ensure ABI compatibility with older glibc for shared libraries

* shared lib without libc but with D_GLIBCXX_USE_CXX11_ABI and -static-libgcc -static-libstdc++

* add -fPIC -fcommon

* add /lib/x86_64-linux-gnu/libstdc++.so.6 to static binaries

* add -static-libgcc -static-libstdc++ to libtonlibjson and emulator when PORTABLE=1

* add -static-libgcc -static-libstdc++ to libtonlibjson and emulator when PORTABLE=1

* update emulator portable

* Update CMakeLists.txt

* test portable macos binaries

* do not use -static-libgcc -static-libstdc++ on mac for shared libs

* do not use -static-libgcc -static-libstdc++ on mac for shared libs

* adjust create-release.yml

* minor fixes, typos

* minor fixes

* linux apps double check

* avoid infinite loop when place in system bin dir

* avoid infinite loop when place in system bin dir 2

* test compilation on linux arm64

* test appimages on arm64 linux

* test appimages on arm64 linux 2

* add portable linux arm64 to release

* clean up

* update README.md
2025-01-21 11:27:25 +03:00
SpyCheese
e42b0cba26 Merge branch 'testnet' into tvm-v9 2025-01-20 13:59:59 +03:00
EmelyanenkoK
1b7c46f496
Merge pull request #1477 from ton-blockchain/tolk-v0.7
Tolk v0.7: overhaul compiler internals and the type system; `bool` type
2025-01-20 12:31:03 +03:00
SpyCheese
a224491179
Fix error processing in StaticBagOfCellsDb (#1481) 2025-01-17 15:58:15 +03:00
SpyCheese
2d603f1f47 Adjust overridden gas limit 2025-01-17 12:46:58 +03:00
SpyCheese
77e5a2f4a2 Merge branch 'testnet' into tvm-v9 2025-01-17 12:32:09 +03:00
SpyCheese
d3485e42b9 Temporary increase gas limit for certain accounts 2025-01-17 12:26:53 +03:00
SpyCheese
710514b8f1
Validate Merkle proofs and updates in TLB validate (#1479)
* Validate Merkle proofs and updates in TLB validate

* Fix out-of-bound access in tl_jni_object.cpp
2025-01-16 09:42:05 +03:00
tolk-vm
2997c027a2
[Tolk] Bump version to v0.7
Totally, v0.7 will include:
- AST-level semantic kernel, transform AST to Ops directly
- fully rewritten type system, drop Hindley-Milner
- `bool` type support
2025-01-15 15:38:47 +03:00
tolk-vm
974d76c5f6
[Tolk] bool type (-1/0 int under the hood)
Comparison operators `== / >= /...` return `bool`.
Logical operators `&& ||` return bool.
Constants `true` and `false` have the `bool` type.
Lots of stdlib functions return `bool`, not `int`.

Operator `!x` supports both `int` and `bool`.
Condition of `if` accepts both `int` and `bool`.
Arithmetic operators are restricted to integers.
Logical `&&` and `||` accept both `bool` and `int`.

No arithmetic operations with bools allowed (only bitwise and logical).
2025-01-15 15:38:47 +03:00
tolk-vm
799e2d1265
[Tolk] Rewrite the type system from Hindley-Milner to static typing
FunC's (and Tolk's before this PR) type system is based on Hindley-Milner.
This is a common approach for functional languages, where
types are inferred from usage through unification.
As a result, type declarations are not necessary:
() f(a,b) { return a+b; } // a and b now int, since `+` (int, int)

While this approach works for now, problems arise with the introduction
of new types like bool, where `!x` must handle both int and bool.
It will also become incompatible with int32 and other strict integers.
This will clash with structure methods, struggle with proper generics,
and become entirely impractical for union types.

This PR completely rewrites the type system targeting the future.
1) type of any expression is inferred and never changed
2) this is available because dependent expressions already inferred
3) forall completely removed, generic functions introduced
   (they work like template functions actually, instantiated while inferring)
4) instantiation `<...>` syntax, example: `t.tupleAt<int>(0)`
5) `as` keyword, for example `t.tupleAt(0) as int`
6) methods binding is done along with type inferring, not before
   ("before", as worked previously, was always a wrong approach)
2025-01-15 15:38:43 +03:00
dbaranovstonfi
987c7ca04b
emulator: set libraries when libs is NOT empty (#1449)
Co-authored-by: dbaranov34 <baranov34@gmail.com>
2025-01-15 13:50:18 +03:00
SpyCheese
2ebc6d6a3c
Fix error processing in load_cell (#1467) 2025-01-15 10:45:04 +03:00
SpyCheese
62838571eb
Support extra currencies in reserve action with +2 flag (#1429)
* Support extra currencies in reserve action with +2 flag

* Enable new reserve behavior in version 9
2025-01-15 10:43:33 +03:00
Victor S.
f6fa986b33
Fix *DATASIZE* opcode log msg (#1465)
Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
2025-01-15 10:39:05 +03:00
crStiv
652f4f0141
Update Changelog.md (#1476)
Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
2025-01-15 10:36:46 +03:00
EmelyanenkoK
8b68210db7
Merge pull request #1475 from ton-blockchain/node-patch
Bugfixes in node and tonlib
2025-01-15 10:34:19 +03:00
SpyCheese
87c4b4a5d4 Fix handling small out-of-sync in validate-query 2025-01-13 17:41:50 +03:00
SpyCheese
cae9ccfacf Retry dht query in adnl-peer if peer does not respond for too long 2025-01-13 17:41:10 +03:00
SpyCheese
4ddb14c136 Fix double tilde for crc computation in tlbc 2025-01-13 17:40:16 +03:00
SpyCheese
dc2f0dad81 Add extra currencies to c7 in tonlib runGetMethod 2025-01-13 17:39:56 +03:00
tolk-vm
3540424aa1
[Tolk] AST-based semantic analysis, get rid of Expr
This is a huge refactoring focusing on untangling compiler internals
(previously forked from FunC).
The goal is to convert AST directly to Op (a kind of IR representation),
doing all code analysis at AST level.

Noteable changes:
- AST-based semantic kernel includes: registering global symbols,
  scope handling and resolving local/global identifiers,
  lvalue/rvalue calc and check, implicit return detection,
  mutability analysis, pure/impure validity checks,
  simple constant folding
- values of `const` variables are calculated NOT based on CodeBlob,
  but via a newly-introduced AST-based constant evaluator
- AST vertices are now inherited from expression/statement/other;
  expression vertices have common properties (TypeExpr, lvalue/rvalue)
- symbol table is rewritten completely, SymDef/SymVal no longer exist,
  lexer now doesn't need to register identifiers
- AST vertices have references to symbols, filled at different
  stages of pipeline
- the remaining "FunC legacy part" is almost unchanged besides Expr
  which was fully dropped; AST is converted to Ops (IR) directly
2025-01-13 20:28:44 +07:00
neodix42
46d4e12b4c
extend generate-random-id utility... (#1462)
* improve windows builds

* install nasm for openssl compilation on win

* install nasm for openssl compilation on win for github

* add create-state, proxy-liteserver, rldp-http-proxy, http-proxy, adnl-proxy, dht-server, libtonlibjson.so and libemulator.so to docker image

* build new artifacts inside Docker

* add files smartcont/auto/* to docker image

* build arm64 in docker branch build

* improve secp256k1 build

* extend generate-random-id with -f parameter (to read addr list from a file)
2025-01-07 19:15:51 +03:00
SpyCheese
0fff1bd8c7 Fix loading library cell in contract code 2024-12-18 12:57:21 +03:00