Skip to content

Generating SPK Index upon loading wallet is slow for large wallets with lots of addresses #1953

@matthiasdebernardini

Description

@matthiasdebernardini

Describe the enhancement
Wallets with large last_revealed indexes are slow to generate the SPK cache when the wallet is loaded. I discovered this with a wallet that has an index of 7,000 addresses.

Use case
I am loading my wallets using the PersistTrait and this SPK list gets generated every time, which for large numbers is slow. I would like to load wallets from persistence as quickly as possible (so I can show the balance).

Additional context
There are a number of ways which were discussed in a call.

  • We can change KeychainTxOutIndex to persist the spks.

    • needs to be careful to check them
  • implement a whole changeset for spk index (@ValuedMammal)

  • make it optional since its not strictly needed for checking balance or listing utxos.

Some context from the call
The problem is with the KeychainTxOutIndex. @evanlinjin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions