-
Notifications
You must be signed in to change notification settings - Fork 68
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
New AddressIndexer leveraging CoinView #1031
Open
quantumagi
wants to merge
21
commits into
stratisproject:release/1.6.0.0
Choose a base branch
from
quantumagi:getbalance2
base: release/1.6.0.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New AddressIndexer leveraging CoinView #1031
quantumagi
wants to merge
21
commits into
stratisproject:release/1.6.0.0
from
quantumagi:getbalance2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zeptin
reviewed
Aug 30, 2022
src/Stratis.Bitcoin.Features.BlockStore/AddressIndexing/AddressIndexerCV.cs
Outdated
Show resolved
Hide resolved
zeptin
previously approved these changes
Sep 3, 2022
Closed
quantumagi
changed the title
Add GetBalance to CoinView
New AddressIndexer leveraging GetBalance on CoinView
Oct 31, 2022
quantumagi
changed the title
New AddressIndexer leveraging GetBalance on CoinView
New AddressIndexer leveraging the GetBalance of CoinView
Oct 31, 2022
quantumagi
changed the title
New AddressIndexer leveraging the GetBalance of CoinView
New AddressIndexer leveraging CoinView
Nov 1, 2022
zeptin
previously approved these changes
Nov 2, 2022
@fassadlr , can you please have a look at this as well and perhaps comment on whether this is good to merge into 1.5. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a reduced version of the earlier PR #995 with not-directly-relevant concerns split-off into separate PRs.
The PR replaces the current (
LiteDB
)AddressIndexer
implementation and shares theCoinDb
repository (LevelDb
and optionallyRocksDb
orDBreeze
).Adding balance recording (for ALL addresses) to
CoinView
ensures a consistent view across available UTXO's and address balances. This is also a faster implementation than is provided by the currentAddressIndexer
. Only a fraction of a second (~40 ms) response time was observed to return the current balance AND ~1800 balance adjustments all the way to genesis. This does not require compaction and neither is it supported.The cumulative balance is recorded in the
Balance
table and adjustments in theBalanceAdjustment
table. This allowsGetBalance
to quickly supply the latest balance and if required a history of balances.The code deals with the following issues:
AddressIndexer
with a new implementation.Note: Similar to
SQLiteWalletRepository
and for best performance, the code tracks destinations (vs addresses). This requires any addresses queried to be convertible to destinations. This is assumed to be so for the current use-cases.