Skip to content

Fix(test-devtools-evm-foundry): remove lz-evm-v1 dependency that breaks external Foundry builds#1941

Open
Alison024 wants to merge 1 commit intoLayerZero-Labs:mainfrom
Alison024:bugfix/compilation-issue
Open

Fix(test-devtools-evm-foundry): remove lz-evm-v1 dependency that breaks external Foundry builds#1941
Alison024 wants to merge 1 commit intoLayerZero-Labs:mainfrom
Alison024:bugfix/compilation-issue

Conversation

@Alison024
Copy link
Copy Markdown

Motivation

@layerzerolabs/test-devtools-evm-foundry fails to compile in external Foundry projects (for example when dependencies are installed with Soldeer) because it imports a package that may not be installed transitively.

This blocks users from running forge build / forge test when following the LayerZero Foundry testing flow.

Reproduction

  1. Create a new Foundry project.
  2. Install dependencies via Soldeer:
    • OpenZeppelin Contracts
    • LayerZero V2
    • LayerZero devtools
  3. Add a test based on the LayerZero Foundry example.
  4. Run forge build or forge test.

Observed error:

  • unresolved import for:
    @layerzerolabs/lz-evm-v1-0.7/contracts/interfaces/ILayerZeroUltraLightNodeV2.sol
  • failure originates from:
    packages/test-devtools-evm-foundry/contracts/mocks/DVNMock.sol

Root Cause

DVNMock.sol imported ILayerZeroUltraLightNodeV2 from @layerzerolabs/lz-evm-v1-0.7.

In consumer setups (especially with Soldeer), this deprecated LayerZero V1 package is often not installed, and the package does not need full V1 functionality anyway. As a result, consumers must add custom remappings or manually install an unnecessary/deprecated dependency.

What Changed

  • Updated packages/test-devtools-evm-foundry/contracts/mocks/DVNMock.sol

    • removed import of ILayerZeroUltraLightNodeV2 from @layerzerolabs/lz-evm-v1-0.7
    • added a minimal local interface containing only the functions actually used by DVNMock:
      • withdrawNative(address payable,uint)
      • updateHash(uint16,bytes32,uint,bytes32)
  • Updated packages/test-devtools-evm-foundry/package.json

    • removed @layerzerolabs/lz-evm-v1-0.7 from:
      • devDependencies
      • peerDependencies
  • Rebuilt package artifacts in:

    • packages/test-devtools-evm-foundry/artifacts/*
  • Updated lockfile:

    • pnpm-lock.yaml

Why This Fix

  • Removes an unnecessary dependency on deprecated V1 package.
  • Makes test-devtools-evm-foundry easier to consume in clean Foundry/Soldeer setups.
  • Keeps behavior unchanged by preserving only the required interface surface used by the mock.

Impact

  • Breaking changes: None expected.
  • Runtime behavior: No functional change intended; dependency graph simplified.
  • Developer experience: External consumers no longer need extra remappings or manual install of V1 package.

Validation

  • Confirmed the package compiles after removing @layerzerolabs/lz-evm-v1-0.7.
  • Original reproduction path no longer requires deprecated V1 dependency to resolve imports.

References

@cursor
Copy link
Copy Markdown

cursor Bot commented May 6, 2026

PR Summary

Low Risk
Low risk: changes are limited to test/devtool mocks and package metadata, plus regenerated Foundry artifacts; no production contract logic is affected.

Overview
Removes an unnecessary LayerZero V1 dependency that caused external Foundry builds to fail by replacing the lz-evm-v1-0.7 ULNv2 import in DVNMock.sol with a minimal local ILayerZeroUltraLightNodeV2 interface.

Updates package.json dependency declarations accordingly and regenerates the Foundry artifacts/ JSON outputs (including updated compiler metadata such as optimizer settings/EVM version).

Reviewed by Cursor Bugbot for commit 17a69cf. Bugbot is set up for automated code reviews on this repo. Configure here.

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