Skip to content

fix(analysis): distinguish Foundry handler assertions - #39

Merged
grandizzy merged 1 commit into
tempoxyz:mainfrom
figtracer:fig/foundry-handler-identity
Aug 19, 2026
Merged

fix(analysis): distinguish Foundry handler assertions#39
grandizzy merged 1 commit into
tempoxyz:mainfrom
figtracer:fig/foundry-handler-identity

Conversation

@figtracer

Copy link
Copy Markdown

Summary

  • identify current Foundry handler assertion failures by target address and selector
  • preserve the existing invariant and legacy-record fallbacks
  • cover two selectors on the same handler when the log ends before another metrics pulse

Root cause

Current Foundry JSON emits handler assertions with failure_type: handler_assertion, a target address, and a function selector. The analyzer ignored the selector and used only the target, collapsing distinct assertion sites into one bug. A later metrics pulse could restore the total with anonymous synthetic bugs, so the reported count depended on whether that pulse arrived before the run ended.

Validation

  • python -m unittest analysis.tests.test_analyze_foundry_parser -v (13 tests)
  • python -m unittest discover -s analysis/tests -v (128 tests)
  • replayed a captured Aave Foundry log; the analyzer now reports both handler selectors and both invariant failures immediately

@figtracer
figtracer marked this pull request as ready for review August 19, 2026 16:01

@mablr mablr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Makes sense, have you tested it locally on PRs ? foundry-rs/foundry#15818 or foundry-rs/foundry#16065 ?

@figtracer

figtracer commented Aug 19, 2026

Copy link
Copy Markdown
Author

yes, it makes bug discovery time more accurate since it doesn't bundle same target findings @mablr

doesn't explain the whole thing but can help on edge cases where it might depend on the pulse

@figtracer
figtracer requested a review from mablr August 19, 2026 16:23

@mablr mablr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Okay LGTM

cc @0xalpharush @grandizzy

@grandizzy

Copy link
Copy Markdown

lgtm, ty

@grandizzy
grandizzy merged commit 15958cf into tempoxyz:main Aug 19, 2026
2 checks passed
@figtracer
figtracer deleted the fig/foundry-handler-identity branch August 19, 2026 18:11
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