RE: Another blockchain puzzle: Last irreversible blocks

You are viewing a single comment's thread from:

Another blockchain puzzle: Last irreversible blocks

in blockchain •  2 months ago 

All else being equal, the later the 21st witness is shuffled in each round, the more 16 block "settlements" we'll see in that round. Once the random witness confirms a block, the settlement gap would switch to 15.

I guess it goes like this?

Which gives the following expectations when everything is running smoothly.

GapCountPct
1523154.87%
1619045.13%
Total421

Meanwhile, if enough top-20 witnesses shuffle from the beginning of one round to the end of the next, I think that could extend the gaps to 22 - since they would not be confirming many new blocks. If the top-20 shift the other way between rounds, I don't think it could narrow a 16 to a 15(?). I think that looks something like this (showing # of blocks confirmed, I think the yellow is where the gap would grow):

Where the Y axis is a top-20 witness position in round 1 and the X axis is their position in round to. That gives another ~24% at 16-22 blocks for settlement.

That's a total of ~69% at 16 blocks or above (ignoring overlaps).

These are both key pieces that I had not considered.

According to SteemDB, we average about 2 missed blocks per hour (<1%), so that's not much of a factor, but I guess they explain the 23-26 block gaps.

So yeah, in broad strokes, I think the numbers line up and I agree that this is more or less what we'd expect to see. It's not as simple and straightforward as I had imagined it.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

All else being equal, the later the 21st witness is shuffled in each round, the more 16 block "settlements" we'll see in that round. Once the random witness confirms a block, the settlement gap would switch to 15.
I guess it goes like this?

I don't know exactly what you meant by '16 block “settlements”'. I assume that you meant the gap between the head and the last irreversible block.
Unfortunately, I can't really interpret your tables at the moment. Perhaps you can explain them or the values or formulas behind them.

But I don't think we're so far away. :-)

As you described at the end, the gap can grow quite a bit. Especially for time-critical applications and financial transactions, this can be a real problem. With a gap of 22, you would have to wait over a minute for the transfer or order to be finally executed.

  ·  last month (edited)

You're right about "settlement". That was just me being too lazy to keep writing the phrase "gap between the head block and the last irreversible block".

I don't have formulas for the tables at all. I just made the tables and filled them in based on intuition, and it's hard to describe (probably because I still don't really even have a good grasp on it).

Table 1: 21st witness

The first table shows the imaginary case where the top-20 witnesses all go in the same order, and the random 21st witness is inserted into each of 21 possible positions.

Without witness21, every block would be "settled" in 15 blocks. However, witness21 is guaranteed to have a stale block, so that pushes the rest back and bumps the gap up to 16 each round until witness21 produces a block. When that happens, the gap drops to 15.

Table 2: top-20 witness shuffling

The second table shows the number of blocks confirmed in two consecutive rounds by a particular pair of witness placements. For example, if a witness goes last in the first round and first in the last round, it only confirms 1 block (lower left). If it goes first in the first round and last in the last round, then it confirms 41 blocks when it produces its own block (top-right). In order for the head block from that round to be marked as final, the witness would need to confirm at least 15 blocks. Thus, I marked the lower-left corner (14 confirmations or less) as yellow.

I reached the conclusion that this can't go beyond 22 by stepping diagonally up and right six times from the lower-left corner until I hit a 15. That was six steps. And 16 (from table-1) + 6 steps gives us 22 total.

Of course, all of this ignores the possibility for missed blocks, and I can't justify any of it empirically. It's just my intuitive attempt to visualize the way that things flow.

Update: I just noticed that I didn't count the starting position in those 6 diagonal steps, so make that 7 and 23.

Loading...
Loading...