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: Brush up repo for publishing (pt. 3) #60

Merged
merged 32 commits into from
Sep 18, 2024

Conversation

slowli
Copy link
Contributor

@slowli slowli commented Sep 13, 2024

What ❔

  • Documents all public items, applies the corresponding lint.
  • Applies more clippy lints.
  • Makes snapshot management private. Makes some more types / traits private as well (e.g., PtrOp trait).
  • Exposes Snapshot and StorageChange types.
  • Re-exports zksync_vm2_interface as the interface module instead of re-exporting its items.
  • Removes potential UB during offset_from calls.

Why ❔

Part of preparations for publishing the VM.

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 cargo fmt and cargo clippy.

@slowli slowli force-pushed the aov-pla-1027-brush-up-vm2-repo-for-publishing-pt3 branch 2 times, most recently from 6b10eeb to d7b696a Compare September 13, 2024 17:19
@slowli slowli force-pushed the aov-pla-1027-brush-up-vm2-repo-for-publishing-pt3 branch from d7b696a to ab46e97 Compare September 13, 2024 17:24
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.

  • Can split the PR into parts if it makes it more reviewable.
  • There are some debatable decisions (e.g., enabling pedantic clippy lints – I think it makes code better, but this is subjective).
  • The built crate docs are available.

crates/vm2/src/callframe.rs Show resolved Hide resolved
crates/vm2/src/callframe.rs Outdated Show resolved Hide resolved
crates/vm2/src/callframe.rs Show resolved Hide resolved
crates/vm2/src/tests/mod.rs Outdated Show resolved Hide resolved
crates/vm2/src/rollback.rs Outdated Show resolved Hide resolved
@slowli slowli marked this pull request as ready for review September 13, 2024 17:40
@slowli
Copy link
Contributor Author

slowli commented Sep 16, 2024

Here's the corresponding PR on the Era side: matter-labs/zksync-era#2883. There's performance regression on some iai benches (order of 2–3%); will investigate its cause.

crates/vm2/src/lib.rs Outdated Show resolved Hide resolved
crates/vm2/src/program.rs Outdated Show resolved Hide resolved
crates/vm2/src/vm.rs Outdated Show resolved Hide resolved
@slowli slowli force-pushed the aov-pla-1027-brush-up-vm2-repo-for-publishing-pt3 branch from fcdbee7 to fbabb85 Compare September 17, 2024 10:50
joonazan
joonazan previously approved these changes Sep 17, 2024
Copy link
Contributor

@joonazan joonazan left a comment

Choose a reason for hiding this comment

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

Looks good once the remaining few comments are implemented.

I will fix the invalid instruction unsoundness in a separate PR.

@slowli slowli merged commit 6f9d832 into master Sep 18, 2024
8 checks passed
@slowli slowli deleted the aov-pla-1027-brush-up-vm2-repo-for-publishing-pt3 branch September 18, 2024 12:33
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.

2 participants