Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wallet): Add Gap Limit Options #1571

Merged
merged 2 commits into from
Feb 20, 2024
Merged

Conversation

coreyphillips
Copy link
Collaborator

@coreyphillips coreyphillips commented Feb 20, 2024

Description

  • Upgrades Beignet to 0.0.23.
  • Implements gapLimitOptions from upgrade.
    • New wallets default to a lookBehind of 5 and a lookAhead of 1 to limit queries to Electrum.
    • Restored wallets temporarily use a lookBehind of 20 and a lookAhead of 20 during the initial scan. Once this scan finishes it reverts back to the default lookBehind-lookAhead of 5-1.
    • If you think the 5-1 defaults are low, we can try something higher like 5-5, but restored wallets may come close to the limits of what a given Electrum server will tolerate for extremely active users or heavy testing sessions.
  • Adds two dev-only views.
    • Monitored Address Types: Found in "Settings->Advanced->Bitcoin Address Type" beneath "Monitored Address Types" allowing us to adjust what address types are actively being monitored. An app restart is required for changes to take effect.
    • Gap Limit: Found in "Settings->Advanced->Gap Limit" allowing us to adjust the gap limit in Bitkit as needed for testing/debugging.
  • Updates broadcastTransaction, getReceiveAddress & getBalance methods.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Tests

  • No test

Screenshot / Video

Simulator Screenshot - iPhone 14 - 2024-02-19 at 20 54 27
Simulator Screenshot - iPhone 14 - 2024-02-19 at 20 54 10

QA Notes

  • Restores should continue to work as expected. Once a restore is successful and the initial scan is complete we should be able to observe that the gap limit lookAhead and lookBehind were reverted to their default of 5-1 in "Settings->Advanced->Gap Limit".

Upgrades Beignet to 0.0.23.
Implements gapLimitOptions from upgrade.
Adds two dev-only views.
Updates broadcastTransaction, getReceiveAddress & getBalance methods.
@limpbrains
Copy link
Collaborator

How does lookBehind: 20 works during wallet restore, it still can't go behind index 0, right?

@coreyphillips
Copy link
Collaborator Author

How does lookBehind: 20 works during wallet restore, it still can't go behind index 0, right?

A lookBehind of 20 is not necessarily needed during the initial scan for a restore since we're scanning all addresses as we generate them anyway, it's just there to conform to the standard/default.

@coreyphillips coreyphillips merged commit fe8905d into master Feb 20, 2024
4 of 5 checks passed
@coreyphillips coreyphillips deleted the feat/gap-limit-options branch February 20, 2024 11:53
@JeanlChristophe JeanlChristophe added this to the Beignet milestone Feb 23, 2024
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.

3 participants