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

fix(forge): more precise diff_score #7057

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Feb 9, 2024

Motivation

I don't know if we have any noticable problems with diff_score atm, but I was just looking at some code using it and noticed that current implementation is a little bit strange.

With current impl contracts having similar starting bytes would have pretty low diff score, and with enough immutables in the longer contract we may get a false positive.

IMO diff_score should be affected by the differences in contracts length as it's very unlikely that the contract would greatly change its length after modifying immutables

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

this looks reasonable to me, but would want more eyes on it

@mattsse mattsse merged commit 2ca9350 into foundry-rs:master Feb 9, 2024
18 of 19 checks passed
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.

3 participants