Skip to content

Relay swap status fix + cleanup#980

Merged
gemcoder21 merged 4 commits intomainfrom
revert-relay
Mar 4, 2026
Merged

Relay swap status fix + cleanup#980
gemcoder21 merged 4 commits intomainfrom
revert-relay

Conversation

@0xh3rman
Copy link
Collaborator

@0xh3rman 0xh3rman commented Mar 3, 2026

This fixes swap status for Relay, and only keep EVM for now

@semanticdiff-com
Copy link

semanticdiff-com bot commented Mar 3, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  apps/daemon/src/consumers/store/store_transactions_consumer.rs  58% smaller
  crates/swapper/src/swapper.rs  51% smaller
  crates/swapper/src/across/mod.rs  46% smaller
  crates/swapper/src/models.rs  37% smaller
  apps/api/src/main.rs  30% smaller
  crates/swapper/src/thorchain/provider.rs  22% smaller
  crates/swapper/src/relay/testkit.rs  18% smaller
  crates/swapper/src/relay/chain.rs  10% smaller
  crates/swapper/src/relay/mapper.rs  9% smaller
  crates/swapper/src/relay/mod.rs  6% smaller
  crates/swapper/src/cross_chain.rs  5% smaller
  crates/swapper/src/relay/asset.rs  5% smaller
  crates/swapper/src/relay/model.rs  4% smaller
  crates/swapper/src/proxy/provider.rs  3% smaller
  crates/swapper/src/near_intents/provider.rs  1% smaller
  Cargo.lock Unsupported file format
  Cargo.toml Unsupported file format
  apps/api/src/chain/swap.rs  0% smaller
  crates/gem_bitcoin/Cargo.toml Unsupported file format
  crates/gem_bitcoin/src/signer/chain_signer.rs  0% smaller
  crates/gem_bitcoin/src/signer/mod.rs  0% smaller
  crates/gem_solana/Cargo.toml Unsupported file format
  crates/gem_solana/src/lib.rs  0% smaller
  crates/gem_solana/src/transaction.rs  0% smaller
  crates/swapper/Cargo.toml Unsupported file format
  crates/swapper/src/across/provider.rs  0% smaller
  crates/swapper/src/error.rs  0% smaller
  crates/swapper/src/near_intents/client.rs  0% smaller
  crates/swapper/src/near_intents/cross_chain_provider.rs  0% smaller
  crates/swapper/src/near_intents/mod.rs  0% smaller
  crates/swapper/src/proxy/mayan/mod.rs  0% smaller
  crates/swapper/src/proxy/provider_factory.rs  0% smaller
  crates/swapper/src/relay/client.rs  0% smaller
  crates/swapper/src/relay/provider.rs  0% smaller
  crates/swapper/src/relay/testdata/request_bsc_usdt_to_sol.json  0% smaller
  crates/swapper/src/relay/testdata/request_eth_to_btc.json  0% smaller
  crates/swapper/src/relay/tx_builder.rs  0% smaller
  crates/swapper/src/thorchain/mod.rs  0% smaller
  gemstone/src/signer/chain.rs  0% smaller

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request systematically reverts the integration of the 'Relay' swap provider, which was initially part of a larger feature. The primary goal is to modularize the Relay functionality, allowing for its re-introduction in smaller, more manageable development phases. This involves a comprehensive removal of all Relay-specific code, dependencies, and related transaction handling logic for Bitcoin and Solana across multiple crates.

