Commit Graph

543 Commits

Author SHA1 Message Date
Aditya Kulkarni 9439901d5c update gitignore 2022-06-07 09:59:13 -05:00
Aditya Kulkarni 994e8a05f2 Merge 'upstream/master' 2022-06-07 09:44:48 -05:00
Larry Ruane ba1b931986 add --sync-from-height command-line option
This causes lightwalletd to discard cached blocks at the given height
and beyond. This in turn causes it to re-fetch those blocks from zcashd.
It's similar to --redownload, except that option discards all blocks
(equivalent to --sync-from-height 0, but the existing --redownload is
retained for compatibility).

This is mostly intended for testing. It's sometimes useful to force the
node to (re)sync some recent blocks, but redownloading all of them takes
around an hour.
2022-05-24 15:17:38 -05:00
Larry Ruane dfac02093d Fix V5 transaction txid (#392)
This is a shortcut fix. Instead of replicating the zip244 transaction
logic that's implemented in librustzcash:
zcash_primitives/src/transaction/components/orchard.rs

cheat by calling getblock with verbose level 1, which prints the txid
of each transaction. This currently requires calling getblock twice,
once for the raw hex (as we have always done), and again to get the
transaction IDs. An easy improvement would be to add the raw hex to
verbosity 1 result. (Or have a new verbosity that shows both.)
2022-05-24 09:23:15 -05:00
adityapk 98cb0ea9f2 cleanup locking for mempool 2022-05-16 13:33:43 -05:00
adityapk 3bec6d290c Timer to 30s 2022-05-13 11:12:12 -05:00
Steven Smith ab4c0fef70 Add support to GetTreeState to return Orchard final state 2022-05-10 23:21:26 -06:00
Larry Ruane 68789356fb update RTD index.html for Orchard
This file is generated from the *.proto files, and had gotten out of date.
Updating it required installing docker; I followed these instructions:
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

I also needed to:

$ sudo chmod 666 /var/run/docker.sock
2022-04-19 11:38:26 -07:00
Larry Ruane 26df6f0992 add V5 transaction (orchard) parsing test 2022-04-12 00:05:29 -06:00
Aditya Kulkarni f6ea41cf9c v1.7.6 2022-04-07 10:50:50 -05:00
Aditya Kulkarni e146dbf5c2 Fix mempool issue 2022-04-07 10:20:01 -05:00
Larry Ruane 631bb16404 fix orchard action ciphertext comment
No functional change. See:
https://github.com/zcash/librustzcash/pull/515#discussion_r808624455
2022-02-16 22:22:46 -07:00
Larry Ruane e53167b6a1 go mod tidy && go mod vendor (update dependencies) 2022-02-16 22:11:50 -07:00
Larry Ruane 7c9bbfa9aa upgrade protoc toolchain 2022-02-16 22:11:50 -07:00
Larry Ruane 83bb19918f restore gRPC GetMempoolTx
This was removed as part of PR #358 (commit "remove gRPC GetMempoolTx")
but should not have been, so it's being restored.
2021-12-09 15:26:55 -07:00
teor c7b1be9fd2 Update list of RPC methods in README 2021-12-08 14:23:52 -07:00
Dimitris Apostolou 13de3232b3 Fix typos 2021-11-30 17:12:35 -07:00
Larry Ruane c006cfe5fb compact blocks should include Orchard transactions
In previous commit, I forgot to include Orchard transactions in compact
blocks (so they will now include transactions with either Sapling or
Orchard transactions).
2021-11-30 14:23:18 -07:00
Larry Ruane 4e1910aeea add NU5 Orchard transaction data to CompactBlock 2021-11-30 10:16:28 -07:00
Larry Ruane fdc54babf2 performance: don't deserialize unused tx fields 2021-11-30 08:36:09 -07:00
Larry Ruane 6d7d9f11a6 improve tx parser memory behavior
This is a non-functional change. Instead of `rawTransaction` (which
carries the result of parsing a full transaction from zcashd) containing
slices of _pointers_ to separately-allocated memory (one allocation for
each spend, for example), allocate a slice of spends (one contiguous
range of memory). A quick benchmark shows sync improves by about 8%.
2021-11-29 18:24:44 -07:00
Larry Ruane ddf3781a60 parse V5 (nu5) transactions
TODO:
- store, instead of just skip over, nu5 transaction fields
- add relevant nu5 fields to CompactBlock
- restore disabled V4 unit tests
- add V5 test vectors to unit tests

The reason most of the V4 transaction and block unit tests are removed
is that they used V3 transactions, which lightwalletd never sees in
production, since lightwalletd starts at Sapling activation (which has
V4 transactions). So these tests were always wrong, in a way. This
commit simplifies the parsing code by removing support for V3 (since it
was never needed). The tests need to be updated to V4, but we'll do
that in a later PR.
2021-10-24 13:30:35 -06:00
Sasha 9263e7f111
Merge pull request #366 from zcash/sasha-doc-updates
Improve documentation for use with docker-compose
2021-09-28 20:37:24 -05:00
Sasha 52ec73c884
Merge pull request #365 from superbaud/master
Improve documentation for use with docker-compose
2021-09-28 20:27:36 -05:00
Taylor Hornby 2defc2501d
Fix em-dashes and add instructions to use a random password 2021-09-28 18:32:19 -06:00
Sasha e150fa7790
clarify that we're exposing lwd to the network 2021-09-28 19:16:43 -05:00
Sasha f84af8fe71
added notes on the multiple zcashd.conf files 2021-09-28 19:13:35 -05:00
Sasha ca4905a6a2
correct typos 2021-09-28 18:55:45 -05:00
adityapk00 33d3d53d34 Verify rawtx 2021-09-07 14:25:20 -06:00
Larry Ruane bdaac63f3e improve reorg by using getbestblockhash 2021-08-30 16:41:24 -06:00
Aditya Kulkarni c1bab818a6 Fetch historical prices from coinbase 2021-08-30 10:43:49 -07:00
Larry Ruane b1f3687d83 add MempoolStream unit test 2021-07-29 13:47:53 -06:00
Larry Ruane 6357f7f15b Refactor mock Sleep, add mock Now time function
Instead of the Sleep function pointer being a standalong global
variable, move it into a new Time struct, and add a Now function
pointer, so that time.Now() can be mocked. Time.Now() isn't used yet.
This will be cleaner if we need to mock more time-related functions in
the future.
2021-07-29 13:47:53 -06:00
Larry Ruane 4f00783f48 remove gRPC GetMempoolTx
This RPC has never been used, and is now superceded by GetMempoolStream.
2021-07-29 13:47:53 -06:00
Larry Ruane 503b9b256b modifications to adityapk00 mempool streaming API
This commit is based on adityapk00 streaming mempool interface but
avoids using goroutines, which are difficult to reason about.

Co-authored-by: Aditya Kulkarni <adityapk@gmail.com>
2021-07-29 13:47:53 -06:00
Aditya Kulkarni c3e1b98d4f Mempool Streaming API 2021-07-29 13:47:53 -06:00
Aditya Kulkarni db02bf40b9 Cleanup logging 2021-07-28 19:34:41 -07:00
Larry Ruane 3f669c3d19 added unit test 2021-07-26 23:20:05 -06:00
Aditya Kulkarni 39179a9721 Return hashes from getlatestblock 2021-07-26 23:20:05 -06:00
Aditya Kulkarni 1b485256a3 Return hashes with getlatestblock 2021-07-26 13:11:02 -07:00
Aditya Kulkarni 7f81fcbf78 Monitor for 1-block reorgs as well 2021-07-26 10:33:28 -07:00
adityapk00 d461c18785
Mempool (#10)
* mempool streaming

* Fix deadlock

* return correct height

* Add mempool stream timeout

* buffer channel

* Mempool API

* comment
2021-07-14 14:46:20 -07:00
Larry Ruane a56af1cfbf GetBlockRange: allow start < end, return blocks in reverse order 2021-05-21 11:17:52 -07:00
Larry Ruane a4cc08b89e GetBlockRange: allow start < end, return blocks in reverse order 2021-05-18 15:38:26 -06:00
adityapk00 41ebe0e04b
Prices (#9)
* Prices API

* Add current prices

* Historical prices persist

* Add mutexs

* multiple providers

* Handle startup

* Edge case where historical price is requested for current

* fix median edge case

* Don't return too old last price

* bug fixes

* price metrics and logging

* warnings
2021-05-18 09:26:55 -07:00
Larry Ruane 4e561f2cfd add darksidewallet support for GetAddressUtxos
Add a new darksidewallet gRPC to add a utxo that can be returned by the
production GetAddressUtxos, for example:

grpcurl -plaintext -d '{"address":"t1g1HQJuwDoStGrYYLj8VhLu1J5igd8TNXV","txid":"1zjB42Z7FtwRZOBNMlTubCgx9l3dsZSqXxmWpuZXJto=","script": "dqkU8saQsCVS4mNwcByoGCtfOaHFaCiIrA==","valueZat": "3010000","height": "686773"}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/AddAddressUtxo

Then the following returns this entry:

grpcurl -plaintext -d '{"startHeight":0,"maxEntries":2,"addresses":["t1g1HQJuwDoStGrYYLj8VhLu1J5igd8TNXV"]}' localhost:9067 cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxos

You can also clear the list of entries:

grpcurl -plaintext localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/ClearAddressUtxo
2021-04-26 11:42:03 -06:00
Aditya Kulkarni d5ca359418 fix merge 2021-04-23 16:41:00 -07:00
adityapk00 f0152f09b9
Merge pull request #8 from adityapk00/lightd_compat
LightwalletD Compatibility
2021-04-22 12:00:54 -07:00
Aditya Kulkarni 02db546516 Update README 2021-04-22 09:25:53 -07:00
Aditya Kulkarni 2941299202 Fix metrics 2021-04-21 11:58:24 -07:00