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

Set lookahead in Settings #203

Closed
sdtsui opened this issue Aug 14, 2020 · 5 comments
Closed

Set lookahead in Settings #203

sdtsui opened this issue Aug 14, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@sdtsui
Copy link
Contributor

sdtsui commented Aug 14, 2020

User should be able to adjust lookahead so their wallet can support more names/transactions. Powerusers are asking for this as it looks as if stuff is disappearing from their wallets.

I think this should be a number input. You might need to restart the node or at least kick off a rescan -> we could make this automatic or have another button for that.

@sdtsui sdtsui added the enhancement New feature or request label Aug 14, 2020
@pinheadmz
Copy link
Contributor

Disagree. Look ahead should be a standard. If users set it too low not knowing what it is, they shoot thenself in the foot. It also means they must memorize that number or keep it with their wallet seed if they ever import. I think it should not be user configurable. What we really need are deep wallet refractors in hsd.

More: handshake-org/hsd#407 (comment)

@chikeichan
Copy link
Contributor

did some digging into the rescan behavior and agree with @pinheadmz - a high enough fixed value with a rescan button should fix the problem, or at least give users to keep rescanning until they grabbed all their txs.

@chikeichan
Copy link
Contributor

The issue I found with lookahead is that if the values is too high, it actually starts to behave inconsistently. I am guessing that the issue might have to do with size limit of bloom filter, if there is one.

The behavior i am noticing is that:

  • I have a wallet with a lookahead value of 700
  • if i set lookahead value to 500, i need to rescan twice
  • if i set lookahead value to 700, i only need to rescan once
  • if i set lookahead value to 800, i actually need to rescan twice as well
  • and if i set lookahead value beyond 1000, i start running into errors from wdb

@pinheadmz
Copy link
Contributor

These two make sense:

if i set lookahead value to 500, i need to rescan twice
if i set lookahead value to 700, i only need to rescan once

This is a bit surprising:

if i set lookahead value to 800, i actually need to rescan twice as well

This is kinda, eh maybe not surprising given the performance hit of generating and scanning for all those keys:

and if i set lookahead value beyond 1000, i start running into errors from wdb

We may find that a lookahead of 1000 takes several seconds when creating a new account, and may cause race conditions when the wallet just isn't ready for API calls yet. I need to try some benchmarks with this value in hsd, but then yeah I think we either need to ditch the internal bloom filter (means rescans will take a lot longer) or refactor it so when a tx is found in a block, the filter is updated and that block is rescanned again: bcoin-org/bcoin@c6859b3

@chikeichan
Copy link
Contributor

#232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants