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

chore(l2): forbid expects #1289

Merged
merged 11 commits into from
Nov 28, 2024
Merged

Conversation

dsocolobsky
Copy link
Contributor

Motivation

We should not be using .expect() and use Errors instead.

Description

  • expect_used = "deny" was added to Cargo.toml to throw clippy errors on expects.
  • .expect() usage was replaced with errors

Closes #1267

@dsocolobsky dsocolobsky changed the title Forbid expects #1267 Forbid expects Nov 26, 2024
@dsocolobsky dsocolobsky changed the title Forbid expects chore(l2): forbid expects Nov 26, 2024
Copy link
Contributor

@fborello-lambda fborello-lambda left a comment

Choose a reason for hiding this comment

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

If we run the stack with the following steps:

  • cd crates/l2
  • cp .env.example .env
  • make init
  • do ctrl-c to stop the server, in order to restart it without some env variables.
  • Comment some env variables starting with COMMITTER, L1_WATCHER, PROPOSER... etc
  • make init-l2

It will not throw an error nor a message saying that there are missing variables. We should throw an error message and even stop the execution saying that some config variables are missing.

crates/l2/proposer/l1_watcher.rs Show resolved Hide resolved
crates/l2/proposer/mod.rs Outdated Show resolved Hide resolved
crates/l2/proposer/prover_server.rs Show resolved Hide resolved
crates/l2/proposer/l1_committer.rs Show resolved Hide resolved
@ilitteri ilitteri added the L2 label Nov 27, 2024
@dsocolobsky dsocolobsky marked this pull request as ready for review November 27, 2024 17:06
@dsocolobsky dsocolobsky requested a review from a team as a code owner November 27, 2024 17:06
Copy link
Contributor

@fborello-lambda fborello-lambda left a comment

Choose a reason for hiding this comment

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

Inside the zkvm dir we can use expect to avoid the compilation error

crates/l2/prover/zkvm/interface/guest/Cargo.toml Outdated Show resolved Hide resolved
crates/l2/prover/zkvm/interface/guest/src/main.rs Outdated Show resolved Hide resolved
crates/l2/prover/zkvm/interface/guest/src/main.rs Outdated Show resolved Hide resolved
crates/l2/prover/zkvm/interface/guest/src/main.rs Outdated Show resolved Hide resolved
crates/l2/prover/zkvm/interface/guest/src/main.rs Outdated Show resolved Hide resolved
crates/l2/prover/zkvm/interface/guest/src/main.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@fborello-lambda fborello-lambda left a comment

Choose a reason for hiding this comment

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

LGTM, ready to merge if the CI passes. Just make sure that type SetupResult is a struct. in PR #1290 or in this one.

crates/l2/contracts/deployer.rs Outdated Show resolved Hide resolved
@dsocolobsky dsocolobsky force-pushed the l2/forbid-expects branch 4 times, most recently from ef9a27f to f318cde Compare November 28, 2024 13:04
@ilitteri ilitteri added this pull request to the merge queue Nov 28, 2024
Merged via the queue into lambdaclass:main with commit d74aeff Nov 28, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

L2: Forbid expects
3 participants