Skip to content

replace alloy dependencies with specific sub-dependencies#4230

Merged
MartinquaXD merged 10 commits intomainfrom
dont-depend-on-alloy
Mar 5, 2026
Merged

replace alloy dependencies with specific sub-dependencies#4230
MartinquaXD merged 10 commits intomainfrom
dont-depend-on-alloy

Conversation

@MartinquaXD
Copy link
Contributor

Description

While depending on alloy is convenient because it bundles everything inside 1 dependency it also hides what parts are actually needed and can delay the compilation of crates unnecessarily.

Changes

replace alloy dependency with the actually used sub-crates like alloy-primitives and alloy-provider

this PR mostly focuses on the smaller "leaf" dependency crates as they are manageable in size and allowing them to compile earlier is more important than optimizing crates like driver, and autopilot.

So far this PR only improves the compile time very slightly by making sure contracts does not indirectly depend on aws-sdk-kms as that is insanely slow to compile.
The effects of this change will be more pronounced when we change the contracts crate to be compiled as individual crates.
But I think even without huge compile time gains being explicit about our dependencies still makes sense.

How to test

compiler

@MartinquaXD MartinquaXD requested a review from a team as a code owner March 4, 2026 22:23
@MartinquaXD MartinquaXD force-pushed the dont-depend-on-alloy branch from 5f21c46 to 3b13640 Compare March 4, 2026 22:23
@MartinquaXD MartinquaXD changed the title remove dependencies on alloy replace alloy dependencies with specific sub-dependencies Mar 4, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively refactors the dependency on the monolithic alloy crate into more granular sub-crate dependencies. This is a positive change for dependency management and should help with compile times. The extraction of signature-validator and zeroex_api from the shared crate into their own crates is also a good step towards better modularity. The changes are mostly mechanical and look correct. I have one minor suggestion for improvement.

I am having trouble creating individual review comments. Click here to see my feedback.

crates/liquidity-sources/src/zeroex.rs (66)

medium

The url crate provides a join method that is more robust for joining URL paths than the custom join_url helper. Using it is more idiomatic. After this change, the join_url function can be removed.

        let mut url = base_url.join("/orderbook/v1/orders").unwrap();

@MartinquaXD MartinquaXD force-pushed the dont-depend-on-alloy branch 2 times, most recently from 52067e2 to 5db94ff Compare March 4, 2026 22:40
@MartinquaXD MartinquaXD force-pushed the dont-depend-on-alloy branch from 5db94ff to a2ba3f1 Compare March 4, 2026 22:54
@MartinquaXD MartinquaXD added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit 5131860 Mar 5, 2026
19 checks passed
@MartinquaXD MartinquaXD deleted the dont-depend-on-alloy branch March 5, 2026 09:41
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants