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: gas report threshold #6143

Merged
merged 1 commit into from
Oct 28, 2023
Merged

Conversation

mattsse
Copy link
Member

@mattsse mattsse commented Oct 27, 2023

Closes #6019

ref #6129

refactors the gas reporter slightly.

also increases the diff matching used for matching contract codes

cc @mds1

@mattsse mattsse requested a review from Evalir October 27, 2023 15:12
Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

nice! lgtm bar comment / mds testing!

// Note: the diff score can be inaccurate for small contracts so we're using
// a relatively high threshold here to avoid filtering out too many
// contracts.
if score < 0.85 {
Copy link
Member

Choose a reason for hiding this comment

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

super small nit, but maybe we can lift this to a constant and document it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's fine here, I also think this entire logic deserves another look because we only do this to filter out candidates for decoding matches, the better approach would be to just get all function selectors

@mattsse mattsse merged commit fab6ee2 into foundry-rs:master Oct 28, 2023
16 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.

Gas report unexpectedly omits some tests
2 participants