You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Description
- Bus-Mapping has two library docs, one is inside the lib.rs, another
locates in README.md, untested. We remove the one in lib.rs and make the
README one checked.
- ExecutionSteps and ExecutionTrace were
We hope the update can reduce confusion.
### Issue Link
### Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [x] This change requires a documentation update
- [ ] Refactor (no updates to logic)
### How Has This Been Tested?
```
cargo test --doc
```
---------
Co-authored-by: sm.wu <[email protected]>

3
+
The `Bus-Mapping` crate is designed to parse EVM execution traces and manipulate the data they provide to obtain structured witness inputs forthe EVM Proof and the State Proof.
4
4
5
-
`Bus-Mapping` is a crate designed to parse EVM execution traces and manipulate
6
-
all of the data they provide in order to obtain structured witness inputs
7
-
for the EVM Proof and the State Proof.
5
+
## Introduction
8
6
9
-
### Introduction
10
-
At the moment every node on ethereum has to validate every transaction in
11
-
the ethereum virtual machine. This means that every transaction adds work
12
-
that everyone needs to do to verify Ethereum’s history. Worse still is that
13
-
each transaction needs to be verified by every new node. Which means the
14
-
amount of work a new node needs to do the sync the network is growing
15
-
constantly. We want to build a proof of validity for the Ethereum blocks to
16
-
avoid this.
7
+
Currently, every node on Ethereum must validate every transaction in the Ethereum Virtual Machine (EVM). This means that each transaction adds work that everyone must do to verify Ethereum’s history. Furthermore, each transaction needs to be verified by every new node, leading to a growing amount of work for new nodes to sync the network. To address this, we aim to build a proof of validity for Ethereum blocks.
17
8
18
-
This means making a proof of validity for the EVM + state reads / writes +
19
-
signatures.
20
-
To simplify we separate our proofs into two components.
9
+
This involves creating a proof of validity for the EVM, including state reads/writes and signatures. To simplify, we divide our proofs into two components:
21
10
22
-
- State proof: State/memory/stack ops have been performed correctly. This
23
-
does not check if the correct location has been read/written. We allow our
24
-
prover to pick any location here and in the EVM proof confirm it is correct.
11
+
- State Proof: Validates that state/memory/stack operations have been performed correctly. However, it does not verify if the correct location has been read/written. Our prover can select any location here and in the EVM proof confirm its correctness.
12
+
- EVM Proof: Validates that the correct opcode is called at the correct time, checking the validity of these opcodes. It also confirms that for each of these opcodes, the state proof performed the correct operation.
25
13
26
-
- EVM proof: This checks that the correct opcode is called at the correct
27
-
time. It checks the validity of these opcodes. It also confirms that for
28
-
each of these opcodes the state proof performed the correct operation.
14
+
Only after verifying both proofs can we be confident that the Ethereum block is executed correctly.
29
15
30
-
Only after verifying both proofs are we confident that that Ethereum block
31
-
is executed correctly.
16
+
## Bus Mapping
32
17
33
-
### Bus Mapping
34
18
The goal of this crate is to serve as:
35
-
- A parsing lib for EVM execution traces.
36
-
- A way to infer some witness data that can only be constructed once we've
37
-
analyzed the full exec trace.
38
-
- An easy interface to collect all of the data to witness into the circuits
39
-
and witness it with few function calls.
40
-
41
-
### Parsing
42
-
Provided a JSON file or a JSON as a stream of bytes, which contains an
43
-
execution trace from an EVM, you can parse it and construct an
44
-
`ExecutionTrace` instance from it. That will automatically fill all of the
45
-
bus-mapping instances of each
46
-
[`ExecutionStep`](crate::exec_trace::ExecutionStep) plus fill in an
47
-
[`OperationContainer`](crate::operation::container::OperationContainer) with
48
-
all of the Memory, Stack and Storage ops performed by the provided trace.
19
+
20
+
- A parsing library for EVM execution traces.
21
+
- A way to infer some witness data that can only be constructed once we've analyzed the full exec trace.
22
+
- An easy interface to collect all of the data to witness into the circuits and witness it with few function calls.
23
+
24
+
## Parsing
25
+
26
+
Given a JSON file or a JSON stream containing an execution trace from an EVM, you can parse it and construct a [`GethExecTrace`](eth_types::GethExecTrace) instance from it. This will automatically populate all of the bus-mapping instances of each [`ExecStep`](crate::circuit_input_builder::ExecStep) and fill an [`OperationContainer`](crate::operation::OperationContainer) with all of the memory, stack, and storage operations performed by the provided trace.
- Iterate over the [`GethExecTrace`](eth_types::GethExecTrace) itself, over each [`ExecStep`](crate::circuit_input_builder::ExecStep) formed by, and check which Stack/Memory&Storage operations are linked to each step. This is also automatically done via the [`Opcode`](crate::evm::opcodes::Opcode) trait defined in this crate.
0 commit comments