Skip to content

Commit 1054ef4

Browse files
authored
Update index.md
1 parent 2ee8c21 commit 1054ef4

File tree

1 file changed

+17
-17
lines changed
  • docs/zkEVM/architecture/l2-state-tree

1 file changed

+17
-17
lines changed

docs/zkEVM/architecture/l2-state-tree/index.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
This document explains how the zkEVM proving system manages changes in the L2 state tree.
22

3-
The main components of the zkEVM proving system are, the ROM, the prover _hashDB_, and the storage state machine's executor.
3+
The main components of the zkEVM proving system are, the ROM, the prover HashDB, and the storage state machine's executor.
44

55
In the zkEVM context, as in Ethereum, it is crucial to ensure the accuracy of state changes resulting from the execution of transactions.
66

77
## zkEVM ROM
88

9-
The zkEVM ROM, written in zero-knowledge Assembly (zkASM), is a program designed to prove computations related to correct L2 state transitions resulting from L2 transactions in a given batch.
9+
The zkEVM ROM, written in zero-knowledge assembly (zkASM), is a program designed to prove computations related to correct L2 state transitions resulting from L2 transactions in a given batch.
1010

1111
Often, multiple zkASM instructions are used to implement a single zkEVM opcode.
1212

1313
The L2 state is captured in the form of a Merkle tree, and its Merkle root, referred to as the _state root_, uniquely represents the summary of the current state data.
1414

15-
The zkEVM ROM must, therefore, have the capability to correctly execute the _create_, _read_, _update_, and _delete_ (CRUD) operations on the Merkle tree.
15+
The zkEVM ROM must, therefore, have the capability to correctly execute the `CREATE`, `READ`, `UPDATE`, and `DELETE` (CRUD) operations on the Merkle tree.
1616

1717
## The storage state machine
1818

@@ -24,13 +24,13 @@ Any operation applied to the Merkle tree must be evidenced with proof, attesting
2424

2525
Such a proof consists of the sibling node and other relevant hash nodes sufficient for verification purposes. This is called a Merkle proof.
2626

27-
An example of a Merkle proof can be found in the [Concepts section](https://docs.polygon.technology/zkEVM/concepts/sparse-merkle-trees/sparse-merkle-tree/?h=merkle+proof#keys-and-navigating-a-merkle-tree).
27+
An example of a Merkle proof can be found in the [Concepts section](../../concepts/sparse-merkle-trees/sparse-merkle-tree.md).
2828

2929
Verifying a Merkle proof involves using the given information to compute the Merkle root and checking if it matches the actual Merkle root.
3030

3131
After processing the last L2 transaction in a batch, the resulting root becomes the _new state root_.
3232

33-
### Example. (Proving read and update operations)
33+
### Example. (Proving `READ` and `UPDATE` operations)
3434

3535
We provide illustrative examples showcasing two CRUD operations on the L2 state: _read_ and _update_ operations.
3636

@@ -40,19 +40,19 @@ The storage state machine is responsible for providing validity proofs of these
4040

4141
Consider the figure above, where the objective is to read the information stored in the fourth leaf ($l_4$).
4242

43-
Suppose a user carries out a transaction, and let $l_4$ represent the balance of the account that initiates the transaction.
43+
Suppose a user carries out a transaction and $l_4$ represents the balance of the account that initiates the transaction.
4444

45-
In the process of reading this leaf, it is crucial to verify its _inclusion_ in the current state at the specified position.
45+
In the process of reading this leaf, it is crucial to verify its inclusion in the current state at the specified position.
4646

47-
This is deterministically computed from some unique properties of the data being stored, such as the account address or the type of data.
47+
This is deterministically computed from some unique properties of the stored data, such as the account address or the data type.
4848

49-
In the figure above, the blue boxes represent data that must be supplied to the storage state machine for the generation of the execution trace.
49+
In the figure above, the blue boxes represent data that must be supplied to the storage state machine for generating the execution trace.
5050

51-
As typically required when verifying a Merkle proof, the data stored in the blue boxes enable the storage state machine to validate that the computed root matches the state root of the Merkle tree.
51+
As typically required when verifying a Merkle proof, the data stored in the blue boxes enables the storage state machine to validate that the computed root matches the state root of the Merkle tree.
5252

5353
![Figure: _](../../../img/zkEVM/l2state-update-proof-eg.png)
5454

55-
Consider the figure above, and in this case we examine a scenario where a leaf is updated.
55+
Consider the figure above, which depicts a scenario where a leaf is updated.
5656

5757
A leaf update means changing the leaf's value, which consequently modifies the state root.
5858

@@ -62,17 +62,17 @@ The storage state machine is used once again to generate an execution trace, ens
6262

6363
Following the same procedure as in the _read_ case, the consistency of the state root is verified to confirm that the changes have been accurately executed.
6464

65-
## The storage SM executor and hashDB
65+
## The storage state machine's executor and HashDB
6666

67-
All essential hashes required for computing execution traces are stored in the _hashDB_.
67+
All essential hashes required for computing execution traces are stored in the HashDB.
6868

69-
During the execution of the L2 state’s related zkEVM opcodes, such as SSTORE or SLOAD, the storage state machine’s executor consistently retrieves values from the hashDB and uses them to construct the corresponding execution traces.
69+
During the execution of the L2 state’s related zkEVM opcodes, such as `SSTORE` or `SLOAD`, the storage state machine’s executor consistently retrieves values from the HashDB and uses them to construct the corresponding execution traces.
7070

71-
The hashDB contains all the hashes, which are all the nodes of the Merkle tree of the L2 state.
71+
The HashDB contains all the hashes, which are all the nodes of the Merkle tree of the L2 state.
7272

73-
The figure below depicts an interaction of the executor with the hashDB, when proving the state transition from $S^{L2_x}_i$ to $S^{L2_x}_{i+1}$.
73+
The figure below depicts an interaction of the executor with the HashDB, when proving the state transition from $S^{L2_x}_i$ to $S^{L2_x}_{i+1}$.
7474

75-
The executor takes as inputs, the current state $S^{L2_x}_i$ and a batch of transactions, retrieves Merkle proofs from the hashDB, and produces the execution trace representing all changes to the state tree.
75+
The executor takes as inputs, the current state $S^{L2_x}_i$ and a batch of transactions, retrieves Merkle proofs from the HashDB, and produces the execution trace representing all changes to the state tree.
7676

7777
![Figure: _ ](../../../img/zkEVM/l2state-executor-hashdb-exec-trace.png)
7878

0 commit comments

Comments
 (0)