Skip to content

Conversation

@Jrigada
Copy link
Contributor

@Jrigada Jrigada commented Jan 15, 2026

This fixes a non-determinism issue in remapping generation that was causing contracts to produce different compilation hashes across operating systems (see matter-labs/foundry-zksync#1188).

Problem

fs::read_dir returns directory entries in an arbitrary order that varies between platforms (e.g., macOS vs Ubuntu). When multiple remapping candidates exist, they get processed and output in different orders depending on the system, leading to inconsistent compilation hashes for the same contracts.

Fix

Sort remapping candidates before processing to ensure consistent and reproducible output regardless of the underlying filesystem behavior.

@DaniPopes DaniPopes enabled auto-merge (squash) January 19, 2026 12:51
@DaniPopes DaniPopes merged commit d86103b into foundry-rs:main Jan 19, 2026
18 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.

2 participants