For consistency, we serialize the `finalState` field in the
same (sparse) encoding as Sapling and Sprout use. In the future
we may want to update this to the dense encoding that
incrementalmerkletree::bridgetree::Frontier uses, but that's not
necessary for the moment.
In zcash/zcash#5762 we altered the gtest runner to turn on logging to
stdout instead of dropping the logs, to make figuring out test failures
easier. However, this also meant the logs would be displayed for tests
that succeeded, and it was confusing to see `ERROR` log lines present.
We now have a test-specific initialization method for tracing that uses
synchronous logging instead of a background thread, and only logs to a
file. In the gtests, we initialize this with a new temporary file, and
add a gtest event listener that clears the file at the start of each
test, and then prints its contents if the test fails.
Example test output:
```
[ RUN ] ChecktransactionTests.CheckVpubNotBothNonzero
gtest/test_checktransaction.cpp:39: Failure
Expected equality of these values:
state.GetRejectReason()
Which is: "bad-txns-vpubs-both-nonzero"
"bad-txns-vpubs-both-nonzer"
--- Logs:
ERROR main: CheckTransaction(): joinsplit.vpub_new and joinsplit.vpub_old both nonzero
---
[ FAILED ] ChecktransactionTests.CheckVpubNotBothNonzero (0 ms)
```
Closeszcash/zcash#5766.
In #5809, we attempted to fix the assumption that on startup, the
wallet's best chain was at the same position as the node's chain tip.
This did not account for a condition where the node's block index
might not contain the block corresponding to the wallet's best chain,
because the node had crashed before the block index containing that
block could be written to disk.
This commit adds handling so that the `ThreadNotifyWallets` thread
will not start until the wallet's best block has been restored
to the node's block index and we're able to obtain a pointer to
that state.
This adds tests to wallet_z_sendmany that demonstrates conditions
where pool-crossing transfers were not being caught by the privacy
policy checks, which were validating only against the transfer
request rather than the actual transfer selected. This missed
cases where sending funds between unified addresses would reveal
amounts via the turnstile.
Making all privacy policy checks after note selection guards against
this error.
We canonicalize git URLs when linting Cargo patches, because Cargo
treats `path/to/repo` and `path/to/repo.git` identically (and similarly
it strips a trailing slash), so we allow `.cargo/config.offline` and
`Cargo.toml` to mismatch in this way to minimise lints.
The previous code assumed that we would only see wallet addresses
that we had explicitly generated, and crashed if we detected a note
sent to a different Orchard receiver within a known account.
Fixeszcash/zcash#5827.
Co-authored-by: Jack Grigg <jack@electriccoin.co>