-
Notifications
You must be signed in to change notification settings - Fork 38.7k
txoutsbyaddress index (take 3) #9806
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
Conversation
a2cbe30 to
1ee7bcf
Compare
|
Wshadow statistics: |
89293d7 to
bd92c93
Compare
|
@paveljanik - Thanks! Fixed that up. Looks like that's the only shadow warning. |
d828eaa to
51de4fa
Compare
|
Thanks for reviving this. IMO this is important. |
|
Concept ACK, are there any statistics on how much extra burden this places on an ordinary node with the index off? |
|
needs rebase |
51de4fa to
aaaa372
Compare
|
@instagibbs - Rebased. Thanks for the heads up. (Side note: Is there any way to have GH tell you when a conflict occurs? That would be really handy.) @sidhujag - Good question. I don't know offhand. I'm happy to do some benchmarking. I may need some help with that. If anybody would like to make some suggestions, I'm all ears. All - Will get more movement on this. Life intervened for awhile and has finally slowed down enough to where I can dedicate more time to this. |
b9ac7b4 to
eab6e67
Compare
|
Thanks droark great feature btw.. this makes walletless spending very easy |
eab6e67 to
8ec71e0
Compare
|
Am placing a to-do list here to remind myself of what I need to do, and solicit feedback on anything people might think is missing.
|
|
needs rebase. |
ab345ad to
fcc0caa
Compare
|
@btcdrak - Thanks. Rebased. |
6ca6511 to
72b72a8
Compare
|
Running this on a .bitcoin/ folder that was last used with 0.13 and was run pruned to 2000. It seems 1GB of ram is too low for this enabled as I got an out of memory error. Now on restarting I get the following after/during the "Rescanning..." step: |
b804b2f to
6c96fc9
Compare
- Switched getutxosbyaddress to getutxoindex, and altered the files as needed to reflect this change. - Switched CCoinsMapByScript key from uint160 to CScriptID. - Various C++11-related changes. - Removed a try/catch case from CCoinsViewDB::CountCoins(). - Changed a const ref in CTxMemPool to a const copy to prevent a possible subtle error. - Added a default value (false) for UTXO indexing under CTxMemPool.
5f3b534 to
77aa7e0
Compare
|
Thanks for preparing this @droark. Is this PR still alive? |
|
@dexX7 - Thanks for checking in. Some family-related issues came up recently that I had to deal with for awhile. I'm almost done rebasing the PR and will catch up with the remaining feedback ASAP, along with some test harness changes that probably need to be folded in. The path forward looks pretty clear to me, IMO. I just need to wrap up the work. |
|
I still need to read more, but... Regarding searching by address , by scriptPubKey, or by COutPoint (tx_id, output_pos), I'm not sure whether I want them all or a subset of them. This all assumes you create a new scriptPubKey -> COutPoint index. Regarding utxo vs stxo vs txo... So although I'm not against gettxoutsbyaddress and I celebrate concept ACK it, but I think it would be nicer to get gettxoutsbyoutpoint and gettxoutsbyscript reviewed and merged in that order first. But I think some other people don't like chained PRs all that much, so just take it as "if we're offering gettxoutsbyaddress, we should be able to offer gettxoutsbyoutpoint and gettxoutsbyscript 'almost for free'(tm) too". It may seem contradictory: I'm asking you to do more with respect to utxo/stxo, but I'm suggesting to do less with respect to addresses and properly removing things for the users that want this feature but don't want to be full archives, which is something we can optimize further later after leveraging the easy important one, which is just looking in the utxo first. Anyway, feel free to note the parts of my long post you like in whatever order you like best and ignore the rest. I plan to have a deeper look either way beyond this concept ack. All the best but needs rebase. |
|
Sorry, no, using GetTransaction doesn't leverage the utxo index we maintain...One would need to search in the utxo (with CCoinsViewCache::AccessCoin) first and then try with GetTransaction only if we want to also serve stxo, which should perhaps be left out of scope for this PR as a later improvement. |
|
Sorry for the long post, not for being long but for being incorrect. There's not need for a gettxobyoutpoint or similar because it already exists and is named gettxout! Only the slower parts were missing, which I plan to serve in #10822 which is just a draft that needs lots of testing. To reiterate, the important parts of my previous fedback:
The PR that should help extend whatever is done for utxo to txo if you do the index: outpoint -> script; is the following: As said it needs testing, but there's no need to wait, let's expose utxo if we can first and then txo "almost for free"(tm). Sorry again for invading the pr in a distractive way, but this needs rebase. |
|
What's the status of this PR, needs more review and testing? General concept ok? I think it would be useful to have an index on the UTXO set for the purposes of supporting external and hardware wallets. |
|
Closing as 'up for grabs'. PR author hasn't checked in for about a year. @droark - if you still want this, feel free to re-open and rebase! |
|
Picked up in " Add address-based index (attempt 4?) #14053 " |
I think those are different, right? this an indeex over the UTXO set, while that is an index over all addresses in the block chain? Or do I get this wrong. |
|
Indeed looks like it. I wonder why it is called take 4 then. Though, scanning the utxo set can already be done with |
Absolutely, that does the same thing. Though it can be pretty slow, which can be awkward if it's part of some user flow, so UTXO indexing is not completely out of the picture probably. |
This is an attempt to revive PR #8660 (and, by extension, PR #5048). For now, this PR simply compiles without fresh warnings or errors. Once it is confirmed that no more conflicts exist, the remaining comments/requests from #8660 will be fully addressed.