Skip to content

Conversation

@edwardycl
Copy link
Contributor

Replaced ethers with alloy and updated minor dependencies.

The only failing test was related to the connection ID, which now produces a different hash due to changes in the underlying struct. Since the connection ID only needs to be unique, this change is acceptable. The test was updated accordingly and now passes.

@lmlmt
Copy link
Contributor

lmlmt commented Jul 18, 2025

@edwardycl What's the reasoning behind this migration?

@edwardycl
Copy link
Contributor Author

@lmlmt alloy is the improved and actively maintained successor to ethers-rs, offering the same core functionality with a more modern and modular design. ethers-rs has been deprecated in favor of alloy as of mid 2024, and the repository is now archived (see #2667).

As a result, alloy has become the go-to library for Web3 development in Rust.

In projects that use hyperliquid-rust-sdk, the SDK introduces a dependency on ethers due to its type definitions. This causes compatibility issues with other parts of the codebase that uses alloy.

There have been previous attempts to migrate to alloy (e.g., #85, #106), but those efforts were either incorrect or outdated. Now that alloy has reached a stable 1.0 release, I revisited the migration and updated the code accordingly.

This was referenced Jul 22, 2025
@lmlmt lmlmt self-requested a review July 22, 2025 02:32
@lmlmt
Copy link
Contributor

lmlmt commented Jul 22, 2025

@lmlmt alloy is the improved and actively maintained successor to ethers-rs, offering the same core functionality with a more modern and modular design. ethers-rs has been deprecated in favor of alloy as of mid 2024, and the repository is now archived (see #2667).

As a result, alloy has become the go-to library for Web3 development in Rust.

In projects that use hyperliquid-rust-sdk, the SDK introduces a dependency on ethers due to its type definitions. This causes compatibility issues with other parts of the codebase that uses alloy.

There have been previous attempts to migrate to alloy (e.g., #85, #106), but those efforts were either incorrect or outdated. Now that alloy has reached a stable 1.0 release, I revisited the migration and updated the code accordingly.

Thanks for the details. Overall looks good to me. Could you also summarize any apis that other users may need to migrate?

Besides that, there is a merge conflict, but once resolved will merge

@edwardycl
Copy link
Contributor Author

@lmlmt I resolved the merge conflict. It was introduced by a new feature that was merged yesterday.

Here is a list of changes that users should be aware of:

  • All fields and parameters with the following types have been changed:
    • ethers::signers::LocalWallet -> alloy::signers::local::PrivateKeySigner
    • ethers::types::H160 -> alloy::primitives::Address
  • The signature_chain_id field inside actions has been changed from U256 to u64.

Other than these, there are no interface changes.

@lmlmt lmlmt merged commit fa57729 into hyperliquid-dex:master Jul 28, 2025
1 check failed
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