Skip to content

Commit

Permalink
Merge clock fix (#114)
Browse files Browse the repository at this point in the history
* Add dependency graph (#107)

* Add clock to GenerationStateCheckpoint and fix interpreter rollback (#109)

* Add clock to GenerationStateCheckpoint and fix interpreter rollback

* Add CHANGELOG entry

---------

Co-authored-by: Robin Salen <30937548+Nashtare@users.noreply.github.com>
Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 19, 2024
1 parent 39bf13b commit a83b2ba
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
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

0 comments on commit a83b2ba

Please sign in to comment.