autoloop: support static loop-ins#1119
Conversation
Summary of ChangesHello, 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 introduces support for static-address-backed loop-ins within the existing autoloop engine. It enables operators to utilize static deposits for automated liquidity management, providing a more flexible alternative to traditional wallet-funded loop-ins. The changes include updates to the liquidity planner, budget accounting, and RPC interfaces to ensure static loop-ins are treated as first-class citizens in the autoloop lifecycle while maintaining safety and consistency. Highlights
🧠 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. Using Gemini Code AssistThe 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
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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for static-address loop-in swaps within the autoloop planner. It adds a new configuration option to select the loop-in source, updates the liquidity manager to handle static loop-in snapshots for budget and traffic accounting, and includes necessary changes to the RPC interface and storage layer to support these swaps. I have no feedback to provide.
522b437 to
dcb8742
Compare
Add a dedicated loop-in source enum to the liquidity parameters rpc and wire it through the internal parameter model and CLI. This keeps the source selection explicit before any static autoloop planning lands, so operators can choose between the legacy wallet-funded path and a future static-address-backed path without relying on implicit fallback behavior.
Move static loop-in label validation to the rpc boundary and remove the same check from the internal manager path. This keeps external requests aligned with the existing swap rpc surface while allowing internal autoloop callers to keep using reserved labels for automated swaps. The tests cover both sides of that contract: rpc requests still reject reserved labels, and the manager path accepts them.
Test-only change. This is needed to reuse it in another test.
Add the static-address helper that prepares full-deposit autoloop loop-ins without dispatching them. The helper selects no-change deposit sets, records explicit outpoints, and quotes the exact selected amount before the planner tries to dispatch anything. The tests cover the full-deposit selector, the quoted request construction, and excluded outpoint handling so later liquidity work can rely on a stable preparation surface.
Teach the liquidity manager to include persisted static loop-ins in budget accounting, in-flight limits, and peer traffic backoff. This adds the static fee model used for conservative accounting and passes storage errors through the relevant planner helpers. The daemon wiring now exposes static loop-ins to liquidity so the manager can see the same ongoing swaps that the static-address subsystem persists, while easy autoloop keeps working with the new fallible traffic lookup path.
Extend the public rpc surface for static autoloop integration without turning the planner on yet. SuggestSwaps responses can now carry static-address loop-in requests and the new planner reason for missing static candidates is mapped over rpc.
Wire static-address-backed loop-ins into the existing autoloop planner and dispatch path. Loop-in rules can now be converted into static candidates, prepared after global sorting, filtered with static fee limits, and dispatched through the static manager. This also fixes MaxAutoInFlight enforcement across all suggested swap types and adds planner tests for missing static candidates and mixed in-flight filtering.
Static autoloop testing surfaced a SuggestSwaps failure when the planner disqualified a custom asset channel. Add the missing AutoReason enum value and handle ReasonCustomChannelData.
dcb8742 to
4f42af0
Compare
This adds static-address-backed loop-ins to the current autoloop engine.
What changes
static_loop_insuggestions, include them inforceautoloop, and enforceMaxAutoInFlightacross all suggested swap types.SuggestSwapsnow exposes static loop-in suggestions through a dedicated RPC field and includes the static no-candidate disqualification reason.AUTO_REASON_CUSTOM_CHANNEL_DATAis added, so custom asset channels are reported as disqualified instead of breaking the RPC response.Important design choices
fast=false.loop_insuggestions.Validation
1,000,000 satstatic deposit was suggested throughsuggestswaps, dispatched throughforceautoloop, completed successfully, moved the deposit toLOOPED_IN, increased outbound liquidity on the target BTC peer, and was not suggested again afterward.Pull Request Checklist
release_notes.mdif your PR contains major features, breaking changes or bugfixes