Commit Graph

21 Commits

Author SHA1 Message Date
Larry Ruane 6e3816b583 add --nocache option to disable compact block file cache
This fixes issue #480. Enabling this option decreases the performance of
gRPCs GetBlock and GetBlockRange, but conserves disk space (the size of
the database is currently around 17GB).

Note, specifying this option will also delete the existing cache (so if
you start again without --nocache, the cache will need to be recreated).
2024-06-27 13:24:57 -05:00
Larry Ruane 6071b06ace Reduce lightwalletd startup (if disk cache already exists)
Reduce the startup time from a couple of minutes to a few seconds (or
less) by removing the deserialization of all compact blocks in the disk
cache. This is an alternative to PR 482, see comment there for details.
2024-06-13 09:08:47 -06:00
Larry Ruane e8453e62f6 update dependencies: packages ioutil, errors
No functional changes.

As pointed out in lightwalletd/pull/469, the errors package we're using
has been deprecated, so this commit updates the code to use "errors"
instead of "github.com/pkg/errors". Same with "io/ioutil", which has
been superceded by "os".
2024-02-01 12:41:14 -07:00
Larry Ruane c97bd8cc23 improve startup logging (no functional change) 2023-06-05 15:33:50 -06:00
Larry Ruane 0d00588941 Get unit tests working again
Now "go test ./..." passes, it had broken due to the V5 transaction
(NU5) changes in #392. I didn't have time to fix the tests at the time.
Also, this fixes a few lint problems.
2022-06-12 12:50:42 -06: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 bdaac63f3e improve reorg by using getbestblockhash 2021-08-30 16:41:24 -06:00
Larry Ruane 5c5c4b882f check disk write return values 2021-03-08 11:21:33 -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 1c6d8a46f7 gracefully handle syncing zcashd (no REORG) 2020-06-26 08:35:35 -06:00
Larry Ruane ead5415693 bump version to 0.4.1, release notes, small fixes 2020-06-05 17:16:36 -06:00
Larry Ruane b47c0ddf99 fix corruption detector, smallest block is 74 bytes, not 78 2020-05-22 08:30:03 -06:00
Larry Ruane f1e793796f implement staging, not well tested 2020-05-21 11:48:03 -06:00
Larry Ruane 86fd87404b add darkside SetMetaState, SetBlocksURL for reorg testing 2020-05-21 11:48:03 -06:00
Larry Ruane f4d5d8e4b2 if corruption detected, save db files for analysis 2020-04-24 16:55:47 -06:00
Larry Ruane c2a6306ce5 Misc cleanups and fixes
- improved corruption recovery (don't back up by just 1 block at a time)
- move darksidewallet gRPCs to their own .proto file
- this force-push removes my commits for reorg testing using SetState
2020-04-24 16:55:47 -06:00
Larry Ruane 3873a4d895 mutex.Lock during c.recoverFromCorruption() 2020-04-23 00:25:14 -06:00
Larry Ruane 1ff6ea4091 move block cache from memory to files 2020-04-08 18:10:50 -06:00
Larry Ruane 1dc439080b add COPYING and copyright lines 2020-03-12 12:02:55 -06:00
Larry Ruane a4f968823f test improvements, and minor cleanups 2020-01-31 16:36:31 -07:00
Larry Ruane 2b73689794 remove sqlite3, add block cache (adityapk00)
Co-authored-by: Aditya Kulkarni <adityapk@gmail.com>
2019-12-19 12:11:03 -07:00