Skip to content

ci: make slither not fail CI#5366

Closed
tynes wants to merge 2 commits intodevelopfrom
fix/slither
Closed

ci: make slither not fail CI#5366
tynes wants to merge 2 commits intodevelopfrom
fix/slither

Conversation

@tynes
Copy link
Contributor

@tynes tynes commented Apr 6, 2023

Description

slither is halting CI. It thinks that yul is an antipattern. It is blocking PRs from being merged because of a if (boolean == false) check which is completely sane, sure you can do if (!boolean) but that is less readable. This commit prevents slither from halting CI. We can figure out how much we want to use slither in the future.

slither is halting CI. It thinks that yul is an antipattern. It
is blocking PRs from being merged because of a `if (boolean == false)`
check which is completely sane, sure you can do `if (!boolean)` but
that is less readable. This commit prevents slither from halting CI.
We can figure out how much we want to use slither in the future.
@tynes tynes requested a review from a team as a code owner April 6, 2023 13:49
@tynes tynes requested a review from mslipper April 6, 2023 13:49
@changeset-bot
Copy link

changeset-bot bot commented Apr 6, 2023

⚠️ No Changeset found

Latest commit: 9950b40

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Apr 6, 2023

Deploy Preview for opstack-docs canceled.

Name Link
🔨 Latest commit 9950b40
🔍 Latest deploy log https://app.netlify.com/sites/opstack-docs/deploys/642f551706c4fd0008aa1c2e

@trianglesphere
Copy link
Contributor

Slither is passing on develop. Is there a specific PR which is causing it to fail?

@tynes
Copy link
Contributor Author

tynes commented Apr 6, 2023

Slither is passing on develop. Is there a specific PR which is causing it to fail?

There are a bunch of PRs, see #5356
The reason it is failing incredibly lame and not helpful

@clabby
Copy link
Contributor

clabby commented Apr 6, 2023

Slither is passing on develop. Is there a specific PR which is causing it to fail?

There are a bunch of PRs, see #5356 The reason it is failing incredibly lame and not helpful

This does look annoying, feels like something a linter should do rather than Slither. The suggestion does look like a valid lint, tho.

To break it down:

  • !boolValue compiles to 2 bytes of asm:
DUP<N>  // [bool]
ISZERO  // [not_bool]
  • boolValue == false compiles to 4 bytes of asm:
DUP<N>     // [bool]
PUSH1 0x00 // [false, bool]
EQ         // [bool == false]

The optimizer picks this up in the non-IR pipeline most of the time, though.

@mslipper mslipper requested a review from maurelian April 6, 2023 22:55
Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

Approving b/c @maurelian approved.

@mergify
Copy link
Contributor

mergify bot commented Apr 6, 2023

This PR has been added to the merge queue, and will be merged soon.

@mergify
Copy link
Contributor

mergify bot commented Apr 6, 2023

This PR is next in line to be merged, and will be merged as soon as checks pass.

@maurelian
Copy link
Contributor

I had a second thought, will update shortly

@refcell
Copy link
Contributor

refcell commented Apr 19, 2023

This was fixed in #5356 by excluding boolean_equality in slither's config file at slither.config.json#L2, correct @tynes?

@tynes tynes closed this Apr 19, 2023
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.

5 participants