How does the seqno shard behave in the workchain? If a new shard is created, what iteration of seqno will be in this shard? What iteration of seqno is in each shard? Is there any documentation with an example?

Aug 29, 2023, 2:38 PM
you have already asked that in Russian @tondev chat and received an answer

What is your question exactly?
Aug 29, 2023, 3:22 PM
I got the wrong answer twice (in Russian chat I received an answer that the masterchain can be sharded, is it oke?)
Aug 29, 2023, 4:47 PM
As I see, you only received correct answers there.

Masterchain doesn’t split to shards
Aug 29, 2023, 4:51 PM
yes, but not in Russian chat
so, I would like to get answers here - en chat
Aug 29, 2023, 4:53 PM
Then ask the question :)
Aug 29, 2023, 4:53 PM
this question is actual, please help me understand the behavior🙏
Aug 29, 2023, 4:57 PM
Suppose that there was a shard with latest seqno 1000. It splits into two shards and each of 2 new blocks in these shards has the seqno 1001.
Aug 29, 2023, 5:01 PM
seqno in new shard started with 1001 (from example?) not with 0 (or 1)?
in masterchain im see array with 2 shards with different seqno?
how i check if shards > 1? I need check it before parsing messages in shards
Aug 29, 2023, 5:07 PM
1001
Yes, because after splitting, shards can grow in height with different speed
Aug 29, 2023, 5:09 PM
1. Seqno in new shard will start with 1001 in the example.
2. Yes, masterchain will have a binary tree with two shards, and they're not guaranteed to have same seqno.
3. If you have the block cell, you need to look at ShardHashes object (https://github.com/ton-blockchain/ton/blob/e1197b13d43a082a48402bdbdeadab472087ad09/crypto/block/block.tlb#L522). Otherwise, you may just look on the list of shards.
Aug 29, 2023, 5:10 PM
so, and what happens after merger for example?
Before in Sh1 (shard 1) have last seqno is 1030
Before in Sh2 (shard 2) have last seqno is 1050 (from 1001)

After Sh1 seqno equals: last seqno in Sh1 is 1030 + 49 (1050 - 1001).

Is right?
and can i see with what seqno iteration began
Aug 29, 2023, 5:22 PM
{Sh1: 1030, Sh2: 1050} —> {Sh12: 1051}
Aug 29, 2023, 5:42 PM
🤔, if Sh2 start with seqno 1001 then difference will be 49 (1050 - 1001). These blocks must into parent shard.
Aug 29, 2023, 5:48 PM
Doesn't it just take maximum of merging shards' seqno?
And it does. https://github.com/ton-blockchain/ton/blob/e1197b13d43a082a48402bdbdeadab472087ad09/crypto/block/block.cpp#L996
Aug 29, 2023, 5:53 PM
Is it because the merge is at AccountChains level? What rule AccountChains distributed if they were in different secno?
Aug 29, 2023, 6:14 PM
accounts are distributed between shardchains depending on the first bits of account address hash
seqno don't affect the distribution
Aug 29, 2023, 6:15 PM
thanks guys for helping me 🙏
Aug 29, 2023, 6:16 PM

© 2024 Draquery.com All rights reserved.