Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 5cb5032

Browse files
fix: several typos in the docs (#1028)
* fix typos README.md * fix typo README.md * fix typos Bytecode_Circuit.md * fix typo EVM_Circuit.md * fix typo Keccak_Circuit.md
1 parent b3db7f0 commit 5cb5032

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

aggregator/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ c_i.post_state_root == c_{i+1}.prev_state_root
3636
for $i \in [1, k-1]$.
3737

3838
## Padded chunk
39-
A __padded chunk__ is a chunk that repeats last valid chunk. It is used for padding.
39+
A __padded chunk__ is a chunk that repeats the last valid chunk. It is used for padding.
4040
If $k< n$, $(n-k)$ padded chunks are padded to the list. A padded chunk has the same data fields as the last real chunk, and the parameters are set as
4141
- state root before this chunk: `c_{k}.prev_state_root`
4242
- state root after this chunk: `c_{k}.post_state_root`
@@ -97,7 +97,7 @@ for i in 1 ... n
9797
chunk_pi_hash := keccak(chain_id || prev_state_root || post_state_root || withdraw_root || chunk_data_hash)
9898
```
9999

100-
This is done by compute the RLCs of chunk[i]'s data_hash for `i=0..k`, and then check the RLC matches the one from the keccak table.
100+
This is done by computing the RLCs of chunk[i]'s data_hash for `i=0..k`, and then check the RLC matches the one from the keccak table.
101101

102102
4. chunks are continuous when they are not padded: they are linked via the state roots.
103103

@@ -106,7 +106,7 @@ for i in 1 ... k-1
106106
c_i.post_state_root == c_{i+1}.prev_state_root
107107
```
108108

109-
5. All the chunks use a same chain id. __Static__.
109+
5. All the chunks use the same chain id. __Static__.
110110
```
111111
for i in 1 ... n
112112
batch.chain_id == chunk[i].chain_id
@@ -119,7 +119,7 @@ for i in 1 ... n:
119119
chunk[i]'s chunk_pi_hash_rlc_cells == chunk[i-1].chunk_pi_hash_rlc_cells
120120
```
121121
This is done via comparing the `data_rlc` of `chunk_{i-1}` and ` chunk_{i}`.
122-
7. the hash input length are correct
122+
7. the hash input length is correct
123123
- first MAX_AGG_SNARKS + 1 hashes all have 136 bytes input
124124
- batch's data_hash length is 32 * number_of_valid_snarks
125125
8. batch data hash is correct w.r.t. its RLCs
@@ -131,7 +131,7 @@ This is done via comparing the `data_rlc` of `chunk_{i-1}` and ` chunk_{i}`.
131131
![Dynamic_inputs](./figures/hash_table.jpg)
132132

133133

134-
Our keccak table uses $2^{19}$ rows. Each keccak round takes `300` rows. When the number of round is is less than $2^{19}/300$, the cell manager will fill in the rest of the rows with dummy hashes.
134+
Our keccak table uses $2^{19}$ rows. Each keccak round takes `300` rows. When the number of round is less than $2^{19}/300$, the cell manager will fill in the rest of the rows with dummy hashes.
135135

136136
The only hash that uses dynamic number of rounds is the last hash.
137137
Suppose we target for `MAX_AGG_SNARK = 10`. Then, the last hash function will take no more than `32 * 10 /136 = 3` rounds.
@@ -154,4 +154,4 @@ For the output of the final data hash
154154
|9,10 | 64 | 0, 0, 1|
155155

156156
Additional checks for dummy chunk
157-
- if `is_padding` for `i`-th chunk, we constrain `chunk[i]'s chunk_pi_hash_rlc_cells == chunk[i-1].chunk_pi_hash_rlc_cells`
157+
- if `is_padding` for `i`-th chunk, we constrain `chunk[i]'s chunk_pi_hash_rlc_cells == chunk[i-1].chunk_pi_hash_rlc_cells`

bus-mapping/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ prover to pick any location here and in the EVM proof confirm it is correct.
2727
time. It checks the validity of these opcodes. It also confirms that for
2828
each of these opcodes the state proof performed the correct operation.
2929

30-
Only after verifying both proofs are we confident that that Ethereum block
30+
Only after verifying both proofs are we confident that the Ethereum block
3131
is executed correctly.
3232

3333
### Bus Mapping

docs/Bytecode_Circuit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The EVM Circuit needs to lookup to the bytecode table that stores the correct by
1515
|RLC of hash's little-endian bytes using evm_word randomness|BytecodeFieldTag::Header|0|0|len of bytes|
1616
|RLC of hash's little-endian bytes using evm_word randomness|BytecodeFieldTag::Byte|idx|true when the byte is not an argument to a PUSHx instruction|byte|
1717

18-
Here `Header` is used to seperate bytecodes.
18+
Here `Header` is used to separate bytecodes.
1919

2020
## Purpose of the Bytecode Circuit
2121

@@ -98,5 +98,5 @@ Here
9898
- when `tag` is `byte`, then lookup to push_table for `(value, push_data_size)`
9999

100100
- correct propagation of each row within one bytecode
101-
- when `tag` transits from `byte` to `byte`, then `length` and `hash` remain the same, `index` increse by 1, `value_rlc` accumulates, and for push data `push_data_left` decay by 1, for code `push_data_left` remains the same as `push_data_size`
101+
- when `tag` transits from `byte` to `byte`, then `length` and `hash` remain the same, `index` increases by 1, `value_rlc` accumulates, and for push data `push_data_left` decay by 1, for code `push_data_left` remains the same as `push_data_size`
102102

docs/EVM_Circuit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Analogously, in EVM Circuit, we build <i>execution steps</i> according to the st
2929

3030
## Architecture
3131

32-
We decompose the execution trace into execution steps and impose constraints for each step/step state transition. A `Step` contains two parts: `StepState` carries the execution step and its context information; and `CellManager` helps to fill the step's information as witnesses into the circuit's cells. An API layer `ConstraintBuilder` is built upon the backend proof system (Halo2) to impose constraints. The oveall architecture looks as follows:
32+
We decompose the execution trace into execution steps and impose constraints for each step/step state transition. A `Step` contains two parts: `StepState` carries the execution step and its context information; and `CellManager` helps to fill the step's information as witnesses into the circuit's cells. An API layer `ConstraintBuilder` is built upon the backend proof system (Halo2) to impose constraints. The overall architecture looks as follows:
3333

3434
```mermaid
3535
stateDiagram
@@ -362,4 +362,4 @@ For RETURNDATACOPY opcode, EVM Circuit does the following type of constraint che
362362
- `SameContextGadget`
363363
- opcodeID checks: opId $==$ OpcodeId(0x3e);
364364
- state transition: rw_counter+, stack\_pointer+3, pc+1, gas -(op_cost+memory expansion cost), memory expand to next memory word size.
365-
365+

docs/Keccak_Circuit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Cyclic shift offset constants $r[x,y]$ are picked according to the following tab
6565
| $y=4$ | 56 | 14 | 18 | 2 | 61 |
6666
| $y=3$ | 21 | 8 | 41 | 45 | 15 |
6767

68-
Round constants $RC[k]$ are also given, in hexiadecimal notion it looks like:
68+
Round constants $RC[k]$ are also given, in hexadecimal notion it looks like:
6969

7070
$$\begin{array}{ll}
7171
RC[ 0] & \verb"0x0000000000000001"
@@ -226,7 +226,7 @@ The parts splitted from the word is then determined bit-by-bit from `target_size
226226
- `uniform` is true, then the remaining `rot`-sized bits [63-`rot`+1,...,63] are divided by `part_size` plus a remainder, and first 64-`rot` bits are determined by a section compensating previous remainder, plus divide by `part_size`, and plus the remainder from `target_size` division;
227227
- `uniform` is false, then the remaining `rot`-sized bits [63-`rot`+1,...,63] are divided by `part_size` plus remainder, and first 64-`rot` bits determined by `part_size` plus a remainder.
228228

229-
The way we do the above split when `uniform` is true enables an optimization shown below, where after rotation the front and tail remainders combined together becomes an inverval of length `part_size`:
229+
The way we do the above split when `uniform` is true enables an optimization shown below, where after rotation the front and tail remainders combined together becomes an interval of length `part_size`:
230230

231231
![split_normalize_true](https://hackmd.io/_uploads/S1V-8qoKn.png)
232232

@@ -350,7 +350,7 @@ $$os[i][j]=s[i][j]+bc[(i+4)\mod 5]+\text{rot}(bc[(i+1)\mod 5], 1) $$ and set it
350350

351351
#### Rationale
352352
- <i>Soundness</i>: Use the symbols in the previous section on Keccak-f permutation function, it can be checked that $C[x]$ is the same as the parity of $A[x,0]+A[x,1]+...+A[x,4]$. So this is what $bc[i]$ checks at the `normalize_6` table lookup step.
353-
In a same rationale, $os[i][j]$ after normalization stands for the parity of $A[x,y]\oplus D[x]$. This normalization is postponed to $\rho/\pi$-step using `normalize_4` table lookup.
353+
In the same rationale, $os[i][j]$ after normalization stands for the parity of $A[x,y]\oplus D[x]$. This normalization is postponed to $\rho/\pi$-step using `normalize_4` table lookup.
354354
- <i>Completeness</i>: Since $C[x]$ is the same as the parity of $A[x,0]+A[x,1]+...+A[x,4]$, any selection of witnesses that satisfy original $\theta$-step in the Section on Keccak-f permutation function will pass the constraints.
355355

356356
### rho/pi-step

0 commit comments

Comments
 (0)