Skip to content

Increase default recovery window to 31000#10630

Closed
BlueeeMoon wants to merge 1 commit intolightningnetwork:masterfrom
BlueeeMoon:patch-1
Closed

Increase default recovery window to 31000#10630
BlueeeMoon wants to merge 1 commit intolightningnetwork:masterfrom
BlueeeMoon:patch-1

Conversation

@BlueeeMoon
Copy link

Increase the default recovery windows for OGs Lightning runners.

I tested 2500, 10000, 20000, 30000 and 31000 and with the last value I recover all my funds finally.

Or maybe add a value in docs between 2500 to XXXXXX.

Thank you.

Increase the default recovery windows for OGs Lightning runners.

I tested 2500, 10000, 20000, 30000 and 31000 and with the last value I recover all my funds finally.

Or maybe add a value in docs between 2500 to XXXXXX
@gemini-code-assist
Copy link

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 increases a critical default configuration value, the recovery window, within the application. This change is aimed at improving the success rate of fund recovery for Lightning Network participants, as demonstrated by testing where the new value facilitated complete fund recovery.

Highlights

  • Default Recovery Window: The defaultRecoveryWindow constant in cmd/commands/commands.go has been increased from 2500 to 31000. This adjustment is based on testing that showed 31000 successfully recovered all funds for Lightning runners.

🧠 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
  • cmd/commands/commands.go
    • Increased the defaultRecoveryWindow constant to 31000.
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 increases the default recovery window from 2500 to 31000. This change is based on user feedback and aims to make wallet recovery more robust, especially for wallets with a long history of address usage. This is a good improvement for fund safety.

I've added one suggestion to include a comment explaining the new value, which will improve code maintainability. As a follow-up, I recommend updating the documentation in docs/recovery.md to reflect this new default value and to provide more guidance for users on this parameter.

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

// TODO(roasbeef): expose all fee conf targets

const defaultRecoveryWindow int32 = 2500
const defaultRecoveryWindow int32 = 31000

Choose a reason for hiding this comment

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

medium

To improve maintainability and provide context for this change, it would be helpful to add a comment explaining why defaultRecoveryWindow is being increased to this specific value. This will help future developers understand the reasoning behind this choice, in line with the style guide's recommendation to explain the 'why' behind code changes.

For example:

// defaultRecoveryWindow is the default number of addresses to scan ahead for
// when recovering a wallet. This value was increased from 2500 to 31000 based
// on user reports of incomplete recovery with the lower value.
const defaultRecoveryWindow int32 = 31000
References
  1. The style guide states that comments should explain the 'why' behind a certain block of code, especially if it requires contextual knowledge not immediately obvious from the code itself. Adding a comment here would clarify the motivation for this specific value. (link)

@lightninglabs-deploy lightninglabs-deploy added the severity-medium Focused review required label Mar 5, 2026
@yyforyongyu
Copy link
Member

Closed due to #10632 (review)

@yyforyongyu yyforyongyu closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

severity-medium Focused review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants