Skip to content

Conversation

hieblmi
Copy link
Collaborator

@hieblmi hieblmi commented Sep 30, 2025

The fast flag enables the client to access change of a fractional amount swap faster. Since batching can delay the publishing of the on-chain swap transaction the client can pay a fee for faster access to optional change. A few examples of how this PR changes the command line arguments for fractional swaps.

loop static in 500000                                                 // Loop in exactly 500000 sats; auto-select deposits to cover the amount.
loop static in 500000 --fast                                         // Same as above, but request fast publication behavior (may cost more).
loop static in --all                                                 // Loop in the full balance of all eligible static-address deposits.
loop static in 500000 --all                                         // Loop in exactly 500000, select all eligible static-address deposits.
loop static in --all --fast                                         // Loop in all deposits with fast publication behavior.
loop static in --utxo txid:vout                                     // Loop in exactly the specified deposit UTXO.
loop static in --utxo txid:vout --fast                                 // Same as above with fast publication behavior.
loop static in --utxo txid:vout --utxo txid:vout ...                 // Loop in the union of the listed deposit UTXOs.
loop static in --utxo txid:vout --utxo txid:vout ... --fast         // Same as above with fast publication behavior.
loop static in 500000 --utxo txid:vout --utxo txid:vout ... --fast     // 500000 from selected deposits with fast publication behavior.

Copy link

Summary of Changes

Hello @hieblmi, 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 enhances the static address loop-in functionality by introducing a 'fast' option. This feature allows users to prioritize the speed of on-chain transaction publishing for fractional change amounts, enabling quicker access to funds by bypassing standard batching delays. The implementation involves comprehensive updates across the system, from the command-line interface and API definitions to the database schema and the sweep batching mechanism, ensuring that the 'fast' preference is consistently handled and applied.

Highlights

  • Fast Flag Introduction: A new 'fast' flag has been introduced for static address loop-in swaps, allowing clients to request expedited publishing of on-chain transactions, particularly for change outputs.
  • Expedited Publishing: When the 'fast' flag is enabled, the sweep batcher will bypass its usual initial delay mechanism, leading to immediate publication of the swap transaction, albeit potentially at a higher fee.
  • Database Persistence: The 'fast' flag is now stored in the database for static address swaps, ensuring that the client's preference for expedited publishing is recorded and persisted.
  • API and CLI Integration: The new 'fast' flag has been integrated across the client's command-line interface, internal API definitions (gRPC and Swagger), and server-side logic to propagate and act upon this new preference.
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

@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 introduces a --fast flag for static address loop-in swaps, enabling expedited publishing of the on-chain transaction in exchange for a potentially higher fee. The implementation correctly propagates this flag from the CLI and RPC layers down to the server request, and the database schema is updated accordingly. The main feature appears to be well-implemented.

Additionally, a similar fast flag mechanism has been added to the sweepbatcher for client-side sweeps. However, this functionality seems to be unused in the current changes, which could lead to confusion. I've added a review comment to seek clarification on this part of the implementation.


/*
If set to true the server will immediately publish the swap in exchange for
a higher fee. This can be useful if the client expects change from a swap.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only available for swaps with change...

// has to pay when the sweeping transaction is broadcast.
uint32 num_static_address_deposits = 7;

// If set, request the server to use fast publication behavior.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

add description

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