Skip to content

fix(deps): resolve circular dependency that breaks clean builds #964

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

Merged
merged 4 commits into from
Apr 29, 2025

Conversation

ccashwell
Copy link
Member

Related Issue

This resolves an issue that causes builds to fail in certain conditions.

Description of changes

  • Created types/PoolOperation.sol consisting of the structs ModifyLiquidityParams and SwapParams which are removed from interfaces/IPoolManager.sol
  • Updated references to point to the new location of these structs.

ccashwell added a commit to Uniswap/v4-periphery that referenced this pull request Apr 1, 2025
@ccashwell ccashwell force-pushed the chris/fix-dependency-graph branch from 239aa9e to 4c9fab1 Compare April 1, 2025 20:12
import {BalanceDelta} from "../types/BalanceDelta.sol";

/// @notice Common types used by both IPoolManager and IHooks
interface PoolOperation {
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason these need to be inside an interface? can the structs just be in the top level file and imported individually?

Copy link
Contributor

Choose a reason for hiding this comment

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

if so this can stay in types otherwise i think it should move to interfaces probably?

Copy link
Contributor

Choose a reason for hiding this comment

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

on naming I'd maybe go PoolOperationParams or something to show its the params that are being defined, its not defining the operations

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah they could be top level rather than wrapped in an interface. Will make that change.

@hensha256 hensha256 marked this pull request as ready for review April 2, 2025 13:00
@hensha256 hensha256 requested a review from a team as a code owner April 2, 2025 13:00
@ccashwell ccashwell force-pushed the chris/fix-dependency-graph branch 2 times, most recently from 8cc4b41 to 0d2dc9a Compare April 2, 2025 14:20
ccashwell added a commit to Uniswap/v4-periphery that referenced this pull request Apr 2, 2025
import {BalanceDelta} from "../types/BalanceDelta.sol";

/// @notice Parameter struct for `ModifyLiquidity` pool operations
struct ModifyLiquidityParams {
Copy link
Contributor

Choose a reason for hiding this comment

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

I see you removed the interface, can we confirm that this still solves the issue? When I implemented this without the interface, it didn't fix the circular dependency

Copy link
Member Author

@ccashwell ccashwell Apr 3, 2025

Choose a reason for hiding this comment

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

Yes, this does still solve the issue. Once these structs are moved out of IPoolManager, the circular references between IHooks and IPoolManager are eliminated and the monorepo builds cleanly.

@ccashwell ccashwell force-pushed the chris/fix-dependency-graph branch from 0d2dc9a to d75f10d Compare April 3, 2025 13:39
@ccashwell ccashwell force-pushed the chris/fix-dependency-graph branch from d75f10d to c083db7 Compare April 3, 2025 13:41
@dianakocsis dianakocsis merged commit a7cf038 into main Apr 29, 2025
5 checks passed
@dianakocsis dianakocsis deleted the chris/fix-dependency-graph branch April 29, 2025 00:46
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.

4 participants