Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

feat: add anchor transaction circuit #105

Merged
merged 21 commits into from
Jun 22, 2023
Merged

feat: add anchor transaction circuit #105

merged 21 commits into from
Jun 22, 2023

Conversation

johntaiko
Copy link

@johntaiko johntaiko commented Jun 1, 2023

@Brechtpd Brechtpd requested a review from ggkitsas June 5, 2023 12:28
zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit/sign_verify.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/witness/taiko.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit/sign_verify.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit/sign_verify.rs Outdated Show resolved Hide resolved
@johntaiko johntaiko force-pushed the feat/anchor_tx branch 3 times, most recently from 3e47d2e to dfa9da6 Compare June 19, 2023 17:06
@Brechtpd
Copy link

Haven't looked into all the changes in detail, but the changes look very good! Will look more closely tomorrow.

Copy link

@ggkitsas ggkitsas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Mentioned some potential optimisation points for reducing the column number.

zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit/sign_verify.rs Outdated Show resolved Hide resolved
Copy link

@Brechtpd Brechtpd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

I think one thing that is missing is byte lookups to ensure that all bytes are in the [0,255] range? Both in the anchor circuit and the sign_verify circuit.

Created a PR with some other misc changes to mainly add some extra comments: #116

gadgets/src/is_equal.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit.rs Outdated Show resolved Hide resolved
zkevm-circuits/src/anchor_tx_circuit/sign_verify.rs Outdated Show resolved Hide resolved
zkevm-circuits/Cargo.toml Outdated Show resolved Hide resolved
@johntaiko johntaiko force-pushed the feat/anchor_tx branch 3 times, most recently from e960000 to 3622cbd Compare June 21, 2023 12:51
@johntaiko
Copy link
Author

@Brechtpd @ggkitsas
All problems are fixed, pls give a final review

);

// Range constraint all bytes
meta.lookup_any("ensure all bytes are actually byte values", |meta| {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just simplified this one so the lookup is always done. This is fine because the column is always used to store just byte values, or is not used in which case it just stores 0.

@Brechtpd Brechtpd merged commit c85976c into main Jun 22, 2023
xiaodino added a commit that referenced this pull request Jun 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In-circuit anchor transaction checks
3 participants