Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: parity circuit naming fixes #5076

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions yellow-paper/docs/rollup-circuits/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ For transactions we have:
- Merges two `merge` rollup proofs

And for the message parity we have:
- The `root` circuit
- Merges `N` `root` or `leaf` proofs
- The `leaf` circuit
- The `root_parity` circuit
- Merges `N` `root` or `base_parity` proofs
- The `base_parity` circuit
- Merges `N` l1 to l2 messages in a subtree

In the diagram the size of the tree is limited for demonstration purposes, but a larger tree would have more layers of merge rollups proofs.
Expand Down Expand Up @@ -91,10 +91,10 @@ graph BT

R((RootParity))

T0[LeafParity]
T1[LeafParity]
T2[LeafParity]
T3[LeafParity]
T0[BaseParity]
T1[BaseParity]
T2[BaseParity]
T3[BaseParity]

T0_P((RootParity 0))
T1_P((RootParity 1))
Expand Down Expand Up @@ -371,7 +371,7 @@ class MergeRollupInputs {
MergeRollupInputs *-- ChildRollupData: left
MergeRollupInputs *-- ChildRollupData: right

class LeafParityInputs {
class BaseParityInputs {
msgs: List~Fr[2]~
}

Expand Down
2 changes: 1 addition & 1 deletion yellow-paper/docs/rollup-circuits/root-rollup.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class ChildRollupData {
ChildRollupData *-- BaseOrMergeRollupPublicInputs: public_inputs


class LeafParityInputs {
class BaseParityInputs {
msgs: List~Fr[2]~
}

Expand Down
14 changes: 7 additions & 7 deletions yellow-paper/docs/rollup-circuits/tree-parity.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ As SHA256 is not snark-friendly, weak devices would not be able to prove inclusi
This circuit is responsible for converting the tree such that users can easily build the proofs.
We essentially use this circuit to front-load the work needed to prove the inclusion of messages in the tree.
As earlier we are using a tree-like structure.
Instead of having a `base`, `merge` and `root` circuits, we will have only `leaf` and `root` parity circuits.
Instead of having a `base`, `merge` and `root` circuits, we will have only `base` and `root` parity circuits.
We only need these two, since what would have been the `merge` is doing the same as the `root` for this case.

```mermaid
graph BT
R((RootParity))

T0[LeafParity]
T1[LeafParity]
T2[LeafParity]
T3[LeafParity]
T0[BaseParity]
T1[BaseParity]
T2[BaseParity]
T3[BaseParity]

T0_P((RootParity 0))
T1_P((RootParity 1))
Expand Down Expand Up @@ -91,7 +91,7 @@ class RootParityInput {
}
RootParityInput *-- ParityPublicInputs: public_inputs

class LeafParityInputs {
class BaseParityInputs {
msgs: List~Fr[2]~
}
```
Expand All @@ -101,7 +101,7 @@ If each just take 2 inputs, the overhead of recursing through the layers might b
Recall that all the inputs are already chosen by the L1, so we don't need to worry about which to chose.

```python
def base_parity_circuit(inputs: LeafParityInputs) -> ParityPublicInputs:
def base_parity_circuit(inputs: BaseParityInputs) -> ParityPublicInputs:
sha_root = MERKLE_TREE(inputs.msgs, SHA256);
converted_root = MERKLE_TREE(inputs.msgs, SNARK_FRIENDLY_HASH_FUNCTION);
return ParityPublicInputs(sha_root, converted_root)
Expand Down
Loading