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

Add Chainscan package #83

Merged
merged 6 commits into from Jul 8, 2020
Merged

Add Chainscan package #83

merged 6 commits into from Jul 8, 2020

Conversation

matheusd
Copy link
Member

Part of #80

(Still missing some documentation, examples and copyright notice on the package.)

This introduces a new package called chainscan. The primary goal for this package is to be able to perform historical and tip-changed-triggered scans of blocks to determine whether they have relevant transactions for the LN node and retrieve the ones that are.

This is an improvement over the existing manual rescan performed by the the dcrd node via LoadTxFilter as done today in dcrlnd in that it checks the cfilters for the wanted targets before attempting to iterate over the block's transactions.

It is also a necessary step towards supporting SPV mode, given that in that mode the LN node does not have access to a full chain.

The package is self-contained and has minimal external dependencies. The implemented scanners (Historical and TipWatcher) require that the caller provide implementations for the chain operations necessary for the search to happen, so this package is usable by callers retrieving their information from a running dcrd instance, a dcrwallet instance or from some other source of blockchain data. This makes it suitable for use by software other than dcrlnd.

A set of tests and benchmarks is included.

@matheusd matheusd mentioned this pull request Feb 11, 2020
9 tasks
@matheusd matheusd mentioned this pull request Mar 10, 2020
@matheusd matheusd force-pushed the chainscan branch 3 times, most recently from 0fed260 to 19cdca6 Compare March 30, 2020 12:56
@matheusd matheusd force-pushed the chainscan branch 2 times, most recently from 155a696 to 899c1a2 Compare March 30, 2020 14:40
@matheusd matheusd force-pushed the chainscan branch 2 times, most recently from 122e190 to 7b8f153 Compare July 8, 2020 17:33
This makes ComputePkScript entirely self contained and independent of
the current network.
This introduces the first version of the chainscan package scanners. The
chainscan package is responsible for performing historical searches on
the blockchain for specific targets: either scripts or outpoints.

It can also watch for events from the tip of the blockchain and react to
them as appropriate.

It has a very small memory footprint for performing the searches after a
target is setup.
This adds the chain source drivers necessary to run Historical and
TipWatcher scanners connected to either an embedded or a remote
dcrwallet.
This adds example programs that can perform historical rescans across
the chain looking for specific addresses either via a dcrd node or via a
dcrwallet instance.
@matheusd matheusd merged commit eae5bde into decred:master Jul 8, 2020
@matheusd matheusd deleted the chainscan branch July 8, 2020 18:29
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.

None yet

1 participant