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 duplicate hash logic #868

Merged
merged 3 commits into from
Feb 25, 2024
Merged

Fix duplicate hash logic #868

merged 3 commits into from
Feb 25, 2024

Conversation

cgewecke
Copy link
Member

In #854 (v0.8.7) logic was added to the collector that filters duplicate consecutive hashes because viaIR was doing that and messing up the hit counts.

However #863 reports a case where these duplicates are expected - they're inheriting onlyOwner and testing the implementation by switching the EOA e.g

 function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}

The instrumentation looks like:

function a() preCondition onlyOwner postCondition {}

...so running the failure and success case one after another gives

precondition  <-- tx #1
precondtion   <-- tx #2
postcondition

PR adds logic to make sure this filtering only happens within a single transaction (frame?) using program counter tracking.

@cgewecke cgewecke merged commit e6df717 into master Feb 25, 2024
3 checks passed
@cgewecke cgewecke deleted the fix-duplicate-hash-logic branch February 25, 2024 23:12
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.

1 participant