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

Streamline the math gadget API #1765

Merged
merged 11 commits into from
Feb 15, 2024
Merged

Streamline the math gadget API #1765

merged 11 commits into from
Feb 15, 2024

Conversation

ChihChengLiang
Copy link
Collaborator

Description

We improve the readability by sweeping gadget constructors under the constraint builder.

Issue Link

Quick search and replace

Type of change

Refactor (no updates to logic)

Contents

  • changed XGadget::construct(cb, ...) to cb.x(...)
  • some IsZero checks are replaced with IsEqual checks.

Rationale

We keep consumption of the following gadgets unchanged because they are not used frequently enough.

  • abs_word
  • add_word
  • binary_number
  • byte_size
  • cmp_words
  • comparison
  • modulo
  • mul_add_words
  • mul_add_words512
  • mul_word_u64

@github-actions github-actions bot added the crate-zkevm-circuits Issues related to the zkevm-circuits workspace member label Feb 13, 2024
Copy link
Collaborator

@miha-stopar miha-stopar left a comment

Choose a reason for hiding this comment

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

LGTM!

@KimiWu123 KimiWu123 self-requested a review February 14, 2024 08:14
Copy link
Contributor

@KimiWu123 KimiWu123 left a comment

Choose a reason for hiding this comment

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

LGTM. Nice work!

@ChihChengLiang ChihChengLiang added this pull request to the merge queue Feb 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 15, 2024
@ChihChengLiang ChihChengLiang added this pull request to the merge queue Feb 15, 2024
Merged via the queue into main with commit cd5edab Feb 15, 2024
13 checks passed
@ChihChengLiang ChihChengLiang deleted the refactor-is-zero branch February 15, 2024 11:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crate-zkevm-circuits Issues related to the zkevm-circuits workspace member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants