Articles Community Debriefs Weekly Debrief

Tomislav Shows Finalization

Tomislav helps us visualize the DAG that we are finalizing “because without that it is very difficult to understand what the code is doing and how we are progressing in a good direction.”

Transcript below:

0:00:00 So I want to show that this is the repository where I was working on the simulator and the validation implementation. And one of the important things is that we need to visualize the DAG that we are finalizing because without that, it’s very difficult to to understand what the code is doing and how we are progressing in a good direction. So, I want to show when we were talking about the conversation fringes, because with multi-parent finalization, we are not finalizing only one block, we are finalizing the boundary – the layer.

0:00:41And so, it’s not just easy to imagine what what exactly where this boundary is, and you’ve probably seen our visualization with the graph with which node can generate the source. So, for example, we can have things like like that. But what I want to show today is the fringes and what I did is, I made some coloring on the same visualization graph because the graph is supported. So you can see here in this very simple, or very simple DAG, in a sense that all validators are producing blocks at the same time. So we see here that each color represents a different finalization fringe. So if we’re starting from the Genesis as the first finalized block, it doesn’t have to be we are looking to simplify the Genesis ceremony where we can apply the same logic for even from the Genesis block.

0:02:00 So here Genesis is finalized and then each layer, and this is what we are calling the fringe, is finalized when the new blocks are built on top, so the last three layers cannot be finalized yet because they don’t have enough stake. But you can see here how…what I wasn’t able to finish today is to mark which block finalizes which fringe. So for example, the block 04 can finalize the first fringe – this purple one -so I’m planning to include some kind of border of each block in the same color. So, when you look at this DAG, you can immediately find out which block is referring to which fringe.

0:02:59 So, now, I want to show more with a little bit more complicated DAGS. So, we can see here that even in this DAG, we cannot finalize even the first layer because the network is split so, the layer doesn’t have enough stake. But now when we have some merging of the branches, now, we see the the layer finalized and if we have even more blocks, now we see how the fringe can be – even even if some node is a little bit late – when this node produces new blocks, this fringe becomes finalized. And maybe some little more complicated DAGS or longer DAGS you can see here how these fringes are finalized. In the sense they’re equalizing because even if some node is slower, it will have some gaps, but the faster node will have more blocks included in this fringe.

0:04:30 – So for example here between this purple and pink, we have these white ones, and this just means that all of these white ones are they’re included in the next fringe. So this node was little bit faster, this was slower, and when the next layer was calculated, all of these blocks are finalized together with this pink one.

0:05:03 – And this is an even more longer DAG. And, for example, this is difficult to recognize what is going on, because this is something that we will have if we detect some strange situation in the DAG, we can generate the specific… so we are generating random (???) in these DAGS. And even if we catch some some bug in the future, we can store the randomly generated DAG in that moment, so that we can create the test from this specific DAG, and include it in all future code. And even if we later, when we apply the fix, we want to be sure that we don’t have some kind of regression bugs. And so we can replay all the specific tests. So, this is one of one of these DAGS that we catch some bugs. And now, now, it’s included in the in the simulator,

0:06:21 – And you can see here how this DAG is missing lots of blocks. So, finalization is very difficult to achieve. So, there is lots of blocks created and there is not too many fringes. So, this is probably something that we will not see in the real network, but we can definitely simulate these kinds of DAGS. And of course, all this coloring will be will include in the node code, and so any user can can use it to generate and see the DAG.

And this is all that I wanted to show.