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

refactor(contract-verifier): Brush up contract verifier #3189

Merged
merged 21 commits into from
Nov 4, 2024

Conversation

slowli
Copy link
Contributor

@slowli slowli commented Oct 29, 2024

What ❔

Brushes up contract verifier code.

Why ❔

Would make it easier to support EVM emulation in the contract verifier.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zkstack dev fmt and zkstack dev lint.

@slowli slowli force-pushed the aov-pla-1059-brush-up-contract-verifier branch from c630768 to 45003b5 Compare October 29, 2024 13:36
@slowli slowli force-pushed the aov-pla-1059-brush-up-contract-verifier branch from 45003b5 to ddc5c8e Compare October 29, 2024 14:23
@slowli slowli marked this pull request as ready for review October 29, 2024 15:43
@slowli slowli requested a review from a team as a code owner October 29, 2024 15:43
Copy link
Contributor Author

@slowli slowli left a comment

Choose a reason for hiding this comment

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

  • Is the contract verifier library used somewhere externally? (Looks like that judging by commit history.) These uses would probably need to be updated, and I'm not quite sure which verifier APIs should be public.
  • I don't see a compelling reason why the contract verifier API should be a node component, especially given that the verifier backend is not a component. I think it could work autonomously provided that it uses some interface to interact with a node (namely, fetch the contract bytecode, contract deployer events and the deploying transaction). All of these seem to be covered by the Web3 RPC. Would such a refactoring be too deep to handle? (Obviously, won't do it in this PR since it's large as-is.)

core/lib/contract_verifier/Cargo.toml Show resolved Hide resolved
perekopskiy
perekopskiy previously approved these changes Oct 31, 2024
Copy link
Contributor

@perekopskiy perekopskiy left a comment

Choose a reason for hiding this comment

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

Is the contract verifier library used somewhere externally?

@AntonD3 please help with it.

I don't see a compelling reason why the contract verifier API should be a node component

It shouldn't. It was a compromise to put it there. Overall I wouldn't proceed with any deep refactoring unless it's clearly needed/beneficial short term. There were discussions about moving contract verifier out of zksync-era somewhere closer to block-explorer but this was deprioritized. So its future is not determined

core/lib/contract_verifier/Cargo.toml Show resolved Hide resolved
yorik
yorik previously approved these changes Nov 1, 2024
Copy link
Contributor

@yorik yorik left a comment

Choose a reason for hiding this comment

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

Approve for workflows

@slowli slowli added this pull request to the merge queue Nov 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 1, 2024
@slowli slowli dismissed stale reviews from yorik and perekopskiy via 43bc3cc November 1, 2024 12:36
@slowli slowli requested review from perekopskiy and yorik November 1, 2024 12:54
@slowli slowli enabled auto-merge November 1, 2024 13:37
@slowli slowli added this pull request to the merge queue Nov 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 1, 2024
@slowli slowli added this pull request to the merge queue Nov 1, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 1, 2024
Copy link
Member

@popzxc popzxc left a comment

Choose a reason for hiding this comment

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

Sorry for being late to the party. Looks great!
Left a few nits, but feel free to ignore.

core/lib/contract_verifier/src/lib.rs Show resolved Hide resolved
core/lib/contract_verifier/src/resolver.rs Show resolved Hide resolved
core/lib/contract_verifier/src/tests/real.rs Show resolved Hide resolved
@slowli
Copy link
Contributor Author

slowli commented Nov 4, 2024

@popzxc I'm preparing a follow-up PR that adds EVM emulation support to the contract verifier; will address your suggestions there.

@slowli slowli added this pull request to the merge queue Nov 4, 2024
Merged via the queue into main with commit 719455c Nov 4, 2024
43 checks passed
@slowli slowli deleted the aov-pla-1059-brush-up-contract-verifier branch November 4, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants