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

Wallet Sync Updates #883

Merged
merged 13 commits into from
Aug 20, 2024
Merged

Conversation

nodech
Copy link
Contributor

@nodech nodech commented Dec 27, 2023

Wallet Sync Updates

Node HTTP

  • Add fullLock option to the interactive scan, that locks the whole chain
    while scan is in progress.
  • Allow propagation of thrown error from interactive scan.

Wallet

  • Fix Standlone get entry requests when the entry is not found.
  • WalletNode now emits open and close events.

Wallet Client

  • Expose Wallet together with WalletClient as WalletClient.Wallet.

Not changelog related

wdb.addBlock guards.

Add more guards around wdb.addBlock. Make sure we did not receive incorrect
block accidentally. This change makes sure:

  • If low blocks were received, they are on the same chain.
  • If the block at the tip height was received, it is till the same.
  • If we received next block, make sure it's prevBlock is the current tip
    ensuring we are on the same chain.

Currently, it does nothing to change the behaviour. But it could call
syncChain which reorgnizes the walletDB to go back to the same chain. If users
are experiencing any of these logs repeteadly, currently they just need to
restart. syncChain is called on wallet->chain connect. This should not happen
when running wallet as a plugin, but if it ever happened wdb would not have
caught it.


Closes #519
Closes #872
Closes #831

@coveralls
Copy link

coveralls commented Dec 27, 2023

Coverage Status

coverage: 69.781% (+1.2%) from 68.551%
when pulling f46192d on nodech:wallet-interactive-rescan
into 106fbfa on handshake-org:master.

@nodech nodech force-pushed the wallet-interactive-rescan branch 2 times, most recently from 75f3a42 to 2b44a64 Compare February 14, 2024 13:38
@nodech nodech marked this pull request as ready for review February 14, 2024 17:00
@nodech nodech added wallet part of the codebase wallet-db part of the codebase breaking-major Backwards incompatible - Release version labels Feb 22, 2024
@nodech
Copy link
Contributor Author

nodech commented Feb 27, 2024

Note on #831. The PR and the commit tries to attempt synchronizing filter when running in SPV mode. Unfortunately, that's not going to work. The SPV add filter/set filter on pool does not have a way to get "acknowledgement" when ALL the peers have updated the filter, so you can't effectively wait for it from the SPV Node side.
SPV Wallet initial sync wont get affected by it, as it will still miss the txs in the blocks that are streaming. So only constant reset is the only solution for SPV wallet for now.

Fullnode wallets can use rescan feature introduced in this PR to properly resolve the transactions, this does not change/fix add blocks on normal sync.

@nodech nodech added this to the hsd 7.0.0 milestone Jun 5, 2024
wallet-node: fix standalone wallet get entry requests when entry is not found on
chain.
client: expose Wallet class.
Interactive rescan by default does per block scan lock. This enables
parallel rescans, as well as chain sync while rescan is in progress. But
in specific cases, it may be more beneficial to stop the node from
syncing while the rescan is in progress.
wdb/client: fix standalone ChainEntry deserialization and add prevBlock.
bsock hooks that nodeclient tries to imitate, are handlers set on
specific event. They are expected to return results to the caller.
Add stack traces to common test helper timeouts.
Change default timeout to 2000.
@nodech nodech merged commit 9ddb69e into handshake-org:master Aug 20, 2024
6 checks passed
@nodech nodech deleted the wallet-interactive-rescan branch August 20, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-major Backwards incompatible - Release version wallet part of the codebase wallet-db part of the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wallet missing TXs Fix missing transaction with filter updates
2 participants