Skip to content

compilation: notify user when running against unchanged artifacts#772

Merged
anishnaik merged 2 commits intomasterfrom
dev/artifact-hash-notification
Feb 5, 2026
Merged

compilation: notify user when running against unchanged artifacts#772
anishnaik merged 2 commits intomasterfrom
dev/artifact-hash-notification

Conversation

@dguido
Copy link
Copy Markdown
Member

@dguido dguido commented Jan 22, 2026

Summary

  • Add artifact hash computation to detect when Medusa runs against unchanged build artifacts
  • Cache hash with timestamp in .medusa-artifact-hash file (stored in corpus directory or cwd)
  • Log informative message when artifacts are new/changed
  • Log warning with time since last run when artifacts are unchanged

This helps catch cases where users edit Solidity code but forget to recompile before running Medusa again.

Changes

  • compilation/artifact_hash.go: New module with hash computation, cache load/save, and notification logic
  • compilation/artifact_hash_test.go: Unit tests for hash computation, caching, and duration formatting
  • fuzzing/fuzzer.go: Integrate notification call after compilation

Example Output

New artifacts:

[INFO] artifacts: Medusa is running against a new set of build artifacts

Unchanged artifacts:

[WARN] artifacts: Medusa is running against the same build artifacts as previously (last run: 5 minutes ago)

Test plan

  • Unit tests pass for hash computation (deterministic, order-independent)
  • Unit tests pass for cache save/load
  • Unit tests pass for duration formatting
  • Code builds without errors
  • golangci-lint passes

Fixes #433

Add functionality to detect when Medusa runs against the same build
artifacts as before. This helps catch cases where users edit code but
forget to recompile.

- Compute SHA-256 hash of compiled contract bytecode
- Cache hash with timestamp in .medusa-artifact-hash file
- Log "new" message when artifacts change
- Log warning with time since last run when artifacts unchanged

Fixes #433

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@anishnaik anishnaik merged commit 471c5f3 into master Feb 5, 2026
15 checks passed
@anishnaik anishnaik deleted the dev/artifact-hash-notification branch February 5, 2026 12:21
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.

Letting the user know when medusa is being run against the same build artifacts

2 participants