How rollbacks work
Recall that the server-source protocol begins with calling the $ exttt ( )$, corresponding to which a message is sent to the stream server, preparing to recei
Recall that the server-source protocol begins with calling the , corresponding to which a message is sent to the stream server, preparing to receive entries related to a specific atomic operation.
When the stream source sends the entries, the stream server appends the data of the entries to the stream file.
Once all entries have been sent, the stream source calls the function, and the header of the stream file is subsequently updated. In particular, the and fields.
But if the is triggered instead of the , the header is not updated.
In other words, the header of the stream file is updated only when the function is called. So, although some entries related to the atomic operation have already been added to the stream file, the header of the stream file is updated only with information of entries related to committed atomic operations.
Since the function can only be executed before a given atomic operation is committed, the header is not updated because the added entries (of the uncommitted atomic operation) will be overwritten with entries of the next atomic operation(s).
This means a rollback amounts to overwriting entries in the stream file that are related to an uncommitted atomic operation.
Example (Commit and rollback)
Suppose an operation has been started, and entries had already been added to the stream file when a rollback was triggered.
Since a rollback was triggered before was committed, the header of the stream file remains unaffected by the added entries.
Let's say the of the stream file is when the rollback occurred. Although the actual length of the stream is , the in the header of the stream file remains unchanged.
Suppose that the next atomic operation gets started and committed, but has only related entries.
Since is committed but only entries have been added to the stream file, the header will now reflect the to be . This means only of the entries of the previously uncommitted operation got overwritten, but the actual stream is still .
How is this not a problem from an application point of view?
It's because if a stream client requests for the stream, the stream server sends the stream only up to the recorded in the header of the stream file, , and not the actual length of the stream, .
Concluding remarks
The basic trick here is for the stream server to only use the information recorded in the header of the stream file, and to change that information only if an atomic operation is committed.
This way the stream server always sends the stream only up to the last entry of the committed operation.
All-in-all, this is just an optimal way to rollback. There's no need to delete information from the stream file. The header of the stream file is updated only if an atomic operation has been committed.
This is the main reason why parameters such as the and are recorded in the header of the stream file.
Last updated on
Stream file
Next is an explanation of the stream file structure. The stream file is created in a binary format instead of a text file. It has a header page and one or more
Introduction
The **zkEVM prover** is a software component with which the zkEVM generates proofs that attest to correct execution of programs given a specific set of inputs.