This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 856
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
the
crate-zkevm-circuits
Issues related to the zkevm-circuits workspace member
label
May 14, 2023
4 tasks
han0110
approved these changes
May 16, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice refactor!
ed255
approved these changes
May 16, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The stats functions look cleaner now. I wasn't expecting such a big code reduction from this!
ChihChengLiang
added a commit
that referenced
this pull request
May 16, 2023
### Description We remove `#![allow(dead_code)]` everywhere in the codebases other than `zkevm-circuits`. This PR should be merged after #1407 ### Issue Link No issue yet ### Type of change - [x] 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) - [ ] This change requires a documentation update ### Contents - Removed `#![allow(dead_code)]` everywhere other than `zkevm-circuits`. - Make test utility functions like `Block::get_test_degree` and `Sha3CodeGen` public functions so that they don't cause `cargo build -p zkevm-circuits` to fail. This might come with the cost of extra compilation time. - Refactor `gen_sha3_code` into `Sha3CodeGen` so that we don't have to import `MemoryKind` to use it.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We have 4 utility commands that show us statistics of different circuits. Currently, these features were compiled with the tests, causing dependency and feature flags management troubles. The commands also cause confusion with the ignored test flags.
We can enjoy many benefits if we keep these commands in binary executables.
bin
directory, so we don't have confusing testing code.Issue Link
It was #1246. After exploring, I found room for improving the status quo.
Type of change
Contents
make stats_state_circuit
,make stats_evm_circuit
,make stats_copy_circuit
, andmake evm_exec_steps_occupancy
tobin
directory.stats
for these specific tools.DisplayTable
and replace all its use withcli-table
's feature. This has the benefit that the line of codes in the codebase reflects more on the core zkevm functionality. After we usedcli-table
, the table also rendered differently, see images below.cli-table
fromdev-dependency
todependency
, but as an optional dependency.subtle
andcriterion
After:
Before:
Rationale
Instrument
is buried deep in the ExecutionConfig. We intend to deal with it in future PRs to keep the diff of this one slim.pub(crate)
topub
How Has This Been Tested?
Manual run
make stats_state_circuit
,make stats_evm_circuit
,make stats_copy_circuit
, andmake evm_exec_steps_occupancy
and see if they work.