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

117 commits

Author SHA1 Message Date
birydrad
72020c04c4
celldb in-memory mode, stats for actors, perf counters, minor fix in rldp2 (#1164)
* 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 <>
2024-09-23 17:34:37 +03:00
SpyCheese
b304b1c7be
LS getDispatchQueueInfo and getDispatchQueueMessages methods (#1161)
* liteServer.getDispatchQueueInfo query

* Fix getting min/max lt

* LS getDispatchQueueMessages method
2024-09-13 20:47:30 +03:00
SpyCheese
feff73c4be Merge branch 'safe_features' into testnet-update 2024-09-06 11:48:46 +03:00
SpyCheese
e32a74e9c5
Collator: change deferring behavior when out queue size is big (#1135) 2024-09-05 15:56:07 +03:00
EmelyanenkoK
b2b79fead1
Ratelimit nochannel ADNL packets (#1147)
* Get ADNL stats in validator console

* Add timestamp to stats

* Limit nochannel adnl packets

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-09-03 13:34:31 +03:00
SpyCheese
dc26c3be67 Improve validator session stats (#1117)
* Improve validator session stats

* Collator stats: block limits, number of processed external messages
* Collator and validator work time
* Last key block seqno
* Approvers and signers

* End validator session stats
2024-08-28 11:15:23 +03:00
SpyCheese
908415d00b
Accelerator, part 1 (#1119)
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
2024-08-23 11:46:40 +03:00
SpyCheese
9c3dc22b78
Improve validator session stats (#1117)
* Improve validator session stats

* Collator stats: block limits, number of processed external messages
* Collator and validator work time
* Last key block seqno
* Approvers and signers

* End validator session stats
2024-08-20 19:54:16 +03:00
SpyCheese
b9e89d4c66
"getcollatoroptionsjson" command in validator console (#1059)
* "getcollatoroptionsjson" command in validator console

* Improve state serializer

Use previous persistent state to speed up reading
2024-07-17 15:10:55 +03:00
EmelyanenkoK
57f95cc282
Add collator options (#1052)
* 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>
2024-07-10 14:58:13 +03:00
Marat
06f503dd02
Tonlib: add methods smc.getRawFullAccountState and blocks.getOutMsgQueueSizes (#1027)
* add method smc.getRawFullAccountState

* Add method blocks.getOutMsgQueueSizes
2024-06-27 16:45:22 +03:00
EmelyanenkoK
0daee1d887
Merge message dispatch queue (#1030)
* 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>
2024-06-27 16:12:23 +03:00
EmelyanenkoK
74801d00b8
Command to disable state serializer (#1011)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-05-31 20:50:31 +03:00
EmelyanenkoK
229d6a8ee9
Fix TL scheme for liteServer.nonfinal.getValidatorGroups (#1008)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-05-29 15:11:09 +03:00
EmelyanenkoK
8a4d44de1e
Compress block candidate broadcasts (#1007)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-05-29 15:10:42 +03:00
EmelyanenkoK
539d5dd2de
Add candidates cache (#1000)
* Broadcast shardchain block candidates in private overlays, generate proof links from candidates

* Disable shardchain block broadcasts in private overlays

* Send block candidate broadcasts to custom overlays, allow non-validators to receive candidates

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-05-24 09:58:07 +03:00
EmelyanenkoK
d5c09936cf
Block broadcasts in custom overlays (#986)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-05-10 17:04:49 +03:00
EmelyanenkoK
6fb2019a4f
Improve validator session stats (#982)
* Add list of validators
* Fix producer stats
* Make round and stats timestamps more meaningful

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-05-08 17:41:15 +03:00
EmelyanenkoK
9a543c6b28
Add more info to session stats (#973)
* Improve validator session stats

* Improve validator session stats

Add got_submit_at, collation_cached, validation_cached.
Fix stats cleanup.

* Fix setting timestamp for cached blocks

* Add serialize/deserialize time, serialized size to validator session stats, fix setting is_accepted

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-04-25 18:47:15 +03:00
EmelyanenkoK
f7907bdd58
Rename private ext msg overlays to custom overlays, change interface a bit (#952)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-04-01 18:24:08 +03:00
EmelyanenkoK
0434eadc1f
Add custom overlays for external messages (#949)
* Private overlay for external messages

* Improve ext msg overlays

* Manage from validator console
* Bypass out queue size limit for high-priority messages
* Shuffle messages in get_external_messages

* Cleanup mempool when creating validator group

* Improve private overlays for externals

1. Allow using validator adnl ids in addition to fullnode ids
2. Set priority per sender, not per overlay
3. Require the same overlay name for all nodes
4. Enable lz4 in private block overlay

* Fix typo, add debug logs

* Enable lz4 in private block overlay by config

Change proto_version for lz4 in catchain overlays to 4

* Add logs for broadcasts in fullnode

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-04-01 16:44:08 +03:00
EmelyanenkoK
b07614335c
liteServer.getOutMsgQueueSizes method (#943)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-03-26 15:55:58 +03:00
EmelyanenkoK
0bcebe8a0e
Exp/compress candidates (#942)
* Compress block candidates in validator-session

* Compress blocks in full-node (disabled for now)

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-03-26 14:52:46 +03:00
EmelyanenkoK
9452c367e4
LS queries to nonfinal blocks (#941)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-03-26 14:51:06 +03:00
EmelyanenkoK
f1592641de
Tonlib improvement fixes (#934)
* 3.6. Fix directory traversal in KeyValueDir

* 3.9. Fix buffer_to_hex reversing nibbles

* 3.5. Fix error handling at blocks.getBlockHeader

* 3.11. Fix query.forget

* 3.12. Fix error handling in RemoteRunSmcMethod

* 4.1. Delete unused files

* 3.10. Use named constants instead hardcoded constants

* 3.4. Fix response block header verification

* 3.1. Check proof of blocks.getShards response

* fix td::buffer_to_hex + test

* 3.2. Add proof check for listBlockTransactions response in RunEmulator actor

* 3.8. Add proof checking for getLibraries method

* fix regression tests

* 3.3 Add proof checking for lookupBlock method

* Add publishers to proof of getLibrariesWithProof response  (#25)

* fix missing return, fix requesting mc block

* Fix requesting lookupBlock with client mc blk == mc ref block

* Fix duplicating lib data in proof and data, add mode 2 for not including the data

* Migration of LastBlockStorage with fixed td::buffer_to_hex

---------

Co-authored-by: ms <dungeon666master@protonmail.com>
Co-authored-by: Marat <98183742+dungeon-master-666@users.noreply.github.com>
2024-03-19 15:31:29 +03:00
EmelyanenkoK
59927ba534
Improve block broadcasts processing; add special overlay for blocks for validators (#885)
* Improve block broadcast processing

* ValidatorManagerImpl::written_handle
* Retry sending broadcasts in ValidatorGroup
* Fix setting channel_ready in AdnlPeerPair

* Add special overlay for validators for block broadcasting (#842)

* Private overlay for broadcasting blocks

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>

(cherry picked from commit a52045bd91)

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2024-02-01 20:20:45 +03:00
SpyCheese
a68b5cbe62
Improve validator session stats (#861) 2024-01-16 14:24:46 +03:00
EmelyanenkoK
4303e49c93 Postpone addition of overlay for block broadcasting (#842)
This reverts commit a52045bd91.
2024-01-16 11:29:03 +03:00
EmelyanenkoK
a52045bd91
Add special overlay for validators for block broadcasting (#842)
* Private overlay for broadcasting blocks

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-12-28 21:54:55 +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
EmelyanenkoK
f923b96a2f
Add Tonlib emulator libs (#744)
* Use global libraries in RunEmulator

* Tonlib method smc.getLibrariesExt

* Process missing transaction in getStateByTransaction

---------

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-07-14 15:38:21 +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
SpyCheese
bb21f732fd
Recent updates in storage (#667)
* Fix error handling in Torrent.cpp, improve choosing peers for upload

* Various improvements in storage daemon

"get-pieces-info"
Store "added at"
Improve calculating up/down speed
Improve TL protocol for future compatibility
Remove empty directories on "--remove-files"
Better windows support
Debug logs in PeerActor
More restrictions on TorrentInfo
Bugfixes

* Global speed limits for download and upload

+bugfix

* Reset download/upload speed on changing settings or completion

* Exclude some system files in TorrentCreator
2023-04-07 15:50:07 +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
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
SpyCheese
308dcc9206
Fix CE (#627) 2023-02-28 12:45:49 +03:00
SpyCheese
0578cb4a42
Fix typos, UBs and warnings (#625) 2023-02-28 12:06:09 +03:00
EmelyanenkoK
c369127ae0
rldp2 support in rldp-http-proxy (#608)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2023-02-03 09:50:44 +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
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
ad736c6bc3
Add "--copy" to storage-daemon-cli create command (#576)
* Add "--copy" flag to "create", improve console output

* Hide excessive logs
2022-12-28 17:40:20 +03:00
SpyCheese
48d48e595e
Pause and resume upload in storage-daemon (#567) 2022-12-23 11:05:29 +03:00
EmelyanenkoK
360ef54e6b
TON Storage utilities (#564)
* Rename chunk to piece in MerkleTree for consistency

* Refactor PeerManager

* Make PeerState thread-safe

* Download torrent by hash

* First version of storage daemon

* Download torrents partially

* Improve storing and loading torrent state in DB

* Rewrite MerkleTree

* "Remove torrent" in storage daemon

* Process errors, fix bugs in storage

* Move TonlibClientWrapper from rldp-http-proxy to tonlib

* Initial version of storage provider

* Move interaction with contracts to smc-util

* Improve TonlibClientWrapper interface

* Various improvements in storage provider

* Fix TorrentCreator.cpp

* Improve interface for partial download

* Client mode in storage-daemon

* Improve interface of storage-daemon-cli

* Fix calculating speed, show peers in storage-daemon

* Use permanent adnl id in storage daemon

* Fix sending large "storage.addUpdate" messages

* Improve printing torrents in cli

* Update tlo

* Fix RldpSender::on_ack

* Update storage provider

* Add "address" parameter to get-provider-params

* Allow client to close storage contract

* Limit torrent description

* Add more logs to storage provider

* smc.forget tonlib method

* Use smc.forget in storage daemon

* Optimize sending messages in smc-util.cpp

* Fix verbosity, remove excessive logs

* Json output in storage-daemon-cli

* Update storage provider contracts

* Fix rldp2 acks

* Change verbosity of logs in rldp2

* Update help and output of commands and in storage-daemon-cli

Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-12-22 12:24:13 +03:00
EmelyanenkoK
3ff50f5f47
Add network id to dht (#559)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-12-20 14:26:39 +03:00
ms
b548ae61dd
Fix truncating JsonString (#552) 2022-12-15 10:04:34 +03:00
EmelyanenkoK
fcf59b4eb5
Reverse connections in adnl (#545)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
2022-12-06 17:06:54 +03:00
SpyCheese
a4a3ea2b77
liteServer.getAccountStatePrunned method (#534) 2022-11-30 08:39:32 +03:00
Ivan Siomash
0ddf2a7f9f
Update jni native-lib ganeration (#497)
* 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

* generate_java: Add support for # and Int256

* generate_java: Add # and Int256 to native-lib

* Fix 'jni.h: no such file'

* Fix TonApi.java

* Fix android build.sh

* Fix android OPENSSL_ROOT_DIR
2022-11-01 22:13:37 +03:00
EmelyanenkoK
b96ab80dfd Merge ton_api.tlo 2022-09-30 12:36:31 +03:00