staticaddr: dynamic deposit conf target#1065
Conversation
Summary of ChangesHello @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 updates the static address loop-in client to dynamically adapt to server-side confirmation requirements. It streamlines the process for small swaps by reducing the client's minimum confirmation threshold, intelligently prioritizes deposits based on their confirmation status, and provides clearer feedback to users when deposits require additional confirmations. These changes improve the client's efficiency and user experience when interacting with servers that implement risk-based confirmation policies. 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. 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for dynamic server-side confirmation requirements for static address loop-ins. The client's minimum confirmation requirement is lowered to 1, and the deposit selection logic is updated to prioritize deposits with more confirmations. Additionally, the client now logs detailed information when a swap fails due to insufficient confirmations, improving user feedback. The changes look good and align with the goal of providing more flexibility for loop-in swaps. I've added a couple of minor suggestions to improve log message formatting for better readability.
| log.Warnf("Insufficient deposit confirmations, max wait: "+ | ||
| "%d blocks", confDetails.MaxBlocksToWait) |
| log.Warnf(" Deposit %s: %d/%d confirmations "+ | ||
| "(need %d more blocks)", | ||
| dep.Outpoint, dep.CurrentConfirmations, | ||
| dep.RequiredConfirmations, dep.BlocksToWait) |
There was a problem hiding this comment.
b59d0dc to
3d7e24f
Compare
48555a2 to
bb2cfd2
Compare
bb2cfd2 to
2bf22a1
Compare
0a42561 to
c084e70
Compare
c084e70 to
cc21207
Compare
|
@hieblmi, remember to re-request review from reviewers when ready |
| // deposit to be considered available for loop-ins, coop-spends and | ||
| // timeouts. | ||
| MinConfs = 6 | ||
| MinConfs = 3 |
There was a problem hiding this comment.
The PR description says "Reduce MinConfs from 6 to 1", but the commit reduces only to 3.
There was a problem hiding this comment.
Thanks, 1 was originally targeted. Fixed the description.
|
|
||
| message PushStaticAddressSweeplessSigsResponse { | ||
| } | ||
|
|
There was a problem hiding this comment.
When we implement the waiting version of dyn-conf, we can drop these RPCs and most of the handling logic on the client side, right? The server will stop returning these errors, so we can clean up the proto files.
There was a problem hiding this comment.
Yes, it is backwards compatible if we remove the proto messages. We can then also remove logInsufficientConfirmationsDetails(err).
cc21207 to
30bb259
Compare
Add DepositConfirmationStatus and InsufficientConfirmationsDetails messages to support structured error responses when deposits lack sufficient confirmations for dynamic risk requirements.
Reduce MinConfs from 6 to 3 to allow faster swap attempts while the server enforces risk-based confirmation requirements. Update SelectDeposits to prioritize more-confirmed deposits first, increasing the likelihood of server acceptance. Add client-side logging of insufficient confirmation details from server error responses.
30bb259 to
66a17f4
Compare
Update static address loop-in client to support dynamic server-side confirmation requirements.
Changes:
Proto updates:
Backwards compatible: Clients with older servers will continue to work normally. The server determines actual confirmation requirements.