Commit Graph

14507 Commits

Author SHA1 Message Date
Homu ac792a3947 Auto merge of #4860 - daira:clarify-meantarget, r=daira
GetNextWorkRequired: clarify why this computation is equivalent to that in the protocol spec

refs https://github.com/zcash/zips/pull/418 cc: @teor2345

Comment-only change; no documentation or testing required.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-12 14:10:57 +00:00
Daira Hopwood 4d16bfd181 GetNextWorkRequired: clarify why this computation is equivalent to that in the protocol spec.
refs https://github.com/zcash/zips/pull/418

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-12 10:52:49 +00:00
Jack Grigg 6c43a57e78 test: Use default shielded address in RPC tests where the type is irrelevant
This means we are running these tests against the recommended functionality,
and that these RPC tests will now use the faster Sapling addresses.
2020-11-11 22:43:26 +00:00
Homu 5c47b9bb08 Auto merge of #4852 - str4d:cargo-update, r=str4d
Update Rust dependencies
2020-11-11 00:40:35 +00:00
Jack Grigg 120b184d8f cargo update 2020-11-10 21:39:55 +00:00
Homu 091f5d7816 Auto merge of #4851 - adityapk00:mining_fix, r=str4d
Don't compile ehHashState::* if mining is disabled

Compile currently fails if using `CONFIGURE_FLAGS=--disable-mining`, because the `ehHashState::*` functions inadvertently get included.
2020-11-10 20:50:38 +00:00
adityapk00 7732b9aff2 Don't compile ehHashState::* if mining is disabled 2020-11-10 11:31:47 -08:00
Homu 60331b9e83 Auto merge of #4574 - oxarbitrage:issue4475, r=daira
Add blockhash parameter to getrawtransaction

Code ported manually from https://github.com/bitcoin/bitcoin/pull/10275 in attempt to fix https://github.com/zcash/zcash/issues/4475
2020-11-10 15:52:11 +00:00
Daira Hopwood 5701095c22
Wording improvements to getrawtransaction RPC documentation 2020-11-10 14:41:07 +00:00
Homu caed4adf50 Auto merge of #4849 - str4d:lint-fixes, r=str4d
Lint fixes

Fixes most lints currently reported by `test/lint/lint-all.sh`.

Includes changes cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#8700
- bitcoin/bitcoin#8840
- bitcoin/bitcoin#9867
  - We backported the second commit in zcash/zcash#3146
- bitcoin/bitcoin#10771
- bitcoin/bitcoin#11394
- bitcoin/bitcoin#11649
- bitcoin/bitcoin#17329
- bitcoin/bitcoin#19258
2020-11-10 01:42:15 +00:00
str4d e531d72337
doc: Adjust subtree developer notes to refer to Zcash
We don't maintain any of the current subtrees, but we might in future.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-10 01:40:51 +00:00
Jack Grigg 399ab8afa6 lint: Fix minor shellcheck lints 2020-11-09 23:20:39 +00:00
Jack Grigg 6b63fdd657 lint: s/trim/lenTrim in src/crypto/equihash.[cpp,h]
Fixes a false positive match to the locale-dependent trim function.
2020-11-09 23:06:21 +00:00
Jack Grigg 25dafc3872 lint: Apply include guard style to src/rust/include 2020-11-09 23:06:21 +00:00
Jack Grigg e6b1d44170 lint: Re-exclude subtrees from lint-include-guards.sh
These are external libraries, and it does not make sense to maintain an
otherwise-meaningless diff from upstream.

This partially reverts commit 1e6d1837a0.
2020-11-09 23:06:21 +00:00
Jack Grigg dbfb3565d6 lint: Opt out of locale dependence in Zcash shell scripts 2020-11-09 23:06:21 +00:00
Jack Grigg 7c4b19fa4d lint: Use consistent shebangs 2020-11-09 23:06:21 +00:00
Jack Grigg 337e528d33 python: Explicitly set encoding to utf8 when opening text files 2020-11-09 23:06:21 +00:00
Jack Grigg 1944eb1c86 lint: Fix duplicate includes 2020-11-09 23:06:21 +00:00
Jack Grigg d0a5343da9 lint: Fix missing or inconsistent include guards 2020-11-09 23:06:21 +00:00
Sjors Provoost c0c05ebb34 doc: improve subtree check instructions 2020-11-09 23:06:21 +00:00
John Newbery 9069364e56 [linter] Strip trailing / in path for git-subtree-check
git-subtree-check fails if the directory is given with a trailing slash,
eg:

