I understand how the state tree works at least for the most part. Is the State Tree an artifact that is created per block in a subnet or is it a global entity for all blocks that make up the chain in a subnet? Thanks in advance.
Every block contains an updated state tree that is close to the previous one but has multiple changes. E.g. the current system time is included in the state tree, and that changes from block to block
Thanks for the reply. So every block basically gets a new state tree it works with. It is not like there is a State Tree created on start up and every block uses it. Am I understanding this correctly?
Yes. Every block is a new state, so there is a new state tree
Thanks. That makes sense. But it looks like from the documentation that there is a global entity that is leveraged for the CUP package. I read it under the Replicated State Structure. It reads as follows:
A Catch-Up Package (CUP) is a special message (not on the blockchain) that has (mostly) everything a replica needs to begin working in a given epoch, without knowing anything about previous epochs. It consists of the following data fields:
The root of a Merkle hash tree for the entire replicated state (as opposed to the partial, per-round certified state).
The summary block for the epoch.
The random beacon for the first round of the epoch.
A signature on the above fields under the (n − f)-out-of-n threshold signing key for the subnet.
Thanks in advance.
That is correct. I would consider this an implementation detail - from a protocol perspective you get a new state tree for every round. Since the state tree contains a lot of information (according to your link hundreds of GB) it isn’t always copied in its entirety for every round. Instead, the last CUP plus a diff is stored. When the subnet creates a new checkpoint then everything is serialized again into a new CUP