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

Merge clock fix #114

Merged
merged 3 commits into from
Mar 19, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix post-txn trie debugging output for multi-logs receipts ([#86](https://github.com/0xPolygonZero/zk_evm/pull/86))
- Fixed *most* failing blocks caused by the merged in aggressive pruning changes ([#97](https://github.com/0xPolygonZero/zk_evm/pull/97))
- Fixed trie hash collision issue when constructing storage tries [#75](https://github.com/0xPolygonZero/zk_evm/pull/75)
- Fix interpreter rollback by adding the clock to generation state checkpoints ([#109] https://github.com/0xPolygonZero/zk_evm/pull/109)

## [0.1.1] - 2024-03-01

Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,38 @@ It uses starky and plonky2 as proving backend: https://github.com/0xPolygonZero/

* [proof_gen](./proof_gen/README.md): A convenience library for generating proofs from inputs already in Intermediate Representation (IR) format.

## Dependency graph

Below is a simplified view of the dependency graph, including the proving systems backend and the application layer defined within [zero-bin](https://github.com/0xPolygonZero/zero-bin).

```mermaid
flowchart TD
subgraph ps [proving systems]
A1{{plonky2}}
A2{{starky}}
end

subgraph zk_evm [zk_evm]
B[mpt_trie]
C[evm_arithmetization]
D[trace_decoder]
E[proof_gen]
A1 --> C
A1 --> E
A2 --> C
B --> C
B ---> D
C ---> D
C --> E
D --> E
end

F{zero-bin}
A1 --> F
C --> F
D --> F
E --> F
```

## Documentation

Expand Down
2 changes: 2 additions & 0 deletions evm_arithmetization/src/cpu/kernel/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ impl<F: Field> State<F> for Interpreter<F> {
GenerationStateCheckpoint {
registers: self.generation_state.registers,
traces: self.generation_state.traces.checkpoint(),
clock: self.get_clock(),
}
}

Expand Down Expand Up @@ -972,6 +973,7 @@ impl<F: Field> State<F> for Interpreter<F> {
fn push_keccak_sponge(&mut self, _op: KeccakSpongeOp) {}

fn rollback(&mut self, checkpoint: GenerationStateCheckpoint) {
self.clock = checkpoint.clock;
self.generation_state.rollback(checkpoint)
}

Expand Down
2 changes: 2 additions & 0 deletions evm_arithmetization/src/generation/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ impl<F: Field> State<F> for GenerationState<F> {
GenerationStateCheckpoint {
registers: self.registers,
traces: self.traces.checkpoint(),
clock: self.get_clock(),
}
}

Expand Down Expand Up @@ -643,6 +644,7 @@ impl<F: Field> Transition<F> for GenerationState<F> {
pub(crate) struct GenerationStateCheckpoint {
pub(crate) registers: RegistersState,
pub(crate) traces: TraceCheckpoint,
pub(crate) clock: usize,
}

/// Withdrawals prover input array is of the form `[addr0, amount0, ..., addrN,
Expand Down