```
> test/lint/git-subtree-check.sh src/univalue/
ERROR: src/univalue/ is not a subtree
```

Shell autocompletes will add the trailing slash when autofilling the
path name, which will therefore cause the script to fail.

Just ignore any trailing slash.
2020-11-09 23:06:21 +00:00
MarcoFalke cff7e776bf Revert "Remove unused variable in shell script"
This partially reverts commit ab8e8b97a359e1c4f1bca8e1769021c95019f2c4
2020-11-09 23:06:21 +00:00
Pieter Wuille eb074fdb24 Improve git-subtree-check.sh
We have several pieces of information about subtrees:
1) What their current directory contents is
2) What their directory contents was at the time of the last subtree merge
3) What the directory contents of the upstream project is in the commit referred to by the subtree merge.

Normally, all 3 should be identical. git-subtree-check.sh so far only compared (1) with (3) however.

Fix this by comparing all three, and give some more useful diff output in the case of mismatch.

The added benefit is that (1) and (2) can be compared without needing to see the upstream repository.
2020-11-09 23:06:21 +00:00
practicalswift 52d9854034 Remove unused variables in shell scripts.
Zcash: Only the script we have.
2020-11-09 23:06:21 +00:00
Wladimir J. van der Laan 92633fdc3d uint256: replace sprintf with HexStr and reverse-iterator
Instead of calling sprintf for every byte, format the hex bytes
ourselves by help of HexStr and a reverse_iterator.
2020-11-09 23:06:21 +00:00
Wladimir J. van der Laan 5295079b2e test: Explicitly set encoding to utf8 when opening text files
These are text files but their encoding does not depend on the locale.
Not all of them require utf8 but it is better to fix it at something
to remove potential unpredictability.

This is necessary on FreeBSD where no locale is set by default,
and apparently Python defaults not only the terminal encoding to the locale
but that of every text file. So without LOCALE environment it defaults text
file encoding to ASCII. This causes problems with e.g. `bitcoin.conf`.

Luckily the locale doesn't affect the default encoding for str.encode() and
bytes.decode() on Python 3, so this is the only change necessary.
2020-11-09 22:59:04 +00:00
isle2983 ccf31edf62 [copyright] add MIT license headers to .sh scripts where missing
Years are set according to 'git log' history

Zcash: Only the scripts we have that are missing the header.
2020-11-09 22:59:04 +00:00
Homu 84a5830aaa Auto merge of #4829 - str4d:backport-lints, r=str4d
Backport useful lints from upstream

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#6892
- bitcoin/bitcoin#11151
- bitcoin/bitcoin#11300
- bitcoin/bitcoin@96d91b79bd
- bitcoin/bitcoin#12097
- bitcoin/bitcoin#12098
- bitcoin/bitcoin#12442
- bitcoin/bitcoin#12572
- bitcoin/bitcoin#12757
- bitcoin/bitcoin#11878
- bitcoin/bitcoin#12933
- bitcoin/bitcoin#12871
- bitcoin/bitcoin#12972
- bitcoin/bitcoin#13281
- bitcoin/bitcoin#13385
- bitcoin/bitcoin#13041
- bitcoin/bitcoin#13454
- bitcoin/bitcoin#13448
- bitcoin/bitcoin#13510
- bitcoin/bitcoin#13851
- bitcoin/bitcoin#13863
- bitcoin/bitcoin#14115
- bitcoin/bitcoin#14831
- bitcoin/bitcoin#15164
- bitcoin/bitcoin#15170
- bitcoin/bitcoin#15166
- bitcoin/bitcoin#16036
- bitcoin/bitcoin#16768
- bitcoin/bitcoin#13494

Several of the lints fail for our current codebase; these will be addressed in a
subsequent PR.
2020-11-09 21:20:55 +00:00
str4d 1e6d1837a0
lint: Remove some subtrees from exclusion
Either they don't violate the lints, or can be easily fixed.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-09 20:06:45 +00:00
str4d 5b543b15eb
lint: Allow stoi in src/rpc/blockchain.cpp
This instance is ok because it's guarded by a strict regex.

Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-09 20:03:22 +00:00
Homu bd5ff7c889 Auto merge of #4835 - str4d:bctest-backports, r=str4d
bitcoin-util-test.py backports

Cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#8829
- bitcoin/bitcoin#8830
- bitcoin/bitcoin#8836
- bitcoin/bitcoin#8881
- bitcoin/bitcoin#9032
- bitcoin/bitcoin#9023
- bitcoin/bitcoin#9069
- bitcoin/bitcoin#9945
2020-11-09 19:57:48 +00:00
Jack Grigg 95ad6fc6bf test: Fix pyflakes warning in bitcoin-util-test.py 2020-11-09 19:56:16 +00:00
str4d 9dbf535441
lints: Add a missing copyright header
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-09 17:17:08 +00:00
str4d 4b69b94bba
Small documentation fixes
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2020-11-09 17:15:46 +00:00
Homu 80a658fbdf Auto merge of #4844 - ebfull:release-v4.1.0, r=daira
Release v4.1.0
2020-11-03 09:59:03 +00:00
Daira Hopwood 08fd678be2
Update approximate release height
Co-authored-by: ying tong <yingtong@z.cash>
2020-11-03 09:56:22 +00:00
Daira Hopwood 90493623a0
Fix a comment about postponement of Clang upgrade 2020-11-03 09:55:02 +00:00
Daira Hopwood 4f331d0f7f
Update doc/release-notes/release-notes-4.1.0.md
Co-authored-by: ying tong <yingtong@z.cash>
2020-11-03 09:52:59 +00:00
Daira Hopwood f8c9a1f2d6
Update doc/release-notes/release-notes-4.1.0.md
Co-authored-by: ying tong <yingtong@z.cash>
2020-11-03 09:51:08 +00:00
Sean Bowe fe681d2cc6
make-release.py: Updated release notes and changelog for 4.1.0. 2020-11-02 13:40:54 -07:00
Sean Bowe 453dacccf8
make-release.py: Updated manpages for 4.1.0. 2020-11-02 13:40:54 -07:00
Sean Bowe 75a8a6c25f
make-release.py: Versioning changes for 4.1.0. 2020-11-02 13:38:03 -07:00
Sean Bowe 34c2a4b380
Postpone clang and libc++ dependency updates until after the 4.1.0 release. 2020-11-02 13:36:34 -07:00
Homu 2a78e35171 Auto merge of #4837 - daira:fix-gitian, r=daira
Fixes for Gitian builds

Remove manual CFLAGS and CXXFLAGS from descriptor.
2020-10-29 12:24:27 +00:00
Daira Hopwood 6cbaa65b55 Gitian builds: Remove manual CFLAGS and CXXFLAGS from descriptor.
Before Zcash launched, we were heavily relying on `zcutil/build.sh` to
apply our Zcash-specific hardening flags. The Gitian deterministic build
system obviously didn't use our script, so the corresponding flags were
manually added to `gitian-linux.yml`.

Since then, we have migrated all of our flags into `configure.ac`.
Manually setting them in the Gitian descriptor is no longer necessary,
and should have been removed at the same time. This didn't cause any
noticeable issues, however, leaving it undetected until we migrated to
Clang in zcash/zcash#4613, and performed a Gitian build for 4.1.0-rc1.

The Gitian failure was caused by linker flags specific to C++ being used
in configuration tests for secp256k1 (a C library). This causes ldd to
emit warnings, which are then converted to errors by the -Werror flags
that were added to CFLAGS and CXXFLAGS by `gitian-linux.yml`. CI did not
encounter this because it uses the standard `--enable-werror` config flag,
which adds `-Werror` to CXXFLAGS but not CFLAGS.

Co-authored-by: Jack Grigg <jack@z.cash>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-10-29 11:15:59 +00:00
John Newbery e289f812d2 Improve logging in bctest.py if there is a formatting mismatch 2020-10-28 16:20:53 +00:00
John Newbery abd7840c22 Clean up bctest.py and bitcoin-util-test.py
- remove newlines
- change tabs for spaces, to align with convention in other py files
- add comments
- add 'Bitcoin Core Developers' copyright notice
2020-10-28 16:20:53 +00:00
jnewbery 5508f14437 Add logging to bitcoin-util-test.py
- Use the python standard logging library
- Run all tests and report all failing test-cases (rather than stop after one test case fails)
- If output is different from expected output, log a contextual diff.
2020-10-28 16:20:53 +00:00
Wladimir J. van der Laan 3e2460b6f8 test: Add format-dependent comparison to bctest
This splits the output comparison for `bitcoin-tx` into two steps:

- First, check for data mismatch, parsing the data as json or hex
  depending on the extension of the output file

- Then, check if the literal string matches

For either of these cases give a different error.

This prevents wild goose chases when e.g. a trailing space doesn't match
exactly, and makes sure that both test output and examples are valid
data of the purported format.
2020-10-28 16:20:53 +00:00