1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-12 19:22:37 +00:00
Commit graph

300 commits

Author SHA1 Message Date
EmelyanenkoK
ba03657617
Fix transaction credit phase (#797)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-11-03 17:05:43 +03:00
SpyCheese
030ebaf772 Change GASCONSUMED opcode to f807 2023-11-03 15:25:58 +03:00
SpyCheese
5847897b37
Various changes in TVM, github builds and tests (#793)
* Bugfixes in TVM and node

* Upgrade to C++17

* Improve GitHub builds

* Fix existing tests and partially integrate them into builds

---------

Co-authored-by: neodiX42 <namlem@gmail.com>
Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
2023-11-03 14:43:34 +03:00
SpyCheese
2bfa6240dd
Support wallet-v4 in tonlib (#785) 2023-10-25 12:20:23 +03:00
SpyCheese
cdf96a21d0
Do not retranslate external messages with wrong initstate (#778) 2023-10-12 14:54:14 +03:00
SpyCheese
41ed354b9f
Explicitly handle special cells in action list (#777) 2023-10-12 14:53:54 +03:00
EmelyanenkoK
ef306dd36e
Patch/fix ub (#724)
* Fix input validation in storage-manager and bitstring

* Fix potentially dangling pointer missing_library

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-07-14 15:25:07 +03:00
EmelyanenkoK
9b34217bf0
Tonlib fix (#743)
* Fix building messages with long body (#709)

* Fix returning slice in tonlib (#734)

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-07-14 15:23:22 +03:00
neodiX42
119f5a3ccc
fix wasm and repetitive builds (#735) 2023-07-14 14:49:02 +03:00
EmelyanenkoK
4b8e90f8fe
Adjust BLS gas prices (#738)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-07-05 14:03:19 +03:00
SpyCheese
961b895622 New tag for encrypted messages 2023-06-27 16:13:16 +03:00
SpyCheese
b4f4aa3ca7
Fix typo in BurningConfig (#721) 2023-06-05 17:22:13 +03:00
EmelyanenkoK
961d870ece
Patch getmethod for tvm upgrade (#714)
* Fix TVM version in emulator

* Add prev_blocks_info to emulator-emscripten.cpp

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-05-29 11:27:54 +03:00
EmelyanenkoK
6b941dcceb
Fix returning config from LS, add extra c7 elements in getmethods (#713)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-05-27 21:22:31 +03:00
EmelyanenkoK
9f93888cf4
TVM Upgrade (#686)
* New TVM instructions

* Remove PREVBLOCKS

* Separate target ton_crypto into TVM-related and -unrelared code

* Add fine for failed "send message"; rework SENDMSG

* Fix include

* Fix bugs, improve action fines

* Disable fines for special accounts

* Handle msg_balance_remaining.grams == null in transaction.cpp

* Bugfixes in SENDMSG

* Fix fee calculation in SENDMSG

* Fix CellStorageStat and transaction.cpp after merge

* SETBOUNCEONACTIONPHASEFAIL instruction

* ADDDIVMOD instructions

* RUNVM, RUNVMX instructions

* Changes in RUNVM

* Tests for adddiv and runvm

* HASHEXT instruction

* Improve opcode-timing

More iterations
Don't measure preliminary run
Remove logs and other excessive operations
Add "error" to output

* Increase RUNVM gas price

* Optimize HASHEXT, adjust gas price

* Add "bounce of action fail" flag to actions

* Stack operations with unlimited arguments

* Ristretto255 instructions

* Adjust gas consumption

* Optional fixed number of return values in RUNVM, fix exception handling

* Adjust gas consumption

* Simplify gas consumption logic

* Support of secp256k1 and sodium libraries in builds (#11)

* add support of secp256k1 library to the builds (linux, win)

* add support of secp256k1 library to the builds (linux, win)

* install secp256k1 via brew

* install libsodium via brew;
change sodium to upper case in FindSodium.cmake

* install libsodium via brew;
change sodium to upper case in FindSodium.cmake

* simplify FindSodium.cmake

* bug fixing

* bug fixing

* bug fixing

* add macro SODIUM_STATIC

* adjust build command for windows

* put back original FindSodium.cmake

* put back original FindSodium.cmake

* fix sodium unzipped path for windows;
add ninja

* fix sodium unzipped path for windows;
add ninja

* fix sodium unzipped path for windows;
add ninja

* Win32 github build for secp256k1

* x64 architecture github build for secp256k1

* fix sodium linking on linux

* enable docker buildx arm64 builds from forked repos

* enable docker buildx arm64 builds from forked repos

* enable docker buildx arm64 builds from forked repos

* adjust mac builds for secp2561k and sodium

* fix tonlib jni generation

* minor fix

* sync fixes across platforms

* add libsodium build script for android and precompiled static libraries

* build tonlib for android (fails)

* FindSodium uppercase

* remove system libsodium for android, use precompiled instead;
specify SECP256K1_INCLUDE_DIR fir mac 12.6

* uppercase sodium

* simplify FindSodium

* fix windows build sodium path;
use ninja for windows

* simplify sodium 2

* adjust windows sodium paths;
add paths to android jni

* add ninja build windows

* add ninja build windows

* add ninja build windows 2

* remove win ninja

* fix 1

* fix 2

* fix win 3

* fix linux compile 3

* fix jni 1

* fix jni 2 and mac

* fix jni 3

* fix jni 4

* fix jni 5

* fix mac 6

* fix mac 7 and jni paths

* fix jni 8

* rework sodium for android

* rework sodium for android

* rework sodium for android 2

* fixed sodium for android 2

* fixed sodium for android 3

* static secp256k1 for android

* add precompiled arm secp256k1

* add precompiled arm secp256k1

* build native-lib with secp256k1 x86-64 (non arm)

* update precompiled with NDK libsecp256k1.a

* update precompiled with NDK libsecp256k1.a

* update precompiled with NDK libsecp256k1.a

* refactor llvm-strip location

* refactor llvm-strip location

* add native-lib.so for armv7a, armv8a

* add native-lib.so for armv7a, armv8a

* test  armv7a, armv8a

* armv7a - fails linking on sodium, test -> armv8a

* works x86-64, armv7a - fails linking on sodium, armv8a - fails linking secp256k1 (incompatible with aarch64linux)

* update libpsec256k1, sodium static libs

* test x86 android native-lib

* test armv7 android native-lib

* test armv8 android native-lib

* x86_64 and arm64 android native-lib works

* x86_64 and arm64 android native-lib works

* x86_64 and arm64 android native-lib works

* test armv7 android native-lib

* test all android native-libs

* test all android native-libs

* test all android native-libs

* test all android native-libs - without SodiumAndroid

* test all android native-libs - with FindSodiumAndroid.cmake

* win, with Sodium via SODIUM_DIR

* win, with Sodium via SODIUM_DIR env

* win, with Sodium via SODIUM_DIR env

* win, with Sodium via SODIUM_DIR env and SODIUM_USE_STATIC_LIBS

* win, with Sodium via SODIUM_DIR, SODIUM_USE_STATIC_LIBS and SODIUM_INCLUDE_DIR

* android, with FindSodium

* android, with FindSodium with SODIUM_USE_STATIC_LIBS

* remove if not apple

* target_link_libraries(ton_crypto_core PUBLIC secp256k1)

* android SECP256K1_INCLUDE_DIRS

* android SECP256K1_INCLUDE_DIR

* add libsecp256k1.a/so pre-compiled with ubuntu 22 x86-64

* add libsecp256k1.a/so pre-compiled with ubuntu 22 x86-64

* sodium dirs

* sodium dirs

* sodium dirs

* remove NOT APPLE and SodiumAndroid

* add NOT APPLE and remove SodiumAndroid

* add NOT APPLE and remove SodiumAndroid

* remove build scripts for 18.04, reduce CMakeLists.txt

* remove build scripts for 18.04, reduce CMakeLists.txt

* Fix cas consumption during library load

* Fix fetch_config_params after merge

* Add all ADDDIVMOD ops to Asm.fif

* Save unpaid storage fee to due_payment

* Add "set prev blocks info" to emulator

* Adjusted builds  (#13)

* Update flake.nix

Add libsodium

* add libsecp256k1-dev and libsodium-dev into wasm build

* make back emulator a shared library;
put emulator to artifacts;
compile wasm artifacts with sodium and secp256k1.

* add secp256k1 to nix

* compile emulator statically with nix

* compile emulator statically with nix

* compile emulator lib statically with nix

* compile emulator lib statically with nix

* add libemulator to artifacts

* add shared libemulator library to artifacts

* minor release fix

* update set-output commands;
add recent_changelog.md

* releases fixes

* releases fixes, multiline

* releases fixes, multiline

* releases fixes, multiline

* put back multiline changelog

* put back multiline changelog

* ConfigParam 19 (global-id) and GLOBALID instruction

* Fix gas consumption in HASHEXT

* Add blst library

* Add bls instructions

* Allow passing long code to opcode-timing

* Add bls testcase

* More BLS instructions

* Fix tests, add bls tests

* Add more bls tests

* Improve some bls operations

* Adjust some BLS gas prices

* Adjust BLS gas prices

* Enable __BLST_PORTABLE__ flag only if PORTABLE flag is set

* Add tests for BLS_PAIRING

* GASCONSUMED instruction

* Fix compilation against docker with blst library; (#14)

* fix compilation against docker with blst library;
add precompiled libblst.a to android builds

* minor fix

* Adjust BLKSWX gas

* Fix comparison with NAN

* Allow arbitrary integers for scalars in ristretto multiplication, fix test

* Adjust nix builds according to PR 694 (#15)

* integrate and test PR-694

* integrate and test PR-694, test 2

* Add P256_CHKSIGN (secp256r1)

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
Co-authored-by: neodiX42 <namlem@gmail.com>
2023-05-24 21:14:13 +03:00
Marat
d6b11d9d36
build fix (#707) 2023-05-24 16:09:29 +03:00
Marat
86623b4cea
Enable more verbose TVM stack dump (#669)
* Verbose stack dump

* Move vm::VmLog::DumpStack and vm::VmLog::DumpStackVerbose to the next verbosity levels
2023-05-24 12:39:15 +03:00
EmelyanenkoK
ef64b92f08
Add fee burning and blackhole address (#703)
* Fix tlbc crash

* Burn specified fraction of fees

* Add "blackhole" for burning TONs

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-05-18 11:26:02 +03:00
SpyCheese
dad980ed09
Fix STSLICECONST, bump Asm.fif version to 0.4.4 (#700) 2023-05-15 16:35:23 +03:00
EmelyanenkoK
583178ccb1
FunC: enable asserts and fix try/catch stack corruption (#699)
* FunC: enable asserts in Release

* FunC: Fix analyzing infinite loops

* FunC: Allow catch with one tensor argument

* FunC: Fix try/catch stack corruption

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-05-15 15:31:42 +03:00
SpyCheese
5abfe2337e
Catchain improvements (#698)
* Fix "sgn" in fift; fix marking infinite loops as noterurn in func

* TON-P1-1: Remove unused catchain queries

* TON-P1-15: Avoid synchronization with self

* TON-P1-3, TON-P1-17: Disallow more than one candidate per src per round (to prevent flood), add checks to process_broadcast

* TON-P1-10: Fix fast/slow attempts

* TON-P1-14: Add named constants

* TON-P1-18, TON-P1-19: Alloc temporary memory in the same way as persistent memory

* TON-P1-20: Add comment to choose_blocks_to_approve

* TON-P1-16: Avoid creating two catchain blocks on need_new_block

* TON-P1-8: Add some validation to validator-engine parameters

* TON-P1-6: Don't allow sending the same block many times

Many requests for the same block are not unusual (however, there's no need to answer them all)

* TON-P1-2: Enable prohibiting dependencies from blamed nodes (2.7.5 in CatChain doc), fix processing blame proofs

* Best practices

bp-6: Fix incorrect warning
bp-7: Remove unused code
bp-8: Bring back PerfWarningTimer logging (only when no callback)
bp-9: Remove unnecessary condition
bp-11: Remove commented-out code
bp-13: Divide code in validator-session-state
Adherence to Specification: Fix typo
2023-05-10 12:57:57 +03:00
EmelyanenkoK
1696ebfa20
Account for unprocessed messages in estimate_block_size; check consensus_config limits in collator (#692)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-05-04 14:45:42 +03:00
EmelyanenkoK
a78adf3062
Increase limit for t_Block.validate, simplify validating StateInit (#691)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-05-03 14:18:18 +03:00
EmelyanenkoK
5606418234
FunC: Prohibit unifying tensors and "forall" vars (#684)
* FunC: Prohibit unifying tensors and "forall" vars

* Bump funC version to 0.4.4

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-04-27 10:23:04 +03:00
EmelyanenkoK
8b0d6a2665
Add WASM FunC autotests (#673)
* feat: func wasm autotests

* fixes necessary for func wasm autotests

---------

Co-authored-by: krigga <krigga7@gmail.com>
2023-04-19 21:29:41 +03:00
Ilyar
8d919a5db9
add missing VM opcode definition (#670) 2023-04-19 20:09:15 +03:00
EmelyanenkoK
fd4c512de5
Move JettonBridge config num for BNB, Polygon 2023-04-17 15:54:33 +03:00
EmelyanenkoK
6ddcac68ad
Add notes on mainnet version to config-code 2023-04-10 09:32:49 +03:00
EmelyanenkoK
e3af63e6c0
Fix PUSHSLICE for some unfortunate slice lengths 2023-04-04 18:26:02 +03:00
EmelyanenkoK
8eb167b76a
Fix FunC UB (#656)
* Fix UB in func

* Improve optimizing int consts and unused variables in FunC

* Bump funC version to 0.4.3

* Fix analyzing repeat loop

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-04-03 10:13:39 +03:00
krigga
f51eb2d747
Add debug enabled flag to transaction and TVM emulator (#662)
* Add debug enabled flag to transaction and TVM emulator

* Set debug_enabled false in Emulator constructor
2023-04-02 17:28:18 +03:00
SpyCheese
eabcb6a8e9
Better error handling in stack serialization (#664) 2023-04-02 17:27:31 +03:00
SpyCheese
5e0dadfff6
Rollback celldb optimization (#658) 2023-03-30 10:03:05 +03:00
SpyCheese
9be3701bc0
Don't delete accounts with extra currencies (temporary) (#659) 2023-03-30 10:02:15 +03:00
EmelyanenkoK
47311d6e0e
Improve tweaking for high throughput (#610)
* Option "--disable-ext-msg-broadcast"

* "Get shard out queue size" query

* Move disabling ext msg broadcasts from command-line arguments to config

* Fix compilation error

* Asynchronous store_cell and gc in celldb

* Make GC in celldb work evenly over time

* Increase timeouts for downloading blocks

* Reuse blocks from previous rounds in validator session

* Use Rldp2 in FullNode for downloading persistent states and archives

* Improve logs in download-archive-slice and download-state

* Decrease delay between serializing shards

* Make CellDbIn::load_cell synchronous to avoid interfering with store_cell

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-03-15 10:47:35 +03:00
EmelyanenkoK
9b3f9e4ac1 Add Licenses to funC stdlib 2023-03-14 21:29:33 +03:00
EmelyanenkoK
7da30e1e7f
Add PRNG with normal distribution to mathlib.fc (#646)
* Add random with normal distribution

* Fix hex arguments in mathlib testcases
2023-03-13 16:49:30 +03:00
SpyCheese
4d5ded5761
Asm.fif improvements (#631) (#645)
* Asm.fif improvements (#631)

Add missing opcodes, CUSTOMOP, disallow 256 PUSHPOW256, recursive PROGRAM, require-asm-fif-version

* Fix nested PROGRAM, add test

* Simplify require-asm-fif-version

---------

Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
2023-03-13 16:48:48 +03:00
EmelyanenkoK
fbb1e548f7
Fix msg_cell on stack for SmartContract::send_*_message (#647)
* Fix msg_cell on stack for SmartContract::send_*_message

* Fix src address in SmartContract::send_internal_message
2023-03-13 16:46:54 +03:00
EmelyanenkoK
865ebfce8d
Add namespaces to Fift (#641)
* Add fift-based disassembler

* Fift improvements: namespaces, hashmaps, flow controls

* Fift: add lib with better block structuring and more

* Minor changes in fift HashMap + tests (#643)

* Minor changes in fift HashMap

* Add tests for extended fift

---------

Co-authored-by: OmicronTau <omicron@ton.org>
Co-authored-by: Tolya <1449561+tolya-yanot@users.noreply.github.com>
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-03-10 14:16:29 +03:00
Dan Volkov
4590ed381b
Make funcfiftlib compilation compatible with modern compilers (#618)
* wip: make funcfiftlib compilation compatible with modern compilers

* wip: add methods needed for another compiler

* fix: tdutils port config if emscripten

* feat: func source and realpath callback

* fix: invalid fift compilation exceptions

---------

Co-authored-by: krigga <krigga7@gmail.com>
2023-03-09 17:37:15 +03:00
Marat
078aabe50e
Add method listBlockTransactionsExt to liteserver (#399)
* Verify proof for method blocks.getTransactions

* check completeness of response

* fix start_lt

* fix mode & 128, check bTxes->ids_ out of bounds

* Improve gitactions; separate cpp-check (#346)

* Use ninja build tool and compile blockchain-explorer

Ninja builds TON much faster;

* Use clang instead of gcc

* remove blockchain-explorer

since target not found on github action

* move ccpcheck to other gitaction

* run nativelib-java only against wallets branch for now

* rename gitaction

* Update windows2019x64-tonlib-java.yml

* Update windows2019x64-tonlib-java.yml

* Update macos-10.15-tonlib-java.yml

* Update windows2019x64-tonlib-java.yml

* Update windows2019x64-tonlib-java.yml

* rebase

* update tlo's

* Revert "Improve gitactions; separate cpp-check (#346)"

This reverts commit bd1d96e6d391e48840d81cfcf10d2692848e504e.

* add checks, simplify ls response

* Revert workflows

* Add verifying proofs

* fix win build

---------

Co-authored-by: neodiX42 <namlem@gmail.com>
2023-03-07 19:49:25 +03:00
EmelyanenkoK
a00744730e Merge branch 'testnet' of https://github.com/ton-blockchain/ton into testnet 2023-03-06 14:04:13 +03:00
EmelyanenkoK
04d4ae2dec Add version printing to legacy tester 2023-03-06 14:03:29 +03:00
Behrang Norouzinia
16e5433981
Fix bug in docs for storing and loading coins (#617)
Coins are 120-bit integer, not 128-bit.

Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
2023-03-05 14:15:37 +03:00
EmelyanenkoK
d9eb0bbd3b
Add func mathlib (#633) 2023-03-04 19:17:39 +03:00
EmelyanenkoK
c2c9a93916
Bump funC version to 0.4.2 2023-03-03 10:33:22 +03:00
SpyCheese
308dcc9206
Fix CE (#627) 2023-02-28 12:45:49 +03:00
SpyCheese
706be23c83
Limit maximal Merkle depth (#626) 2023-02-28 12:06:57 +03:00
SpyCheese
0578cb4a42
Fix typos, UBs and warnings (#625) 2023-02-28 12:06:09 +03:00
neodiX42
5a47495d87
Add cross-platform Linux and macOS binaries (statically compiled with NixPkgs) + wasm artifacts (#621)
* fix build

* nix flake

* nix package

* static musl build env

* make all builds in static env

* GH Actions nightly and static workflows

* deb package

* cmake install {adnl-proxy,blockchain-explorer,create-state,http-proxy,rldp-http-proxy,storage-cli}

* nix flake: add static glibc build variant

* GH Actions: deb-nightly-{musl,glibc_static}, tests-rolling jobs

* rpm package

* build blockchain-explorer

* GH Actions: deb_rpm-nightly: ubuntu-{latest=>22.04}

* crypto/pow-miner: skip install

* ghactions: tests-rolling: show tests run, progress

* ghactions: deb_rpm-nightly: add manual trigger [skip ci]

* nix flake refactor

* find_package=>pkg-config(zlib)

FindZLIB.cmake can't find static zlib prior to CMake 3.24, so use
pkg-config.

* nix old glibc build

* nix aarch64 support

* packages: Populate APT and RPM repos at ton-repo

- {deb,rpm}.sh: Separate build and install dirs
- rpm.sh: Conditionally include lib/
- Accomodate local CI runs w/act

* [skip ci] README packages

* fix aarch64 build -Wnoerror=address

* [skip ci] rpm set releasever

* [skip ci] document local packages upload

* m1 build: gate cpu=apple-m1 by clang version

* packages: Ship musl binaries + old glibc dylibs

* packages: macos build

* nix: bump nixpkgs

* fix windows CI build

* [skip ci] nix: static aarch64 builds

* packages: deb,rpm multiarch

* ghactions: aarch64 musl deb,rpm build

* [skip ci] deb build: deref source links, -x

* [skip ci] nix darwin static build

* [skip ci] nix common hostPkgs

* [skip ci] brew: move formula over to homebrew-ton-repo

* [skip ci] nix fix aarch64-linux build

* [skip ci] ghactions: nix use GITHUB_TOKEN

* [skip ci] Move from ton-repo to gh releases

* [skip ci] ghactions aarch64-darwin self-hosted runner

* [skip ci] ghactions deb,rpm nightly 10h timeout

* [skip ci] fix brew install

fixes
Errno::EACCES: Permission denied @ dir_s_mkdir - /private/tmp/ton-XXX/bin/.brew_home

* [skip ci] ghactions deb,rpm nightly: don't upload ton-packages as we gh release them later

* [skip ci] README: brew instructions

* [skip ci] nightly linux binaries release

* [skip ci] packages: ship macos dylib

* [skip ci] ghactions: Run Windows build nightly, upload to gh releases

* nix: remove defaultPackage, switch to different oldglibc build method

We used to rebuild nixpkgs-stable with old glibc, which broke on aarch64
due to its particular bootstrap toolchain. This just takes nixos 19.09's
version of GCC but new dependencies, sidestepping the issue.

* fix rpm release, add aur release

* fix local (act) ci run

* ghactions: linux-nightly: Print out SSH public keys

* ghactions: bump cachix actions

* nix: default devShell

* [skip ci] rpm,aur: Ship lib

* [skip ci] packages: windows: Remove CMake files from out

* [skip ci] packages: Import chocolatey package

* fixup! fix rpm release, add aur release

* [skip ci] packages: aarch64-linux: build dylib as well

* [skip ci] ghactions: run on self-hosted

* [skip ci] ghactions: windows-nightly: Bump nodejs actions

* [skip ci] nix: Only add Linux packaging tools on Linux

* [skip ci] doc: document direct download binaries in README

* fix tonlib android jni ci

* fixup! fix tonlib android jni ci

* [skip ci] ghactions: Update GH release dates

Errata: doesn't update tags.

* [skip ci] ghactions: Fix racy brew gh release by splitting arch

* initiali commit - binaries only

* fixes

* fixes

* fixes

* fixes

* remove packages dir for now

* add storage-daemon storage-daemon-cli

* fix emulator

* try macos aarch64

* try macos aarch64

* try macos aarch64

* try macos aarch64

* try macos aarch64

* try macos aarch64

* try macos aarch64

* try macos aarch64

* try macos aarch64

* try macos aarch64

* try macos aarch64 sh

* try macos aarch64 sh

* try macos aarch64 bash

* try macos aarch64 bash

* try macos aarch64 bash

* try macos aarch64 bash

* try macos aarch64 bash

* try macos aarch64 bash

* try macos aarch64 bash

* fix funcfiftlib compilation with emscripten

* fix funcfiftlib compilation with emscripten

* add github action to compile TON with emscripten

* add github action to compile TON with emscripten

* add github action to compile TON with emscripten

* add github action to compile TON with emscripten

* add github action to compile TON with emscripten

* add github action to compile TON with emscripten

* try macos aarch64

* fix funcfiftlib compilation with emscripten

* fix funcfiftlib compilation with emscripten

* add github action to compile TON with emscripten

* disable aarch64 github actions for now

* disable aarch64 github actions for now

* trigger all GH actions

* trigger all GH actions 2

* trigger all GH actions 3

* trigger all GH actions 4

* trigger all GH actions 5

* put back rldp-http-proxy to win build

* put back rldp-http-proxy to win build

* dont use pkgConfig for zlib

* fix zlib_library

* use BUILD_SHARED_LIBS flag for static compilation

* test 1

* test 2

* add wasm binaries to release.
test 3

* add simple binaries' execution test

* build emulator-emscripten

* build and add into artifacts wasm tlbc and emulator-emscripten

* build and add into artifacts wasm tlbc and emulator-emscripten, 2

* build and add into artifacts wasm tlbc and emulator-emscripten, 3

* build and add into artifacts wasm tlbc and emulator-emscripten, 4

* build emulator-emscripten with static libs

* minor nix mac aarch64 fix

* add single artifacts to release

* bypass $repo to Dockerfile

* add wasm artifacts to release

* add wasm artifacts to release

* add wasm artifacts to release

* add wasm artifacts to release

* add more artifacts to release; remove compilation against Ubuntu 18.04.

* retrieve GITHUB_TOKEN for ton-blockchain/ton

* remove binary check for arm64

---------

Co-authored-by: tonthemoon <tonthemoon@mailbox.org>
2023-02-27 12:32:41 +03:00
Andrey Pfau
9ea6b5bf30
Fix error message for unpacking block header (#595)
Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
2023-02-02 10:04:39 +03:00
EmelyanenkoK
3b3c25b654
Add account state by transaction and emulator (extended) (#592)
* account_state_by_transaction

* Correct time calculation

* Bug fixes

* Refactor

* namespace block::transaction

* smc.forget

* RunEmulator: remove wallet_id

* Refactor & fixes

* AccountStateByTransaction: use shardchain block instead of masterchain block

* transaction emulator core

* refactor

* tx emulator major functionality

* small format changes

* readme

* clean

* return json, add support for init messages

* tx emulator readme

* refactor getConfigParam and getConfigAll

* add shardchain_libs_boc parameter

* option to change verbosity level of transaction emulator

* fix deserializing ShardAccount with account_none

* add mode needSpecialSmc when unpack config

* emulator: block::Transaction -> block::transaction::Transaction

* Refactor

* emulator: Fix bug

* emulator: Support for emulator-extern

* emulator: Refactor

* Return vm log and vm exit code.

* fix build on macos, emulator_static added

* adjust documentation

* ignore_chksig for external messages

* tvm emulator, run get method

* Added more params for transaction emulator

* Added setters for optional transaction emulator params, moved libs to a new setter

* Added actions cell output to transaction emulator

* fix tonlib build

* refactoring, rand seed as hex size 64, tvm emulator send message

* tvm send message, small refactoring

* fix config decoding, rename

* improve documentation

* macos export symbols

* Added run_get_method to transaction emulator emscipten wrapper

* Fixed empty action list serialization

* Changed actions list cell to serialize as json null instead of empty string in transaction emulator

* stack as boc

* log gas remaining

* Fix prev_block_id

* fix build errors

* Refactor fetch_config_params

* fix failing unwrap of optional rand_seed

* lookup correct shard, choose prev_block based on account shard

* fix tonlib android jni build

---------

Co-authored-by: legaii <jgates.ardux@gmail.com>
Co-authored-by: ms <dungeon666master@protonmail.com>
Co-authored-by: krigga <krigga7@gmail.com>
2023-02-02 10:03:45 +03:00
SpyCheese
c6143715cc
Fix some error handling in FunC (#599) 2023-01-23 13:01:40 +03:00
EmelyanenkoK
653c88aa9d
Add pragmas to funC for precise control of computation order (#589)
* FunC pragmas: allow-post-modification and compute-asm-ltr

* Warn if #pragma is enabled only in included files

* Add tests for new pragmas

* Add special ops for "allow-post-modification" only when needed

* Update FunC version to 0.4.1

* Allow empty inlines (#10)

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-01-13 12:45:04 +03:00
EmelyanenkoK
6b49d6a382
Add legacy_tester for existing funC contracts (#588)
* Add legacy_tester for existing funC contracts

* Add storage-contracts and pragma options
2023-01-12 12:33:15 +03:00
SpyCheese
13b9f460af
SuspendedAddressList config param (#585)
* SuspendedAddressList config param

* Change tag for cskip_suspended
2023-01-09 20:37:58 +03:00
EmelyanenkoK
a1d8a5e4f3
Add complex assigns to FunC and fix UB (#574)
* Fixed complex funC setglob cases

* Forbid modifying local variables after using them in the same tensor

* Fix analyzing "while" in func

* Update funC version (#9)

* Update stress tester

* Fix using variable after move

Co-authored-by: krigga <krigga7@gmail.com>
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-12-29 18:06:13 +03:00
EmelyanenkoK
7347ec0b3b
Add TON Storage to Proxy via storage gateway (#577)
* Access ton storage from proxy, resolve "dns_storage_address" in tonlib

* Set storage gateway address in proxy args

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-12-29 17:28:50 +03:00
SpyCheese
8bfad35e93
Add try/catch to func stress-tester (#565) 2022-12-22 15:26:58 +03:00
EmelyanenkoK
e1be988df5
Add try/catch to FunC (#560)
* Add try-catch

* Fix 'return' bugs

* Update tests

* Fix 'SETCONTVARARGS' bug

* Fix 'SETCONTVARARGS' bug again

* Check deep stack

* Add throw_arg

Co-authored-by: legaii <jgates.ardux@gmail.com>
2022-12-22 15:26:39 +03:00
EmelyanenkoK
b6d44bb02a
Revert "fix include paths parsing under Windows (#541)" (#557)
This reverts commit 4d09d04a42.
2022-12-15 17:12:29 +03:00
elderorb
4d09d04a42
fix include paths parsing under Windows (#541) 2022-12-15 14:55:11 +03:00
EmelyanenkoK
6f63be6140
Add more params to JettonBridgeParams 2022-12-13 17:25:12 +03:00
EmelyanenkoK
75f57bdc76
Add versions to JettonBridgeParams (#547) 2022-12-08 15:53:01 +03:00
SpyCheese
ac50074ff6
Fix getting cell-db-reader in AsyncStateSerializer (#546) 2022-12-07 21:49:17 +03:00
EmelyanenkoK
d8dd75ec83
Limit account storage size (#530)
* Limit size of an account

* Bugfix

* Don't check size for special accounts

* Improve timeouts in collator and validator

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-11-30 08:40:19 +03:00
SpyCheese
5e3cc23921 Optimize calculation of storage stat, add logs to transaction.cpp 2022-11-24 19:16:55 +03:00
EmelyanenkoK
3d9a165586
Fix set_seed in stdlib.fc 2022-10-24 20:23:05 +03:00
EmelyanenkoK
64b960740a
Fix typo in ConfigParam 79 2022-10-22 14:42:13 +03:00
EmelyanenkoK
4c8194ab5b
Add ConfigParam 79 (#498)
* Add ConfigParam 79

* Change Config79 MsgAddress -> bits256

* Add ConfigParam 81 for Polygon
2022-10-21 17:45:37 +03:00
EmelyanenkoK
15f5a1d55a
Merge pull request #488 from ton-blockchain/master
Merge upstream
2022-10-12 14:25:27 +03:00
SpyCheese
91580e7ebf Fix emulate_not in func 2022-10-12 14:09:15 +03:00
Vladimir Támara Patiño
f7041cb44f
Can compile in OpenBSD/adJ. Closes #337 (#430)
* Updating abseil-cpp to version of 14th April 2022 that supports OpenBSD/adJ

* Not using dl in OpenBSD/adJ
2022-10-11 10:32:49 +03:00
SpyCheese
1d42c38122
Move some constants to global config (#484) 2022-10-10 17:13:21 +03:00
SpyCheese
580884033b
Check limits in validate-query, check timeout in collator (#469) 2022-10-06 21:31:41 +03:00
EmelyanenkoK
b640f06846 Add comments to stdlib 2022-10-06 09:16:44 +03:00
EmelyanenkoK
4b940f8bad
Merge pull request #480 from ton-blockchain/testnet
Merge dev branch
2022-10-03 09:25:27 +03:00
SpyCheese
495327099c Check level of c4 and c5 2022-10-03 09:15:41 +03:00
tolya-yanot
313d37e134 auto-dns & manual-dns smartcontracts updated to actual DNS standard version by starlightduck 2022-09-30 12:14:14 +03:00
SpyCheese
fc8da44940
Fix compilation of muliplication (#475) 2022-09-29 09:24:15 +03:00
SpyCheese
5c2ad4a6c7 Tests for func with scripts 2022-09-23 16:27:18 +03:00
EmelyanenkoK
6a72aba9af
Bump func version 2022-09-22 16:55:14 +03:00
EmelyanenkoK
d23267d996
Add triple quotes asms (#463)
* Add python-like triple quotes for multiline strings

* Add test for multiline asm

* Allow asm definition duplicate

* Asm duplicate: add test & fixes

* Fix multiline asm

* Fix asm duplicate

Co-authored-by: legaii <jgates.ardux@gmail.com>
2022-09-22 16:54:26 +03:00
SpyCheese
bb5bc6178c Change recursion to loop in CellSlice 2022-09-21 11:04:40 +03:00
Starlight Duck
3c380e0a7b
Implement compilation and pre-computation of logical operations (#437)
* Implement compilation and pre-computation of logical operations (and, or, xor, not)

* Fix emulate_and optimization

* Fix variable flags in emulate_not

* Rename co2.fc to co3.fc

Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
2022-09-20 14:19:42 +03:00
EmelyanenkoK
3b1d33f543
Allow constants with the same name and value (#462)
Co-authored-by: legaii <jgates.ardux@gmail.com>
2022-09-20 14:16:53 +03:00
EmelyanenkoK
9c6787d2ff
Fix undefined behavior code (#464)
* Fix UB in arithmetics

* Fix misaligned allocations in validator sessions

* Fix integer overflow in bigint.hpp

* Fix potential UB

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-09-19 17:31:54 +03:00
Andrey Tvorozhkov
bd5f4f61ac
Fix dump of null items (#459)
Co-authored-by: Andrey Tvorozhkov <andrey@h-labs.ru>
2022-09-15 09:37:27 +03:00
Andrey Tvorozhkov
e40d323fce
Add ~strdump and STRDUMP TVM OP (#452)
* Add ~strdump and STRDUMP TVM OP

Add ~strdump and STRDUMP TVM OP

Add ~strdump and STRDUMP TVM OP

* STRDUMP fixes

Co-authored-by: Andrey Tvorozhkov <andrey@h-labs.ru>
2022-09-14 12:36:54 +03:00
AlexeyFSL
e2cca03a78
Func and Fift lib for WASM (#455)
* Add social badges

Add telegram, Twitter and Stack Overflow badges in Readme

* update README.md badges

* patch for wasm build

* fix narrowing conversion error for clang compiler

* refactor func code

* funcfift lib implementation

* fix funcfift lib
fix CMakeFile

* fix rvalue missing

* remove unused field from result json

* name fix
remove unused target

* rename

* added script for building funcfiftlib to wasm

* fix json fild names

* fix commit hash for script

* added version function to funcfiftlib

* update commit hash for script

* add realpath fail processing
fix DISABLE_EXCEPTION_CATCHING option

* update hash in script

Co-authored-by: Anthony Tsivarev <tsivarev.a@gmail.com>
Co-authored-by: EmelyanenkoK <emelyanenko.kirill@gmail.com>
Co-authored-by: tolya-yanot <1449561+tolya-yanot@users.noreply.github.com>
2022-09-14 12:36:01 +03:00
tolya-yanot
da65be6ee2 Fix DNS resolve in liteclient and tonlib 2022-08-30 03:30:00 +03:00
SpyCheese
b44e5403c8 Fix DNS resolve in liteclient and tonlib 2022-08-29 11:04:03 +03:00
EmelyanenkoK
17c561c4db
Merge pull request #439 from ton-blockchain/master
Merge master
2022-08-17 08:02:56 +03:00
Andrey Tvorozhkov
c1f281d814
Add addr@+ / addr@ functions to parse addr from slice (#366)
Add addr@ to parse `addr_none$00` / `addr_extern$01` / `addr_std$10` / `addr_var$11` from slice.

Tests:

```
<b b{00} s, b> <s addr@  ."addr_none$00 parsed: " print-addr cr  // addr_none$00
<b b{01} s, 10 9 u, b{1101010101} s, b> <s addr@ ."addr_extern$01 parsed: " print-addr cr // addr_extern$01
<b b{10} s, b{1} s, 10 30 u, b{1111111111} s, -1 8 i, x{8000000000000000000000000000000000000000000000000000000000000000} s, b> <s addr@ ."addr_std$10 with Anycast parsed: " print-addr  cr // addr_std$10 with Anycast
<b b{10} s, b{0} s, -1 8 i, x{8000000000000000000000000000000000000000000000000000000000000000} s, b> <s addr@ ."addr_std$10 without Anycast parsed: " print-addr cr // addr_std$10 without Anycast
<b b{11} s, b{1} s, 10 30 u, b{1111111111} s, 256 9 u, -10 32 i, x{8000000000000000000000000000000000000000000000000000000000000000} s, b> <s addr@ ."addr_var$11 with Anycast parsed: " print-addr cr // addr_var$11
<b b{11} s, b{0} s, 256 9 u, -10 32 i, x{8000000000000000000000000000000000000000000000000000000000000000} s, b> <s addr@ ."addr_var$10 with Anycast parsed: " print-addr cr // addr_var$11
```
2022-08-15 18:35:27 +03:00
andreypfau
e36452fffe
Explicitly add ValueFlow prefix (#411) 2022-08-15 18:23:23 +03:00
Dmitriy
fb3077af9b crypto/vm: fix include 2022-08-11 12:27:47 +03:00
SpyCheese
8d7f1bba73
Update catchain (#432)
* Update catchain

* Update ton_api.tlo
2022-08-08 09:31:36 +03:00
EmelyanenkoK
5101b404a4 Merge branch 'master' into testnet 2022-08-04 17:45:31 +03:00
EmelyanenkoK
d46e4b3538 A series of FunC improvements (#378)
* Don't use IFJMP/IFNOTJMP in inline functions

* Fix incorrect ifelse branch code generation 

https://github.com/ton-blockchain/ton/issues/374

* Make generate_code_all clearer

* Don't replace IFJMP with IF in inner blocks in inline functions

* Allow unbalance if/else by using RETALT

* Fix wrong PUSHCONT

* Bugfix in IF code generation for inline functions

* Fix unbalanced if/else

* Bugfix and improvements in code generation

* Fix analyzing while(0) in func

https://github.com/ton-blockchain/ton/issues/377

* FunC and Asm.fif: Fix inlining large functions

https://github.com/ton-blockchain/ton/issues/375

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-08-04 14:53:47 +03:00
EmelyanenkoK
40cec56e28
A series of FunC improvements (#378)
* Don't use IFJMP/IFNOTJMP in inline functions

* Fix incorrect ifelse branch code generation 

https://github.com/ton-blockchain/ton/issues/374

* Make generate_code_all clearer

* Don't replace IFJMP with IF in inner blocks in inline functions

* Allow unbalance if/else by using RETALT

* Fix wrong PUSHCONT

* Bugfix in IF code generation for inline functions

* Fix unbalanced if/else

* Bugfix and improvements in code generation

* Fix analyzing while(0) in func

https://github.com/ton-blockchain/ton/issues/377

* FunC and Asm.fif: Fix inlining large functions

https://github.com/ton-blockchain/ton/issues/375

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-08-04 14:48:19 +03:00
SpyCheese
7e207dc78f Update DNS resolver in liteclient and tonlib 2022-06-29 17:59:30 +03:00
sonofmom
f599f08791 Silence errant debug stderr output 2022-06-20 00:21:57 +02:00
EmelyanenkoK
8537dd60e6
Fix tests (#405)
* [tonlib] Update master configs and fix test-tonlib-offline

* Fix test-bigint in release build

Co-authored-by: ms <98183742+dungeon-master-666@users.noreply.github.com>
Co-authored-by: dungeon-master-666 <dungeon666master@protonmail.com>
2022-06-13 20:02:32 +03:00
EmelyanenkoK
845cbca1e5
Make asynchronous celldb interface (#388)
* Asynchronous load_cell in celldb

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-06-01 10:03:50 +03:00
EmelyanenkoK
ca00f0ed91
Extended error notes for unacceptable external messages (#383)
* patch sendMessage

* Verbose error message for "sendMessage" LS query

* More verbose errors in external-message.cpp

Co-authored-by: dungeon-master-666 <dungeon666master@protonmail.com>
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-05-24 21:21:58 +03:00
EmelyanenkoK
89b8717cf8
Persistent optimization (#382)
* State serialization consuming less RAM

* Move large-boc-serializer to crypto/vm, refactor code

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-05-24 21:17:11 +03:00
EmelyanenkoK
c07394aab5
Optimization of persistent state serialization (#364)
* Fix double serialization of masterchain; increase sync_blocks_before

* Improve logging in DownloadState

* Write persistent state directly to file instead of a buffer

* Don't keep ref to masterchain state in AsyncStateSerializer

* Sparse state serialization over longer period

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-05-15 17:51:24 +03:00
starlightduck
eb35cf653a Use td::realpath and add re-inclusion tests 2022-05-12 18:57:03 +03:00
starlightduck
9356a16b84 Implement #include keyword with advanced checks and backtrace 2022-05-12 12:54:34 +03:00
EmelyanenkoK
0c772185ef Add constants and string literals to funC
* Add special string literals "..."? (s,a,u,h,)

* Add string literal H (256-bit hash)

* Add string literal c (crc32)

* Use td::hex_encode instead of homebrew function and add test

* Fix error codes and use more generic address

* Add support for int and slice constants

* Add support for strongly typed constants

* Add support for precompiled constant expressions (hard!)

Co-authored-by: starlightduck <starlightduck@gmail.com>
2022-05-06 11:13:04 +03:00
starlightduck
0e955793ed Add support for #pragma version and FunC versioning
FunC pragma refined error messages and ^ partials
2022-05-06 11:11:42 +03:00
OmicronTau
0e47c6c8e0 Asm.fif typo in IFBITJMPs 2022-05-06 11:11:06 +03:00
akifoq
34590176eb Fix IF:<{ and IFNOT:<{ empty continuation case
The boolean value should be DROPped in the case the continuation is empty.
2022-05-06 11:06:48 +03:00
Starlight Duck
3fee04e20a Support libraries in LS and request+caching in TLC 2022-05-06 10:48:05 +03:00
Starlight Duck
7dc980562f tonlib use correct c7: config and address when executing 2022-05-06 10:46:16 +03:00
OmicronTau
59fcd7cbd5 Deactivate accounts upon destruction in block 2022-05-06 10:44:44 +03:00
OmicronTau
1b480e39ba Fix infinity max_gas_limit for get methods 2022-05-06 10:44:26 +03:00
OmicronTau
703bcd6e32 Add tests and fixes for modpow2, muldivmod 2022-05-06 10:43:53 +03:00
tolya-yanot
6faeca69a2 Fix split-depth and collator 2021-11-07 23:58:36 +03:00
OmicronTau
64e68a47ec Fix 256+ depth pruned cell deserialization 2021-09-15 18:08:39 +03:00
OmicronTau
cc86a0724a Fix muldivmod 2021-09-15 18:08:39 +03:00
EmelyanenkoK
03fc659d23 Update block.tlb 2021-09-06 12:49:36 +03:00
tolya-yanot
c1a733c0f0 Add send_mode param to tonlib_api msg.message (send_mode=-1 - use default) 2021-08-02 23:59:42 +03:00
EmelyanenkoK
46204d918d Make fine multiplicators rational with 256 base 2021-06-16 20:03:22 +03:00
EmelyanenkoK
41255daa54 Use punishment params from config for validator complaints 2021-06-16 20:03:22 +03:00
EmelyanenkoK
9a4ac01078 Set proto_version in ValidatorSessionConfig from network config 2021-06-16 20:03:22 +03:00
EmelyanenkoK
82a3eb9bd2 Add TL-B schemes for consensus_v3, misbehaviour_punishment and oracles 2021-06-16 20:03:22 +03:00
Kirill Ponazdyr
456cc977be Increase thread limit to 256 2021-04-03 20:03:54 +03:00
Alex Melman
bab4c1637e Automatically integrates git build information into executables.
Usage:
func.exe -V
adnl-pong -V
validator-engine -V
and so on.
Result will be shown in the following format:
Func build information: [ Commit: d8b751d7a5, Date: 2021-02-27 14:34:41 +0200]
2021-02-27 14:34:43 +03:00
Alex Melman
41a3418b7b Adds command line parameter -V that shows build version to the binaries.
Build number controlled in top level CMakeLists.txt file via -DBUILD_VERSION variable.
Usage:
adnl-pong -V
validator-engine -V
and so on.
2021-02-27 14:34:41 +03:00
Kirill A
a12e3db5d3 Enable installation of smartcontract and tonlib-cli 2021-02-26 23:48:52 +03:00
EmelyanenkoK
f9828a1252 Fix old hash parsing in create-config-proposal.fif 2021-02-09 17:26:26 +03:00
EmelyanenkoK
666576682a Fix non-critical bug in config-code
Wins/losses order is messed up
2021-02-09 17:26:26 +03:00
ton
24dc184a2e validator large state serialization bugfix + tdlib update for clients 2021-01-07 22:48:04 +03:00
ton
dab7ee3f97 updated pow-miner + small bugfix 2020-07-10 13:46:16 +03:00
ton
f064b1047a pow-testgiver support 2020-07-06 17:07:20 +03:00
ton
dbde9c1c40 minor bugfix 2020-06-03 21:47:47 +04:00
ton
4e2624459b integrating the existing state of TON Storage / TON Payments / CPS Fift development branches 2020-05-27 22:10:46 +04:00
ton
040df63c98 minor improvements and bugfixes 2020-05-07 10:35:23 +04:00
ton
eecf05ca59 bugfixes + tonlib update 2020-04-30 15:04:47 +04:00
ton
9f008b129f updated submodules, bugfixes
- added new fift/func code for validator complaint creation
- bugfixes in validator
- updates in tonlib
- new versions of rocksdb/abseil
- hardfork support
2020-04-27 16:01:46 +04:00
ton
16a4566091 validator bugfix + old key blocks download improvement 2020-04-11 18:08:57 +04:00
ton
be9c34c62d bugfixes 2020-04-10 23:06:01 +04:00
ton
8be3fc99ed bugfixes + decreased archive slice size 2020-04-08 23:49:28 +04:00
ton
cf97f48cd7 error handling in lite client, speed up message dequeue in blocks 2020-04-07 00:08:53 +04:00
ton
dfc040cb00 validator: multiple bugfixes 2020-04-06 15:22:14 +04:00
ton
7efb345e3d remove debug checks to improve performance under load on weak validators 2020-04-05 13:56:24 +04:00
ton
d17186896b fixed block scheme bug 2020-04-03 23:21:15 +04:00
ton
c300b4ff30 bugfix in validator 2020-04-03 18:47:22 +04:00