Highlights

  • Relay Module Removal: The entire 'relay' module within the crates/swapper directory has been removed, including its asset definitions, chain logic, client, data mappers, models, provider implementation, test utilities, and Solana transaction builder.
  • Bitcoin Signer Removal: The BitcoinChainSigner implementation and its associated module in crates/gem_bitcoin/src/signer have been removed, as they were part of the Relay provider's functionality.
  • Solana Transaction Logic Removal: Dedicated Solana transaction building logic, previously found in crates/gem_solana/src/transaction.rs, has been removed along with its module and related dependencies.
  • Dependency Clean-up: Several dependencies, including bitcoin, base58ck, bitcoin-internals, bitcoin-units, futures-timer, and hex_lit, have been removed from Cargo.lock and Cargo.toml files, reflecting the removal of the Relay provider's components.
  • Quote Fetching Simplification: The quote fetching mechanism in crates/swapper/src/swapper.rs was simplified by removing the futures-timer dependency and the explicit timeout logic, streamlining how quotes are retrieved from various providers.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • Cargo.lock
    • Updated dependencies by removing several Bitcoin and Solana related crates and futures-timer
    • Adjusted secp256k1 version
  • Cargo.toml
    • Removed futures-timer and bitcoin dependencies
  • crates/gem_bitcoin/Cargo.toml
    • Removed bitcoin dependency from the signer feature and general dependencies
  • crates/gem_bitcoin/src/signer/chain_signer.rs
    • Removed the Bitcoin chain signer implementation
  • crates/gem_bitcoin/src/signer/mod.rs
    • Removed the chain_signer module and its public export
  • crates/gem_solana/Cargo.toml
    • Removed the transaction feature and hex dependency
  • crates/gem_solana/src/lib.rs
    • Removed the transaction module
  • crates/gem_solana/src/transaction.rs
    • Removed the Solana transaction building logic
  • crates/swapper/Cargo.toml
    • Removed the transaction feature from gem_solana and the futures-timer dependency
  • crates/swapper/src/error.rs
    • Removed SolanaError import and its conversion to SwapperError
  • crates/swapper/src/lib.rs
    • Removed the relay module
  • crates/swapper/src/models.rs
    • Updated the list of supported chains for the Relay provider, replacing Abstract with Manta
  • crates/swapper/src/proxy/provider_factory.rs
    • Added a new function new_relay for creating a Relay proxy provider
  • crates/swapper/src/relay/asset.rs
    • Removed Relay asset-related definitions
  • crates/swapper/src/relay/chain.rs
    • Removed Relay chain-related definitions
  • crates/swapper/src/relay/client.rs
    • Removed the Relay client implementation
  • crates/swapper/src/relay/mapper.rs
    • Removed Relay data mapping utilities
  • crates/swapper/src/relay/mod.rs
    • Removed the entire Relay module
  • crates/swapper/src/relay/model.rs
    • Removed Relay data models
  • crates/swapper/src/relay/provider.rs
    • Removed the Relay provider implementation
  • crates/swapper/src/relay/testkit.rs
    • Removed Relay test utilities
  • crates/swapper/src/relay/tx_builder.rs
    • Removed the Relay Solana transaction builder
  • crates/swapper/src/swapper.rs
    • Removed futures-timer dependency and simplified the quote fetching mechanism
  • gemstone/src/signer/chain.rs
    • Removed the BitcoinChainSigner from the GemChainSigner enum
Activity
  • The pull request was created to revert the 'relay part' of a previous pull request (897), aiming to break down the changes into smaller, more manageable batches for future integration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 reverts the relay feature, removing a significant amount of code and dependencies, and also refactors the Relay provider to use the ProxyProvider pattern. My review has identified a potential regression where the timeout for fetching quotes from providers has been removed, which could cause the system to hang. I've also noted a functional change to the Relay provider's supported chains that seems out of place for a revert PR and may need clarification.

Note: Security Review did not run due to the size of the PR.

…elay

# Conflicts:
#	crates/swapper/src/relay/asset.rs
#	crates/swapper/src/relay/mapper.rs
#	crates/swapper/src/relay/mod.rs
#	crates/swapper/src/relay/model.rs
#	crates/swapper/src/relay/provider.rs
#	crates/swapper/src/relay/testkit.rs
# Conflicts:
#	crates/swapper/src/relay/asset.rs
#	crates/swapper/src/relay/mapper.rs
#	crates/swapper/src/relay/mod.rs
#	crates/swapper/src/relay/model.rs
#	crates/swapper/src/relay/provider.rs
#	crates/swapper/src/relay/testkit.rs
@0xh3rman 0xh3rman changed the title Revert relay Relay swap status fix + cleanup Mar 4, 2026
Introduce a new Relay integration and expose vault addresses via the API. Adds a relay module (asset, chain, mapper, model, testkit, and testdata) to map Relay API responses into internal SwapResult metadata and to fetch solver/vault addresses. Integrates Relay into the proxy provider to return swap results and vault addresses from the relay service. Adds GET /chain/swaps/<provider>/vault_addresses endpoint to the API. Refactors cross-chain detection to rely on a VaultAddressMap (removing the old per-provider CrossChainProvider trait and hardcoded provider detectors) and updates tests accordingly. Also adds treasury addresses to NearIntents as default vault addresses and applies small imports/formatting cleanups across providers.
@gemcoder21 gemcoder21 merged commit a22cc1a into main Mar 4, 2026
6 checks passed
@gemcoder21 gemcoder21 deleted the revert-relay branch March 4, 2026 01: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.

2 participants