Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Slp Graph Search feature (gcash#451)
* add slp graph search core * gs server updates, only mempool handling remains * add mempool access to graph search * update sample-bchd.conf * update generated pb for web proxy * update generated pb.go and swagger * Use multiple goroutines to load the graph search db I just hardcoded maxGoroutines at 4 as seems the db loading process doesn't get much better with more goroutines. Loading time with 1M items is a little over 1 minute. Before this it took around 4-5 minutes. There are a couple of optimizations noted (see TODOs) * clean up debug slp debug statements * clean up debug slp debug statements * improve loading experience * use cpu count * 3 for max goroutines * log loading status at info log level * clean up logging and notation * add gs status to GetBlockchainInfo * return proper error for GetGraphSearchDb during the loading period the db isn't available so we'll return this as an error so its clear why its not available * refactor into standalone package * fix lock * topo sort new block txns * remove debug lines * clean up mempool/block handling With GS added some renaming was done since both slp index and gs are sharing the same event handler. Also some of the logging messages was cleaned up. * fix error handling in addTxn * refactor event handling * improved debug logging * remove stray fmt.Println() * more refactoring and containment of gs * use original prop names * fix state changes * nit: use "hash" vs "txid" in naming validity cache * update bchutil version * update goslp version * grpc server address property updates * for grpc endpoints GetAddressTransactions and GetAddressUnspentOutputs convert slp to cash address * include slp address property in input metadata for SubscribeTransactoins endpoints on inputs * remove address prefix in response * add check for slp parsing error * update generated files to include graphsearch * remove bad type reference * Revert "remove GetBip44HdAddress grpc endpoint" This reverts commit f3cfa5a. * fixes for including Bip44 endpoint * use cache in ConnectBlock * use RLock as much as possible * follow-up merge commit * nits * follow up merge * refactored gs parts * fix performance issues from locking * using atomic lock to read gs db state seemed to degrade performance significantly, switched to RLock before commiting to a Lock * reduced the number of times any kind of lock is being held * impr debug logging * set gs db ready flag * separate flag checks for gs * remove GetBip44HdAddress * impr err resp * peer sync tweaks from btcd * Revert "peer sync tweaks from btcd" This reverts commit df5730b. * run protoc after merge * enable slpgraphsearch for bchrpc regtests * put gs AddTx update in goroutine * fix pb generated files (merge conflicts) * improve handling the removal of slp mempool items * fixes error of having RemoveMempoolSlpTxs inside a for loop in ConnectBlock * make RemoveMempoolSlpTxs a private method and remove it from the grpc server block event * ignore non-contributing parents * fix generated pb after merge * update bindata for a clean merge * unit test updates: - update proxy test url - update regtest npm pkg versions Co-authored-by: Ekliptor <[email protected]>
- Loading branch information