Commit Graph

504 Commits

Author SHA1 Message Date
dependabot[bot] 21c2876860 Bump golang.org/x/net from 0.19.0 to 0.23.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.19.0 to 0.23.0.
- [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 12:49:11 -06:00
str4d 2fb5ccd7aa
Merge pull request #479 from emersonian/go-1.22.2
Bump golang version to mitigate HTTP/2 continuation floods (#478)
2024-04-22 17:41:43 +01:00
Emerson Hall 5a500fb5b2 Bump golang version to mitigate HTTP/2 continuation floods (#478) 2024-04-04 22:16:50 -05:00
dependabot[bot] 283cc6475b Bump google.golang.org/protobuf from 1.32.0 to 1.33.0
Bumps google.golang.org/protobuf from 1.32.0 to 1.33.0.

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-14 09:35:54 -06:00
Yasser Isa 38b751e551
Create CI.yaml in Github Actions (#475)
* Migrate gitlab-CI to Github-Actions
2024-03-07 12:24:01 -07:00
dependabot[bot] cc04b52bec Bump golang.org/x/crypto from 0.16.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-13 11:50:57 -07:00
Larry Ruane 1002f42497 Update dependencies
To update to the latest dependencies, I removed everything within the
`require` sections of `go.mod`, updated to the latest protobuf compiler,
and then ran `go mod tidy` and `make`. This repopulated go.mod and go.sum.
I had previously done this in PR 395 (June 2022).

This should be done periodically to obtain the latest bug fixes and
other improvements in the dependencies. There should be no functional
changes.
2024-02-01 12:41:14 -07:00
Larry Ruane 9ed586d7cd fix Makefile: darkside.proto isn't generated 2024-02-01 12:41:14 -07: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
Kris Nuttycombe 5c534c6142
Merge pull request #471 from chairulakmal/470_update_wallet_examples
fix(docs): update wallet examples in Readme
2024-01-11 15:11:54 -07:00
Kris Nuttycombe e91d882057
Merge pull request #469 from LarryRuane/2023-12-darkside-GetSubtreeRoots
test: add darkside support for GetSubtreeRoots gRPC
2024-01-11 15:10:30 -07:00
Larry Ruane bfd4e0a53f test: add darkside support for GetSubtreeRoots gRPC
One new darksidewallet gRPC added, SetSubtreeRoots()
2024-01-11 12:48:10 -07:00
chairulakmal a8f3733074
fix(docs): update wallet examples in Readme 2024-01-11 22:30:28 +07:00
dependabot[bot] cdcbfeb5cc Bump golang.org/x/crypto from 0.14.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.14.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.14.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-27 10:56:18 -07:00
oscar-pepper c7dddecfe9 Update darksidewalletd.md 2023-11-28 13:52:06 -07:00
dependabot[bot] 71d9e0b6ef Bump google.golang.org/grpc from 1.53.0 to 1.56.3
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.53.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-28 13:13:56 -07:00
Larry Ruane f880f582a9 fail during startup if rpcpassword not specified 2023-10-26 14:47:24 -06:00
Larry Ruane f936ae8e61 add comments that GetTaddressTxids() returns transactions 2023-10-19 16:37:22 -06:00
Larry Ruane fb12fba802 update GetSubtreeRoots gRPC comment 2023-10-19 16:30:19 -06:00
dependabot[bot] 7555b494d3 Bump github.com/btcsuite/btcd from 0.23.1 to 0.23.2
Bumps [github.com/btcsuite/btcd](https://github.com/btcsuite/btcd) from 0.23.1 to 0.23.2.
- [Release notes](https://github.com/btcsuite/btcd/releases)
- [Changelog](https://github.com/btcsuite/btcd/blob/master/CHANGES)
- [Commits](https://github.com/btcsuite/btcd/compare/v0.23.1...v0.23.2)

---
updated-dependencies:
- dependency-name: github.com/btcsuite/btcd
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-19 16:25:12 -06:00
dependabot[bot] cd7c7143a1 Bump golang.org/x/net from 0.7.0 to 0.17.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.7.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-19 16:22:11 -06:00
Larry Ruane 8003d7fb6e darksidewallet: GetLightdInfo with no blocks shouldn't crash
Instead, return a reasonable error message. Issue #451.
2023-09-04 15:06:00 -06:00
Larry Ruane 853016bfd2 darkside GetLightdInfo: return fake build info
Instead of returning empty strings for `ZcashdBuild` and
`ZcashdSubversion`, return fixed "darksidewallet" strings.
2023-09-04 15:06:00 -06:00
Larry Ruane 7971992989 darkside GetTreeState gRPC: support block hash or height
In production mode, the `GetTreeState` gRPC supports block specification
by either height or block hash. But until now, darkside emulation only
supports height. This commit adds support for block hash.

It also allows entries to be deleted (darkside `RemoveTreeState`) by
block hash (not just height).
2023-09-04 14:22:44 -06:00
ebfull 2df6364979 Fix README's suggested zcashd configuration
`lightwalletd` needs to be enabled now, not `insightexplorer`.
2023-09-03 15:34:07 -06:00
Jack Grigg 8269810eee darkside: Store, track, and expose commitment tree sizes 2023-08-16 10:34:38 -06:00
Jack Grigg b9de328ea9 darkside: Introduce `activeBlock` struct 2023-08-16 10:34:38 -06:00
Jack Grigg 04dbfe1d29 Regenerate Protobuf and gRPC bindings with more recent protoc 2023-08-16 10:34:38 -06:00
Jack Grigg b805382ac3 Only pass `limit` argument to `z_getsubtreesbyindex` if `maxEntries > 0`
We also remove the `i < maxEntries` bound on returned results, as the
`limit` parameter already causes `zcashd` to bound its returned entries.

Closes zcash/lightwalletd#444.
2023-07-11 17:26:59 -06:00
Yasser ab90099deb Update Dockerfile
The minimum required version of Golang is version 1.17
2023-07-07 07:53:35 -06:00
dependabot[bot] f7795c83a3 Bump google.golang.org/grpc from 1.47.0 to 1.53.0
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.47.0 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.47.0...v1.53.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-06 23:20:24 -06:00
Larry Ruane 2e25236094 test: follow-on to PR 440 - update test vectors
Fix unit test: go test ./parser
(Compact block serialization has changed.)
2023-07-04 11:36:13 -06:00
Jack Grigg f0e4c27ed6 Bring in latest `compact_formats.proto`
From zcash/librustzcash@c13c8c6678,
including the rework of how the commitment tree sizes are to be
represented in CompactBlocks.
2023-07-04 11:05:41 -06:00
Larry Ruane c506123a08 add GetSubtreeRoots() gRPC 2023-06-27 21:14:59 -06:00
Larry Ruane c97bd8cc23 improve startup logging (no functional change) 2023-06-05 15:33:50 -06:00
Larry Ruane 214d4a8475 add GetBlockNullifier and GetBlockRangeNullifiers #406
These return compact blocks with only the transactions' nullifiers
remaining. This affects both Orchard and Sapling transactions.
2023-06-05 15:19:08 -06:00
Larry Ruane d55679f301 add Sapling and Orchard tree commitment sizes to GetBlock result
And also to GetBlockRange. This requires an updated version of zcashd
`getblock` RPC that returns these values. These values are written to
the compact block cache (/var/lib/lightwalletd/db/main/blocks), but of
course older cached compact blocks won't have these values. To get these
values into all cached blocks, shut down lightwalletd, remove that file,
and restart (with, of course, an updated version of zcashd running).
2023-06-04 22:26:17 -06:00
Larry Ruane de8b6230ba extend darksidewallet locking
See https://github.com/zcash/lightwalletd/issues/433
2023-05-27 07:53:12 -06:00
dependabot[bot] e3d9c11f14 Bump golang.org/x/net from 0.0.0-20220520000938-2e3eb7b945c2 to 0.7.0
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220520000938-2e3eb7b945c2 to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 18:40:15 -07:00
Larry Ruane 478ec3e361 fix frontend unit test TestGetLatestBlock
This test was broken by PR 415.
2023-02-14 13:43:48 -07:00
Dimitris Apostolou 07fd6a966a Fix typos 2023-01-02 13:11:15 -07:00
Larry Ruane 5d174f7feb darkside: fix GetBlock intermittent (timing) failure
In PR 412 (darksidewallet fixes for tx v5), I added a failure condition
to the GetBlock gRPC based on a block being requested always being in
the cache. I believe my thinking was that since there is no asynchronous
independent zcashd, if it wasn't in the cache, it never would be. I
failed to take into account that the block ingestor takes time to run,
and a test can run quickly enough that the block ingestor hasn't had
time to process the block. I reproduced the problem by commenting out
the starting of the block ingestor.

I think that error condition can be removed, which is what this commit
does. I tested by leaving the block ingestor commented out, so that
GetBlock has to use the RPC interface to get the block, and it works.
2022-11-19 17:19:39 -07:00
JG 636a4d9632 Updated required golang version
Updated required golang version to 1.17 to reflect the version specified in the go.mod
2022-11-01 15:42:13 -06:00
Larry Ruane 4267cc9754 fix GetLatestBlock() gRPC (pure block cache)
See issue 397. If the block cache is still populating (lightwalletd is
syncing with zcashd), behave the same as if the cache was fully
populated, other than performance.

This turned out to affect only the GetLatestBlock() gRPC. Previously, it
would return the height and hash of the latest block in the cache. After
this commit, it queries zcashd using the getblockchaininfo, which
contains both of those values.

GetBlock() (and GetBlockRange()) already worked correctly; if the
requested block isn't in the cache, it requests it from zcashd.
2022-10-20 10:04:05 -06:00
Larry Ruane ad5ecda5fb fix darside ApplyStaged many blocks performance regression
If the darkside "getblock" RPC handler is given a block hash as argument
(rather than a height), it was deserializing all active blocks
sequentially to find the one with the given hash. This is slow if there
is a large of blocks.

I considered the most general solution of adding a block hash map to
darkside so that any block could be looked up by its hash, but that
turns out to be a lot of effort. So instead, maintain a one-block cache
because a block is always looked up by hash immediately after being
looked up by height (this was changed in PR 412).
2022-09-11 16:49:41 -06:00
Francisco Gindre 15fe0ced86 [#390] Support for GetTreeState on Darksidewalletd
This commit adds support for adding/removing/clearing TreeState
structs for lightwalletd to return as if they were TreeState
messages requested to Zcashd for a given height.

Closes #390
2022-08-29 14:24:14 -06:00
Larry Ruane bbe8d14ecc Fix darksidewallet for tx v5 changes
Darkside test framework broke due to the V5 txid changes (issue 392).
This change enhances darksideRawRequest("getblock") to allow the
argument to be either a height or a block hash, rather than only a
height.
2022-08-28 15:45:04 -06:00
Francisco Gindre c999c4fd29 [#388] Darksidewalletd does not tell developers why it failed when a method is invoked 2022-08-27 17:25:06 -06:00
Larry Ruane f53511cb03 Fix reorg race condition that can cause rare crashes
Fixes issue 408.

This bug was introduced by PR 393, which changed how txids are
determined. That PR changed each call to the zcash getblock call into a
pair of calls, the first to get the raw block data, the second to
retrieve the txids in the block. (Unfortunately, you can't get both in a
single getblock RPC.) But this ordering introduced a timing window in
which the block at the given height can change, if a reorg occurred
between the two calls.

This PR reorders the getblock calls, so that the first call gets the
transaction IDs, which also happens to return the block hash, so then
the second getblock call can specify the block hash, rather than the
height. This ensures that the two RPC calls return consistent data,
definitely the same block.
2022-08-23 13:14:09 -06:00
Larry Ruane 2d3943b8e9 add required locking (mutex) to GetMempoolTx 2022-07-21 11:31:03 -06:00