Skip to content

Commit

Permalink
Merge pull request #427 from reveloper/weekly_update_46
Browse files Browse the repository at this point in the history
Weekly update 46
  • Loading branch information
reveloper committed Nov 20, 2023
2 parents 2cc8374 + fb3b847 commit 4a44944
Show file tree
Hide file tree
Showing 9 changed files with 1,059 additions and 5 deletions.
74 changes: 74 additions & 0 deletions docs/develop/blockchain/sharding-lifecycle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Infinity Sharding Paradigm

:::danger
Page is under development.
:::

## Understanding Split Merge in TON Blockchain

The TON (Telegram Open Network) Blockchain introduces innovative concepts for blockchain scalability and efficiency. One such concept is the Split Merge functionality, integral to its blockchain architecture. This short article explores the key aspects of Split Merge in the TON Blockchain, focusing on its role within the Infinite Sharding Paradigm (ISP).

#### Infinite Sharding Paradigm (ISP) and its Application

ISP underpins the TON Blockchain's design, treating each account as part of its separate "accountchain." These accountchains are then aggregated into shardchain blocks for efficiency. The state of a shardchain comprises the states of all its accountchains. Thus, a shardchain block essentially is a collection of virtual blocks of accounts assigned to it.

- **ShardState**: Approximated as Hashmap(n, AccountState), where n is the bit length of the account_id.
- **ShardBlock**: Approximated as Hashmap(n, AccountBlock).

Each shardchain, or more precisely, each shardchain block, is identified by a combination of `workchain_id` and a binary prefix `s` of the account_id.

## Sharding Example

![](/img/docs/blockchain-fundamentals/split-merge.svg)

In the provided graphic scheme:

- The black line represents the masterchain.
- Shards of a workchain are divided by time and denoted in black dashed line.
- Blocks 101, 102, 103, and 80 relate to the masterchain block with seqno=29. Here, 101, 102, and 103 are in one shard, while 80 is in another.
- If a split or merge event happens, the affected shards pause until the next masterchain block.

In summary, Split Merge in TON Blockchain is a complex yet efficient mechanism that enhances scalability and interaction within the blockchain network. It exemplifies TON's approach to resolving common blockchain challenges, emphasizing efficiency and global consistency.


## Sharding Details

#### Split and Non-Split Parts of Shardchain

A shardchain block and state are divided into two parts:

1. **Split Part**: Complies with the ISP form, containing account-specific data.
2. **Non-Split Part**: Involves data pertaining to the block's interaction with other blocks and the outside world.

#### Interaction with Other Blocks

The non-split parts are crucial for ensuring global consistency, reduced to internal and external local consistency conditions. They are significant for:

- Message forwarding between shardchains.
- Transactions involving multiple shardchains.
- Delivery guarantees and validation of a block's initial state against its predecessor.

#### Inbound and Outbound Messages

Key components of the non-split part of a shardchain block include:

- **InMsgDescr**: Descriptions of all messages imported into the block.
- **OutMsgDescr**: Descriptions of all messages exported or generated by the block.

#### Block Header and Validator Signatures

The block header, another non-split component, contains essential information like workchain_id, binary prefix of account_ids, and various hashes (e.g., of the immediate predecessor). Validator signatures are appended to the unsigned block, forming the signed block.

#### Outbound Message Queue

OutMsgQueue in the shardchain state is a critical non-split part. It holds undelivered messages from OutMsgDescr until they are processed or delivered to their destination.

#### Shard Split and Merge Mechanics

In the context of dynamic sharding, shard configurations may change due to split and merge events. These events are synchronized with the masterchain block. For instance, if a split or merge occurs, the affected shards wait for the next masterchain block before proceeding.


## See Also

* [Block Layout](/develop/data-formats/block-layout)
* [Whitepapers](/learn/docs)
2 changes: 1 addition & 1 deletion docs/develop/dapps/apis/sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The data provider is a [Liteserver](/participate/run-nodes/liteserver), which ca

| Library | Language | ADNL connector type | Description |
|---------|----------|-------|--------------|
|[ton-kotlin](https://github.com/andreypfau/ton-kotlin)|Kotlin|Native ADNL |Kotlin/Multiplatform SDK for The Open Network|
|[ton-kotlin](https://github.com/ton-community/ton-kotlin)|Kotlin|Native ADNL |Kotlin/Multiplatform SDK for The Open Network|
|[tonutils-go](https://github.com/xssnick/tonutils-go)|GO|Native ADNL |Golang library for interacting with TON blockchain|
|[tongo](https://github.com/tonkeeper/tongo)|GO|Native ADNL |Go implementation of libraries for TON blockchain|
|[tonutils](https://github.com/thekiba/tonutils) | TypeScript | Native ADNL | TypeScript-based interface for building and interacting with applications in TON Ecosystem. |
Expand Down
4 changes: 2 additions & 2 deletions docs/develop/dapps/asset-processing/jettons.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ in the wallet to pay the required gas fees.

Communication between Jetton wallets and TON wallets occurs through the following communication sequence:

![](message_layouts.png)
![](/img/docs/asset-processing/jetton_transfer.svg)


`Sender -> sender' jetton wallet` means the transfer message body contains the following data:
`Sender -> sender' jetton wallet` means the _transfer_ message body contains the following data:


| Name | Type |
Expand Down
2 changes: 1 addition & 1 deletion docs/develop/smart-contracts/testing/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Check test suites used for TON Ecosystem contracts and learn by examples.
* [governance_tests](https://github.com/Trinketer22/governance_tests/blob/master/elector_tests/tests/complaint-test.fc)
* [MassSender.spec.ts](https://github.com/Gusarich/ton-mass-sender/blob/main/tests/MassSender.spec.ts)
* [TonForwarder.spec.ts](https://github.com/TrueCarry/ton-contract-forwarder/blob/main/src/contracts/ton-forwarder/TonForwarder.spec.ts)

* [Assurer.spec.ts](https://github.com/aSpite/dominant-assurance-contract/blob/main/tests/Assurer.spec.ts)

## See Also
* [Blueprint](/develop/smart-contracts/sdk/javascript)
Expand Down
13 changes: 12 additions & 1 deletion docs/participate/explorers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Almost all explorers have the ability to find out information about balances, tr

Next, we will consider several explorers that can be attributed to each of these categories.

## TON Scan
## TON Scan.org

Good explorer for everyday use. It provides a comprehensive view of the TON Blockchain, allowing users to search for transactions, addresses, blocks, and more. Any search is performed against the public [address book](https://github.com/catchain/tonscan/blob/master/src/addrbook.json) (TON Foundation, OKX and etc.)

Expand All @@ -45,6 +45,17 @@ Good explorer for everyday use. It provides a comprehensive view of the TON Bloc
- URL: https://tonscan.org/
- Testnet URL: https://testnet.tonscan.org/

## TON Scan.com

### Features

- Transaction aggregation analytics
- Transaction Traces

### Links

- URL: https://tonscan.com/

## Ton Whales Explorer

This explorer is more oriented towards developers than ordinary users.
Expand Down
8 changes: 8 additions & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,14 @@ const sidebars = {
}
],
},
{
type: 'category',
label: 'Blockchain Fundamentals',
items: [

'develop/blockchain/sharding-lifecycle',
],
},
{
type: 'category',
label: 'Data Formats',
Expand Down
Loading

0 comments on commit 4a44944

Please sign in to comment.