Commit Graph

437 Commits

Author SHA1 Message Date
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
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
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
Larry Ruane a4cc08b89e GetBlockRange: allow start < end, return blocks in reverse order 2021-05-18 15:38:26 -06: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
Larry Ruane dcad72ed25 generalize GetAddressUtxos to accept taddr list 2021-04-08 11:22:12 -06:00
Larry Ruane d292bfaea5 update to latest go, protobufs, grpc toolchain
Should be no functional differences. This patch was generated by
installing the latest tools and running `make update-grpc`.
2021-04-07 12:58:01 -06:00
Larry Ruane 0995e130f4 eliminate genblocks compile warning
testtools/genblocks/main.go:91:74: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
https://github.com/golang/go/issues/32479
2021-04-07 10:45:46 -06:00
Larry Ruane 17c47cfebe call checkTaddress() for each given taddress 2021-03-08 12:25:02 -07:00
Larry Ruane 824cb8dc8e check SplitN() return value to prevent indexing beyond end of slice 2021-03-08 12:25:02 -07:00
Larry Ruane ad739ce055 allow Ping testing grpc only if explicitly enabled 2021-03-08 12:25:02 -07:00
Larry Ruane 86a76a96cb check txid (hash0 length argument, must be 64 2021-03-08 11:23:05 -07:00
Larry Ruane 5c5c4b882f check disk write return values 2021-03-08 11:21:33 -07:00
Larry Ruane 22dda4a28d check all json.Unmarshal() error returns 2021-03-08 11:14:48 -07:00
Larry Ruane c7c5da1fda don't log method names to stderr unless --grpc-logging-insecure 2021-03-08 11:12:26 -07:00
Larry Ruane d9d12998b2 remove error logging that client requests can cause 2021-03-08 10:51:31 -07:00
Larry Ruane a69537cf2b restore coinbase height check
The reason that it had to be disabled has gone away. This provides more
security by ensuring that the blocks we receive from zcashd are valid.
2021-01-15 16:49:22 -07:00
Larry Ruane 82045d493a fix GetTaddressBalance (json problem) 2021-01-15 14:05:27 -07:00
Larry Ruane 97d57395b2 fix GetTaddressTxids() 2021-01-12 16:18:29 -07:00
Larry Ruane d7f35f2713 fix database file location bug introduced by PR320
PR 320 introduced a bug that causes the `blocks` and `lengths` database
files to be located one directory level higher than it they should be.

The bug doesn't cause any functional problem, it only makes the
lightwalletd do more work (re-download the block cache), and it also
makes it not possible to switch between testnet and mainnet.

This patch locates the database files back where they belong.
2021-01-11 12:19:51 -07:00
Larry Ruane acca1a7c80 Update protoc grpc toolchain to latest
I installed the latest toolchain according to:
https://grpc.io/docs/languages/go/quickstart/

I updated the protoc command line arguments in Makefile based on
that quickstart guide, then I ran: make update-grpc

This has set the tool version (which you can see at the top of
any .pb.go file) to:

protoc-gen-go v1.25.0
protoc        v3.14.0
2021-01-05 18:20:10 -07:00
Dimitris Apostolou b450634ab7 Fix typos 2020-12-21 13:03:41 -07:00
Larry Ruane 33e7312218 add zcashd versioning to GetLightdInfo result 2020-12-03 22:55:08 -07:00
Ben Wilson 0e0cdcc8ef Update docs/docker-run.md
Co-authored-by: Larry Ruane <larry@z.cash>
2020-11-16 17:20:25 -07:00
Ben Wilson 993437d880 Added a simple docker run example doc 2020-11-16 17:20:25 -07:00
Larry Ruane 05c51935ad fix pullblocks.sh for macOS 2020-11-04 08:25:14 -07:00
Larry Ruane 1712bde1bc add gRPC GetAddressUtxos 2020-10-28 13:09:59 -06:00
Larry Ruane c66521335f add GetTreeState gRPC (for checkpoints) 2020-10-28 12:55:38 -06:00
Larry Ruane 20105167b8 GetBlockRange, GetTaddressTxids segfault: add checking for nil (null) arguments 2020-10-07 15:38:47 -06:00
Larry Ruane 063287888f add more version information to GetLightdInfo result 2020-10-06 10:03:37 -06:00
Larry Ruane 1906e1d1eb fix GetTransaction (broken in "add GetMempool()" commit) 2020-10-06 09:36:22 -06:00
Larry Ruane ac1bf8481c refactor Reverse(), no functional changes 2020-09-14 10:31:17 -06:00
Larry Ruane 7381129740 add GetMempoolTx() 2020-09-10 14:01:01 -06:00