Bump dependencies and release v0.1.8 (#41)

* Bump dependencies

* Bump `bindgen`

* Remove zcashd subtree

* Squashed 'depend/zcash/' content from commit 35186b009

git-subtree-dir: depend/zcash
git-subtree-split: 35186b00928f3ba994f0e66bb234c412cbffc7b6

* Update to zcashd v5.3.0

* Make dependency versions match zcashd v5.3.0

* Update README for Orchard, and make dependency bumps clearer

* Add release 0.1.8 to the CHANGELOG

Co-authored-by: teor <teor@riseup.net>
This commit is contained in:
Marek 2022-10-30 23:53:25 +01:00 committed by GitHub
parent 5266ac19b7
commit b4a8aa2b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
397 changed files with 22674 additions and 11760 deletions

View File

@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] - ReleaseDate
## [0.1.8] - 2022-10-31
### Changed
- Updated `depend/zcash` to version 5.3.0 which includes updated dependencies
- Updated `bindgen` to version 0.60.1
## [0.1.7] - 2022-08-31
### Changed

View File

@ -48,25 +48,34 @@ path = "src/lib.rs"
external-secp = []
[dependencies]
# Must match depend/zcash/Cargo.toml
# All these dependencies must match the versions in:
# https://github.com/zcash/zcash/blob/<git subtree version>/Cargo.toml
blake2b_simd = "1"
cxx = { version = "=1.0.72", features = ["c++17"] }
cxx = { version = "=1.0.79", features = ["c++17"] }
libc = "0.2"
memuse = "0.2"
orchard = "0.2"
orchard = "0.3"
rand_core = "0.6"
tracing = "0.1"
zcash_encoding = "0.1"
zcash_note_encryption = "0.1"
zcash_primitives = { version = "0.7", features = ["transparent-inputs"] }
zcash_encoding = "0.2"
zcash_note_encryption = "0.2"
zcash_primitives = { version = "0.8.1", features = ["transparent-inputs"] }
[build-dependencies]
# The `bindgen` dependency should match the version used by zebra-state's `rocksdb` dependency in:
# https://github.com/ZcashFoundation/zebra/blob/main/zebra-state/Cargo.toml
bindgen = "0.60.1"
# These dependencies are shared with a lot of other Zebra dependencies,
# so they should be left at the minimum required versions.
# (They will automatically get upgraded as other libraries or Zebra upgrades.)
cc = { version = ">= 1.0.36", features = ["parallel"] }
cxx-gen = "0.7.73"
bindgen = "0.59"
syn = { version = "1.0.99", features = ["full", "printing"] }
[dev-dependencies]
# These dependencies are shared with a lot of other Zebra dependencies.
# (See above.)
rustc-serialize = "0.3"
hex = "0.4.2"
lazy_static = "1.4.0"

View File

@ -20,15 +20,11 @@ using `bindgen` to generate Rust bindings, and compiling everything together
into a single library. Due to the way the `zcash_script` is written we unfortunately need
to include a lot of other stuff e.g. the orchard library.
Note that `zcash_script` (the C++ library/folder inside `zcash`) uses some Rust
FFI functions from `zcash`; and it also links to `librustzcash` which is written in Rust.
Therefore, when updating `zcash_script` (this crate), we need to make sure that shared dependencies
between all of those are the same versions (and are patched to the same revisions, if applicable).
To do that, check for versions in:
### Updating this crate
- `zcash/Cargo.toml` in the revision pointed to by this crate (also check for patches)
- `librustzcash/Cargo.toml` in the revision pointed to by `zcash` (also check for patches)
- `librustzcash/<crate>/Cargo.toml` in the revision pointed to by `zcash`
1. Update `depend/zcash` with the latest tagged version of `zcashd`
2. Update `Cargo.toml` versions to match the versions used by the latest tagged version of `zcashd`, and its dependencies
3. Publish a new release
### Updating `depend/zcash`
@ -55,6 +51,22 @@ git rm depend/zcash/Cargo.toml
where `<ref>` is a reference to a branch, tag or commit (it should be a tag when preparing
a release, but it will be likely a branch or commit when testing).
### Updating `Cargo.toml`
Note that `zcash_script` (the C++ library/folder inside `zcash`) uses some Rust
FFI functions from `zcash`; and it also links to `librustzcash` which is written in Rust.
Therefore, when updating `zcash_script` (this crate), we need to make sure that shared dependencies
between all of those are the same versions (and are patched to the same revisions, if applicable).
To do that, check for versions in:
- `zcash/Cargo.toml` in the revision pointed to by this crate (also check for patches)
- `librustzcash/Cargo.toml` in the revision pointed to by `zcash` (also check for patches)
- `librustzcash/<crate>/Cargo.toml` in the revision pointed to by `zcash`
- `orchard/Cargo.toml` in the revision pointed to by `zcash` (also check for patches)
To double-check, you can use `cargo tree` or `cargo deny check bans` on Zebra,
once the `zcash_script`, `librustzcash`, and `orchard` versions have all been updated.
### Publishing New Releases
Releases for `zcash-script` are made with the help of [cargo release](https://github.com/sunng87/cargo-release).

View File

@ -0,0 +1,14 @@
# This configures basic cross-editor formatting.
#
# See https://editorconfig.org/ for more info, and to see if your editor
# requires a plugin to take advantage of it.
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

View File

@ -21,15 +21,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: install
args: --git https://github.com/mozilla/cargo-vet.git cargo-vet
# This is necessary because `cargo vet --locked` implies `cargo metadata --frozen`,
# preventing all network access.
- name: Ensure dependency sources are present
uses: actions-rs/cargo@v1
with:
command: fetch
args: --locked
args: cargo-vet
- name: Run cargo vet --locked
uses: actions-rs/cargo@v1

View File

@ -5,8 +5,12 @@ on:
branches:
- master
permissions: {}
jobs:
deploy:
permissions:
contents: write # to push pages branch (peaceiris/actions-gh-pages)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

View File

@ -20,6 +20,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo python3 -m pip install yq
- name: Cargo patches
run: ./test/lint/lint-cargo-patches.sh
@ -51,7 +53,6 @@ jobs:
- name: Shellcheck
run: ./test/lint/lint-shell.sh
if: always()
continue-on-error: true # Temporary until we get this passing
- name: Whitespace
run: ./test/lint/lint-whitespace.sh
@ -74,19 +75,19 @@ jobs:
if: always()
rust-clippy:
name: Clippy (1.59.0)
name: Clippy (1.64.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.59.0
toolchain: 1.64.0
components: clippy
override: true
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
name: Clippy (1.59.0)
name: Clippy (1.64.0)
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets -- -D warnings
@ -97,7 +98,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.59.0
toolchain: 1.64.0
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1

132
depend/zcash/.gitignore vendored Normal file
View File

@ -0,0 +1,132 @@
*.tar.gz
*.deb
*.exe
src/bitcoin
src/zcashd
src/zcashd-wallet-tool
src/zcash-cli
src/zcash-gtest
src/zcash-inspect
src/zcash-tx
src/test/test_bitcoin
zcutil/bin/
*zcashTest.pk
*zcashTest.vk
# autoreconf
Makefile.in
aclocal.m4
autom4te.cache/
build-aux/config.guess
build-aux/config.sub
build-aux/depcomp
build-aux/install-sh
build-aux/ltmain.sh
build-aux/m4/libtool.m4
build-aux/m4/lt~obsolete.m4
build-aux/m4/ltoptions.m4
build-aux/m4/ltsugar.m4
build-aux/m4/ltversion.m4
build-aux/missing
build-aux/compile
build-aux/test-driver
config.log
config.status
configure
configure~
libtool
src/config/bitcoin-config.h
src/config/bitcoin-config.h.in
src/config/stamp-h1
share/setup.nsi
confdefs.h
conftest.cpp
conftest.err
cache/
venv-mnf/
src/univalue/gen
.deps
.dirstamp
.libs
.*.swp
*.*~*
*.bak
*.rej
*.orig
*.pyc
*.o
*.o.tmp
*.o-*
.zcash
*.a
*.lib
*.pb.cc
*.pb.h
.vscode
*.log
*.trs
*.dmg
*.json.h
*.raw.h
#libtool object files
*.lo
*.la
# Compilation
Makefile
# Rust
.cargo/.configured-for-*
.cargo/config
src/rust/gen/
target/
# Unit-tests
Makefile.test
src/test/buildenv.py
# Resources cpp
qrc_*.cpp
# Mac specific
.DS_Store
build
#lcov
*.gcno
*.gcda
/*.info
test_bitcoin.coverage/
zcash-gtest.coverage/
total.coverage/
coverage_percent.txt
afl-temp
#build tests
linux-coverage-build
linux-build
win32-build
qa/pull-tester/tests_config.py
qa/pull-tester/tests_config.ini
qa/cache/*
!src/leveldb*/Makefile
/doc/doxygen/
libzcash_script.pc
contrib/debian/files
contrib/debian/substvars
src/fuzzing/*/input
src/fuzzing/*/output
src/fuzz.cpp
.updatecheck-token

671
depend/zcash/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,7 @@ SUBDIRS = src
if ENABLE_MAN
SUBDIRS += doc/man
endif
.PHONY: deploy FORCE
.PHONY: deploy FORCE rpc-tests
GZIP_ENV="-9n"
@ -155,7 +155,7 @@ endif
dist_bin_SCRIPTS = zcutil/fetch-params.sh
dist_noinst_SCRIPTS = autogen.sh zcutil/build-debian-package.sh zcutil/build.sh
RUST_DIST = $(top_srcdir)/.cargo $(top_srcdir)/Cargo.toml $(top_srcdir)/Cargo.lock rust-toolchain
RUST_DIST = $(top_srcdir)/.cargo $(top_srcdir)/Cargo.toml $(top_srcdir)/Cargo.lock $(top_srcdir)/rust-toolchain.toml
EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-tests qa/zcash $(DIST_DOCS) $(BIN_CHECKS) $(RUST_DIST)
@ -174,3 +174,6 @@ clean-local:
distclean-local:
rm -f zcutil/bin/db_*
rmdir zcutil/bin 2>/dev/null || true
rpc-tests: $(BITCOIND_BIN)
qa/pull-tester/rpc-tests.py $(RPC_TEST)

View File

@ -1,4 +1,4 @@
Zcash 5.2.0
Zcash 5.3.0
<img align="right" width="120" height="80" src="doc/imgs/logo.png">
===========
@ -6,20 +6,28 @@ What is Zcash?
--------------
[Zcash](https://z.cash/) is an implementation of the "Zerocash" protocol.
Based on Bitcoin's code, Zcash intends to offer a far higher standard of privacy
through a sophisticated zero-knowledge proving scheme that preserves
confidentiality of transaction metadata. More technical details are available
in our [Protocol Specification](https://zips.z.cash/protocol/protocol.pdf).
Initially based on Bitcoin's design, Zcash intends to offer a far
higher standard of privacy through a sophisticated zero-knowledge
proving scheme that preserves confidentiality of transaction
metadata. More technical details are available in our [Protocol
Specification](https://zips.z.cash/protocol/protocol.pdf).
This software is the Zcash client. It downloads and stores the entire history
of Zcash transactions; depending on the speed of your computer and network
connection, the synchronization process could take a day or more once the
blockchain has reached a significant size.
## The `zcashd` Full Node
This repository hosts the `zcashd` software, a Zcash consensus node
implementation. It downloads and stores the entire history of Zcash
transactions. Depending on the speed of your computer and network
connection, the synchronization process could take several days.
<p align="center">
<img src="doc/imgs/zcashd_screen.gif" height="500">
</p>
The `zcashd` code is derived from a source fork of
[Bitcoin Core](https://github.com/bitcoin/bitcoin). The code was forked
initially from Bitcoin Core v0.11.2, and the two codebases have diverged
substantially.
#### :lock: Security Warnings
See important security warnings on the
@ -34,9 +42,17 @@ is an automatic deprecation shutdown feature which will halt the node some
time after this 16-week period. The automatic feature is based on block
height.
## Other Zcash Implementations
The [Zebra](https://github.com/ZcashFoundation/zebra) project offers a
different Zcash consensus node implementation, written largely from the
ground up.
## Getting Started
Please see our [user guide](https://zcash.readthedocs.io/en/latest/rtd_pages/rtd_docs/user_guide.html) for joining the main Zcash network.
Please see our [user
guide](https://zcash.readthedocs.io/en/latest/rtd_pages/rtd_docs/user_guide.html)
for instructions on joining the main Zcash network.
### Need Help?

View File

@ -13,4 +13,6 @@ if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="$(command -v glibtoolize)"; then
LIBTOOLIZE="${GLIBTOOLIZE}"
export LIBTOOLIZE
fi
command -v autoreconf >/dev/null || \
(echo "configuration failed, please install autoconf first" && exit 1)
autoreconf --install --force --warnings=all

View File

@ -1,7 +1,7 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 5)
define(_CLIENT_VERSION_MINOR, 2)
define(_CLIENT_VERSION_MINOR, 3)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 50)
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
@ -330,7 +330,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wdeprecated-register],[CXXFLAGS="$CXXFLAGS -Wno-deprecated-register"],,[[$CXXFLAG_WERROR]])
fi
enable_hwcrc32=no
enable_sse42=no
enable_sse41=no
enable_avx2=no
enable_shani=no
@ -340,6 +340,8 @@ if test "x$use_asm" = "xyes"; then
# Check for optional instruction set support. Enabling these does _not_ imply that all code will
# be compiled with them, rather that specific objects/libs may use them after checking for runtime
# compatibility.
dnl x86
AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-msse4.1],[[SSE41_CXXFLAGS="-msse4.1"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-mavx -mavx2],[[AVX2_CXXFLAGS="-mavx -mavx2"]],,[[$CXXFLAG_WERROR]])
@ -347,7 +349,7 @@ AX_CHECK_COMPILE_FLAG([-msse4 -msha],[[SHANI_CXXFLAGS="-msse4 -msha"]],,[[$CXXFL
TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $SSE42_CXXFLAGS"
AC_MSG_CHECKING(for assembler crc32 support)
AC_MSG_CHECKING(for SSE4.2 intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdint.h>
#if defined(_MSC_VER)
@ -362,7 +364,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
l = _mm_crc32_u64(l, 0);
return l;
]])],
[ AC_MSG_RESULT(yes); enable_hwcrc32=yes],
[ AC_MSG_RESULT(yes); enable_sse42=yes],
[ AC_MSG_RESULT(no)]
)
CXXFLAGS="$TEMP_CXXFLAGS"
@ -414,6 +416,24 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
)
CXXFLAGS="$TEMP_CXXFLAGS"
# ARM
AX_CHECK_COMPILE_FLAG([-march=armv8-a+crc+crypto],[[ARM_CRC_CXXFLAGS="-march=armv8-a+crc+crypto"]],,[[$CXXFLAG_WERROR]])
TEMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS $ARM_CRC_CXXFLAGS"
AC_MSG_CHECKING(for ARM CRC32 intrinsics)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <arm_acle.h>
#include <arm_neon.h>
]],[[
__crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0);
vmull_p64(0, 0);
]])],
[ AC_MSG_RESULT(yes); enable_arm_crc=yes; ],
[ AC_MSG_RESULT(no)]
)
CXXFLAGS="$TEMP_CXXFLAGS"
fi
CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
@ -473,7 +493,6 @@ case $host in
ZC_REQUIRE_TOOL(WINDRES, windres)
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN"
LEVELDB_TARGET_FLAGS="-DOS_WINDOWS"
dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.
dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override
@ -488,7 +507,6 @@ case $host in
;;
*darwin*)
TARGET_OS=darwin
LEVELDB_TARGET_FLAGS="-DOS_MACOSX"
if test x$cross_compiling != xyes; then
BUILD_OS=darwin
AC_CHECK_PROG([PORT],port, port)
@ -542,35 +560,9 @@ case $host in
*android*)
dnl make sure android stays above linux for hosts like *linux-android*
TARGET_OS=android
LEVELDB_TARGET_FLAGS="-DOS_ANDROID"
;;
*linux*)
TARGET_OS=linux
LEVELDB_TARGET_FLAGS="-DOS_LINUX"
;;
*kfreebsd*)
LEVELDB_TARGET_FLAGS="-DOS_KFREEBSD"
;;
*freebsd*)
LEVELDB_TARGET_FLAGS="-DOS_FREEBSD"
;;
*openbsd*)
LEVELDB_TARGET_FLAGS="-DOS_OPENBSD"
;;
*netbsd*)
LEVELDB_TARGET_FLAGS="-DOS_NETBSD"
;;
*dragonfly*)
LEVELDB_TARGET_FLAGS="-DOS_DRAGONFLYBSD"
;;
*solaris*)
LEVELDB_TARGET_FLAGS="-DOS_SOLARIS"
;;
*hpux*)
LEVELDB_TARGET_FLAGS="-DOS_HPUX"
;;
*)
AC_MSG_ERROR(Cannot build leveldb for $host. Please file a bug report.)
;;
esac
@ -809,7 +801,73 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
)
LDFLAGS="$TEMP_LDFLAGS"
# Check for reduced exports
dnl LevelDB platform checks
AC_MSG_CHECKING(for fdatasync)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],
[[ fdatasync(0); ]])],
[ AC_MSG_RESULT(yes); HAVE_FDATASYNC=1 ],
[ AC_MSG_RESULT(no); HAVE_FDATASYNC=0 ]
)
AC_MSG_CHECKING(for F_FULLFSYNC)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],
[[ fcntl(0, F_FULLFSYNC, 0); ]])],
[ AC_MSG_RESULT(yes); HAVE_FULLFSYNC=1 ],
[ AC_MSG_RESULT(no); HAVE_FULLFSYNC=0 ]
)
AC_MSG_CHECKING(for O_CLOEXEC)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fcntl.h>]],
[[ open("", O_CLOEXEC); ]])],
[ AC_MSG_RESULT(yes); HAVE_O_CLOEXEC=1 ],
[ AC_MSG_RESULT(no); HAVE_O_CLOEXEC=0 ]
)
dnl crc32c platform checks
AC_MSG_CHECKING(for __builtin_prefetch)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[
char data = 0;
const char* address = &data;
__builtin_prefetch(address, 0, 0);
]])],
[ AC_MSG_RESULT(yes); HAVE_BUILTIN_PREFETCH=1 ],
[ AC_MSG_RESULT(no); HAVE_BUILTIN_PREFETCH=0 ]
)
AC_MSG_CHECKING(for _mm_prefetch)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <xmmintrin.h>]], [[
char data = 0;
const char* address = &data;
_mm_prefetch(address, _MM_HINT_NTA);
]])],
[ AC_MSG_RESULT(yes); HAVE_MM_PREFETCH=1 ],
[ AC_MSG_RESULT(no); HAVE_MM_PREFETCH=0 ]
)
AC_MSG_CHECKING(for strong getauxval support in the system headers)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <arm_acle.h>
#include <arm_neon.h>
#include <sys/auxv.h>
]], [[
getauxval(AT_HWCAP);
]])],
[ AC_MSG_RESULT(yes); HAVE_STRONG_GETAUXVAL=1 ],
[ AC_MSG_RESULT(no); HAVE_STRONG_GETAUXVAL=0 ]
)
AC_MSG_CHECKING(for weak getauxval support in the compiler)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
unsigned long getauxval(unsigned long type) __attribute__((weak));
#define AT_HWCAP 16
]], [[
getauxval(AT_HWCAP);
]])],
[ AC_MSG_RESULT(yes); HAVE_WEAK_GETAUXVAL=1 ],
[ AC_MSG_RESULT(no); HAVE_WEAK_GETAUXVAL=0 ]
)
dnl Check for reduced exports
if test x$use_reduce_exports = xyes; then
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
@ -1051,11 +1109,13 @@ AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
AM_CONDITIONAL([ENABLE_SSE42],[test x$enable_sse42 = xyes])
AM_CONDITIONAL([ENABLE_SSE41],[test x$enable_sse41 = xyes])
AM_CONDITIONAL([ENABLE_AVX2],[test x$enable_avx2 = xyes])
AM_CONDITIONAL([ENABLE_SHANI],[test x$enable_shani = xyes])
AM_CONDITIONAL([ENABLE_ARM_CRC],[test x$enable_arm_crc = xyes])
AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])
AM_CONDITIONAL([WORDS_BIGENDIAN],[test x$ac_cv_c_bigendian = xyes])
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
@ -1092,15 +1152,22 @@ AC_SUBST(SSE42_CXXFLAGS)
AC_SUBST(SSE41_CXXFLAGS)
AC_SUBST(AVX2_CXXFLAGS)
AC_SUBST(SHANI_CXXFLAGS)
AC_SUBST(ARM_CRC_CXXFLAGS)
AC_SUBST(LIBTOOL_APP_LDFLAGS)
AC_SUBST(BOOST_LIBS)
AC_SUBST(TESTDEFS)
AC_SUBST(LEVELDB_TARGET_FLAGS)
AC_SUBST(EVENT_LIBS)
AC_SUBST(EVENT_PTHREADS_LIBS)
AC_SUBST(ZMQ_LIBS)
AC_SUBST(HAVE_GMTIME_R)
AC_SUBST(LIBZCASH_LIBS)
AC_SUBST(HAVE_FDATASYNC)
AC_SUBST(HAVE_FULLFSYNC)
AC_SUBST(HAVE_O_CLOEXEC)
AC_SUBST(HAVE_BUILTIN_PREFETCH)
AC_SUBST(HAVE_MM_PREFETCH)
AC_SUBST(HAVE_STRONG_GETAUXVAL)
AC_SUBST(HAVE_WEAK_GETAUXVAL)
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile src/test/buildenv.py])
AC_CONFIG_FILES([qa/pull-tester/tests_config.ini],[chmod +x qa/pull-tester/tests_config.ini])
AC_CONFIG_LINKS([qa/pull-tester/rpc-tests.py:qa/pull-tester/rpc-tests.py])
@ -1128,7 +1195,7 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
unset PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --with-bignum=no --enable-module-recovery"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --disable-openssl-tests"
AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue])
AC_OUTPUT

View File

@ -1,3 +1,15 @@
zcash (5.3.0) stable; urgency=medium
* 5.3.0 release.
-- Electric Coin Company <team@electriccoin.co> Thu, 20 Oct 2022 10:52:37 -0600
zcash (5.3.0~rc1) stable; urgency=medium
* 5.3.0-rc1 release.
-- Electric Coin Company <team@electriccoin.co> Tue, 11 Oct 2022 11:30:02 +0000
zcash (5.2.0) stable; urgency=medium
* 5.2.0 release.

View File

@ -265,6 +265,11 @@ Copyright: 2011 The LevelDB Authors
License: BSD-3-clause-Google
Comment: The LevelDB Authors are listed in src/leveldb/AUTHORS.
Files: src/crc32c/*
Copyright: 2017 The CRC32C Authors
License: BSD-3-clause-Google
Comment: The CRC32C Authors are listed in src/crc32c/AUTHORS.
License: Apache-2.0
On Debian systems, the full text of the Apache License v2.0 can be found in the
file `/usr/share/common-licenses/Apache-2.0`.

View File

@ -14,8 +14,8 @@ ZCASHTX=${ZCASHTX:-$SRCDIR/zcash-tx}
# The autodetected version git tag can screw up manpage output a little bit
read -r -a ZECVERSTR <<< "$($ZCASHCLI --version | head -n1 | awk '{ print $NF }')"
read -r -a ZECVER <<< "$(echo $ZECVERSTR | awk -F- '{ OFS="-"; NF--; print $0; }')"
read -r -a ZECCOMMIT <<< "$(echo $ZECVERSTR | awk -F- '{ print $NF }')"
read -r -a ZECVER <<< "$(echo ${ZECVERSTR[0]} | awk -F- '{ OFS="-"; NF--; print $0; }')"
read -r -a ZECCOMMIT <<< "$(echo ${ZECVERSTR[0]} | awk -F- '{ print $NF }')"
# Create a footer file with copyright content.
# This gets autodetected fine for zcashd if --version-string is not set,
@ -26,14 +26,14 @@ grep -v "Bitcoin Core Developers" footer.h2m >footer-no-bitcoin-copyright.h2m
for cmd in $ZCASHD $ZCASHCLI $ZCASHTX; do
cmdname="${cmd##*/}"
help2man -N --version-string=$ZECVER --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
sed -i "s/\\\-$ZECCOMMIT//g" ${MANDIR}/${cmdname}.1
help2man -N --version-string=${ZECVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
sed -i "s/\\\-${ZECCOMMIT[0]}//g" ${MANDIR}/${cmdname}.1
done
for cmd in $ZCASHD_WALLET_TOOL; do
cmdname="${cmd##*/}"
help2man -N --version-string=$ZECVER --include=footer-no-bitcoin-copyright.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
sed -i "s/\\\-$ZECCOMMIT//g" ${MANDIR}/${cmdname}.1
help2man -N --version-string=${ZECVER[0]} --include=footer-no-bitcoin-copyright.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}
sed -i "s/\\\-${ZECCOMMIT[0]}//g" ${MANDIR}/${cmdname}.1
done
rm -f footer.h2m

View File

@ -0,0 +1,48 @@
#!/usr/bin/env bash
export LC_ALL=C
set -o pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CLANG_PACKAGE="$SCRIPT_DIR/../../depends/packages/native_clang.mk"
LIBCXX_PACKAGE="$SCRIPT_DIR/../../depends/packages/libcxx.mk"
CLANG_VERSION=$( grep -v _major_version $CLANG_PACKAGE | grep -oP "_version=\K.*" )
LIBCXX_MSYS2_VERSION=$( grep -oP "_msys2_version=\K.*" $LIBCXX_PACKAGE )
update_clang_hash() {
url="https://github.com/llvm/llvm-project/releases/download/llvmorg-$CLANG_VERSION/clang+llvm-$CLANG_VERSION-$1.tar.xz"
echo "Fetching $url"
hash=$( curl -fL $url | sha256sum | awk '{print $1}' )
retVal=$?
if [ $retVal -ne 0 ]; then
if [ $retVal -eq 22 ]; then
echo
echo "The LLVM project has not published a $CLANG_VERSION build for $1."
echo "You will need to manually fix the Makefile to use a different version."
echo
fi
else
sed -i "/\$(package)_sha256_hash_$2=/c\\\$(package)_sha256_hash_$2=$hash" $CLANG_PACKAGE
sed -i "/\$(package)_sha256_hash_$2=/c\\\$(package)_sha256_hash_$2=$hash" $LIBCXX_PACKAGE
fi
}
update_libcxx_msys2_hash() {
url="https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-$1-$LIBCXX_MSYS2_VERSION-any.pkg.tar.zst"
echo "Fetching $url"
hash=$( curl -fL $url | sha256sum | awk '{print $1}' )
sed -i "/\$(package)_$2=/c\\\$(package)_$2=$hash" $LIBCXX_PACKAGE
}
# For native targets
# update_clang_hash CLANG_COMPILED_TARGET MAKEFILE_PACKAGE_IDENTIFIER
update_clang_hash aarch64-linux-gnu aarch64_linux
update_clang_hash x86_64-apple-darwin darwin
update_clang_hash x86_64-linux-gnu-ubuntu-18.04 linux
update_clang_hash amd64-unknown-freebsd12 freebsd
# For Windows cross-compilation
# update_libcxx_msys2_hash LIBCXX_LIBRARY MAKEFILE_HASH_SUFFIX
update_libcxx_msys2_hash libc++ sha256_hash
update_libcxx_msys2_hash libc++abi libcxxabi_sha256_hash

View File

@ -5,7 +5,7 @@ export LC_ALL=C
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
RUST_PACKAGE="$SCRIPT_DIR/../../depends/packages/native_rust.mk"
RUST_VERSION=$( cat $RUST_PACKAGE | grep -oP "_version=\K.*" )
RUST_VERSION=$( grep -oP "_version=\K.*" $RUST_PACKAGE )
update_hash() {
url="https://static.rust-lang.org/dist/$1-$RUST_VERSION-$2.tar.gz"

View File

@ -11,7 +11,7 @@ fi
env | sort | grep ZCASHD || true
export ZCASHD_CMD='zcashd -printtoconsole'
if [[ ! -n ${ZCASHD_NETWORK} ]];then
if [[ -z ${ZCASHD_NETWORK} ]];then
export ZCASHD_NETWORK=mainnet
fi

View File

@ -0,0 +1,143 @@
---
name: "zcash-5.3.0-rc1"
enable_cache: true
distro: "debian"
suites:
- "buster"
- "bullseye"
architectures:
- "amd64"
packages:
- "curl"
- "autoconf"
- "automake"
- "bsdmainutils"
- "binutils-gold"
- "ca-certificates"
- "faketime"
- "g++-multilib"
- "git-core"
- "libc6-dev"
- "libtinfo5"
- "libtool"
- "libxml2"
- "m4"
- "ncurses-dev"
- "pkg-config"
- "python"
- "unzip"
- "wget"
- "zlib1g-dev"
remotes:
- "url": "https://github.com/zcash/zcash.git"
"dir": "zcash"
files: []
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="x86_64-linux-gnu"
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --enable-hardening --enable-werror"
MAKEOPTS="V=1 -j$(nproc)"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="date ar ranlib nm strip objcopy"
HOST_CFLAGS=""
HOST_CXXFLAGS=""
HOST_LDFLAGS=-static-libstdc++
export QT_RCC_TEST=0
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR="$PWD"
mkdir -p ${WRAP_DIR}
if test -n "$GBUILD_CACHE_ENABLED"; then
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
fi
function create_global_faketime_wrappers {
for prog in ${FAKETIME_PROGS}; do
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
chmod +x ${WRAP_DIR}/${prog}
done
}
function create_per-host_faketime_wrappers {
for i in $HOSTS; do
for prog in ${FAKETIME_HOST_PROGS}; do
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
chmod +x ${WRAP_DIR}/${i}-${prog}
done
done
}
export PATH=${WRAP_DIR}:${PATH}
# Faketime for depends so intermediate results are comparable
create_global_faketime_wrappers "2000-01-01 12:00:00"
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
cd zcash
BASEPREFIX="${PWD}/depends"
# Build dependencies for each host
for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
done
# Faketime for binaries
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
# Create the release tarball using (arbitrarily) the first host
export GIT_DIR="$PWD/.git"
./autogen.sh
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
make dist
SOURCEDIST=$(echo zcash-*.tar.gz)
DISTNAME=${SOURCEDIST/%.tar.gz}
# Correct tar file order
mkdir -p temp
pushd temp
tar xf ../$SOURCEDIST
find zcash* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
popd
ORIGPATH="$PATH"
# Extract the release tarball into a dir for each host and build
for i in ${HOSTS}; do
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir -p distsrc-${i}
cd distsrc-${i}
INSTALLPATH="${PWD}/installed/${DISTNAME}"
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}"
make ${MAKEOPTS}
make ${MAKEOPTS} -C src check-security
make install DESTDIR=${INSTALLPATH}
cd installed
find . -name "lib*.la" -delete
find . -name "lib*.a" -delete
rm -rf ${DISTNAME}/lib/pkgconfig
find ${DISTNAME}/bin -type f -executable -exec objcopy --only-keep-debug {} {}.dbg \; -exec strip -s {} \; -exec objcopy --add-gnu-debuglink={}.dbg {} \;
# Commented out while we don't build any libraries
#find ${DISTNAME}/lib -type f -exec objcopy --only-keep-debug {} {}.dbg \; -exec strip -s {} \; -exec objcopy --add-gnu-debuglink={}.dbg {} \;
find ${DISTNAME} -not -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
find ${DISTNAME} -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz
cd ../../
rm -rf distsrc-${i}
done
mkdir -p $OUTDIR/src
mv $SOURCEDIST $OUTDIR/src
mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.tar.gz ${OUTDIR}/${DISTNAME}-linux64-debug.tar.gz
mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-linux64.tar.gz

View File

@ -1,5 +1,5 @@
---
name: "zcash-5.2.0"
name: "zcash-5.3.0"
enable_cache: true
distro: "debian"
suites:
@ -47,7 +47,7 @@ script: |
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
export BUILD_DIR="$PWD"
mkdir -p ${WRAP_DIR}
if test -n "$GBUILD_CACHE_ENABLED"; then
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@ -86,7 +86,7 @@ script: |
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
cd zcash
BASEPREFIX=`pwd`/depends
BASEPREFIX="${PWD}/depends"
# Build dependencies for each host
for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
@ -97,11 +97,13 @@ script: |
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
# Create the release tarball using (arbitrarily) the first host
export GIT_DIR="$PWD/.git"
./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
make dist
SOURCEDIST=`echo zcash-*.tar.gz`
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
SOURCEDIST=$(echo zcash-*.tar.gz)
DISTNAME=${SOURCEDIST/%.tar.gz}
# Correct tar file order
mkdir -p temp
pushd temp
@ -115,7 +117,7 @@ script: |
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir -p distsrc-${i}
cd distsrc-${i}
INSTALLPATH=`pwd`/installed/${DISTNAME}
INSTALLPATH="${PWD}/installed/${DISTNAME}"
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST

View File

@ -15,7 +15,7 @@ files:
script: |
WRAP_DIR=$HOME/wrapped
mkdir -p ${WRAP_DIR}
export PATH=`pwd`:$PATH
export PATH="$PWD":$PATH
FAKETIME_PROGS="dmg genisoimage"
# Create global faketime wrappers

View File

@ -36,7 +36,7 @@ script: |
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
export BUILD_DIR="$PWD"
mkdir -p ${WRAP_DIR}
if test -n "$GBUILD_CACHE_ENABLED"; then
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@ -77,7 +77,7 @@ script: |
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
cd bitcoin
BASEPREFIX=`pwd`/depends
BASEPREFIX="${PWD}/depends"
mkdir -p ${BASEPREFIX}/SDKs
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz
@ -92,11 +92,12 @@ script: |
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
# Create the release tarball using (arbitrarily) the first host
export GIT_DIR="$PWD/.git"
./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
make dist
SOURCEDIST=`echo bitcoin-*.tar.gz`
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
SOURCEDIST=$(echo bitcoin-*.tar.gz)
DISTNAME=${SOURCEDIST/%.tar.gz}
# Correct tar file order
mkdir -p temp
@ -111,7 +112,7 @@ script: |
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir -p distsrc-${i}
cd distsrc-${i}
INSTALLPATH=`pwd`/installed/${DISTNAME}
INSTALLPATH="${PWD}/installed/${DISTNAME}"
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST

View File

@ -15,7 +15,7 @@ files:
- "osslsigncode-Backports-to-1.7.1.patch"
- "bitcoin-win-unsigned.tar.gz"
script: |
BUILD_DIR=`pwd`
BUILD_DIR="$PWD"
SIGDIR=${BUILD_DIR}/signature/win
UNSIGNED_DIR=${BUILD_DIR}/unsigned
@ -32,7 +32,7 @@ script: |
./configure --without-gsf --without-curl --disable-dependency-tracking
make
find ${UNSIGNED_DIR} -name "*-unsigned.exe" | while read i; do
INFILE="`basename "${i}"`"
OUTFILE="`echo "${INFILE}" | sed s/-unsigned//`"
INFILE="$(basename "${i}")"
OUTFILE="${INFILE/%-unsigned}"
./osslsigncode attach-signature -in "${i}" -out "${OUTDIR}/${OUTFILE}" -sigin "${SIGDIR}/${INFILE}.pem"
done

View File

@ -37,7 +37,7 @@ script: |
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
export BUILD_DIR="$PWD"
mkdir -p ${WRAP_DIR}
if test -n "$GBUILD_CACHE_ENABLED"; then
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
@ -101,7 +101,7 @@ script: |
create_per-host_linker_wrapper "2000-01-01 12:00:00"
cd bitcoin
BASEPREFIX=`pwd`/depends
BASEPREFIX="${PWD}/depends"
# Build dependencies for each host
for i in $HOSTS; do
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
@ -113,11 +113,12 @@ script: |
create_per-host_linker_wrapper "${REFERENCE_DATETIME}"
# Create the release tarball using (arbitrarily) the first host
export GIT_DIR="$PWD/.git"
./autogen.sh
CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
CONFIG_SITE=${BASEPREFIX}/$(echo "${HOSTS}" | awk '{print $1;}')/share/config.site ./configure --prefix=/
make dist
SOURCEDIST=`echo bitcoin-*.tar.gz`
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
SOURCEDIST=$(echo bitcoin-*.tar.gz)
DISTNAME=${SOURCEDIST/%.tar.gz}
# Correct tar file order
mkdir -p temp
@ -134,7 +135,7 @@ script: |
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir -p distsrc-${i}
cd distsrc-${i}
INSTALLPATH=`pwd`/installed/${DISTNAME}
INSTALLPATH="${PWD}/installed/${DISTNAME}"
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST

View File

@ -1,5 +1,5 @@
### Qos ###
### QoS (Quality of service) ###
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. It limits outbound TCP traffic with a source or destination port of 8233, but not if the destination IP is within a LAN (defined as 192.168.x.x).
This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. It limits outbound TCP traffic with a source or destination port of 8233, but not if the destination IP is within a LAN.
This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it.

View File

@ -11,8 +11,10 @@ IF="eth0"
LINKCEIL="1gbit"
#limit outbound Bitcoin protocol traffic to this rate
LIMIT="160kbit"
#defines the address space for which you wish to disable rate limiting
LOCALNET="192.168.0.0/16"
#defines the IPv4 address space for which you wish to disable rate limiting
LOCALNET_V4="192.168.0.0/16"
#defines the IPv6 address space for which you wish to disable rate limiting
LOCALNET_V6="fe80::/10"
#delete existing rules
tc qdisc del dev ${IF} root
@ -31,6 +33,12 @@ tc class add dev ${IF} parent 1:1 classid 1:11 htb rate ${LIMIT} ceil ${LIMIT} p
tc filter add dev ${IF} parent 1: protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11
if [ -n "${LOCALNET_V6}" ] ; then
# v6 cannot have the same priority value as v4
tc filter add dev ${IF} parent 1: protocol ipv6 prio 3 handle 1 fw classid 1:10
tc filter add dev ${IF} parent 1: protocol ipv6 prio 4 handle 2 fw classid 1:11
fi
#delete any existing rules
#disable for now
#ret=0
@ -40,9 +48,15 @@ tc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11
#done
#limit outgoing traffic to and from port 8233. but not when dealing with a host on the local network
# (defined by $LOCALNET)
# --set-mark marks packages matching these criteria with the number "2"
# these packages are filtered by the tc filter with "handle 2"
# (defined by $LOCALNET_V4 and $LOCALNET_V6)
# --set-mark marks packages matching these criteria with the number "2" (v4)
# --set-mark marks packages matching these criteria with the number "4" (v6)
# these packets are filtered by the tc filter with "handle 2"
# this filter sends the packages into the 1:11 class, and this class is limited to ${LIMIT}
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 8233 ! -d ${LOCALNET} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8233 ! -d ${LOCALNET} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 8233 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
iptables -t mangle -A OUTPUT -p tcp -m tcp --sport 8233 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2
if [ -n "${LOCALNET_V6}" ] ; then
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --dport 8233 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
ip6tables -t mangle -A OUTPUT -p tcp -m tcp --sport 8233 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4
fi

View File

@ -1,62 +0,0 @@
#!/bin/bash
# Copyright (c) 2013 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
if [ -d "$1" ]; then
cd "$1" || exit 1
else
echo "Usage: $0 <datadir>" >&2
echo "Removes obsolete Bitcoin database files" >&2
exit 1
fi
LEVEL=0
if [ -f wallet.dat -a -f addr.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=1; fi
if [ -f wallet.dat -a -f peers.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=2; fi
if [ -f wallet.dat -a -f peers.dat -a -f coins/CURRENT -a -f blktree/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=3; fi
if [ -f wallet.dat -a -f peers.dat -a -f chainstate/CURRENT -a -f blocks/index/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=4; fi
case $LEVEL in
0)
echo "Error: no Bitcoin datadir detected."
exit 1
;;
1)
echo "Detected old Bitcoin datadir (before 0.7)."
echo "Nothing to do."
exit 0
;;
2)
echo "Detected Bitcoin 0.7 datadir."
;;
3)
echo "Detected Bitcoin pre-0.8 datadir."
;;
4)
echo "Detected Bitcoin 0.8 datadir."
;;
esac
FILES=""
DIRS=""
if [ $LEVEL -ge 3 ]; then FILES=$(echo $FILES blk????.dat blkindex.dat); fi
if [ $LEVEL -ge 2 ]; then FILES=$(echo $FILES addr.dat); fi
if [ $LEVEL -ge 4 ]; then DIRS=$(echo $DIRS coins blktree); fi
for FILE in $FILES; do
if [ -f $FILE ]; then
echo "Deleting: $FILE"
rm -f $FILE
fi
done
for DIR in $DIRS; do
if [ -d $DIR ]; then
echo "Deleting: $DIR/"
rm -rf $DIR
fi
done
echo "Done."

View File

@ -37,7 +37,7 @@ define vendor_crate_deps
( mkdir -p $$($(1)_download_dir)/$(1) && echo Vendoring dependencies for $(1)... && \
tar -xf $(native_rust_cached) -C $$($(1)_download_dir) && \
tar --strip-components=1 -xf $$($(1)_source_dir)/$(2) -C $$($(1)_download_dir)/$(1) && \
patch -p1 -d $$($(1)_download_dir)/$(1) < $(PATCHES_PATH)/$(1)/$(3) && \
cp $$($(1)_download_dir)/$(1)/$(3) $$($(1)_download_dir)/$(1)/Cargo.lock && \
$$($(1)_download_dir)/native/bin/cargo vendor --locked --manifest-path $$($(1)_download_dir)/$(1)/$(4) $$($(1)_download_dir)/$(CRATE_REGISTRY) && \
cd $$($(1)_download_dir) && \
find $(CRATE_REGISTRY) | sort | tar --no-recursion -czf $$($(1)_download_dir)/$(5).temp -T - && \

View File

@ -1,8 +1,8 @@
package=boost
$(package)_version=1_79_0
$(package)_version=1_80_0
$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(subst _,.,$($(package)_version))/source/
$(package)_file_name=boost_$($(package)_version).tar.bz2
$(package)_sha256_hash=475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39
$(package)_sha256_hash=1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0
$(package)_dependencies=native_b2
ifneq ($(host_os),darwin)

View File

@ -1,5 +1,6 @@
package=libcxx
$(package)_version=$(native_clang_version)
$(package)_msys2_version=14.0.6-1
ifneq ($(canonical_host),$(build))
ifneq ($(host_os),mingw32)
@ -8,28 +9,31 @@ ifneq ($(host_os),mingw32)
$(package)_download_path=$(native_clang_download_path)
$(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
$(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
$(package)_sha256_hash_aarch64_linux=15ff2db12683e69e552b6668f7ca49edaa01ce32cb1cbc8f8ed2e887ab291069
$(package)_sha256_hash_aarch64_linux=1a81fda984f5e607584916fdf69cf41e5385b219b983544d2c1a14950d5a65cf
$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
$(package)_sha256_hash_linux=84a54c69781ad90615d1b0276a83ff87daaeded99fbc64457c350679df7b4ff0
$(package)_sha256_hash_linux=61582215dafafb7b576ea30cc136be92c877ba1f1c31ddbbd372d6d65622fef5
# Starting from LLVM 14.0.0, some Clang binary tarballs store libc++ in a
# target-specific subdirectory.
define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/lib && \
cp lib/libc++.a $($(package)_staging_prefix_dir)/lib && \
cp lib/libc++abi.a $($(package)_staging_prefix_dir)/lib
(test ! -f lib/*/libc++.a || cp lib/*/libc++.a $($(package)_staging_prefix_dir)/lib) && \
(test ! -f lib/*/libc++abi.a || cp lib/*/libc++abi.a $($(package)_staging_prefix_dir)/lib) && \
(test ! -f lib/libc++.a || cp lib/libc++.a $($(package)_staging_prefix_dir)/lib) && \
(test ! -f lib/libc++abi.a || cp lib/libc++abi.a $($(package)_staging_prefix_dir)/lib)
endef
else
# For Windows cross-compilation, use the MSYS2 binaries.
# Using 13.0.0-3 because 13.0.1-1 has missing `new` and `delete` symbols.
$(package)_download_path=https://repo.msys2.org/mingw/x86_64
$(package)_download_file=mingw-w64-x86_64-libc++-13.0.0-3-any.pkg.tar.zst
$(package)_file_name=mingw-w64-x86_64-libcxx-13.0.0-3-any.pkg.tar.zst
$(package)_sha256_hash=0f8819e88273579f7c9262456c6b8f4d73e1693095c2364d1192c61c5f6a1a4f
$(package)_download_file=mingw-w64-x86_64-libc++-$($(package)_msys2_version)-any.pkg.tar.zst
$(package)_file_name=mingw-w64-x86_64-libcxx-$($(package)_msys2_version)-any.pkg.tar.zst
$(package)_sha256_hash=05f888ec1d82cb989a22ced6b85834c5d9aac46613b15334e6a2806c3d0960a4
$(package)_libcxxabi_download_file=mingw-w64-x86_64-libc++abi-13.0.0-3-any.pkg.tar.zst
$(package)_libcxxabi_file_name=mingw-w64-x86_64-libcxxabi-13.0.0-3-any.pkg.tar.zst
$(package)_libcxxabi_sha256_hash=7224a7252a566938afe91ea8f130682abd29b10e13c9a3c2347af523ca0d7c42
$(package)_libcxxabi_download_file=mingw-w64-x86_64-libc++abi-$($(package)_msys2_version)-any.pkg.tar.zst
$(package)_libcxxabi_file_name=mingw-w64-x86_64-libcxxabi-$($(package)_msys2_version)-any.pkg.tar.zst
$(package)_libcxxabi_sha256_hash=0ca22d18cb155f6d230d7f6691c05b876316e0c381195428f063f66352689ca4
$(package)_extra_sources += $($(package)_libcxxabi_file_name)
@ -68,8 +72,10 @@ endef
define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/lib && \
cp $(build_prefix)/lib/libc++.a $($(package)_staging_prefix_dir)/lib && \
if [ -f "$(build_prefix)/lib/libc++abi.a" ]; then cp $(build_prefix)/lib/libc++abi.a $($(package)_staging_prefix_dir)/lib; fi
(test ! -f $(build_prefix)/lib/*/libc++.a || cp $(build_prefix)/lib/*/libc++.a $($(package)_staging_prefix_dir)/lib) && \
(test ! -f $(build_prefix)/lib/*/libc++abi.a || cp $(build_prefix)/lib/*/libc++abi.a $($(package)_staging_prefix_dir)/lib) && \
(test ! -f $(build_prefix)/lib/libc++.a || cp $(build_prefix)/lib/libc++.a $($(package)_staging_prefix_dir)/lib) && \
(test ! -f $(build_prefix)/lib/libc++abi.a || cp $(build_prefix)/lib/libc++abi.a $($(package)_staging_prefix_dir)/lib)
endef
endif

View File

@ -1,22 +1,28 @@
package=native_clang
$(package)_major_version=13
$(package)_version=13.0.1
# To update the Clang compiler:
# - Change the versions below, and the MSYS2 version in libcxx.mk
# - Run the script ./contrib/devtools/update-clang-hashes.sh
# - Manually fix the versions for packages that don't exist (the LLVM project
# doesn't uniformly cut binaries across releases).
# The Clang compiler should use the same LLVM version as the Rust compiler.
$(package)_major_version=14
$(package)_version=14.0.6
$(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
$(package)_download_path_linux=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
$(package)_download_path_linux=https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0
$(package)_download_file_linux=clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz
$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz
$(package)_sha256_hash_linux=84a54c69781ad90615d1b0276a83ff87daaeded99fbc64457c350679df7b4ff0
$(package)_sha256_hash_linux=61582215dafafb7b576ea30cc136be92c877ba1f1c31ddbbd372d6d65622fef5
$(package)_download_path_darwin=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
$(package)_download_file_darwin=clang+llvm-$($(package)_version)-x86_64-apple-darwin.tar.xz
$(package)_file_name_darwin=clang-llvm-$($(package)_version)-x86_64-apple-darwin.tar.xz
$(package)_sha256_hash_darwin=dec02d17698514d0fc7ace8869c38937851c542b02adf102c4e898f027145a4d
$(package)_sha256_hash_darwin=e6cc6b8279661fd4452c2847cb8e55ce1e54e1faf4ab497b37c85ffdb6685e7c
$(package)_download_path_freebsd=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version)
$(package)_download_file_freebsd=clang+llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz
$(package)_file_name_freebsd=clang-llvm-$($(package)_version)-amd64-unknown-freebsd12.tar.xz
$(package)_sha256_hash_freebsd=8101c8d3a920bf930b33987ada5373f43537c5de8c194be0ea10530fd0ad5617
$(package)_sha256_hash_freebsd=b0a7b86dacb12afb8dd2ca99ea1b894d9cce84aab7711cb1964b3005dfb09af3
$(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
$(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz
$(package)_sha256_hash_aarch64_linux=15ff2db12683e69e552b6668f7ca49edaa01ce32cb1cbc8f8ed2e887ab291069
$(package)_sha256_hash_aarch64_linux=1a81fda984f5e607584916fdf69cf41e5385b219b983544d2c1a14950d5a65cf
ifneq (,$(wildcard /etc/arch-release))
$(package)_dependencies=native_libtinfo
@ -45,6 +51,8 @@ define $(package)_stage_cmds
cp -P bin/lld-link $($(package)_staging_prefix_dir)/bin && \
cp -P bin/llvm-ranlib $($(package)_staging_prefix_dir)/bin && \
cp -P bin/llvm-strip $($(package)_staging_prefix_dir)/bin && \
(test ! -f include/x86_64-unknown-linux-gnu/c++/v1/__config_site || \
cp include/x86_64-unknown-linux-gnu/c++/v1/__config_site include/c++/v1/__config_site) && \
mv include/ $($(package)_staging_prefix_dir) && \
mv lib/ $($(package)_staging_prefix_dir) && \
mv libexec/ $($(package)_staging_prefix_dir)

View File

@ -1,31 +1,17 @@
package=native_cxxbridge
# The version needs to match cxx in Cargo.toml
$(package)_version=1.0.72
$(package)_version=1.0.79
$(package)_download_path=https://github.com/dtolnay/cxx/archive/refs/tags
$(package)_file_name=native_cxxbridge-$($(package)_version).tar.gz
$(package)_download_file=$($(package)_version).tar.gz
$(package)_sha256_hash=22b2ec9b6cbec281f4b4d8dc8e403e7ab276b9d2140d4e7074a1388a252c4c0b
$(package)_sha256_hash=4da400783dee17e9a99dd39a17cd2cc346df311cb8745832e2b4d5173c23dfcd
$(package)_build_subdir=gen/cmd
$(package)_dependencies=native_rust
# This file is somewhat annoying to update, but can be done like so from the repo base:
# $ export VERSION=1.0.72
# $ rm .cargo/config .cargo/.configured-for-offline
# $ mkdir tmp
# $ cd tmp
# $ tar xf ../depends/sources/native_cxxbridge-$VERSION.tar.gz
# $ cd cxx-$VERSION
# $ cargo build --release --package=cxxbridge-cmd --bin=cxxbridge
# $ cargo clean
# $ cd ..
# $ mv cxx-$VERSION cxx-$VERSION-locked
# $ tar xf ../depends/sources/native_cxxbridge-$VERSION.tar.gz
# $ diff -urN cxx-$VERSION cxx-$VERSION-locked >../depends/patches/native_cxxbridge/lockfile.diff
$(package)_patches=lockfile.diff
$(package)_extra_sources=$(package)-$($(package)_version)-vendored.tar.gz
define $(package)_fetch_cmds
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
$(call vendor_crate_deps,$(package),$($(package)_file_name),lockfile.diff,Cargo.toml,$(package)-$($(package)_version)-vendored.tar.gz)
$(call vendor_crate_deps,$(package),$($(package)_file_name),third-party/Cargo.lock,Cargo.toml,$(package)-$($(package)_version)-vendored.tar.gz)
endef
define $(package)_extract_cmds
@ -37,7 +23,7 @@ define $(package)_extract_cmds
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/lockfile.diff && \
cp third-party/Cargo.lock . && \
mkdir -p .cargo && \
echo "[source.crates-io]" >.cargo/config && \
echo "replace-with = \"vendored-sources\"" >>.cargo/config && \

View File

@ -1,14 +1,18 @@
package=native_rust
$(package)_version=1.59.0
# To update the Rust compiler, change the version below and then run the script
# ./contrib/devtools/update-rust-hashes.sh
# The Rust compiler should use the same LLVM version as the Clang compiler; you
# can check this with `rustc --version -v`.
$(package)_version=1.64.0
$(package)_download_path=https://static.rust-lang.org/dist
$(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz
$(package)_sha256_hash_linux=0c1c2da3fa26372e5178123aa5bb0fdcd4933fbad9bfb268ffbd71807182ecae
$(package)_sha256_hash_linux=a893977f238291370ab96726a74b6b9ae854dc75fbf5730954d901a93843bf9b
$(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz
$(package)_sha256_hash_darwin=d82204f536af0c7bfd2ea2213dc46b99911860cfc5517f7321244412ae96f159
$(package)_sha256_hash_darwin=b6003d49fb857ff8dc105a3ccba98b851cd3e7d874005acb92284fd1113adc0d
$(package)_file_name_freebsd=rust-$($(package)_version)-x86_64-unknown-freebsd.tar.gz
$(package)_sha256_hash_freebsd=83f9c49b6e9025b712fc5d65e49f1b6ad959966534cd39c8dc2ce2c85a6ca484
$(package)_sha256_hash_freebsd=f188a9a7f947d559add5aa7b5aa218d9c5177237eb9ea62109347f0f1464e3a2
$(package)_file_name_aarch64_linux=rust-$($(package)_version)-aarch64-unknown-linux-gnu.tar.gz
$(package)_sha256_hash_aarch64_linux=ab5da30a3de5433e26cbc74c56b9d97b569769fc2e456fc54378adc8baaee4f0
$(package)_sha256_hash_aarch64_linux=7d8860572431bd4ee1b9cd0cd77cf7ff29fdd5b91ed7c92a820f872de6ced558
# Mapping from GCC canonical hosts to Rust targets
# If a mapping is not present, we assume they are identical, unless $host_os is
@ -17,10 +21,10 @@ $(package)_rust_target_x86_64-pc-linux-gnu=x86_64-unknown-linux-gnu
$(package)_rust_target_x86_64-w64-mingw32=x86_64-pc-windows-gnu
# Mapping from Rust targets to SHA-256 hashes
$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=81dbd37919f631f962ac0798111803eb8f06ffde608f0e5dd3682d701cf5566d
$(package)_rust_std_sha256_hash_x86_64-apple-darwin=959af8bafbc9f3916a1d1111d7378fdd7aa459410cdd2d3bbfc2d9d9a6db0683
$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=9a67ae84e9e75efb57eeeab617e32379a555de336a30bb74a476e575cd38f63a
$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=cf5e4303dd7c3b70a738a2336097c9f2189c8b702a89a8c453d83ac0dee4602c
$(package)_rust_std_sha256_hash_aarch64-unknown-linux-gnu=2b425658f84793d5bbf00ce545f410ec6454add202cce27a718d81e0233e7007
$(package)_rust_std_sha256_hash_x86_64-apple-darwin=eb2f7c51f63973765f01efe509ccd2f26345d4bf0d77695adb4198a0899ae648
$(package)_rust_std_sha256_hash_x86_64-pc-windows-gnu=dcf87f97432adf7228e907b551d9b73f1ab16f79dc5da0724a227b7ffdaf57b4
$(package)_rust_std_sha256_hash_x86_64-unknown-freebsd=c91edba781ba56f35f2dba56a268d41866ea9bb5f6ffb9d342635f66b836898b
define rust_target
$(if $($(1)_rust_target_$(2)),$($(1)_rust_target_$(2)),$(if $(findstring darwin,$(3)),x86_64-apple-darwin,$(if $(findstring freebsd,$(3)),x86_64-unknown-freebsd,$(2))))

View File

@ -1,449 +0,0 @@
diff -urN cxx-1.0.72/Cargo.lock cxx-1.0.72-locked/Cargo.lock
--- cxx-1.0.72/Cargo.lock 1970-01-01 01:00:00.000000000 +0100
+++ cxx-1.0.72-locked/Cargo.lock 2022-07-25 13:19:29.023791072 +0100
@@ -0,0 +1,445 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "adler"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+
+[[package]]
+name = "autocfg"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "cc"
+version = "1.0.73"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
+dependencies = [
+ "jobserver",
+]
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "clang-ast"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9c380e0de48337007dfc91b09eb75f567f5f08209437857fbaabbaf2e77e830"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "clap"
+version = "3.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54635806b078b7925d6e36810b1755f2a4b5b4d57560432c1ecf60bcbe10602b"
+dependencies = [
+ "bitflags",
+ "clap_lex",
+ "indexmap",
+ "strsim",
+ "textwrap",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
+dependencies = [
+ "os_str_bytes",
+]
+
+[[package]]
+name = "codespan-reporting"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
+dependencies = [
+ "termcolor",
+ "unicode-width",
+]
+
+[[package]]
+name = "crc32fast"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
+dependencies = [
+ "cfg-if",
+]
+
+[[package]]
+name = "cxx"
+version = "1.0.72"
+dependencies = [
+ "cc",
+ "cxx-build",
+ "cxx-gen",
+ "cxx-test-suite",
+ "cxxbridge-flags",
+ "cxxbridge-macro",
+ "link-cplusplus",
+ "rustversion",
+ "trybuild",
+]
+
+[[package]]
+name = "cxx-build"
+version = "1.0.72"
+dependencies = [
+ "cc",
+ "codespan-reporting",
+ "cxx-gen",
+ "once_cell",
+ "pkg-config",
+ "proc-macro2",
+ "quote",
+ "scratch",
+ "syn",
+]
+
+[[package]]
+name = "cxx-gen"
+version = "0.7.72"
+dependencies = [
+ "codespan-reporting",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "cxx-test-suite"
+version = "0.0.0"
+dependencies = [
+ "cxx",
+ "cxx-build",
+ "cxxbridge-flags",
+]
+
+[[package]]
+name = "cxxbridge-cmd"
+version = "1.0.72"
+dependencies = [
+ "clap",
+ "codespan-reporting",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "cxxbridge-flags"
+version = "1.0.72"
+
+[[package]]
+name = "cxxbridge-macro"
+version = "1.0.72"
+dependencies = [
+ "clang-ast",
+ "cxx",
+ "flate2",
+ "memmap",
+ "proc-macro2",
+ "quote",
+ "serde",
+ "serde_json",
+ "syn",
+]
+
+[[package]]
+name = "demo"
+version = "0.0.0"
+dependencies = [
+ "cxx",
+ "cxx-build",
+]
+
+[[package]]
+name = "dissimilar"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8c97b9233581d84b8e1e689cdd3a47b6f69770084fc246e86a7f78b0d9c1d4a5"
+
+[[package]]
+name = "flate2"
+version = "1.0.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
+dependencies = [
+ "crc32fast",
+ "miniz_oxide",
+]
+
+[[package]]
+name = "glob"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
+
+[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+
+[[package]]
+name = "indexmap"
+version = "1.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
+dependencies = [
+ "autocfg",
+ "hashbrown",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
+
+[[package]]
+name = "jobserver"
+version = "0.1.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.126"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
+
+[[package]]
+name = "link-cplusplus"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8cae2cd7ba2f3f63938b9c724475dfb7b9861b545a90324476324ed21dbc8c8"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "memmap"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "miniz_oxide"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
+dependencies = [
+ "adler",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1"
+
+[[package]]
+name = "os_str_bytes"
+version = "6.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4"
+
+[[package]]
+name = "pkg-config"
+version = "0.3.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.41"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdcc2916cde080c1876ff40292a396541241fe0072ef928cd76582e9ea5d60d2"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8"
+
+[[package]]
+name = "ryu"
+version = "1.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
+
+[[package]]
+name = "scratch"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96311ef4a16462c757bb6a39152c40f58f31cd2602a40fceb937e2bc34e6cbab"
+
+[[package]]
+name = "serde"
+version = "1.0.140"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.140"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.82"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "strsim"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
+
+[[package]]
+name = "syn"
+version = "1.0.98"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "textwrap"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb"
+
+[[package]]
+name = "toml"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "trybuild"
+version = "1.0.63"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "764b9e244b482a9b81bde596aa37aa6f1347bf8007adab25e59f901b32b4e0a0"
+dependencies = [
+ "dissimilar",
+ "glob",
+ "once_cell",
+ "serde",
+ "serde_derive",
+ "serde_json",
+ "termcolor",
+ "toml",
+]
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
+
+[[package]]
+name = "unicode-width"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

View File

@ -1,14 +1,14 @@
Zcash Contributors
==================
Jack Grigg (1190)
Kris Nuttycombe (570)
Jack Grigg (1243)
Kris Nuttycombe (582)
Simon Liu (460)
Sean Bowe (389)
Daira Hopwood (334)
Daira Hopwood (343)
Eirik Ogilvie-Wigley (216)
Wladimir J. van der Laan (152)
Pieter Wuille (142)
Wladimir J. van der Laan (158)
Pieter Wuille (143)
Alfredo Garcia (119)
Taylor Hornby (118)
Marshall Gaucher (116)
@ -16,20 +16,21 @@ Ying Tong Lai (90)
Jonas Schnelli (90)
Jay Graber (89)
Larry Ruane (88)
Marco Falke (85)
Marco Falke (86)
Cory Fields (78)
Matt Corallo (60)
sasha (58)
Nathan Wilcox (56)
sasha (59)
Nathan Wilcox (57)
practicalswift (42)
Kevin Gallagher (38)
Dimitris Apostolou (38)
fanquake (36)
Luke Dashjr (26)
Carl Dong (26)
Luke Dashjr (24)
Gregory Maxwell (24)
John Newbery (23)
Jorge Timón (22)
Greg Pfeil (20)
furszy (18)
Jonathan "Duke" Leto (18)
syd (16)
@ -61,6 +62,8 @@ Jeff Garzik (8)
Chun Kuan Lee (8)
Ben Wilson (8)
Karl-Johan Alm (7)
Hennadii Stepanov (7)
Alex Wied (7)
James O'Beirne (6)
David Mercer (6)
Daniel Kraft (6)
@ -74,13 +77,13 @@ Johnathan Corgan (5)
George Tankersley (5)
Gavin Andresen (5)
Gareth Davies (5)
Alex Wied (5)
sandakersmann (4)
gladcow (4)
WO (4)
Sjors Provoost (4)
Nate Wilcox (4)
Jim Posen (4)
Ben Woosley (4)
mruddy (3)
lpescher (3)
isle2983 (3)
@ -94,7 +97,7 @@ Evan Klitzke (3)
Ethan Heilman (3)
Eric Lombrozo (3)
Danny Willems (3)
Ben Woosley (3)
Conrado Gouvea (3)
Anthony Towns (3)
Alfie John (3)
Aditya Kulkarni (3)
@ -128,20 +131,21 @@ Jesse Cohen (2)
Jeffrey Czyz (2)
Jack Gavigan (2)
ITH4Coinomia (2)
Hennadii Stepanov (2)
DeckerSU (2)
Dan Raviv (2)
Dagur Valberg Johannsson (2)
Conrado Gouvea (2)
Bryant Eisenbach (2)
Brian Stafford (2)
Brad Miller (2)
Bjorn Hjortsberg (2)
Amgad Abdelhafez (2)
Alex Tsankov (2)
Alex (2)
Akio Nakamura (2)
ロハン ダル (1)
zathras-crypto (1)
vim88 (1)
user (1)
unsystemizer (1)
tulip (1)
tpantin (1)
@ -214,6 +218,7 @@ Jonas Nick (1)
Jon Layton (1)
Jeffrey Walton (1)
Janito Vaqueiro Ferreira Filho (1)
James White (1)
Jainan-Tandel (1)
Igor Cota (1)
Ian T (1)
@ -241,10 +246,10 @@ Bob McElrath (1)
Bitcoin Error Log (1)
Bernhard M. Wiedemann (1)
Ashley Holman (1)
Andrés G. Aragoneses (1)
Andrew Chow (1)
Allan Niemerg (1)
Alex van der Peet (1)
Alex (1)
Ahmad Kazi (1)
Adam Weiss (1)
Adam Langley (1)

View File

@ -3,14 +3,20 @@
[zcashd](README.md)
- [User Documentation](user.md)
- [Platform Support](user/platform-support.md)
- [Wallet Backup](user/wallet-backup.md)
- [Shielding Coinbase Outputs](user/shield-coinbase.md)
- [Data Directory Structure](user/files.md)
- [Metrics](user/metrics.md)
- [Using `zcashd` with Tor](user/tor.md)
- [Security Warnings](user/security-warnings.md)
- [Deprecated Features](user/deprecation.md)
- [Developer Documentation](dev.md)
- [DNS Seeders](dev/dnsseed-policy.md)
- [Rust in `zcashd`](dev/rust.md)
- [Regtest tips and hints](dev/regtest.md)
- [Regtest Tips And Hints](dev/regtest.md)
- [Platform Tier Policy](dev/platform-tier-policy.md)
- [Deprecation Procedure](dev/deprecation.md)
- [Design](design.md)
- [Chain state](design/chain-state.md)
- ["Coins" view](design/coins-view.md)
- [P2P data propagation](design/p2p-data-propagation.md)
- [Chain State](design/chain-state.md)
- ["Coins" View](design/coins-view.md)
- [P2P Data Propagation](design/p2p-data-propagation.md)

View File

@ -0,0 +1,54 @@
Expectations for DNS Seed operators
====================================
Zcash attempts to minimize the level of trust in DNS seeds,
but DNS seeds still pose a small amount of risk for the network.
As such, DNS seeds must be run by entities which have some minimum
level of trust within the Zcash community.
Other implementations of Zcash software may also use the same
seeds and may be more exposed. In light of this exposure, this
document establishes some basic expectations for operating DNS seeds.
0. A DNS seed operating organization or person is expected to follow good
host security practices, maintain control of applicable infrastructure,
and not sell or transfer control of the DNS seed. Any hosting services
contracted by the operator are equally expected to uphold these expectations.
1. The DNS seed results must consist exclusively of fairly selected and
functioning Zcash nodes from the public network to the best of the
operator's understanding and capability.
2. For the avoidance of doubt, the results may be randomized but must not
single out any group of hosts to receive different results unless due to an
urgent technical necessity and disclosed.
3. The results may not be served with a DNS TTL of less than one minute.
4. Any logging of DNS queries should be only that which is necessary
for the operation of the service or urgent health of the Zcash
network and must not be retained longer than necessary nor disclosed
to any third party.
5. Information gathered as a result of the operators node-spidering
(not from DNS queries) may be freely published or retained, but only
if this data was not made more complete by biasing node connectivity
(a violation of expectation (1)).
6. Operators are encouraged, but not required, to publicly document the
details of their operating practices.
7. A reachable email contact address must be published for inquiries
related to the DNS seed operation.
If these expectations cannot be satisfied the operator should discontinue
providing services and contact the active Zcash development team as well as
creating an issue in the [Zcash repository](https://github.com/zcash/zcash).
Behavior outside of these expectations may be reasonable in some
situations but should be discussed in public in advance.
See also
----------
- [zcash-seeder](https://github.com/zcash/zcash-seeder) is a reference
implementation of a DNS seed.

View File

@ -26,7 +26,7 @@ delta between the old and new versions - even if the old version is in the
## Adding new dependencies in online-Rust mode
The `zcashd` build system pins all dependencies, and in order to facilitate
deterministic builds, `cargo` is configured to run in offline mode with vendored
reproducible builds, `cargo` is configured to run in offline mode with vendored
crates. This means that if, for example, you add the `foobar` crate to
`Cargo.toml`, you will likely see an error similar to this:
@ -37,16 +37,32 @@ location searched: registry `https://github.com/rust-lang/crates.io-index`
required by package `librustzcash v0.2.0 (/path/to/zcash)`
```
Instead, you first need to build `zcashd` in online-Rust mode:
```
CONFIGURE_FLAGS=--enable-online-rust ./zcutil/build.sh
```
To add dependencies that are compatible with the reproducible build system, you need to follow these steps:
After doing so, you can add a new dependency as follows:
1. Add the new dependency to `Cargo.toml`.
2. Run `cargo check` to update the `Cargo.lock` file.
3. Commit `Cargo.toml` and `Cargo.lock`.
1. First, if you've made changes to dependencies in `Cargo.toml`, these must be reverted before the next step:
```
git stash
```
2. Next, reconfigure the build system for "online" mode:
```
CONFIGURE_FLAGS=--enable-online-rust ./zcutil/build.sh
```
3. Now, introduce the dependency changes into `Cargo.toml`. If you saved changes in Step 1 with `git stash`, you can reapply them:
```
git stash pop
```
4. Update `Cargo.lock`:
```
cargo check
```
5. Commit the changes to `Cargo.toml` and `Cargo.lock` together:
```
git commit ./Cargo.{toml,lock}
```
6. Verify the reproducible build works in vendored/offline mode without the `--enable-online-rust` flag:
```
./zcutil/build.sh
```
## Using a local Rust dependency

View File

@ -0,0 +1,24 @@
Data Directory Files
====================
Files within the zcashd data directory (``~/.zcash/`` on Linux unless otherwise specified)
include:
| File | Description
|-----------------------|--------------
|``zcash.conf`` | contains configuration settings for zcashd
|``zcashd.pid`` | stores the process id of zcashd while running
|``blocks/blk000*.dat`` | block data (custom, 128 MiB per file)
|``blocks/rev000*.dat`` | block undo data (custom)
|``blocks/index/*`` | block index (LevelDB)
|``chainstate/*`` | block chain state database (LevelDB)
|``database/*`` | BDB database environment
|``db.log`` | wallet database log file
|``debug.log`` | contains debug information and general logging generated by zcashd
|``fee_estimates.dat`` | stores statistics used to estimate minimum transaction fees and priorities required for confirmation
|``peers.dat`` | peer IP address database (custom format)
|``wallet.dat`` | personal wallet (BDB) with keys and transactions (keep private, back this up!)
|``.cookie`` | session RPC authentication cookie (written at start when cookie authentication is used, deleted on shutdown)
|``.lock`` | data directory lock file (empty)
|``testnet3/*`` | contains testnet versions of these files, except ``zcash.conf``, if running ``-testnet``
|``onion_private_key`` | cached Tor hidden service private key for ``-listenonion``

View File

@ -0,0 +1,137 @@
Security Warnings
=================
Security Audit
--------------
Zcash has been subjected to a formal third-party security review. For security
announcements, audit results and other general security information, see
https://z.cash/support/security.html
Wallet Encryption
-----------------
Wallet encryption is disabled, for several reasons:
- Encrypted wallets are unable to correctly detect shielded spends (due to the
nature of unlinkability of JoinSplits) and can incorrectly show larger
available shielded balances until the next time the wallet is unlocked. This
problem was not limited to failing to recognize the spend; it was possible
for the shown balance to increase by the amount of change from a spend,
without deducting the spent amount.
- While encrypted wallets prevent spending of funds, they do not maintain the
shielding properties of JoinSplits (due to the need to detect spends). That
is, someone with access to an encrypted wallet.dat has full visibility of
your entire transaction graph (other than newly-detected spends, which suffer
from the earlier issue).
- We were concerned about the resistance of the algorithm used to derive wallet
encryption keys (inherited from
[Bitcoin](https://bitcoin.org/en/secure-your-wallet)) to dictionary attacks
by a powerful attacker. If and when we re-enable wallet encryption, it is
likely to be with a modern passphrase-based key derivation algorithm designed
for greater resistance to dictionary attack, such as Argon2i.
You should use full-disk encryption (or encryption of your home directory) to
protect your wallet at rest, and should assume (even unprivileged) users who
are running on your OS can read your wallet.dat file.
Side-Channel Attacks
--------------------
This implementation of Zcash is not resistant to side-channel attacks. You
should assume (even unprivileged) users who are running on the hardware, or who
are physically near the hardware, that your `zcashd` process is running on
will be able to:
- Determine the values of your secret spending keys, as well as which notes you
are spending, by observing cache side-channels as you perform a JoinSplit
operation. This is due to probable side-channel leakage in the libsnark
proving machinery.
- Determine which notes you own by observing cache side-channel information
leakage from the incremental witnesses as they are updated with new notes.
- Determine which notes you own by observing the trial decryption process of
each note ciphertext on the blockchain.
You should ensure no other users have the ability to execute code (even
unprivileged) on the hardware your `zcashd` process runs on until these
vulnerabilities are fully analyzed and fixed.
REST Interface
--------------
The REST interface is a feature inherited from upstream Bitcoin. By default,
it is disabled. We do not recommend you enable it until it has undergone a
security review.
RPC Interface
-------------
Users should choose a strong RPC password. If no RPC username and password are
set, zcashd will not start and will print an error message with a suggestion
for a strong random password. If the client knows the RPC password, they have
at least full access to the node. In addition, certain RPC commands can be
misused to overwrite files and/or take over the account that is running zcashd.
(In the future we may restrict these commands, but full node access including
the ability to spend from and export keys held by the wallet would still be
possible unless wallet methods are disabled.)
Users should also refrain from changing the default setting that only allows
RPC connections from localhost. Allowing connections from remote hosts would
enable a MITM to execute arbitrary RPC commands, which could lead to compromise
of the account running zcashd and loss of funds. For multi-user services that
use one or more zcashd instances on the backend, the parameters passed in by
users should be controlled to prevent confused-deputy attacks which could spend
from any keys held by that zcashd.
Block Chain Reorganization: Major Differences
---------------------------------------------
Users should be aware of new behavior in Zcash that differs significantly from
Bitcoin: in the case of a block chain reorganization, Bitcoin's coinbase
maturity rule helps to ensure that any reorganization shorter than the maturity
interval will not invalidate any of the rolled-back transactions. Zcash keeps
Bitcoin's 100-block maturity interval for generation transactions, but because
JoinSplits must be anchored within a block, this provides more limited
protection against transactions becoming invalidated. In the case of a block
chain reorganization for Zcash, all JoinSplits which were anchored within the
reorganization interval and any transactions that depend on them will become
invalid, rolling back transactions and reverting funds to the original owner.
The transaction rebroadcast mechanism inherited from Bitcoin will not
successfully rebroadcast transactions depending on invalidated JoinSplits if
the anchor needs to change. The creator of an invalidated JoinSplit, as well as
the creators of all transactions dependent on it, must rebroadcast the
transactions themselves.
Receivers of funds from a JoinSplit can mitigate the risk of relying on funds
received from transactions that may be rolled back by using a higher minconf
(minimum number of confirmations).
Logging z_* RPC calls
---------------------
The option `-debug=zrpc` covers logging of the z_* calls. This will reveal
information about private notes which you might prefer not to disclose. For
example, when calling `z_sendmany` to create a shielded transaction, input
notes are consumed and new output notes are created.
The option `-debug=zrpcunsafe` covers logging of sensitive information in z_*
calls which you would only need for debugging and audit purposes. For example,
if you want to examine the memo field of a note being spent.
Private spending keys for z addresses are never logged.
Potentially-Missing Required Modifications
------------------------------------------
In addition to potential mistakes in code we added to Bitcoin Core, and
potential mistakes in our modifications to Bitcoin Core, it is also possible
that there were potential changes we were supposed to make to Bitcoin Core but
didn't, either because we didn't even consider making those changes, or we ran
out of time. We have brainstormed and documented a variety of such
possibilities in [issue #826](https://github.com/zcash/zcash/issues/826), and
believe that we have changed or done everything that was necessary for the
1.0.0 launch. Users may want to review this list themselves.

View File

@ -0,0 +1,137 @@
# Shielding Coinbase UTXOs
**Summary**
Use `z_shieldcoinbase` RPC call to shield coinbase UTXOs.
**Who should read this document**
Miners, Mining pools, Online wallets
## Background
The current Zcash protocol includes a consensus rule that coinbase rewards must
be sent to a shielded address.
## User Experience Challenges
A user can use the z_sendmany RPC call to shield coinbase funds, but the call
was not designed for sweeping up many UTXOs, and offered a suboptimal user
experience.
If customers send mining pool payouts to their online wallet, the service
provider must sort through UTXOs to correctly determine the non-coinbase UTXO
funds that can be withdrawn or transferred by customers to another transparent
address.
## Solution
The z_shieldcoinbase call makes it easy to sweep up coinbase rewards from
multiple coinbase UTXOs across multiple coinbase reward addresses.
z_shieldcoinbase fromaddress toaddress (fee) (limit)
The default fee is 0.0010000 ZEC and the default limit on the maximum number of
UTXOs to shield is 50.
## Examples
Sweep up coinbase UTXOs from a transparent address you use for mining:
zcash-cli z_shieldcoinbase tMyMiningAddress zMyPrivateAddress
Sweep up coinbase UTXOs from multiple transparent addresses to a shielded
address:
zcash-cli z_shieldcoinbase "*" zMyPrivateAddress
Sweep up with a fee of 1.23 ZEC:
zcash-cli z_shieldcoinbase tMyMiningAddress zMyPrivateAddress 1.23
Sweep up with a fee of 0.1 ZEC and set limit on the maximum number of UTXOs to
shield at 25:
zcash-cli z_shieldcoinbase "*" zMyPrivateAddress 0.1 25
### Asynchronous Call
The `z_shieldcoinbase` RPC call is an asynchronous call, so you can queue up
multiple operations.
When you invoke
zcash-cli z_shieldcoinbase tMyMiningAddress zMyPrivateAddress
JSON will be returned immediately, with the following data fields populated:
- operationid: a temporary id to use with `z_getoperationstatus` and
`z_getoperationresult` to get the status and result of the operation.
- shieldedUTXOs: number of coinbase UTXOs being shielded
- shieldedValue: value of coinbase UTXOs being shielded.
- remainingUTXOs: number of coinbase UTXOs still available for shielding.
- remainingValue: value of coinbase UTXOs still available for shielding
### Locking UTXOs
The `z_shieldcoinbase` call will lock any selected UTXOs. This prevents the
selected UTXOs which are already queued up from being selected for any other
send operation. If the `z_shieldcoinbase` call fails, any locked UTXOs are
unlocked.
You can use the RPC call `lockunspent` to see which UTXOs have been locked.
You can also use this call to unlock any UTXOs in the event of an unexpected
system failure which leaves UTXOs in a locked state.
### Limits, Performance and Transaction Confirmation
The number of coinbase UTXOs selected for shielding can be adjusted by setting
the limit parameter. The default value is 50.
If the limit parameter is set to zero, the zcashd `mempooltxinputlimit` option
will be used instead, where the default value for `mempooltxinputlimit` is
zero, which means no limit.
Any limit is constrained by a hard limit due to the consensus rule defining a
maximum transaction size of 100,000 bytes.
In general, the more UTXOs that are selected, the longer it takes for the
transaction to be verified. Due to the quadratic hashing problem, some miners
use the `mempooltxinputlimit` option to reject transactions with a large number
of UTXO inputs.
Currently, as of November 2017, there is no commonly agreed upon limit, but as
a rule of thumb (a form of emergent consensus) if a transaction has less than
100 UTXO inputs, the transaction will be mined promptly by the majority of
mining pools, but if it has many more UTXO inputs, such as 500, it might take
several days to be mined by a miner who has higher or no limits.
### Anatomy of a z_shieldcoinbase transaction
The transaction created is a shielded transaction. It consists of a single
joinsplit, which consumes coinbase UTXOs as input, and deposits value at a
shielded address, minus any fee.
The number of coinbase UTXOs is determined by a user configured limit.
If no limit is set (in the case when limit parameter and `mempooltxinputlimit`
options are set to zero) the behaviour of z_shieldcoinbase is to consume as
many UTXOs as possible, with `z_shieldcoinbase` constructing a transaction up
to the size limit of 100,000 bytes.
As a result, the maximum number of inputs that can be selected is:
- P2PKH coinbase UTXOs ~ 662
- 2-of-3 multisig P2SH coinbase UTXOs ~ 244.
Here is an example of using `z_shieldcoinbase` on testnet to shield multi-sig coinbase UTXOs.
- Block 141042 is almost ~2 MB in size (the maximum size for a block) and
contains 1 coinbase reward transaction and 20 transactions, each indivually
created by a call to z_shieldcoinbase.
- https://explorer.testnet.z.cash/block/0050552a78e97c89f666713c8448d49ad1d7263274422272696187dedf6c0d03
- Drilling down into a transaction, you can see there is one joinsplit, with
244 inputs (vin) and 0 outputs (vout).
- https://explorer.testnet.z.cash/tx/cf4f3da2e434f68b6e361303403344e22a9ff9a8fda9abc180d9520d0ca6527d

View File

@ -0,0 +1,289 @@
Tor Support in Zcash
====================
Tor can be used to provide a layer of network anonymity for Zcash users.
Additionally, Zcash users may chose to connect only to Tor hidden services, and
also to expose their own Tor hidden service to allow users to connect to them
over the Tor network.
0. Install Tor
--------------
The easiest way to install Tor is to use the
[Tor Browser Bundle](https://www.torproject.org/download/). For headless
installs, you probably want to install the Tor daemon. The Tor Project
provides [instructions](https://support.torproject.org/apt/) for doing this on
common Linux distributions. Note that the Tor Browser Bundle exposes a SOCKS
listener on tcp/9150 by default, while the Tor daemon exposes the SOCKS
listener on tcp/9050. For the purposes of the example below, we'll assume that
you're using the Tor daemon and that the SOCKS listener is on tcp/9050.
1. Run zcashd over Tor
----------------------
Configuring zcashd to use a Tor SOCKS proxy will route all outgoing connections
over Tor.
```bash
$ zcashd -proxy=127.0.0.1:9050
```
Yay! Your zcashd node is now leveraging the Tor network to connect to other
zcashd nodes. But there's more fun to be had. By creating a
[Tor Hidden Service](https://2019.www.torproject.org/docs/faq.html.en#TorOnionServices).
you can help promote privacy for Zcash users by advertising your node's .onion
address to other Tor Zcash users.
2. Expose your zcashd via a Tor hidden service (optional)
---------------------------------------------------------
Edit your /etc/tor/torrc (or equivalent config file) to map the hidden service
to your zcashd TCP listener. The directory can be whatever you like but the
port numbers should be equal to the zcashd p2p listen port (8233 by default).
An example is below.
```yaml
############### This section is just for location-hidden services ###
## Once you have configured a hidden service, you can look at the
## contents of the file ".../hidden_service/hostname" for the address
## to tell people.
##
## HiddenServicePort x y:z says to redirect requests on port x to the
## address y:z.
#
# Placeholder for when zcashd adds support for Onion v3 addresses
#HiddenServiceDir /var/lib/tor/zcash_hidden_service_v3/
#HiddenServiceVersion 3
#HiddenServicePort 8233 127.0.0.1:8233
# use the generated v2 Onion hostname until v3 support is complete
HiddenServiceDir /var/lib/tor/zcash_hidden_service_v2/
HiddenServiceVersion 2
HiddenServicePort 8233 127.0.0.1:8233
```
Note that zcashd does not yet support Onion v3 addresses, but will do so before
v2 addresses are removed from Tor. See [this
issue](https://github.com/zcash/zcash/issues/3051) for more information on
what's required to make zcashd support v3 Onion addresses.
After making these edits to /etc/tor/torrc, restart tor to create the hidden
service hostname and keys.
```bash
$ sudo systemctl restart tor
```
Then set a bash variable to provide your Onion service hostname to zcashd so it
can advertise your node to other Tor capable nodes on the Zcash network.
```bash
$ export MY_ONION_HOSTNAME=`sudo cat /var/lib/tor/zcash_hidden_service_v2/hostname`
```
Now configure the zcashd node to use the Tor proxy, enable the TCP listener
(only on localhost), and advertise your onion address so that other nodes on
the Zcash network can connect to you over Tor.
```bash
$ zcashd -proxy=127.0.0.1:9050 -externalip=$MY_ONION_HOSTNAME -listen -bind=127.0.0.1 -listenonion=0
```
zcashd flags used:
- `-proxy=ip:port`: sets the proxy server. This must match the port IP and port
on which your Tor listener is configured.
- `-externalip=<ip|host>`: sets the publicly routable address that zcashd will
advertise to other zcash nodes. This can be an IPv4, IPv6 or .onion address.
Onion addresses are given preference for advertising and connections. Onionv3
addresses are [not yet supported](https://github.com/zcash/zcash/issues/3051).
- `-listen`: Enable listening for incoming connections with this flag;
listening is off by default, but is needed in order for Tor to connect to
zcashd.
- `-bind=ip`: Bind (only) to this IP. Will bind to all interfaces by default
if ``listen=1``.
- `-listenonion=<0|1>`: Enable or disable autoconfiguration of Tor hidden
service via control socket API. Disabled in this example because we manually
configured the hidden service in /etc/tor/torrc.
Once your node is up and running, you can use `zcash-cli` to verify that it
is properly connected to other Zcash nodes over the p2p network, and is
correctly advertising its Onion address to the network.
```bash
$ zcash-cli getnetworkinfo
```
```javascript
{
"version": 4020050,
"subversion": "/MagicBean:4.2.0/",
"protocolversion": 170013,
"connections": 9,
"networks": [
{
"name": "ipv4",
"limited": true,
"reachable": false,
"proxy": "127.0.0.1:9050",
"proxy_randomize_credentials": true
},
{
"name": "ipv6",
"limited": true,
"reachable": false,
"proxy": "127.0.0.1:9050",
"proxy_randomize_credentials": true
},
{
"name": "onion",
"limited": false,
"reachable": true,
"proxy": "127.0.0.1:9050",
"proxy_randomize_credentials": true
}
],
"relayfee": 0.00000100,
"localaddresses": [
{
"address": "ynizm2wpla6ec22q.onion",
"port": 8233,
"score": 10
}
],
}
```
3. Dynamically Configure Onion Service (Optional)
-------------------------------------------------
Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket
API, to create and destroy 'ephemeral' hidden services programmatically. zcashd
has been updated to make use of this.
This configuration could be used instead of manually configuring the Onion
service as in step 2 above.
If Tor is running (and proper authentication has been configured), zcashd
automatically creates a hidden service to listen on. zcashd will also use Tor
automatically to connect to other .onion nodes if the control socket can be
successfully opened.
This new feature is enabled by default if zcashd is listening (`-listen`) and
requires a Tor connection to work. It can be explicitly disabled with
`-listenonion=0` and, if not disabled, configured using the `-torcontrol`
and `-torpassword` settings. To show verbose debugging information, pass
`-debug=tor`.
Connecting to Tor's control socket API requires one of two authentication
methods to be configured:
1. Cookie authentication, which requires write access to the `CookieAuthFile`
specified in Tor configuration. In some cases, this is preconfigured and the
creation of a hidden service is automatic. If permission problems are seen
with `-debug=tor` they can be resolved by adding both the user running tor
and the user running zcashd to the same group and setting permissions
appropriately. On Debian-based systems the user running zcashd can be added
to the debian-tor group, which has the appropriate permissions.
2. Authentication with the `-torpassword` flag and a `hash-password`, which
can be enabled and specified in Tor configuration.
On Debian systems, where Tor is installed via APT, you can trivially permit
zcashd to connect to the Tor socket by adding the zcash user to the
`debian-tor` group.
```bash
$ sudo usermod -aG debian-tor zcash
```
When properly configured, this will allow zcashd to automatically connect to
the Tor control socket API and configure an ephemeral hidden service.
```bash
$ zcashd -debug=tor
```
```
Feb 11 15:26:20.323 INFO main: tor: Got service ID tweustb4j6o3u5x7, advertizing service tweustb4j6o3u5x7.onion:8233
Feb 11 15:26:20.323 DEBUG tor: tor: Cached service private key to /home/zcash/.zcash/onion_private_key
Feb 11 15:26:20.323 INFO main: AddLocal(tweustb4j6o3u5x7.onion:8233,4)
...
Feb 11 15:26:47.565 INFO main: ProcessMessages: advertizing address tweustb4j6o3u5x7.onion:8233
```
4. Connect to a single Zcash Onion server
-----------------------------------------
This invocation will start zcashd and connect via Tor to a single zcashd onion
server.
Launch zcashd as follows:
```bash
$ zcashd -onion=127.0.0.1:9050 -connect=ynizm2wpla6ec22q.onion
```
- `-onion=ip:port`: Use SOCKS5 proxy to reach peers via Tor hidden services.
This must match the port IP and port on which your Tor listener is
configured.
- `-connect=<hostname|ip>`: Connect only to the specified node(s); `-noconnect`
or `-connect=0` alone to disable automatic connections
Now use zcash-cli to verify there is only a single peer connection.
```bash
$ zcash-cli getpeerinfo
```
```javascript
[
{
"id": 1,
"addr": "ynizm2wpla6ec22q.onion",
...
"version": 170013,
"subver": "/MagicBean:4.2.0/",
"inbound": false,
...
}
]
```
4. Connect to multiple Zcash Onion servers
------------------------------------------
This invocation will start zcashd, skip DNS seeding, connect via Tor to a
multiple zcashd onion servers, and also advertise your Onion server to other
Tor capable Zcash nodes.
Launch zcashd as follows:
```bash
$ export MY_ONION_HOSTNAME=`sudo cat /var/lib/tor/zcash_hidden_service_v2/hostname`
$ zcashd -listen -onion=127.0.0.1:9050 -addnode=ynizm2wpla6ec22q.onion -dnsseed=0 -onlynet=onion -externalip=$MY_ONION_HOSTNAME -bind=127.0.0.1
```
zcashd flags used:
- `-onion=ip:port`: Use SOCKS5 proxy to reach peers via Tor hidden services.
This must match the port IP and port on which your Tor listener is
configured.
- `-addnode=<host|ip>`: Add a node to connect to and attempt to keep the
connection open
- `-externalip=<ip|onion>`: sets the publicly routable address that zcashd will
advertise to other zcash nodes. This can be an IPv4, IPv6 or .onion address.
Onion addresses are given preference for advertising and connections. Onionv3
addresses are [not yet supported](https://github.com/zcash/zcash/issues/3051).
- `-listen`: Enable listening for incoming connections with this flag;
listening is off by default, but is needed in order for Tor to connect to
zcashd.
- `-bind=<ip>`: Bind (only) to this IP. Will bind to all interfaces by default
if `listen=1` and `bind` is not set.
- `-onlynet=<net>`: Only connect to nodes in network `<net>` (ipv4, ipv6 or
onion)

View File

@ -0,0 +1,143 @@
# Wallet Backup Instructions
## Overview
Backing up your Zcash private keys is the best way to be proactive about
preventing loss of access to your ZEC.
Problems resulting from bugs in the code, user error, device failure, etc. may
lead to losing access to your wallet (and as a result, the private keys of
addresses which are required to spend from them).
No matter what the cause of a corrupted or lost wallet could be, we highly
recommend all users backup on a regular basis. Anytime a new address in the
wallet is generated, we recommending making a new backup so all private keys
for addresses in your wallet are safe.
Note that a backup is a duplicate of data needed to spend ZEC so where you keep
your backup(s) is another important consideration. You should not store backups
where they would be equally or increasingly susceptible to loss or theft.
## Instructions for backing up your wallet and/or private keys
These instructions are specific for the officially supported Zcash Linux
client. For backing up with third-party wallets, please consult with user
guides or support channels provided for those services.
There are multiple ways to make sure you have at least one other copy of the
private keys needed to spend your ZEC and view your shielded ZEC.
For all methods, you will need to include an export directory setting in your
config file (`zcash.conf` located in the data directory which is `~/.zcash/`
unless it's been overridden with `datadir=` setting):
`exportdir=path/to/chosen/export/directory`
You may chose any directory within the home directory as the location for
export & backup files. If the directory doesn't exist, it will be created.
Note that zcashd will need to be stopped and restarted for edits in the config
file to take effect.
### Using `backupwallet`
To create a backup of your wallet, use:
```bash
$ zcash-cli backupwallet <nameofbackup>
```
The backup will be an exact copy of the current state of your wallet.dat file
stored in the export directory you specified in the config file. The file path
will also be returned.
If you generate a new Zcash address, it will not be reflected in the backup
file.
If your original `wallet.dat` file becomes inaccessible for whatever reason,
you can use your backup by copying it into your data directory and renaming the
copy to `wallet.dat`.
### Using `z_exportwallet` & `z_importwallet`
If you prefer to have an export of your private keys in human readable format,
you can use:
```bash
$ zcash-cli z_exportwallet <nameofbackup>`
```
This will generate a file in the export directory listing all transparent and
shielded private keys with their associated public addresses. The file path
will be returned in the command line.
To import keys into a wallet which were previously exported to a file, use:
```bash
$ zcash-cli z_importwallet <path/to/exportdir/nameofbackup>
```
### Using `z_exportkey`, `z_importkey`, `dumpprivkey` & `importprivkey`
If you prefer to export a single private key for a shielded address, you can
use:
```bash
$ zcash-cli z_exportkey <z-address>
```
This will return the private key and will not create a new file.
For exporting a single private key for a transparent address, you can use the
command inherited from Bitcoin:
```bash
$ zcash-cli dumpprivkey <t-address>
```
This will return the private key and will not create a new file.
To import a private key for a shielded address, use:
```bash
$ zcash-cli z_importkey <z-priv-key>
```
This will add the key to your wallet and rescan the wallet for associated
transactions if it is not already part of the wallet.
The rescanning process can take a few minutes for a new private key. To skip
it, instead use:
```bash
$ zcash-cli z_importkey <z-private-key> no
```
For other instructions on fine-tuning the wallet rescan, see the command's help
documentation:
```bash
$ zcash-cli help z_importkey
```
To import a private key for a transparent address, use:
```bash
$ zcash-cli importprivkey <t-priv-key>
```
This has the same functionality as `z_importkey` but works with transparent
addresses.
See the command's help documentation for instructions on fine-tuning the wallet
rescan:
```bash
$ zcash-cli help importprivkey
```
### Using `dumpwallet`
This command inherited from Bitcoin is deprecated and should not be used. It
will export private keys in a similar fashion as `z_exportwallet` but only for
transparent addresses.

View File

@ -338,6 +338,10 @@ Current subtrees include:
- **Note**: Follow the instructions in [Upgrading LevelDB](#upgrading-leveldb) when
merging upstream changes to the LevelDB subtree.
- src/crc32c
- Used by leveldb for hardware acceleration of CRC32C checksums for data integrity.
- Upstream at https://github.com/google/crc32c ; Maintained by Google.
- src/secp256k1
- Upstream at https://github.com/bitcoin-core/secp256k1/ ; actively maintained by Core contributors.

View File

@ -1,6 +0,0 @@
Expectations for DNS Seed operators
====================================
This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/dnsseed_policy.html
The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/dnsseed_policy.rst

View File

@ -1,5 +0,0 @@
# Data Directory Files
This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/files.html
The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/files.rst

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
.TH ZCASH-CLI "1" "July 2022" "zcash-cli v5.2.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASH-CLI "1" "October 2022" "zcash-cli v5.3.0" "User Commands"
.SH NAME
zcash-cli \- manual page for zcash-cli v5.2.0
zcash-cli \- manual page for zcash-cli v5.3.0
.SH DESCRIPTION
Zcash RPC client version v5.2.0
Zcash RPC client version v5.3.0
.PP
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
.TH ZCASH-TX "1" "July 2022" "zcash-tx v5.2.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASH-TX "1" "October 2022" "zcash-tx v5.3.0" "User Commands"
.SH NAME
zcash-tx \- manual page for zcash-tx v5.2.0
zcash-tx \- manual page for zcash-tx v5.3.0
.SH DESCRIPTION
Zcash zcash\-tx utility version v5.2.0
Zcash zcash\-tx utility version v5.3.0
.SS "Usage:"
.TP
zcash\-tx [options] <hex\-tx> [commands]

View File

@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
.TH ZCASHD-WALLET-TOOL "1" "July 2022" "zcashd-wallet-tool v5.2.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASHD-WALLET-TOOL "1" "October 2022" "zcashd-wallet-tool v5.3.0" "User Commands"
.SH NAME
zcashd-wallet-tool \- manual page for zcashd-wallet-tool v5.2.0
zcashd-wallet-tool \- manual page for zcashd-wallet-tool v5.3.0
.SH SYNOPSIS
.B zcashd-wallet-tool
[\fI\,OPTIONS\/\fR]

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
.TH ZCASHD "1" "July 2022" "zcashd v5.2.0" "User Commands"
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1.
.TH ZCASHD "1" "October 2022" "zcashd v5.3.0" "User Commands"
.SH NAME
zcashd \- manual page for zcashd v5.2.0
zcashd \- manual page for zcashd v5.3.0
.SH DESCRIPTION
Zcash Daemon version v5.2.0
Zcash Daemon version v5.3.0
.PP
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.
@ -94,7 +94,7 @@ Keep at most <n> unconnectable transactions in memory (default: 100)
.HP
\fB\-par=\fR<n>
.IP
Set the number of script verification threads (\fB\-16\fR to 16, 0 = auto, <0 =
Set the number of script verification threads (\fB\-8\fR to 16, 0 = auto, <0 =
leave that many cores free, default: 0)
.HP
\fB\-pid=\fR<file>
@ -458,7 +458,7 @@ transaction; setting this too low may abort large transactions (default:
.HP
\fB\-printtoconsole\fR
.IP
Send trace/debug info to console instead of debug.log file
Send trace/debug info to console instead of the debug log
.PP
Chain selection options:
.HP

View File

@ -1,5 +1,179 @@
# Zcash Payment API
This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/payment_api.html
## Overview
The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/payment_api.rst
Zcash extends the Bitcoin Core API with new RPC calls to support private Zcash payments.
Zcash payments make use of two address formats:
* taddr - an address for transparent funds (just like a Bitcoin address, value stored in UTXOs)
* zaddr - an address for private funds (value stored in objects called notes)
When transferring funds from one taddr to another taddr, you can use either the existing Bitcoin RPC calls or the new Zcash RPC calls.
When a transfer involves zaddrs, you must use the new Zcash RPC calls.
## Compatibility with Bitcoin Core
Zcash supports all commands in the Bitcoin Core API (as of version 0.11.2). Where applicable, Zcash will extend commands in a backwards-compatible way to enable additional functionality.
We do not recommend use of accounts which are now deprecated in Bitcoin Core. Where the account parameter exists in the API, please use “” as its value, otherwise an error will be returned.
To support multiple users in a single nodes wallet, consider using getnewaddress or z_getnewaddress to obtain a new address for each user. Also consider mapping multiple addresses to each user.
## List of Zcash API commands
Optional parameters are denoted in [square brackets].
RPC calls by category:
* Accounting: z_getbalance, z_gettotalbalance
* Addresses : z_getnewaddress, z_listaddresses, z_validateaddress, z_exportviewingkey, z_importviewingkey
* Keys : z_exportkey, z_importkey, z_exportwallet, z_importwallet
* Operation: z_getoperationresult, z_getoperationstatus, z_listoperationids
* Payment : z_listreceivedbyaddress, z_listunspent, z_sendmany, z_shieldcoinbase
RPC parameter conventions:
* taddr : Transparent address
* zaddr : Private address
* address : Accepts both private and transparent addresses.
* amount : JSON format decimal number with at most 8 digits of precision, with 1 ZEC expressed as 1.00000000.
* memo : Metadata expressed in hexadecimal format. Limited to 512 bytes, the current size of the memo field of a private transaction. Zero padding is automatic.
### Accounting
Command | Parameters | Description
--- | --- | ---
z_getbalance<br>| address [minconf=1] | Returns the balance of a taddr or zaddr belonging to the nodes wallet.<br><br>Optionally set the minimum number of confirmations a private or transparent transaction must have in order to be included in the balance. Use 0 to count unconfirmed transactions.
z_gettotalbalance<br>| [minconf=1] | Return the total value of funds stored in the nodes wallet.<br><br>Optionally set the minimum number of confirmations a private or transparent transaction must have in order to be included in the balance. Use 0 to count unconfirmed transactions.<br><br>Output:<br>{<br>"transparent" : 1.23,<br>"private" : 4.56,<br>"total" : 5.79}
### Addresses
Command | Parameters | Description
--- | --- | ---
z_getnewaddress | | Return a new zaddr for sending and receiving payments. The spending key for this zaddr will be added to the nodes wallet.<br><br>Output:<br>zN68D8hSs3...
z_listaddresses | | Returns a list of all the zaddrs in this nodes wallet for which you have a spending key.<br><br>Output:<br>{ [“z123…”, “z456...”, “z789...”] }
z_validateaddress | zaddr | Return information about a given zaddr.<br><br>Output:<br>{"isvalid" : true,<br>"address" : "zcWsmq...",<br>"type" : "sprout",<br>"payingkey" : "f5bb3c...",<br>"transmissionkey" : "7a58c7...",<br>"ismine" : true}
### Key Management
Command | Parameters | Description
--- | --- | ---
z_exportkey | zaddr | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Return a zkey for a given zaddr belonging to the nodes wallet.<br><br>The key will be returned as a string formatted using Base58Check as described in the Zcash protocol spec.<br><br>Output:AKWUAkypwQjhZ6LLNaMuuuLcmZ6gt5UFyo8m3jGutvALmwZKLdR5
z_importkey | zkey [rescan=true] | _Wallet must be unlocked._<br><br>Add a zkey as returned by z_exportkey to a node's wallet.<br><br>The key should be formatted using Base58Check as described in the Zcash protocol spec.<br><br>Set rescan to true (the default) to rescan the entire local block database for transactions affecting any address or pubkey script in the wallet (including transactions affecting the newly-added address for this spending key).
z_exportwallet | filename | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Creates or overwrites a file with taddr private keys and zaddr private keys in a human-readable format.<br><br>Filename is the file in which the wallet dump will be placed. May be prefaced by an absolute file path. An existing file with that name will be overwritten.<br><br>No value is returned but a JSON-RPC error will be reported if a failure occurred.
z_importwallet | filename | _Requires an unlocked wallet or an unencrypted wallet._<br><br>Imports private keys from a file in wallet export file format (see z_exportwallet). These keys will be added to the keys currently in the wallet. This call may need to rescan all or parts of the block chain for transactions affecting the newly-added keys, which may take several minutes.<br><br>Filename is the file to import. The path is relative to zcashds working directory.<br><br>No value is returned but a JSON-RPC error will be reported if a failure occurred.
z_exportviewingkey | zaddr | Reveals the viewing key corresponding to 'zaddr'. Then the z_importviewingkey can be used with this output.
z_importviewingkey | vkey [rescan=whenkeyisnew] [startHeight=0] | Adds a viewing key (as returned by z_exportviewingkey) to your wallet.
### Payment
Command | Parameters | Description
--- | --- | ---
z_listreceivedbyaddress<br> | zaddr [minconf=1] | Return a list of amounts received by a zaddr belonging to the nodes wallet.<br><br>Optionally set the minimum number of confirmations which a received amount must have in order to be included in the result. Use 0 to count unconfirmed transactions.<br><br>Output:<br>[{<br>“txid”: “4a0f…”,<br>“amount”: 0.54,<br>“memo”:”F0FF…”,}, {...}, {...}<br>]
z_listunspent | [minconf=1] [maxconf=9999999] [includeWatchonly=false] [zaddrs] | Returns array of unspent shielded notes with between minconf and maxconf (inclusive) confirmations.<br><br>Optionally filter to only include notes sent to specified addresses.<br><br>When minconf is 0, unspent notes with zero confirmations are returned, even though they are not immediately spendable.<br><br>Results are an array of Objects, each of which has: {txid, jsindex, jsoutindex, confirmations, address, amount, memo}
z_sendmany<br> | fromaddress amounts [minconf=1] [fee=0.0001] | _This is an Asynchronous RPC call_<br><br>Send funds from an address to multiple outputs. The address can be either a taddr or a zaddr.<br><br>Amounts is a list containing key/value pairs corresponding to the addresses and amount to pay. Each output address can be in taddr or zaddr format.<br><br>When sending to a zaddr, you also have the option of attaching a memo in hexadecimal format.<br><br>**NOTE:**When sending coinbase funds to a zaddr, the node's wallet does not allow any change. Put another way, spending a partial amount of a coinbase utxo is not allowed. This is not a consensus rule but a local wallet rule due to the current implementation of z_sendmany. In future, this rule may be removed.<br><br>Example of Outputs parameter:<br>[{“address”:”t123…”, “amount”:0.005},<br>,{“address”:”z010…”,”amount”:0.03, “memo”:”f508af…”}]<br><br>Optionally set the minimum number of confirmations which a private or transparent transaction must have in order to be used as an input. When sending from a zaddr, minconf must be greater than zero.<br><br>Optionally set a transaction fee, which by default is 0.0001 ZEC.<br><br>Any transparent change will be sent to a new transparent address. Any private change will be sent back to the zaddr being used as the source of funds.<br><br>Returns an operationid. You use the operationid value with z_getoperationstatus and z_getoperationresult to obtain the result of sending funds, which if successful, will be a txid.
z_shieldcoinbase<br> | fromaddress toaddress [fee=0.0001] [limit=50] | _This is an Asynchronous RPC call_<br><br>Shield transparent coinbase funds by sending to a shielded z address. Utxos selected for shielding will be locked. If there is an error, they are unlocked. The RPC call `listlockunspent` can be used to return a list of locked utxos.<br><br>The number of coinbase utxos selected for shielding can be set with the limit parameter, which has a default value of 50. If the parameter is set to 0, the number of utxos selected is limited by the `-mempooltxinputlimit` option. Any limit is constrained by a consensus rule defining a maximum transaction size of 100000 bytes. <br><br>The from address is a taddr or "*" for all taddrs belonging to the wallet. The to address is a zaddr. The default fee is 0.0001.<br><br>Returns an object containing an operationid which can be used with z_getoperationstatus and z_getoperationresult, along with key-value pairs regarding how many utxos are being shielded in this transaction and what remains to be shielded.
### Operations
Asynchronous calls return an OperationStatus object which is a JSON object with the following defined key-value pairs:
* operationid : unique identifier for the async operation. Use this value with z_getoperationstatus or z_getoperationresult to poll and query the operation and obtain its result.
* status : current status of operation
* queued : operation is pending execution
* executing : operation is currently being executed
* cancelled
* failed.
* success
* result : result object if the status is success. The exact form of the result object is dependent on the call itself.
* error: error object if the status is failed. The error object has the following key-value pairs:
* code : number
* message: error message
Depending on the type of asynchronous call, there may be other key-value pairs. For example, a z_sendmany operation will also include the following in an OperationStatus object:
* method : name of operation e.g. z_sendmany
* params : an object containing the parameters to z_sendmany
Currently, as soon as you retrieve the operation status for an operation which has finished, that is it has either succeeded, failed, or been cancelled, the operation and any associated information is removed.
It is currently not possible to cancel operations.
Command | Parameters | Description
--- | --- | ---
z_getoperationresult <br>| [operationids] | Return OperationStatus JSON objects for all completed operations the node is currently aware of, and then remove the operation from memory.<br><br>Operationids is an optional array to filter which operations you want to receive status objects for.<br><br>Output is a list of operation status objects, where the status is either "failed", "cancelled" or "success".<br>[<br>{“operationid”: “opid-11ee…”,<br>“status”: “cancelled”},<br>{“operationid”: “opid-9876”, “status”: ”failed”},<br>{“operationid”: “opid-0e0e”,<br>“status”:”success”,<br>“execution_time”:”25”,<br>“result”: {“txid”:”af3887654…”,...}<br>},<br>]<br><br> Examples:<br>zcash-cli z_getoperationresult '["opid-8120fa20-5ee7-4587-957b-f2579c2d882b"]'<br> zcash-cli z_getoperationresult
z_getoperationstatus <br>| [operationids] | Return OperationStatus JSON objects for all operations the node is currently aware of.<br><br>Operationids is an optional array to filter which operations you want to receive status objects for.<br><br>Output is a list of operation status objects.<br>[<br>{“operationid”: “opid-12ee…”,<br>“status”: “queued”},<br>{“operationid”: “opd-098a…”, “status”: ”executing”},<br>{“operationid”: “opid-9876”, “status”: ”failed”}<br>]<br><br>When the operation succeeds, the status object will also include the result.<br><br>{“operationid”: “opid-0e0e”,<br>“status”:”success”,<br>“execution_time”:”25”,<br>“result”: {“txid”:”af3887654…”,...}<br>}
z_listoperationids <br>| [state] | Return a list of operationids for all operations which the node is currently aware of.<br><br>State is an optional string parameter to filter the operations you want listed by their state. Acceptable parameter values are queued, executing, success, failed, cancelled.<br><br>[“opid-0e0e…”, “opid-1af4…”, … ]
## Asynchronous RPC call Error Codes
Zcash error codes are defined in https://github.com/zcash/zcash/blob/master/src/rpcprotocol.h
### z_sendmany error codes
RPC_INVALID_PARAMETER (-8) | _Invalid, missing or duplicate parameter_
---------------------------| -------------------------------------------------
"Minconf cannot be zero when sending from zaddr" | Cannot accept minimum confirmation value of zero when sending from zaddr.
"Minconf cannot be negative" | Cannot accept negative minimum confirmation number.
"Minimum number of confirmations cannot be less than 0" | Cannot accept negative minimum confirmation number.
"From address parameter missing" | Missing an address to send funds from.
"No recipients" | Missing recipient addresses.
"Memo must be in hexadecimal format" | Encrypted memo field data must be in hexadecimal format.
"Memo size of __ is too big, maximum allowed is __ " | Encrypted memo field data exceeds maximum size of 512 bytes.
"From address does not belong to this node, zaddr spending key not found." | Sender address spending key not found.
"Invalid parameter, expected object" | Expected object.
"Invalid parameter, unknown key: __" | Unknown key.
"Invalid parameter, expected valid size" | Invalid size.
"Invalid parameter, expected hex txid" | Invalid txid.
"Invalid parameter, vout must be positive" | Invalid vout.
"Invalid parameter, duplicated address" | Address is duplicated.
"Invalid parameter, amounts array is empty" | Amounts array is empty.
"Invalid parameter, unknown key" | Key not found.
"Invalid parameter, unknown address format" | Unknown address format.
"Invalid parameter, size of memo" | Invalid memo field size.
"Invalid parameter, amount must be positive" | Invalid or negative amount.
"Invalid parameter, too many zaddr outputs" | z_address outputs exceed maximum allowed.
"Invalid parameter, expected memo data in hexadecimal format" | Encrypted memo field is not in hexadecimal format.
"Invalid parameter, size of memo is larger than maximum allowed __ " | Encrypted memo field data exceeds maximum size of 512 bytes.
RPC_INVALID_ADDRESS_OR_KEY (-5) | _Invalid address or key_
--------------------------------| ---------------------------
"Invalid from address, no spending key found for zaddr" | z_address spending key not found.
"Invalid output address, not a valid taddr." | Transparent output address is invalid.
"Invalid from address, should be a taddr or zaddr." | Sender address is invalid.
"From address does not belong to this node, zaddr spending key not found." | Sender address spending key not found.
RPC_WALLET_INSUFFICIENT_FUNDS (-6) | _Not enough funds in wallet or account_
-----------------------------------| ------------------------------------------
"Insufficient funds, no UTXOs found for taddr from address." | Insufficient funds for sending address.
"Could not find any non-coinbase UTXOs to spend. Coinbase UTXOs can only be sent to a single zaddr recipient." | Must send Coinbase UTXO to a single z_address.
"Could not find any non-coinbase UTXOs to spend." | No available non-coinbase UTXOs.
"Insufficient funds, no unspent notes found for zaddr from address." | Insufficient funds for sending address.
"Insufficient transparent funds, have __, need __ plus fee __" | Insufficient funds from transparent address.
"Insufficient protected funds, have __, need __ plus fee __" | Insufficient funds from shielded address.
RPC_WALLET_ERROR (-4) | _Unspecified problem with wallet_
----------------------| -------------------------------------
"Could not find previous JoinSplit anchor" | Try restarting node with `-reindex`.
"Error decrypting output note of previous JoinSplit: __" |
"Could not find witness for note commitment" | Try restarting node with `-rescan`.
"Witness for note commitment is null" | Missing witness for note commitment.
"Witness for spendable note does not have same anchor as change input" | Invalid anchor for spendable note witness.
"Not enough funds to pay miners fee" | Retry with sufficient funds.
"Missing hex data for raw transaction" | Raw transaction data is null.
"Missing hex data for signed transaction" | Hex value for signed transaction is null.
"Send raw transaction did not return an error or a txid." |
RPC_WALLET_ENCRYPTION_FAILED (-16) | _Failed to encrypt the wallet_
-------------------------------------------------------------------------| -------------------------------------
"Failed to sign transaction" | Transaction was not signed, sign transaction and retry.
RPC_WALLET_KEYPOOL_RAN_OUT (-12) | _Keypool ran out, call keypoolrefill first_
-------------------------------------------------------------------------| -----------------------------------------------
"Could not generate a taddr to use as a change address" | Call keypoolrefill and retry.

View File

@ -0,0 +1,176 @@
Notable changes
===============
Wallet Performance Improvements
-------------------------------
`zcashd 5.2.0` improved the performance of wallet scanning with multithreaded
batched trial decryption of Sapling outputs. However, for some nodes this
resulted in growing memory usage that would eventually cause an OOM abort. We
have identified the cause of the growth, and made significant improvements to
reduce the memory usage of the batch scanner. In addition, the batch scanner now
has a memory limit of 100 MiB.
`zcashd` now reports the following new metrics when `-prometheusport` is set:
- (counter) `zcashd.wallet.batchscanner.outputs.scanned`
- (gauge) `zcashd.wallet.batchscanner.size.transactions`
- (gauge) `zcashd.wallet.batchscanner.usage.bytes`
- (gauge) `zcashd.wallet.synced.block.height`
RPC Interface
-------------
- The `finalorchardroot` field in the `getblock` result and the
`orchard.commitments.finalRoot` field in the `z_gettreestate` result have
been changed to match the byte ordering used for the `orchard.anchor`
field in the `getrawtransaction` result. These previously produced different
hash values from the `orchard.anchor` field due to having been byte-flipped
in their internal representation in zcashd.
Changelog
=========
Alex (1):
build: update book.yml Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
Alex Wied (2):
cuckoocache: Add missing header
build: Reorder link targets to properly build on Nix
Andrés G. Aragoneses (1):
autogen.sh: warn about needing autoconf if autoreconf is not found
Ben Woosley (1):
doc: Correct spelling errors in comments
Conrado Gouvea (1):
Include algorithm.h in cuckoocache.h
Daira Hopwood (8):
Add contrib/debian/copyright entry for crc32c.
Apply suggestions from code review
Update doc/book/src/user/security-warnings.md
Update librustzcash commit and adapt to changes in `DiversifierKey`.
Avoid an implicit clone of the Orchard bundle in ContextualCheckTransaction.
Use prepared epks and ivks in trial decryption.
Audit dependency updates.
Include memory usage of the `tags` vector. This fixes *one* of the bugs pointed out by @str4d at https://github.com/zcash/zcash/pull/6156/files#r979122874
DeckerSU (2):
miner: fix MAXSOLS
test_framework: fix AttributeError in sapling_spends_compact_digest
Greg Pfeil (11):
Eliminate indirection for debug log
Define some basic cross-editor configuration
Canonicalize some user-provided paths
Add an `rpc-tests` make target
Add simplejson to requirements for rpc-tests
Also canonicalize paramsdir.
Backport tor.md changes from readthedocs
Don't recommend -reindex-chainstate.
Add a finalorchardroot RPC test
Fix finalorchardroot serialization
Apply suggestions from code review
Hennadii Stepanov (5):
Enable ShellCheck rules
script: Lint Gitian descriptors with ShellCheck
script: Enable SC2006 rule for Gitian scripts
script: Enable SC2155 rule for Gitian scripts
script: Enable SC2001 rule for Gitian scripts
Jack Grigg (52):
Squashed 'src/leveldb/' changes from f545dfabff..f8ae182c1e
Squashed 'src/crc32c/' content from commit 224988680f
depends: Update Rust to 1.62.1
depends: Update Clang / libcxx to LLVM 14.0.6
depends: Update Rust to 1.63.0
CI: Migrate to published versions of cargo-vet
rust: Update some of the pinned dependencies
rust: Add `zcash-inspect` binary for inspecting Zcash data
rust: Add P2PKH signature checking to `zcash-inspect`
rust: Add address inspection to `zcash-inspect`
rust: Add mnemonic phrase inspection to `zcash-inspect`
rust: Simplify `next_pow2` in `zcash-inspect`
rust: Place tighter bound on encoded heights in `zcash-inspect`
lint: Fix shell lints
CI: Enforce shell lints to prevent regression
lint: Fix ShellCheck lints in Zcash scripts
lint: Disable some ShellChecks on Gitian descriptors
rust: Add shielded sighash to `zcash-inspect` output for txs
rust: `zcash-inspect` 32-byte hex as maybe a commitment or nullifier
build: Build Rust library and binaries at the same time
rust: Migrate to latest `zcash_primitives` revision
rust: Migrate Rust tests to latest `zcash_primitives` revision
wallet: Use `auto&` to avoid copying inside `ThreadNotifyWallets`
wallet: Refactor `ThreadNotifyWallets` to support batch memory limits
wallet: Add dynamic memory usage tracking to `BatchScanner`
wallet: Collect metrics on the number of scanned outputs
wallet: Set a memory limit of 100 MiB for batch scanning
wallet: Only store successful trial decryptions in batch scanner
depends: Update Rust to 1.64.0
qa: Postpone dependencies that require CMake
qa: Postpone Clang 15 to retain LLVM 14 pin
depends: Update cxx to 1.0.76
depends: Update Boost to 1.80.0
Fix clippy lints
qa: Add audit policies for patched Rust crates
metrics: Add gauge for the height to which the wallet is synced
wallet: Move heap tracking of batch tasks behind a trait
wallet: Correctly track heap usage of batch items
wallet: Improve estimation of `rayon` spawned task size
Squashed 'src/secp256k1/' changes from a4abaab793..efad3506a8
Squashed 'src/secp256k1/' changes from efad3506a8..1758a92ffd
build: Disable secp256k1 OpenSSL tests
wallet: Remove lock on cs_main from CWallet::ChainTip
rust: Update to `metrics 0.20`
depends: Update cxx to 1.0.78
qa: Postpone Clang 15.0.2
rust: Update to `cpufeatures 0.2.5`
qa: Recommend cargo-upgrades instead of cargo-outdated
rust: Audit some dependency updates
rust: Update remaining dependencies
make-release.py: Versioning changes for 5.3.0-rc1.
make-release.py: Updated manpages for 5.3.0-rc1.
James White (1):
Add IPv6 support to qos.sh
Kris Nuttycombe (7):
Update `z_sendmany` help to clarify what happens when sending from a UA
Revert "redirect and update source documentation"
Fix documentation line wrapping
Backport changes from zcash.readthedocs.io
Move restored documentation into the zcashd book
Replace manual mangement of the Sapling proving context with cxx
Apply suggestions from code review
Luke Dashjr (2):
Bugfix: Only use git for build info if the repository is actually the right one
Bugfix: Detect genbuild.sh in repo correctly
Marco Falke (1):
Remove script to clean up datadirs
Nathan Wilcox (1):
Update rust.md
Pieter Wuille (1):
libsecp256k1 no longer has --with-bignum= configure option
Wladimir J. van der Laan (6):
build: Update build system for new leveldb
doc: Add crc32c subtree to developer notes
test: Add crc32c to subtree check linter
test: Add crc32c exception to various linters and generation scripts
build: CRC32C build system integration
build: Get rid of `CLIENT_DATE`
sasha (1):
Make RUST_DIST in Makefile.am refer to rust-toolchain.toml (baf7d9e)
user (1):
README.md: Clarify distinction between protocol vs zcashd implementation; link to Zebra; line wrapping.

View File

@ -0,0 +1,192 @@
Notable changes
===============
Wallet Performance Improvements
-------------------------------
`zcashd 5.2.0` improved the performance of wallet scanning with multithreaded
batched trial decryption of Sapling outputs. However, for some nodes this
resulted in growing memory usage that would eventually cause an OOM abort. We
have identified the cause of the growth, and made significant improvements to
reduce the memory usage of the batch scanner. In addition, the batch scanner now
has a memory limit of 100 MiB.
`zcashd` now reports the following new metrics when `-prometheusport` is set:
- (counter) `zcashd.wallet.batchscanner.outputs.scanned`
- (gauge) `zcashd.wallet.batchscanner.size.transactions`
- (gauge) `zcashd.wallet.batchscanner.usage.bytes`
- (gauge) `zcashd.wallet.synced.block.height`
RPC Interface
-------------
- The `finalorchardroot` field in the `getblock` result and the
`orchard.commitments.finalRoot` field in the `z_gettreestate` result have
been changed to match the byte ordering used for the `orchard.anchor`
field in the `getrawtransaction` result. These previously produced different
hash values from the `orchard.anchor` field due to having been byte-flipped
in their internal representation in zcashd.
Changelog
=========
Alex (1):
build: update book.yml Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com>
Alex Wied (2):
cuckoocache: Add missing header
build: Reorder link targets to properly build on Nix
Andrés G. Aragoneses (1):
autogen.sh: warn about needing autoconf if autoreconf is not found
Ben Woosley (1):
doc: Correct spelling errors in comments
Conrado Gouvea (1):
Include algorithm.h in cuckoocache.h
Daira Hopwood (9):
Add contrib/debian/copyright entry for crc32c.
Apply suggestions from code review
Update doc/book/src/user/security-warnings.md
Update librustzcash commit and adapt to changes in `DiversifierKey`.
Avoid an implicit clone of the Orchard bundle in ContextualCheckTransaction.
Use prepared epks and ivks in trial decryption.
Audit dependency updates.
Include memory usage of the `tags` vector. This fixes *one* of the bugs pointed out by @str4d at https://github.com/zcash/zcash/pull/6156/files#r979122874
Always use a tuple as right argument of % in new Python code.
DeckerSU (2):
miner: fix MAXSOLS
test_framework: fix AttributeError in sapling_spends_compact_digest
Greg Pfeil (20):
Eliminate indirection for debug log
Define some basic cross-editor configuration
Canonicalize some user-provided paths
Add an `rpc-tests` make target
Add simplejson to requirements for rpc-tests
Also canonicalize paramsdir.
Backport tor.md changes from readthedocs
Don't recommend -reindex-chainstate.
Add a finalorchardroot RPC test
Fix finalorchardroot serialization
Apply suggestions from code review
Fix display of binary name in error messages.
Address review feedback and fixed test failures
Add test for `zcashd --help`
Fix `zcashd --help`
Apply suggestions from code review
Qualify a `string`
Dont define wallet-needing code when --disable-wallet
make-release.py: Versioning changes for 5.3.0.
make-release.py: Updated manpages for 5.3.0.
Hennadii Stepanov (5):
Enable ShellCheck rules
script: Lint Gitian descriptors with ShellCheck
script: Enable SC2006 rule for Gitian scripts
script: Enable SC2155 rule for Gitian scripts
script: Enable SC2001 rule for Gitian scripts
Jack Grigg (53):
Squashed 'src/leveldb/' changes from f545dfabff..f8ae182c1e
Squashed 'src/crc32c/' content from commit 224988680f
depends: Update Rust to 1.62.1
depends: Update Clang / libcxx to LLVM 14.0.6
depends: Update Rust to 1.63.0
CI: Migrate to published versions of cargo-vet
rust: Update some of the pinned dependencies
rust: Add `zcash-inspect` binary for inspecting Zcash data
rust: Add P2PKH signature checking to `zcash-inspect`
rust: Add address inspection to `zcash-inspect`
rust: Add mnemonic phrase inspection to `zcash-inspect`
rust: Simplify `next_pow2` in `zcash-inspect`
rust: Place tighter bound on encoded heights in `zcash-inspect`
lint: Fix shell lints
CI: Enforce shell lints to prevent regression
lint: Fix ShellCheck lints in Zcash scripts
lint: Disable some ShellChecks on Gitian descriptors
rust: Add shielded sighash to `zcash-inspect` output for txs
rust: `zcash-inspect` 32-byte hex as maybe a commitment or nullifier
build: Build Rust library and binaries at the same time
rust: Migrate to latest `zcash_primitives` revision
rust: Migrate Rust tests to latest `zcash_primitives` revision
wallet: Use `auto&` to avoid copying inside `ThreadNotifyWallets`
wallet: Refactor `ThreadNotifyWallets` to support batch memory limits
wallet: Add dynamic memory usage tracking to `BatchScanner`
wallet: Collect metrics on the number of scanned outputs
wallet: Set a memory limit of 100 MiB for batch scanning
wallet: Only store successful trial decryptions in batch scanner
depends: Update Rust to 1.64.0
qa: Postpone dependencies that require CMake
qa: Postpone Clang 15 to retain LLVM 14 pin
depends: Update cxx to 1.0.76
depends: Update Boost to 1.80.0
Fix clippy lints
qa: Add audit policies for patched Rust crates
metrics: Add gauge for the height to which the wallet is synced
wallet: Move heap tracking of batch tasks behind a trait
wallet: Correctly track heap usage of batch items
wallet: Improve estimation of `rayon` spawned task size
Squashed 'src/secp256k1/' changes from a4abaab793..efad3506a8
Squashed 'src/secp256k1/' changes from efad3506a8..1758a92ffd
build: Disable secp256k1 OpenSSL tests
wallet: Remove lock on cs_main from CWallet::ChainTip
rust: Update to `metrics 0.20`
depends: Update cxx to 1.0.78
qa: Postpone Clang 15.0.2
rust: Update to `cpufeatures 0.2.5`
qa: Recommend cargo-upgrades instead of cargo-outdated
rust: Audit some dependency updates
rust: Update remaining dependencies
make-release.py: Versioning changes for 5.3.0-rc1.
make-release.py: Updated manpages for 5.3.0-rc1.
make-release.py: Updated release notes and changelog for 5.3.0-rc1.
James White (1):
Add IPv6 support to qos.sh
Kris Nuttycombe (12):
Update `z_sendmany` help to clarify what happens when sending from a UA
Revert "redirect and update source documentation"
Fix documentation line wrapping
Backport changes from zcash.readthedocs.io
Move restored documentation into the zcashd book
Replace manual mangement of the Sapling proving context with cxx
Apply suggestions from code review
Update and/or postpone dependencies for 5.3.0
Vet cxxbridge upgrade.
Update to released versions of librustzcash crates.
Certify librustzcash crate upgrades.
Fix clippy lints.
Luke Dashjr (2):
Bugfix: Only use git for build info if the repository is actually the right one
Bugfix: Detect genbuild.sh in repo correctly
Marco Falke (1):
Remove script to clean up datadirs
Nathan Wilcox (1):
Update rust.md
Pieter Wuille (1):
libsecp256k1 no longer has --with-bignum= configure option
Wladimir J. van der Laan (6):
build: Update build system for new leveldb
doc: Add crc32c subtree to developer notes
test: Add crc32c to subtree check linter
test: Add crc32c exception to various linters and generation scripts
build: CRC32C build system integration
build: Get rid of `CLIENT_DATE`
sasha (1):
Make RUST_DIST in Makefile.am refer to rust-toolchain.toml (baf7d9e)
user (1):
README.md: Clarify distinction between protocol vs zcashd implementation; link to Zebra; line wrapping.

View File

@ -1,6 +0,0 @@
Security Warnings
====================
This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/security_warnings.html
The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/security_warnings.rst

View File

@ -1,5 +0,0 @@
# Shielding Coinbase UTXOs
This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/shield_coinbase.html
The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/shield_coinbase.rst

View File

@ -1,6 +0,0 @@
TOR SUPPORT IN ZCASH
====================
This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/tor.html
The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/tor.rst

View File

@ -1,6 +1,17 @@
Compiling/running automated tests
---------------------------------
This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/development_guidelines.html#testing
Automated tests will be automatically compiled if dependencies were met in configure
and tests weren't explicitly disabled.
The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/development_guidelines.rst
There are two scripts for running tests:
* ``qa/zcash/full_test_suite.py``, to run the main test suite
* ``qa/pull-tester/rpc-tests.sh``, to run the RPC tests.
The main test suite uses two different testing frameworks. Tests using the Boost
framework are under ``src/test/``; tests using the Google Test/Google Mock
framework are under ``src/gtest/`` and ``src/wallet/gtest/``. The latter framework
is preferred for new Zcash unit tests.
RPC tests are implemented in Python under the ``qa/rpc-tests/`` directory.

View File

@ -1,5 +0,0 @@
# Wallet Backup Instructions
This document has been relocated to https://zcash.readthedocs.io/en/latest/rtd_pages/wallet_backup.html
The source for this document is available at https://gitlab.com/zcash-docs/zcash-docs/blob/master/source/rtd_pages/wallet_backup.rst

View File

@ -11,15 +11,16 @@ Before running the tests, the following must be installed.
Unix
----
The python3-zmq library is required. On Ubuntu or Debian it can be installed via:
The python3-zmq library and simplejson are required. On Ubuntu or Debian they
can be installed via:
```
sudo apt-get install python3-zmq
sudo apt-get install python3-simplejson python3-zmq
```
OS X
------
```
pip3 install pyzmq
pip3 install pyzmq simplejson
```
Running tests
@ -27,19 +28,22 @@ Running tests
You can run any single test by calling
qa/pull-tester/rpc-tests.py <testname>
RPC_TEST=<testname> make rpc-tests
Or you can run any combination of tests by calling
qa/pull-tester/rpc-tests.py <testname1> <testname2> <testname3> ...
RPC_TEST="<testname1> <testname2> <testname3> ..." make rpc-tests
Run the regression test suite with
qa/pull-tester/rpc-tests.py
make rpc-tests
Run all possible tests with
qa/pull-tester/rpc-tests.py --extended
RPC_TEST="--extended" make rpc-tests
You can also run the tests directly using `qa/pull-tester/rpc-tests.py` instead
of `make`, but that won't ensure that zcashd is up-to-date with any changes.
By default, tests will be run in parallel. To specify how many jobs to run,
append `--jobs=n` (default n=4).

View File

@ -57,6 +57,7 @@ BASE_SCRIPTS= [
'wallet_listreceived.py',
'mempool_tx_expiry.py',
'finalsaplingroot.py',
'finalorchardroot.py',
'wallet_orchard.py',
'wallet_overwintertx.py',
'wallet_persistence.py',
@ -143,6 +144,7 @@ BASE_SCRIPTS= [
'wallet_z_sendmany.py',
'wallet_zero_value.py',
'threeofthreerestore.py',
'show_help.py',
]
ZMQ_SCRIPTS = [

View File

@ -57,7 +57,7 @@ class Zip221Test(BitcoinTestFramework):
if height >= 35:
orchard_root = hex_str_to_bytes(
self.nodes[0].getblock(str(height))["finalorchardroot"])[::-1]
self.nodes[0].getblock(str(height))["finalorchardroot"])
v2_data = (orchard_root, 0)
else:
v2_data = None

View File

@ -0,0 +1,283 @@
#!/usr/bin/env python3
# Copyright (c) 2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
NU5_BRANCH_ID,
assert_equal,
connect_nodes_bi,
get_coinbase_address,
nuparams,
start_nodes,
wait_and_assert_operationid_status,
)
from decimal import Decimal
SPROUT_TREE_EMPTY_ROOT = "59d2cde5e65c1414c32ba54f0fe4bdb3d67618125286e6a191317917c812c6d7"
SAPLING_TREE_EMPTY_ROOT = "3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb"
ORCHARD_TREE_EMPTY_ROOT = "ae2935f1dfd8a24aed7c70df7de3a668eb7a49b1319880dde2bbd9031ae5d82f"
NULL_FIELD = "0000000000000000000000000000000000000000000000000000000000000000"
# Verify block header field 'hashFinalOrchardRoot' (returned in rpc as 'finalorchardroot')
# is updated when Orchard transactions with outputs (commitments) are mined into a block.
class FinalOrchardRootTest(BitcoinTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 2
self.cache_behavior = 'sprout'
def setup_network(self, split=False):
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[[
'-txindex', # Avoid JSONRPC error: No information available about transaction
'-reindex', # Required due to enabling -txindex
nuparams(NU5_BRANCH_ID, 200),
'-debug',
]] * self.num_nodes)
connect_nodes_bi(self.nodes,0,1)
self.is_network_split=False
self.sync_all()
def run_test(self):
# Verify genesis block doesn't contain the final orchard root field.
blk = self.nodes[0].getblock("0")
assert "finalorchardroot" not in blk
treestate = self.nodes[0].z_gettreestate("0")
assert_equal(treestate["height"], 0)
assert_equal(treestate["hash"], self.nodes[0].getblockhash(0))
assert_equal(treestate["sprout"]["commitments"]["finalRoot"], SPROUT_TREE_EMPTY_ROOT)
assert_equal(treestate["sprout"]["commitments"]["finalState"], "000000")
assert "skipHash" not in treestate["sprout"]
assert_equal(treestate["sapling"]["commitments"]["finalRoot"], NULL_FIELD)
# There is no sapling state tree yet, and trying to find it in an earlier
# block won't succeed (we're at genesis block), so skipHash is absent.
assert "finalState" not in treestate["sapling"]
assert "skipHash" not in treestate["sapling"]
assert_equal(treestate["orchard"]["commitments"]["finalRoot"], NULL_FIELD)
# There is no orchard state tree yet, and trying to find it in an earlier
# block won't succeed (we're at genesis block), so skipHash is absent.
assert "finalState" not in treestate["orchard"]
assert "skipHash" not in treestate["orchard"]
# Verify no generated blocks before NU5 contain the empty root of the Orchard tree.
blockcount = self.nodes[0].getblockcount()
for height in range(1, blockcount + 1):
blk = self.nodes[0].getblock(str(height))
assert "finalorchardroot" not in blk
treestate = self.nodes[0].z_gettreestate(str(height))
assert_equal(treestate["height"], height)
assert_equal(treestate["hash"], self.nodes[0].getblockhash(height))
if height < 100:
assert "skipHash" not in treestate["sprout"]
assert_equal(treestate["sprout"]["commitments"]["finalRoot"], SPROUT_TREE_EMPTY_ROOT)
assert_equal(treestate["sprout"]["commitments"]["finalState"], "000000")
assert "skipHash" not in treestate["sapling"]
assert_equal(treestate["sapling"]["commitments"]["finalRoot"], SAPLING_TREE_EMPTY_ROOT)
assert_equal(treestate["sapling"]["commitments"]["finalState"], "000000")
assert "skipHash" not in treestate["orchard"]
assert_equal(treestate["orchard"]["commitments"]["finalRoot"], NULL_FIELD)
assert "finalState" not in treestate["orchard"]
self.sync_all()
self.nodes[0].generate(11)
self.sync_all()
# post-NU5
for height in range(200, 211):
blk = self.nodes[0].getblock(str(height))
assert_equal(blk["finalorchardroot"], ORCHARD_TREE_EMPTY_ROOT)
treestate = self.nodes[0].z_gettreestate(str(height))
assert_equal(treestate["height"], height)
assert_equal(treestate["hash"], self.nodes[0].getblockhash(height))
if height < 100:
assert "skipHash" not in treestate["sprout"]
assert_equal(treestate["sprout"]["commitments"]["finalRoot"], SPROUT_TREE_EMPTY_ROOT)
assert_equal(treestate["sprout"]["commitments"]["finalState"], "000000")
assert "skipHash" not in treestate["sapling"]
assert_equal(treestate["sapling"]["commitments"]["finalRoot"], SAPLING_TREE_EMPTY_ROOT)
assert_equal(treestate["sapling"]["commitments"]["finalState"], "000000")
assert "skipHash" not in treestate["orchard"]
assert_equal(treestate["orchard"]["commitments"]["finalRoot"], ORCHARD_TREE_EMPTY_ROOT)
assert_equal(treestate["orchard"]["commitments"]["finalState"], "000000")
# Node 0 shields some funds
taddr0 = get_coinbase_address(self.nodes[0])
acct0 = self.nodes[0].z_getnewaccount()['account']
addrRes0 = self.nodes[0].z_getaddressforaccount(acct0, ['orchard'])
assert_equal(acct0, addrRes0['account'])
assert_equal(addrRes0['receiver_types'], ['orchard'])
orchardAddr0 = addrRes0['address']
recipients = []
recipients.append({"address": orchardAddr0, "amount": Decimal('10')})
myopid = self.nodes[0].z_sendmany(taddr0, recipients, 1, 0, 'AllowRevealedSenders')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
# Verify the final Orchard root has changed
blk = self.nodes[0].getblock("211")
root = blk["finalorchardroot"]
assert root is not ORCHARD_TREE_EMPTY_ROOT
assert root is not NULL_FIELD
# Verify there is a Orchard output description (its commitment was added to tree)
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["orchard"]["actions"]), 2)
# Since there is a now orchard shielded input in the blockchain,
# the orchard values should have changed
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["orchard"]["commitments"]["finalRoot"], root)
assert_equal(new_treestate["sprout"], treestate["sprout"])
assert new_treestate["orchard"]["commitments"]["finalRoot"] != treestate["orchard"]["commitments"]["finalRoot"]
assert new_treestate["orchard"]["commitments"]["finalState"] != treestate["orchard"]["commitments"]["finalState"]
assert_equal(len(new_treestate["orchard"]["commitments"]["finalRoot"]), 64)
assert_equal(len(new_treestate["orchard"]["commitments"]["finalState"]), 196)
treestate = new_treestate
# Mine an empty block and verify the final Orchard root does not change
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(root, self.nodes[0].getblock("212")["finalorchardroot"])
# Mine a block with a transparent tx and verify the final Orchard root does not change
taddr1 = self.nodes[1].getnewaddress()
self.nodes[0].sendtoaddress(taddr1, Decimal("1.23"))
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("213")["tx"]), 2)
assert_equal(self.nodes[1].z_getbalance(taddr1), Decimal("1.23"))
assert_equal(root, self.nodes[0].getblock("213")["finalorchardroot"])
# Mine a block with a Sprout shielded tx and verify the final Orchard root does not change
zaddr0 = self.nodes[0].listaddresses()[0]['sprout']['addresses'][0]
assert_equal(self.nodes[0].z_getbalance(zaddr0), Decimal('50'))
recipients = [{"address": taddr0, "amount": Decimal('12.34')}]
opid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, 0, 'AllowRevealedRecipients')
wait_and_assert_operationid_status(self.nodes[0], opid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("214")["tx"]), 2)
assert_equal(self.nodes[0].z_getbalance(zaddr0), Decimal("37.66"))
assert_equal(root, self.nodes[0].getblock("214")["finalorchardroot"])
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["orchard"]["commitments"]["finalRoot"], root)
assert_equal(new_treestate["orchard"], treestate["orchard"])
assert new_treestate["sprout"]["commitments"]["finalRoot"] != treestate["sprout"]["commitments"]["finalRoot"]
assert new_treestate["sprout"]["commitments"]["finalState"] != treestate["sprout"]["commitments"]["finalState"]
assert_equal(len(new_treestate["sprout"]["commitments"]["finalRoot"]), 64)
assert_equal(len(new_treestate["sprout"]["commitments"]["finalState"]), 266)
treestate = new_treestate
# Mine a block with a Sapling shielded tx and verify the final Orchard root does not change
saplingAddr1 = self.nodes[1].z_getnewaddress("sapling")
recipients = [{"address": saplingAddr1, "amount": Decimal('2.34')}]
myopid = self.nodes[0].z_sendmany(zaddr0, recipients, 1, 0, 'AllowRevealedAmounts')
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("215")["tx"]), 2)
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal("2.34"))
assert_equal(root, self.nodes[0].getblock("215")["finalorchardroot"])
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["orchard"]["commitments"]["finalRoot"], root)
assert_equal(new_treestate["orchard"], treestate["orchard"])
assert new_treestate["sapling"]["commitments"]["finalRoot"] != treestate["sapling"]["commitments"]["finalRoot"]
assert new_treestate["sapling"]["commitments"]["finalState"] != treestate["sapling"]["commitments"]["finalState"]
assert_equal(len(new_treestate["sapling"]["commitments"]["finalRoot"]), 64)
assert_equal(len(new_treestate["sapling"]["commitments"]["finalState"]), 70)
treestate = new_treestate
# Mine a block with an Orchard shielded recipient and verify the final Orchard root changes
acct1 = self.nodes[1].z_getnewaccount()['account']
addrRes1 = self.nodes[1].z_getaddressforaccount(acct1, ['orchard'])
assert_equal(acct1, addrRes1['account'])
assert_equal(addrRes1['receiver_types'], ['orchard'])
orchardAddr1 = addrRes1['address']
recipients = [{"address": orchardAddr1, "amount": Decimal('2.34')}]
myopid = self.nodes[0].z_sendmany(orchardAddr0, recipients, 1, 0)
mytxid = wait_and_assert_operationid_status(self.nodes[0], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("216")["tx"]), 2)
assert_equal(self.nodes[1].z_getbalance(orchardAddr1), Decimal("2.34"))
assert root is not self.nodes[0].getblock("216")["finalorchardroot"]
# Verify there is a Orchard output description (its commitment was added to tree)
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["orchard"]["actions"]), 2) # there is Orchard shielded change
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["sprout"], treestate["sprout"])
assert_equal(new_treestate["sapling"], treestate["sapling"])
assert new_treestate["orchard"]["commitments"]["finalRoot"] != treestate["orchard"]["commitments"]["finalRoot"]
assert new_treestate["orchard"]["commitments"]["finalState"] != treestate["orchard"]["commitments"]["finalState"]
assert_equal(len(new_treestate["orchard"]["commitments"]["finalRoot"]), 64)
assert_equal(len(new_treestate["orchard"]["commitments"]["finalState"]), 260)
treestate = new_treestate
# Mine a block with an Orchard shielded sender and transparent recipient and verify the final Orchard root changes (because actions)
taddr2 = self.nodes[0].getnewaddress()
recipients = []
recipients.append({"address": taddr2, "amount": Decimal('2.34')})
myopid = self.nodes[1].z_sendmany(orchardAddr1, recipients, 1, 0, 'AllowRevealedRecipients')
mytxid = wait_and_assert_operationid_status(self.nodes[1], myopid)
self.sync_all()
self.nodes[0].generate(1)
self.sync_all()
assert_equal(len(self.nodes[0].getblock("217")["tx"]), 2)
assert_equal(self.nodes[0].z_getbalance(taddr2), Decimal("2.34"))
assert root is not self.nodes[0].getblock("217")["finalorchardroot"]
# Verify there is a Orchard output description (its commitment was added to tree)
result = self.nodes[0].getrawtransaction(mytxid, 1)
assert_equal(len(result["orchard"]["actions"]), 2) # there is Orchard shielded change
new_treestate = self.nodes[0].z_gettreestate(str(-1))
assert_equal(new_treestate["sprout"], treestate["sprout"])
assert_equal(new_treestate["sapling"], treestate["sapling"])
assert new_treestate["orchard"]["commitments"]["finalRoot"] != treestate["orchard"]["commitments"]["finalRoot"]
assert new_treestate["orchard"]["commitments"]["finalState"] != treestate["orchard"]["commitments"]["finalState"]
assert_equal(len(new_treestate["orchard"]["commitments"]["finalRoot"]), 64)
assert_equal(len(new_treestate["orchard"]["commitments"]["finalState"]), 260)
if __name__ == '__main__':
FinalOrchardRootTest().main()

View File

@ -19,7 +19,7 @@ from decimal import Decimal
SPROUT_TREE_EMPTY_ROOT = "59d2cde5e65c1414c32ba54f0fe4bdb3d67618125286e6a191317917c812c6d7"
SAPLING_TREE_EMPTY_ROOT = "3e49b5f954aa9d3545bc6c37744661eea48d7c34e3000d82b7f0010c30f4c2fb"
ORCHARD_TREE_EMPTY_ROOT = "2fd8e51a03d9bbe2dd809831b1497aeb68a6e37ddf707ced4aa2d8dff13529ae"
ORCHARD_TREE_EMPTY_ROOT = "ae2935f1dfd8a24aed7c70df7de3a668eb7a49b1319880dde2bbd9031ae5d82f"
NULL_FIELD = "0000000000000000000000000000000000000000000000000000000000000000"
# Verify block header field 'hashFinalSaplingRoot' (returned in rpc as 'finalsaplingroot')

View File

@ -0,0 +1,504 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
#
# Test --help
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_true, zcashd_binary
import subprocess
import tempfile
import time
help_message = """
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.
Usage:
zcashd [options] Start Zcash Daemon
Options:
-?
This help message
-alerts
Receive and display P2P network alerts (default: 1)
-alertnotify=<cmd>
Execute command when a relevant alert is received or we see a really
long fork (%s in cmd is replaced by message)
-allowdeprecated=<feature>
Explicitly allow the use of the specified deprecated feature. Multiple
instances of this parameter are permitted; values for <feature> must be
selected from among {"none", "addrtype", "getnewaddress",
"getrawchangeaddress", "legacy_privacy", "wallettxvjoinsplit",
"z_getbalance", "z_getnewaddress", "z_gettotalbalance",
"z_listaddresses", "dumpwallet", "zcrawjoinsplit", "zcrawkeygen",
"zcrawreceive"}
-blocknotify=<cmd>
Execute command when the best block changes (%s in cmd is replaced by
block hash)
-checkblocks=<n>
How many blocks to check at startup (default: 288, 0 = all)
-checklevel=<n>
How thorough the block verification of -checkblocks is (0-4, default: 3)
-conf=<file>
Specify configuration file (default: zcash.conf)
-daemon
Run in the background as a daemon and accept commands
-datadir=<dir>
Specify data directory (this path cannot use '~')
-paramsdir=<dir>
Specify Zcash network parameters directory
-dbcache=<n>
Set database cache size in megabytes (4 to 16384, default: 450)
-debuglogfile=<file>
Specify location of debug log file: this can be an absolute path or a
path relative to the data directory (default: debug.log)
-exportdir=<dir>
Specify directory to be used when exporting data
-ibdskiptxverification
Skip transaction verification during initial block download up to the
last checkpoint height. Incompatible with flags that disable
checkpoints. (default = 0)
-loadblock=<file>
Imports blocks from external blk000??.dat file on startup
-maxorphantx=<n>
Keep at most <n> unconnectable transactions in memory (default: 100)
-par=<n>
Set the number of script verification threads (-8 to 16, 0 = auto, <0 =
leave that many cores free, default: 0)
-pid=<file>
Specify pid file (default: zcashd.pid)
-prune=<n>
Reduce storage requirements by pruning (deleting) old blocks. This mode
disables wallet support and is incompatible with -txindex. Warning:
Reverting this setting requires re-downloading the entire blockchain.
(default: 0 = disable pruning blocks, >550 = target size in MiB to use
for block files)
-reindex-chainstate
Rebuild chain state from the currently indexed blocks (implies -rescan)
-reindex
Rebuild chain state and block index from the blk*.dat files on disk
(implies -rescan)
-sysperms
Create new files with system default permissions, instead of umask 077
(only effective with disabled wallet functionality)
-txexpirynotify=<cmd>
Execute command when transaction expires (%s in cmd is replaced by
transaction id)
-txindex
Maintain a full transaction index, used by the getrawtransaction rpc
call (default: 0)
Connection options:
-addnode=<ip>
Add a node to connect to and attempt to keep the connection open
-banscore=<n>
Threshold for disconnecting misbehaving peers (default: 100)
-bantime=<n>
Number of seconds to keep misbehaving peers from reconnecting (default:
86400)
-bind=<addr>
Bind to given address and always listen on it. Use [host]:port notation
for IPv6
-connect=<ip>
Connect only to the specified node(s); -noconnect or -connect=0 alone to
disable automatic connections
-discover
Discover own IP addresses (default: 1 when listening and no -externalip
or -proxy)
-dns
Allow DNS lookups for -addnode, -seednode and -connect (default: 1)
-dnsseed
Query for peer addresses via DNS lookup, if low on addresses (default: 1
unless -connect/-noconnect)
-externalip=<ip>
Specify your own public address
-forcednsseed
Always query for peer addresses via DNS lookup (default: 0)
-listen
Accept connections from outside (default: 1 if no -proxy or
-connect/-noconnect)
-listenonion
Automatically create Tor hidden service (default: 1)
-maxconnections=<n>
Maintain at most <n> connections to peers (default: 125)
-maxreceivebuffer=<n>
Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)
-maxsendbuffer=<n>
Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)
-mempoolevictionmemoryminutes=<n>
The number of minutes before allowing rejected transactions to re-enter
the mempool. (default: 60)
-mempooltxcostlimit=<n>
An upper bound on the maximum size in bytes of all transactions in the
mempool. (default: 80000000)
-onion=<ip:port>
Use separate SOCKS5 proxy to reach peers via Tor hidden services
(default: -proxy)
-onlynet=<net>
Only connect to nodes in network <net> (ipv4, ipv6 or onion)
-permitbaremultisig
Relay non-P2SH multisig (default: 1)
-peerbloomfilters
Support filtering of blocks and transaction with bloom filters (default:
1)
-port=<port>
Listen for connections on <port> (default: 8233 or testnet: 18233)
-proxy=<ip:port>
Connect through SOCKS5 proxy
-proxyrandomize
Randomize credentials for every proxy connection. This enables Tor
stream isolation (default: 1)
-seednode=<ip>
Connect to a node to retrieve peer addresses, and disconnect
-timeout=<n>
Specify connection timeout in milliseconds (minimum: 1, default: 5000)
-torcontrol=<ip>:<port>
Tor control port to use if onion listening enabled (default:
127.0.0.1:9051)
-torpassword=<pass>
Tor control port password (default: empty)
-whitebind=<addr>
Bind to given address and whitelist peers connecting to it. Use
[host]:port notation for IPv6
-whitelist=<netmask>
Whitelist peers connecting from the given netmask or IP address. Can be
specified multiple times. Whitelisted peers cannot be DoS banned and
their transactions are always relayed, even if they are already in the
mempool, useful e.g. for a gateway
-whitelistrelay
Accept relayed transactions received from whitelisted inbound peers even
when not relaying transactions (default: 1)
-whitelistforcerelay
Force relay of transactions from whitelisted inbound peers even they
violate local relay policy (default: 1)
-maxuploadtarget=<n>
Tries to keep outbound traffic under the given target (in MiB per 24h),
0 = no limit (default: 0)
Wallet options:
-disablewallet
Do not load the wallet and disable wallet RPC calls
-keypool=<n>
Set key pool size to <n> (default: 100)
-migration
Enable the Sprout to Sapling migration
-migrationdestaddress=<zaddr>
Set the Sapling migration address
-mintxfee=<amt>
Fees (in ZEC/kB) smaller than this are considered zero fee for
transaction creation (default: 0.00001)
-orchardactionlimit=<n>
Set the maximum number of Orchard actions permitted in a transaction
(default 50)
-paytxfee=<amt>
Fee (in ZEC/kB) to add to transactions you send (default: 0.00)
-rescan
Rescan the block chain for missing wallet transactions on startup
-salvagewallet
Attempt to recover private keys from a corrupt wallet on startup
(implies -rescan)
-sendfreetransactions
Send transactions as zero-fee transactions if possible (default: 0)
-spendzeroconfchange
Spend unconfirmed change when sending transactions (default: 1)
-txconfirmtarget=<n>
If paytxfee is not set, include enough fee so transactions begin
confirmation on average within n blocks (default: 2)
-txexpirydelta
Set the number of blocks after which a transaction that has not been
mined will become invalid (min: 4, default: 20 (pre-Blossom) or 40
(post-Blossom))
-upgradewallet
Upgrade wallet to latest format on startup
-wallet=<file>
Specify wallet file absolute path or a path relative to the data
directory (default: wallet.dat)
-walletbroadcast
Make the wallet broadcast transactions (default: 1)
-walletnotify=<cmd>
Execute command when a wallet transaction changes (%s in cmd is replaced
by TxID)
-zapwallettxes=<mode>
Delete all wallet transactions and only recover those parts of the
blockchain through -rescan on startup (1 = keep tx meta data e.g.
account owner and payment request information, 2 = drop tx meta data)
-walletrequirebackup=<bool>
By default, the wallet will not allow generation of new spending keys &
addresses from the mnemonic seed until the backup of that seed has been
confirmed with the `zcashd-wallet-tool` utility. A user may start zcashd
with `-walletrequirebackup=false` to allow generation of spending keys
even if the backup has not yet been confirmed.
ZeroMQ notification options:
-zmqpubhashblock=<address>
Enable publish hash block in <address>
-zmqpubhashtx=<address>
Enable publish hash transaction in <address>
-zmqpubrawblock=<address>
Enable publish raw block in <address>
-zmqpubrawtx=<address>
Enable publish raw transaction in <address>
Monitoring options:
-metricsallowip=<ip>
Allow metrics connections from specified source. Valid for <ip> are a
single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0)
or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified
multiple times. (default: only localhost)
-metricsbind=<addr>
Bind to given address to listen for metrics connections. (default: bind
to all interfaces)
-prometheusport=<port>
Expose node metrics in the Prometheus exposition format. An HTTP
listener will be started on <port>, which responds to GET requests on
any request path. Use -metricsallowip and -metricsbind to control
access.
Debugging/Testing options:
-debug=<category>
Output debugging information (default: 0, supplying <category> is
optional). If <category> is not supplied or if <category> = 1, output
all debugging information. <category> can be: addrman, alert, bench,
coindb, db, estimatefee, http, libevent, lock, mempool, mempoolrej, net,
partitioncheck, pow, proxy, prune, rand, receiveunsafe, reindex, rpc,
selectcoins, tor, zmq, zrpc, zrpcunsafe (implies zrpc). For multiple
specific categories use -debug=<category> multiple times.
-experimentalfeatures
Enable use of experimental features
-help-debug
Show all debugging options (usage: --help -help-debug)
-logips
Include IP addresses in debug output (default: 0)
-logtimestamps
Prepend debug output with timestamp (default: 1)
-minrelaytxfee=<amt>
Fees (in ZEC/kB) smaller than this are considered zero fee for relaying,
mining and transaction creation (default: 0.000001)
-maxtxfee=<amt>
Maximum total fees (in ZEC) to use in a single wallet transaction or raw
transaction; setting this too low may abort large transactions (default:
0.10)
-printtoconsole
Send trace/debug info to console instead of the debug log
Chain selection options:
-testnet
Use the test chain
Node relay options:
-datacarrier
Relay and mine data carrier transactions (default: 1)
-datacarriersize
Maximum size of data in data carrier transactions we relay and mine
(default: 83)
Block creation options:
-blockminsize=<n>
Set minimum block size in bytes (default: 0)
-blockmaxsize=<n>
Set maximum block size in bytes (default: 2000000)
-blockprioritysize=<n>
Set maximum size of high-priority/low-fee transactions in bytes
(default: 1000000)
Mining options:
-gen
Generate coins (default: 0)
-genproclimit=<n>
Set the number of threads for coin generation if enabled (-1 = all
cores, default: 1)
-equihashsolver=<name>
Specify the Equihash solver to be used if enabled (default: "default")
-mineraddress=<addr>
Send mined coins to a specific single address
-minetolocalwallet
Require that mined blocks use a coinbase address in the local wallet
(default: 1)
RPC server options:
-server
Accept command line and JSON-RPC commands
-rest
Accept public REST requests (default: 0)
-rpcbind=<addr>
Bind to given address to listen for JSON-RPC connections. Use
[host]:port notation for IPv6. This option can be specified multiple
times (default: bind to all interfaces)
-rpcuser=<user>
Username for JSON-RPC connections
-rpcpassword=<pw>
Password for JSON-RPC connections
-rpcauth=<userpw>
Username and hashed password for JSON-RPC connections. The field
<userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A canonical
python script is included in share/rpcuser. This option can be specified
multiple times
-rpcport=<port>
Listen for JSON-RPC connections on <port> (default: 8232 or testnet:
18232)
-rpcallowip=<ip>
Allow JSON-RPC connections from specified source. Valid for <ip> are a
single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0)
or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified
multiple times
-rpcthreads=<n>
Set the number of threads to service RPC calls (default: 4)
Metrics Options (only if -daemon and -printtoconsole are not set):
-showmetrics
Show metrics on stdout (default: 1 if running in a console, 0 otherwise)
-metricsui
Set to 1 for a persistent metrics screen, 0 for sequential metrics
output (default: 1 if running in a console, 0 otherwise)
-metricsrefreshtime
Number of seconds between metrics refreshes (default: 1 if running in a
console, 600 otherwise)
Compatibility options:
-preferredtxversion
Preferentially create transactions having the specified version when
possible (default: 4)
"""
class ShowHelpTest(BitcoinTestFramework):
def setup_network(self):
self.nodes = []
def show_help(self):
with tempfile.SpooledTemporaryFile(max_size=2**16) as log_stdout:
args = [ zcashd_binary(), "--help" ]
process = subprocess.Popen(args, stdout=log_stdout)
while process.poll() is None:
time.sleep(0.25)
assert_equal(process.returncode, 0)
log_stdout.seek(0)
stdout = log_stdout.read().decode('utf-8')
assert_true(help_message in stdout)
def run_test(self):
self.show_help()
if __name__ == '__main__':
ShowHelpTest().main()

View File

@ -54,6 +54,9 @@ PORT_MIN = 11000
PORT_RANGE = 5000
def zcashd_binary():
return os.getenv("ZCASHD", ZCASHD_BINARY)
class PortSeed:
# Must be initialized with a unique integer for each process
n = None
@ -211,7 +214,7 @@ def wait_for_bitcoind_start(process, url, i):
'''
while True:
if process.poll() is not None:
raise Exception('bitcoind exited with status %i during initialization' % process.returncode)
raise Exception('%s exited with status %i during initialization' % (zcashd_binary(), process.returncode))
try:
rpc = get_rpc_proxy(url, i)
rpc.getblockcount()
@ -257,7 +260,7 @@ def initialize_chain(test_dir, num_nodes, cachedir, cache_behavior='current'):
block_time = int(time.time()) - (200 * PRE_BLOSSOM_BLOCK_TARGET_SPACING)
for i in range(MAX_NODES):
datadir = initialize_datadir(cachedir, i)
args = [ os.getenv("ZCASHD", ZCASHD_BINARY), "-keypool=1", "-datadir="+datadir, "-discover=0" ]
args = [ zcashd_binary(), "-keypool=1", "-datadir="+datadir, "-discover=0" ]
args.extend([
'-nuparams=5ba81b19:1', # Overwinter
'-nuparams=76b809bb:1', # Sapling
@ -267,7 +270,7 @@ def initialize_chain(test_dir, num_nodes, cachedir, cache_behavior='current'):
args.append("-connect=127.0.0.1:"+str(p2p_port(0)))
bitcoind_processes[i] = subprocess.Popen(args)
if os.getenv("PYTHON_DEBUG", ""):
print("initialize_chain: bitcoind started, waiting for RPC to come up")
print("initialize_chain: %s started, waiting for RPC to come up" % (zcashd_binary(),))
wait_for_bitcoind_start(bitcoind_processes[i], rpc_url(i), i)
if os.getenv("PYTHON_DEBUG", ""):
print("initialize_chain: RPC successfully started")
@ -403,7 +406,7 @@ def start_node(i, dirname, extra_args=None, rpchost=None, timewait=None, binary=
"""
datadir = os.path.join(dirname, "node"+str(i))
if binary is None:
binary = os.getenv("ZCASHD", ZCASHD_BINARY)
binary = zcashd_binary()
args = [ binary, "-datadir="+datadir, "-keypool=1", "-discover=0", "-rest" ]
args.extend([
'-nuparams=5ba81b19:1', # Overwinter
@ -430,7 +433,7 @@ def assert_start_raises_init_error(i, dirname, extra_args=None, expected_msg=Non
node = start_node(i, dirname, extra_args, stderr=log_stderr)
stop_node(node, i)
except Exception as e:
assert 'bitcoind exited' in str(e) #node must have shutdown
assert ("%s exited" % (zcashd_binary(),)) in str(e) #node must have shutdown
if expected_msg is not None:
log_stderr.seek(0)
stderr = log_stderr.read().decode('utf-8')
@ -438,9 +441,9 @@ def assert_start_raises_init_error(i, dirname, extra_args=None, expected_msg=Non
raise AssertionError("Expected error \"" + expected_msg + "\" not found in:\n" + stderr)
else:
if expected_msg is None:
assert_msg = "bitcoind should have exited with an error"
assert_msg = "%s should have exited with an error" % (zcashd_binary(),)
else:
assert_msg = "bitcoind should have exited with expected error " + expected_msg
assert_msg = "%s should have exited with expected error %s" % (zcashd_binary(), expected_msg)
raise AssertionError(assert_msg)
def start_nodes(num_nodes, dirname, extra_args=None, rpchost=None, binary=None):

View File

@ -91,7 +91,7 @@ def sapling_spends_noncompact_digest(saplingBundle):
digest = blake2b(digest_size=32, person=b'ZTxIdSSpendNHash')
for desc in saplingBundle.spends:
digest.update(ser_uint256(desc.cv))
digest.update(ser_uint256(desc.anchor))
digest.update(ser_uint256(saplingBundle.anchor))
digest.update(ser_uint256(desc.rk))
return digest.digest()

View File

@ -7,27 +7,150 @@ description = "The cryptographic code in this crate has been reviewed for correc
[criteria.license-reviewed]
description = "The license of this crate has been reviewed for compatibility with its usage in this repository. If the crate is not available under the MIT license, `contrib/debian/copyright` has been updated with a corresponding copyright notice for files under `depends/*/vendored-sources/CRATE_NAME`."
[[audits.aead]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "0.4.3 -> 0.5.1"
notes = "Adds an AeadCore::generate_nonce function to generate random nonces, given a CryptoRng."
[[audits.anyhow]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.56 -> 1.0.61"
notes = "Update does not introduce new code. Minor build script changes look fine."
[[audits.anyhow]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.61 -> 1.0.65"
notes = "Build script changes just alter what it is probing for; no difference in side effects."
[[audits.bellman]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
delta = "0.13.0 -> 0.13.1"
notes = "Adds multi-threaded batch validation, which I checked against the existing single-threaded batch validation."
[[audits.chacha20]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
delta = "0.8.1 -> 0.8.2"
notes = "Unpins zeroize."
[[audits.chacha20]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "0.8.2 -> 0.9.0"
[[audits.chacha20poly1305]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
delta = "0.9.0 -> 0.9.1"
notes = "Unpins zeroize."
[[audits.chacha20poly1305]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "0.9.1 -> 0.10.1"
notes = "This mainly adapts to API changes between aead 0.4 and aead 0.5."
[[audits.cipher]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "0.3.0 -> 0.4.3"
notes = "Significant rework of (mainly RustCrypto-internal) APIs."
[[audits.clearscreen]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.9 -> 1.0.10"
notes = "Bumps nix and removes some of its default features."
[[audits.cpufeatures]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.2.2 -> 0.2.5"
notes = "Unsafe changes just introduce `#[inline(never)]` wrappers."
[[audits.crypto-common]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
delta = "0.1.3 -> 0.1.6"
notes = "New trait and type alias look fine."
[[audits.cxx]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "1.0.68 -> 1.0.72"
[[audits.cxx]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.72 -> 1.0.76"
notes = "Impls Unpin for SharedPtr and UniquePtr. The rationale makes sense."
[[audits.cxx]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.76 -> 1.0.78"
[[audits.cxx]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "1.0.78 -> 1.0.79"
notes = """
This release changes the result of the `cxxbridge` `exception` call to return
a struct containing both the pointer to an error message and its length,
instead of just the raw `*const u8`.
"""
[[audits.cxxbridge-flags]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "1.0.68 -> 1.0.72"
[[audits.cxxbridge-flags]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.72 -> 1.0.76"
[[audits.cxxbridge-flags]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.76 -> 1.0.78"
[[audits.cxxbridge-flags]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "1.0.78 -> 1.0.79"
notes = "This is exclusively an update to the `cxxbridge` dependency version."
[[audits.cxxbridge-macro]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "1.0.68 -> 1.0.72"
[[audits.cxxbridge-macro]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.72 -> 1.0.76"
[[audits.cxxbridge-macro]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.76 -> 1.0.78"
[[audits.cxxbridge-macro]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "1.0.78 -> 1.0.79"
[[audits.cxxbridge-macro]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "1.0.78 -> 1.0.79"
notes = "This is exclusively an update to the `cxxbridge` dependency version."
[[audits.equihash]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -46,6 +169,20 @@ criteria = ["crypto-reviewed", "safe-to-deploy"]
version = "0.1.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.getrandom]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.2.6 -> 0.2.7"
notes = """
Checked that getrandom::wasi::getrandom_inner matches wasi::random_get.
Checked that getrandom::util_libc::Weak lock ordering matches std::sys::unix::weak::DlsymWeak.
"""
[[audits.group]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.12.0 -> 0.12.1"
[[audits.halo2_gadgets]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
@ -70,6 +207,98 @@ criteria = ["crypto-reviewed", "safe-to-deploy"]
delta = "0.1.0 -> 0.2.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.indexmap]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.8.1 -> 1.9.1"
notes = "I'm satisfied that the assertion guarding the new unsafe block is correct."
[[audits.inout]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
version = "0.1.3"
notes = "Reviewed in full."
[[audits.itoa]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.1 -> 1.0.3"
notes = "Update makes no changes to code."
[[audits.libm]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.2.2 -> 0.2.5"
[[audits.link-cplusplus]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.6 -> 1.0.7"
[[audits.lock_api]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.4.7 -> 0.4.9"
notes = "The unsafe changes fix soundness bugs. The unsafe additions in the new ArcMutexGuard::into_arc method seem fine, but it should probably have used ManuallyDrop instead of mem::forget."
[[audits.log]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.4.16 -> 0.4.17"
notes = "I confirmed that the unsafe transmutes are fine; NonZeroU128 and NonZeroI128 are `#[repr(transparent)]` wrappers around u128 and i128 respectively."
[[audits.memuse]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.2.0 -> 0.2.1"
notes = "Exposes an existing macro. Note that I am the author of the crate."
[[audits.metrics]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.19.0 -> 0.20.1"
[[audits.metrics-exporter-prometheus]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.10.0 -> 0.11.0"
[[audits.metrics-macros]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.5.1 -> 0.6.0"
[[audits.metrics-util]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.13.0 -> 0.14.0"
[[audits.mio]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.8.2 -> 0.8.4"
notes = """
Migrates from winapi to windows-sys. The changes to API usage look reasonable
based on what I've seen in other uses of the windows-sys crate. Unsafe code
falls into two categories:
- Usage of `mem::zeroed()`, which doesn't look obviously wrong. The
`..unsafe { mem::zeroed() }` in `sys::unix::selector::kqueue` looks weird
but AFAICT is saying \"take any unspecified fields from an instance of this
struct that has been zero-initialized\", which is fine for integer fields. It
would be nice if there was documentation to this effect (explaining why this
is done instead of `..Default::default()`).
- Calls to Windows API methods. These are either pre-existing (and altered for
the differences in the crate abstractions), or newly added in logic that
appears to be copied from miow 0.3.6 (I scanned this by eye and didn't see
any noteworthy changes other than handling windows-sys API differences).
"""
[[audits.num-integer]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.1.44 -> 0.1.45"
notes = "Fixes some argument-handling panic bugs."
[[audits.orchard]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
@ -82,33 +311,183 @@ criteria = ["crypto-reviewed", "safe-to-deploy"]
delta = "0.1.0 -> 0.2.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.orchard]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.2.0 -> 0.3.0"
[[audits.parking_lot]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.11.2 -> 0.12.1"
notes = "Most `unsafe {}` changes were to reduce the scope of the unsafe blocks. I didn't closely review the migration to the asm! macro but it looks reasonable."
[[audits.parking_lot_core]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.8.5 -> 0.9.3"
[[audits.poly1305]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "0.7.2 -> 0.8.0"
notes = "Changes to unsafe (avx2) code look reasonable."
[[audits.proc-macro2]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "1.0.37 -> 1.0.41"
[[audits.quanta]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.9.3 -> 0.10.1"
[[audits.serde]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.136 -> 1.0.143"
notes = "Bumps serde-derive and adds some constructors."
[[audits.serde]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.143 -> 1.0.145"
[[audits.serde_derive]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.136 -> 1.0.143"
notes = "Bumps syn, inverts some build flags."
[[audits.serde_derive]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.143 -> 1.0.145"
[[audits.sketches-ddsketch]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "0.1.3 -> 0.2.0"
notes = "I did not review the refactor, but there are no unsafe blocks and I didn't see any obvious changes that could result in panics."
[[audits.syn]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "1.0.91 -> 1.0.98"
[[audits.thiserror]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.30 -> 1.0.32"
notes = "Bumps thiserror-impl, no code changes."
[[audits.thiserror]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.32 -> 1.0.37"
notes = "The new build script invokes rustc to determine whether it supports the Provider API. The only side-effect is it overwrites `$OUT_DIR/probe.rs`, which is fine because it is unique to the thiserror package."
[[audits.thiserror-impl]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.30 -> 1.0.32"
notes = "Only change is to refine an error message."
[[audits.thiserror-impl]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
delta = "1.0.32 -> 1.0.37"
notes = "Proc macro changes migrating to the Provider API look fine."
[[audits.unicode-ident]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
version = "1.0.2"
[[audits.universal-hash]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "0.4.1 -> 0.5.0"
notes = "I checked correctness of to_blocks which uses unsafe code in a safe function."
[[audits.windows_aarch64_msvc]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-run"
version = "0.36.1"
notes = """
Adds a binary blob to the library search path, that contains a subset of
the Windows SDK to avoid a direct dependency on the latter. See
https://github.com/microsoft/windows-rs/pull/1217 for context. I did not
audit the binary blob, but the build script looks fine.
"""
[[audits.windows_i686_gnu]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-run"
version = "0.36.1"
notes = """
Adds a binary blob to the library search path, that contains a subset of
the Windows SDK to avoid a direct dependency on the latter. See
https://github.com/microsoft/windows-rs/pull/1217 for context. I did not
audit the binary blob, but the build script looks fine.
"""
[[audits.windows_i686_msvc]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-run"
version = "0.36.1"
notes = """
Adds a binary blob to the library search path, that contains a subset of
the Windows SDK to avoid a direct dependency on the latter. See
https://github.com/microsoft/windows-rs/pull/1217 for context. I did not
audit the binary blob, but the build script looks fine.
"""
[[audits.windows_x86_64_gnu]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-run"
version = "0.36.1"
notes = """
Adds a binary blob to the library search path, that contains a subset of
the Windows SDK to avoid a direct dependency on the latter. See
https://github.com/microsoft/windows-rs/pull/1217 for context. I did not
audit the binary blob, but the build script looks fine.
"""
[[audits.windows_x86_64_msvc]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-run"
version = "0.36.1"
notes = """
Adds a binary blob to the library search path, that contains a subset of
the Windows SDK to avoid a direct dependency on the latter. See
https://github.com/microsoft/windows-rs/pull/1217 for context. I did not
audit the binary blob, but the build script looks fine.
"""
[[audits.zcash_address]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
version = "0.1.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_address]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.1.0 -> 0.2.0"
[[audits.zcash_encoding]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
version = "0.1.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_encoding]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.1.0 -> 0.2.0"
[[audits.zcash_history]]
who = "Jack Grigg <jack@z.cash>"
criteria = "safe-to-deploy"
@ -121,6 +500,11 @@ criteria = ["crypto-reviewed", "safe-to-deploy"]
version = "0.1.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_note_encryption]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.1.0 -> 0.2.0"
[[audits.zcash_primitives]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
@ -133,6 +517,11 @@ criteria = ["crypto-reviewed", "safe-to-deploy"]
delta = "0.6.0 -> 0.7.0"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_primitives]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.7.0 -> 0.8.1"
[[audits.zcash_proofs]]
who = "Jack Grigg <jack@z.cash>"
criteria = ["crypto-reviewed", "safe-to-deploy"]
@ -151,3 +540,14 @@ criteria = ["crypto-reviewed", "safe-to-deploy"]
delta = "0.7.0 -> 0.7.1"
notes = "The ECC core team maintains this crate, and we have reviewed every line."
[[audits.zcash_proofs]]
who = "Kris Nuttycombe <kris@nutty.land>"
criteria = "safe-to-deploy"
delta = "0.7.1 -> 0.8.0"
[[audits.zeroize]]
who = "Daira Hopwood <daira@jacaranda.org>"
criteria = "safe-to-deploy"
delta = "1.4.3 -> 1.5.7"
notes = "The zeroize_c_string unit test has UB, but that's very unlikely to cause a problem in practice."

View File

@ -1,6 +1,36 @@
# cargo-vet config file
[policy.equihash]
audit-as-crates-io = true
[policy.f4jumble]
audit-as-crates-io = true
[policy.group]
audit-as-crates-io = true
[policy.orchard]
audit-as-crates-io = true
[policy.zcash_address]
audit-as-crates-io = true
[policy.zcash_encoding]
audit-as-crates-io = true
[policy.zcash_history]
audit-as-crates-io = true
[policy.zcash_note_encryption]
audit-as-crates-io = true
[policy.zcash_primitives]
audit-as-crates-io = true
[policy.zcash_proofs]
audit-as-crates-io = true
[[exemptions.addr2line]]
version = "0.17.0"
criteria = "safe-to-deploy"
@ -21,10 +51,6 @@ criteria = "safe-to-deploy"
version = "0.7.6"
criteria = "safe-to-deploy"
[[exemptions.ansi_term]]
version = "0.12.1"
criteria = "safe-to-deploy"
[[exemptions.anyhow]]
version = "1.0.56"
criteria = "safe-to-deploy"
@ -37,16 +63,12 @@ criteria = "safe-to-deploy"
version = "0.7.2"
criteria = "safe-to-deploy"
[[exemptions.atomic-shim]]
version = "0.2.0"
criteria = "safe-to-deploy"
[[exemptions.autocfg]]
version = "1.1.0"
criteria = "safe-to-deploy"
[[exemptions.backtrace]]
version = "0.3.64"
version = "0.3.66"
criteria = "safe-to-deploy"
[[exemptions.base64ct]]
@ -70,7 +92,7 @@ version = "1.3.2"
criteria = "safe-to-deploy"
[[exemptions.bitvec]]
version = "1.0.0"
version = "1.0.1"
criteria = "safe-to-deploy"
[[exemptions.blake2b_simd]]
@ -86,7 +108,7 @@ version = "0.9.0"
criteria = "safe-to-deploy"
[[exemptions.block-buffer]]
version = "0.10.2"
version = "0.10.3"
criteria = "safe-to-deploy"
[[exemptions.block-modes]]
@ -106,7 +128,7 @@ version = "0.4.0"
criteria = "safe-to-deploy"
[[exemptions.bumpalo]]
version = "3.8.0"
version = "3.11.0"
criteria = "safe-to-deploy"
[[exemptions.byte-slice-cast]]
@ -118,7 +140,7 @@ version = "1.4.3"
criteria = "safe-to-deploy"
[[exemptions.bytes]]
version = "1.1.0"
version = "1.2.1"
criteria = "safe-to-deploy"
[[exemptions.cc]]
@ -158,19 +180,19 @@ version = "0.2.2"
criteria = "safe-to-deploy"
[[exemptions.crossbeam-channel]]
version = "0.5.4"
version = "0.5.6"
criteria = "safe-to-deploy"
[[exemptions.crossbeam-deque]]
version = "0.8.1"
version = "0.8.2"
criteria = "safe-to-deploy"
[[exemptions.crossbeam-epoch]]
version = "0.9.8"
version = "0.9.11"
criteria = "safe-to-deploy"
[[exemptions.crossbeam-utils]]
version = "0.8.8"
version = "0.8.12"
criteria = "safe-to-deploy"
[[exemptions.crunchy]]
@ -206,7 +228,7 @@ version = "0.9.0"
criteria = "safe-to-deploy"
[[exemptions.digest]]
version = "0.10.3"
version = "0.10.5"
criteria = "safe-to-deploy"
[[exemptions.directories]]
@ -226,7 +248,7 @@ version = "3.0.0"
criteria = "safe-to-deploy"
[[exemptions.either]]
version = "1.6.1"
version = "1.8.0"
criteria = "safe-to-deploy"
[[exemptions.ff]]
@ -250,23 +272,23 @@ version = "2.0.0"
criteria = "safe-to-deploy"
[[exemptions.futures-channel]]
version = "0.3.21"
version = "0.3.24"
criteria = "safe-to-deploy"
[[exemptions.futures-core]]
version = "0.3.21"
version = "0.3.24"
criteria = "safe-to-deploy"
[[exemptions.futures-task]]
version = "0.3.21"
version = "0.3.24"
criteria = "safe-to-deploy"
[[exemptions.futures-util]]
version = "0.3.21"
version = "0.3.24"
criteria = "safe-to-deploy"
[[exemptions.generic-array]]
version = "0.14.5"
version = "0.14.6"
criteria = "safe-to-deploy"
[[exemptions.getrandom]]
@ -278,7 +300,7 @@ version = "0.2.6"
criteria = "safe-to-deploy"
[[exemptions.gimli]]
version = "0.26.1"
version = "0.26.2"
criteria = "safe-to-deploy"
[[exemptions.group]]
@ -294,7 +316,7 @@ version = "0.8.1"
criteria = "safe-to-deploy"
[[exemptions.hashbrown]]
version = "0.11.2"
version = "0.12.3"
criteria = "safe-to-deploy"
[[exemptions.hdwallet]]
@ -314,15 +336,15 @@ version = "0.11.0"
criteria = "safe-to-deploy"
[[exemptions.http]]
version = "0.2.6"
version = "0.2.8"
criteria = "safe-to-deploy"
[[exemptions.http-body]]
version = "0.4.4"
version = "0.4.5"
criteria = "safe-to-deploy"
[[exemptions.httparse]]
version = "1.6.0"
version = "1.8.0"
criteria = "safe-to-deploy"
[[exemptions.httpdate]]
@ -330,7 +352,7 @@ version = "1.0.2"
criteria = "safe-to-deploy"
[[exemptions.hyper]]
version = "0.14.18"
version = "0.14.20"
criteria = "safe-to-deploy"
[[exemptions.impl-codec]]
@ -349,20 +371,16 @@ criteria = "safe-to-deploy"
version = "1.8.1"
criteria = "safe-to-deploy"
[[exemptions.instant]]
version = "0.1.12"
criteria = "safe-to-deploy"
[[exemptions.ipnet]]
version = "2.4.0"
version = "2.5.0"
criteria = "safe-to-deploy"
[[exemptions.itoa]]
version = "1.0.1"
version = "1.0.4"
criteria = "safe-to-deploy"
[[exemptions.js-sys]]
version = "0.3.57"
version = "0.3.60"
criteria = "safe-to-deploy"
[[exemptions.jubjub]]
@ -374,7 +392,7 @@ version = "1.4.0"
criteria = "safe-to-deploy"
[[exemptions.libc]]
version = "0.2.122"
version = "0.2.135"
criteria = "safe-to-deploy"
[[exemptions.libm]]
@ -402,7 +420,7 @@ version = "0.1.0"
criteria = "safe-to-deploy"
[[exemptions.memchr]]
version = "2.4.1"
version = "2.5.0"
criteria = "safe-to-deploy"
[[exemptions.memoffset]]
@ -430,19 +448,15 @@ version = "0.13.0"
criteria = "safe-to-deploy"
[[exemptions.miniz_oxide]]
version = "0.4.4"
version = "0.5.4"
criteria = "safe-to-deploy"
[[exemptions.mio]]
version = "0.8.2"
criteria = "safe-to-deploy"
[[exemptions.miow]]
version = "0.3.7"
criteria = "safe-to-deploy"
[[exemptions.nix]]
version = "0.22.3"
version = "0.24.2"
criteria = "safe-to-deploy"
[[exemptions.nom]]
@ -453,8 +467,8 @@ criteria = "safe-to-deploy"
version = "0.7.0"
criteria = "safe-to-deploy"
[[exemptions.ntapi]]
version = "0.3.7"
[[exemptions.nu-ansi-term]]
version = "0.46.0"
criteria = "safe-to-deploy"
[[exemptions.num-bigint]]
@ -466,7 +480,7 @@ version = "0.1.44"
criteria = "safe-to-deploy"
[[exemptions.num-traits]]
version = "0.2.14"
version = "0.2.15"
criteria = "safe-to-deploy"
[[exemptions.num_cpus]]
@ -474,31 +488,35 @@ version = "1.13.1"
criteria = "safe-to-deploy"
[[exemptions.num_threads]]
version = "0.1.5"
version = "0.1.6"
criteria = "safe-to-deploy"
[[exemptions.object]]
version = "0.27.1"
version = "0.29.0"
criteria = "safe-to-deploy"
[[exemptions.once_cell]]
version = "1.10.0"
version = "1.15.0"
criteria = "safe-to-deploy"
[[exemptions.opaque-debug]]
version = "0.3.0"
criteria = "safe-to-deploy"
[[exemptions.overload]]
version = "0.1.1"
criteria = "safe-to-deploy"
[[exemptions.pairing]]
version = "0.22.0"
criteria = "safe-to-deploy"
[[exemptions.parity-scale-codec]]
version = "3.1.2"
version = "3.2.1"
criteria = "safe-to-deploy"
[[exemptions.parity-scale-codec-derive]]
version = "3.1.2"
version = "3.1.3"
criteria = "safe-to-deploy"
[[exemptions.parking_lot]]
@ -538,7 +556,7 @@ version = "0.8.0"
criteria = "safe-to-deploy"
[[exemptions.pin-project-lite]]
version = "0.2.8"
version = "0.2.9"
criteria = "safe-to-deploy"
[[exemptions.pin-utils]]
@ -549,6 +567,10 @@ criteria = "safe-to-deploy"
version = "0.7.2"
criteria = "safe-to-deploy"
[[exemptions.portable-atomic]]
version = "0.3.15"
criteria = "safe-to-deploy"
[[exemptions.ppv-lite86]]
version = "0.2.16"
criteria = "safe-to-deploy"
@ -558,11 +580,11 @@ version = "0.11.1"
criteria = "safe-to-deploy"
[[exemptions.proc-macro-crate]]
version = "1.1.3"
version = "1.2.1"
criteria = "safe-to-deploy"
[[exemptions.proc-macro2]]
version = "1.0.37"
version = "1.0.46"
criteria = "safe-to-deploy"
[[exemptions.quanta]]
@ -570,7 +592,7 @@ version = "0.9.3"
criteria = "safe-to-deploy"
[[exemptions.quote]]
version = "1.0.17"
version = "1.0.21"
criteria = "safe-to-deploy"
[[exemptions.radium]]
@ -598,7 +620,7 @@ version = "0.5.1"
criteria = "safe-to-deploy"
[[exemptions.rand_core]]
version = "0.6.3"
version = "0.6.4"
criteria = "safe-to-deploy"
[[exemptions.rand_hc]]
@ -610,15 +632,15 @@ version = "0.2.1"
criteria = "safe-to-deploy"
[[exemptions.raw-cpuid]]
version = "10.3.0"
version = "10.6.0"
criteria = "safe-to-deploy"
[[exemptions.rayon]]
version = "1.5.1"
version = "1.5.3"
criteria = "safe-to-deploy"
[[exemptions.rayon-core]]
version = "1.9.1"
version = "1.9.3"
criteria = "safe-to-deploy"
[[exemptions.reddsa]]
@ -630,7 +652,7 @@ version = "0.5.0"
criteria = "safe-to-deploy"
[[exemptions.redox_syscall]]
version = "0.2.13"
version = "0.2.16"
criteria = "safe-to-deploy"
[[exemptions.redox_users]]
@ -638,7 +660,7 @@ version = "0.4.3"
criteria = "safe-to-deploy"
[[exemptions.regex]]
version = "1.5.5"
version = "1.6.0"
criteria = "safe-to-deploy"
[[exemptions.regex-automata]]
@ -646,7 +668,7 @@ version = "0.1.10"
criteria = "safe-to-deploy"
[[exemptions.regex-syntax]]
version = "0.6.25"
version = "0.6.27"
criteria = "safe-to-deploy"
[[exemptions.ring]]
@ -654,7 +676,7 @@ version = "0.16.20"
criteria = "safe-to-deploy"
[[exemptions.ripemd]]
version = "0.1.1"
version = "0.1.3"
criteria = "safe-to-deploy"
[[exemptions.rustc-demangle]]
@ -665,6 +687,10 @@ criteria = "safe-to-deploy"
version = "2.1.0"
criteria = "safe-to-deploy"
[[exemptions.ryu]]
version = "1.0.11"
criteria = "safe-to-deploy"
[[exemptions.scopeguard]]
version = "1.1.0"
criteria = "safe-to-deploy"
@ -689,6 +715,10 @@ criteria = "safe-to-deploy"
version = "1.0.136"
criteria = "safe-to-deploy"
[[exemptions.serde_json]]
version = "1.0.86"
criteria = "safe-to-deploy"
[[exemptions.sha2]]
version = "0.9.9"
criteria = "safe-to-deploy"
@ -706,11 +736,11 @@ version = "0.1.3"
criteria = "safe-to-deploy"
[[exemptions.smallvec]]
version = "1.8.0"
version = "1.10.0"
criteria = "safe-to-deploy"
[[exemptions.socket2]]
version = "0.4.4"
version = "0.4.7"
criteria = "safe-to-deploy"
[[exemptions.spin]]
@ -726,7 +756,7 @@ version = "2.4.1"
criteria = "safe-to-deploy"
[[exemptions.syn]]
version = "1.0.91"
version = "1.0.102"
criteria = "safe-to-deploy"
[[exemptions.synstructure]]
@ -754,7 +784,7 @@ version = "1.1.4"
criteria = "safe-to-deploy"
[[exemptions.time]]
version = "0.3.9"
version = "0.3.15"
criteria = "safe-to-deploy"
[[exemptions.time-macros]]
@ -762,7 +792,7 @@ version = "0.2.4"
criteria = "safe-to-deploy"
[[exemptions.tinyvec]]
version = "1.5.1"
version = "1.6.0"
criteria = "safe-to-deploy"
[[exemptions.tinyvec_macros]]
@ -770,7 +800,7 @@ version = "0.1.0"
criteria = "safe-to-deploy"
[[exemptions.tokio]]
version = "1.17.0"
version = "1.21.2"
criteria = "safe-to-deploy"
[[exemptions.toml]]
@ -778,11 +808,11 @@ version = "0.5.9"
criteria = "safe-to-deploy"
[[exemptions.tower-service]]
version = "0.3.1"
version = "0.3.2"
criteria = "safe-to-deploy"
[[exemptions.tracing]]
version = "0.1.32"
version = "0.1.37"
criteria = "safe-to-deploy"
[[exemptions.tracing-appender]]
@ -790,15 +820,15 @@ version = "0.2.2"
criteria = "safe-to-deploy"
[[exemptions.tracing-attributes]]
version = "0.1.20"
version = "0.1.23"
criteria = "safe-to-deploy"
[[exemptions.tracing-core]]
version = "0.1.24"
version = "0.1.30"
criteria = "safe-to-deploy"
[[exemptions.tracing-subscriber]]
version = "0.3.10"
version = "0.3.16"
criteria = "safe-to-deploy"
[[exemptions.try-lock]]
@ -810,15 +840,19 @@ version = "1.15.0"
criteria = "safe-to-deploy"
[[exemptions.uint]]
version = "0.9.3"
version = "0.9.4"
criteria = "safe-to-deploy"
[[exemptions.unicode-ident]]
version = "1.0.5"
criteria = "safe-to-deploy"
[[exemptions.unicode-normalization]]
version = "0.1.19"
version = "0.1.22"
criteria = "safe-to-deploy"
[[exemptions.unicode-xid]]
version = "0.2.2"
version = "0.2.4"
criteria = "safe-to-deploy"
[[exemptions.universal-hash]]
@ -854,31 +888,31 @@ version = "0.11.0+wasi-snapshot-preview1"
criteria = "safe-to-deploy"
[[exemptions.wasm-bindgen]]
version = "0.2.80"
version = "0.2.83"
criteria = "safe-to-deploy"
[[exemptions.wasm-bindgen-backend]]
version = "0.2.80"
version = "0.2.83"
criteria = "safe-to-deploy"
[[exemptions.wasm-bindgen-macro]]
version = "0.2.80"
version = "0.2.83"
criteria = "safe-to-deploy"
[[exemptions.wasm-bindgen-macro-support]]
version = "0.2.80"
version = "0.2.83"
criteria = "safe-to-deploy"
[[exemptions.wasm-bindgen-shared]]
version = "0.2.80"
version = "0.2.83"
criteria = "safe-to-deploy"
[[exemptions.web-sys]]
version = "0.3.57"
version = "0.3.60"
criteria = "safe-to-deploy"
[[exemptions.which]]
version = "4.2.5"
version = "4.3.0"
criteria = "safe-to-deploy"
[[exemptions.winapi]]
@ -893,6 +927,17 @@ criteria = "safe-to-deploy"
version = "0.4.0"
criteria = "safe-to-deploy"
[[exemptions.windows-sys]]
version = "0.36.1"
criteria = "safe-to-deploy"
[exemptions.windows-sys.dependency-criteria]
windows_aarch64_msvc = "safe-to-run"
windows_i686_gnu = "safe-to-run"
windows_i686_msvc = "safe-to-run"
windows_x86_64_gnu = "safe-to-run"
windows_x86_64_msvc = "safe-to-run"
[[exemptions.wyz]]
version = "0.5.0"
criteria = "safe-to-deploy"

View File

@ -5,44 +5,37 @@
#
# Ccache 4.0 requires adding CMake to the depends system.
native_ccache 4.0 2022-09-01
native_ccache 4.1 2022-09-01
native_ccache 4.2 2022-09-01
native_ccache 4.2.1 2022-09-01
native_ccache 4.3 2022-09-01
native_ccache 4.4 2022-09-01
native_ccache 4.4.1 2022-09-01
native_ccache 4.4.2 2022-09-01
native_ccache 4.5 2022-09-01
native_ccache 4.5.1 2022-09-01
native_ccache 4.6 2022-09-01
native_ccache 4.6.1 2022-09-01
native_ccache 4.0 2022-11-01
native_ccache 4.1 2022-11-01
native_ccache 4.2 2022-11-01
native_ccache 4.2.1 2022-11-01
native_ccache 4.3 2022-11-01
native_ccache 4.4 2022-11-01
native_ccache 4.4.1 2022-11-01
native_ccache 4.4.2 2022-11-01
native_ccache 4.5 2022-11-01
native_ccache 4.5.1 2022-11-01
native_ccache 4.6 2022-11-01
native_ccache 4.6.1 2022-11-01
native_ccache 4.6.2 2022-11-01
native_ccache 4.6.3 2022-11-01
native_ccache 4.7 2022-11-01
# Clang and Rust are currently pinned to LLVM 13
native_clang 14.0.0 2022-09-01
native_clang 14.0.1 2022-09-01
native_clang 14.0.2 2022-09-01
native_clang 14.0.3 2022-09-01
native_clang 14.0.4 2022-09-01
native_clang 14.0.5 2022-09-01
native_clang 14.0.6 2022-09-01
libcxx 14.0.0 2022-09-01
libcxx 14.0.1 2022-09-01
libcxx 14.0.2 2022-09-01
libcxx 14.0.3 2022-09-01
libcxx 14.0.4 2022-09-01
libcxx 14.0.5 2022-09-01
libcxx 14.0.6 2022-09-01
native_rust 1.60.0 2022-09-01
native_rust 1.61.0 2022-09-01
native_rust 1.62.0 2022-09-01
native_rust 1.62.1 2022-09-01
# Clang and Rust are currently pinned to LLVM 14
libcxx 15.0.0 2022-11-01
libcxx 15.0.1 2022-11-01
libcxx 15.0.2 2022-11-01
libcxx 15.0.3 2022-11-01
native_clang 15.0.0 2022-11-01
native_clang 15.0.1 2022-11-01
native_clang 15.0.2 2022-11-01
native_clang 15.0.3 2022-11-01
# We're never updating to this version
bdb 18.1.40 2024-02-01
# Google Test 1.10.0 requires adding CMake to the depends system.
googletest 1.10.0 2022-09-01
googletest 1.11.0 2022-09-01
googletest 1.12.0 2022-09-01
googletest 1.12.1 2022-09-01
googletest 1.10.0 2022-11-01
googletest 1.11.0 2022-11-01
googletest 1.12.0 2022-11-01
googletest 1.12.1 2022-11-01

View File

@ -411,8 +411,8 @@ def main():
print("""
You should also check the Rust dependencies using cargo:
cargo install cargo-outdated cargo-audit
cargo outdated
cargo install cargo-upgrades cargo-audit
cargo upgrades
cargo audit
""")
if status == 0:

View File

@ -1 +0,0 @@
1.59.0

View File

@ -0,0 +1,2 @@
[toolchain]
channel = "1.64.0"

View File

@ -20,10 +20,13 @@ else
exit 1
fi
git_check_in_repo() {
! { git status --porcelain -uall --ignored "$@" 2>/dev/null || echo '??'; } | grep -q '?'
}
DESC=""
SUFFIX=""
LAST_COMMIT_DATE=""
if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" ] && [ -e "$(command -v git)" ] && [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] && git_check_in_repo share/genbuild.sh; then
# clean 'dirty' status of touched files that haven't been modified
git diff >/dev/null 2>/dev/null
@ -36,9 +39,6 @@ if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/
# otherwise generate suffix from git, i.e. string like "59887e8-dirty"
SUFFIX=$(git rev-parse --short HEAD)
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
# get a string like "2012-04-10 16:27:19 +0200"
LAST_COMMIT_DATE="$(git log -n 1 --format="%ci")"
fi
if [ -n "$DESC" ]; then
@ -52,7 +52,4 @@ fi
# only update build.h if necessary
if [ "$INFO" != "$NEWINFO" ]; then
echo "$NEWINFO" >"$FILE"
if [ -n "$LAST_COMMIT_DATE" ]; then
echo "#define BUILD_DATE \"$LAST_COMMIT_DATE\"" >> "$FILE"
fi
fi

View File

@ -33,6 +33,9 @@ LIBSECP256K1=secp256k1/libsecp256k1.la
LIBUNIVALUE=univalue/libunivalue.la
LIBZCASH=libzcash.a
INSPECT_TOOL_BIN=zcash-inspect$(EXEEXT)
INSPECT_TOOL_BUILD=$(top_builddir)/target/$(RUST_TARGET)/release/zcash-inspect$(EXEEXT)
WALLET_TOOL_BIN=zcashd-wallet-tool$(EXEEXT)
WALLET_TOOL_BUILD=$(top_builddir)/target/$(RUST_TARGET)/release/zcashd-wallet-tool$(EXEEXT)
@ -90,7 +93,7 @@ $(CXXBRIDGE_H) $(CXXBRIDGE_CPP): $(CXXBRIDGE_RS)
# requires https://github.com/rust-bitcoin/rust-secp256k1/issues/380 to be addressed.
RUST_ENV_VARS = \
RUSTC="$(RUSTC)" \
RUSTFLAGS="--cfg=rust_secp_no_symbol_renaming" \
RUSTFLAGS="--cfg=rust_secp_no_symbol_renaming -L native=$(abs_top_srcdir)/src/secp256k1/.libs" \
CC="$(CC)" \
CFLAGS="$(CFLAGS)" \
CXX="$(CXX)" \
@ -129,11 +132,15 @@ LIBBITCOIN_CRYPTO_SHANI = crypto/libbitcoin_crypto_shani.a
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SHANI)
endif
cargo-build-lib: $(CARGO_CONFIGURED)
$(rust_verbose)$(RUST_ENV_VARS) $(CARGO) build --lib $(RUST_BUILD_OPTS) $(cargo_verbose)
cargo-build: $(CARGO_CONFIGURED) $(LIBSECP256K1)
$(rust_verbose)$(RUST_ENV_VARS) $(CARGO) build $(RUST_BUILD_OPTS) $(cargo_verbose)
cargo-build-bins: $(CARGO_CONFIGURED)
$(rust_verbose)$(RUST_ENV_VARS) $(CARGO) build --bins $(RUST_BUILD_OPTS) $(cargo_verbose)
cargo-build-lib: cargo-build
cargo-build-bins: cargo-build
$(INSPECT_TOOL_BIN): cargo-build-bins
$(AM_V_at)cp $(INSPECT_TOOL_BUILD) $@
$(WALLET_TOOL_BIN): cargo-build-bins
$(AM_V_at)cp $(WALLET_TOOL_BUILD) $@
@ -150,8 +157,6 @@ $(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*)
# But to build the less dependent modules first, we manually select their order here:
EXTRA_LIBRARIES += \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_CRYPTO_SSE41) \
$(LIBBITCOIN_CRYPTO_AVX2) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_SERVER) \
@ -174,7 +179,7 @@ endif
if BUILD_BITCOIN_UTILS
bin_PROGRAMS += zcash-cli zcash-tx
bin_SCRIPTS += $(WALLET_TOOL_BIN)
bin_SCRIPTS += $(INSPECT_TOOL_BIN) $(WALLET_TOOL_BIN)
endif
LIBZCASH_H = \
@ -463,6 +468,7 @@ crypto_libbitcoin_crypto_sse41_a_CPPFLAGS = $(AM_CPPFLAGS)
if ENABLE_SSE41
crypto_libbitcoin_crypto_sse41_a_CXXFLAGS += $(SSE41_CXXFLAGS)
crypto_libbitcoin_crypto_sse41_a_CPPFLAGS += -DENABLE_SSE41
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE41)
endif
crypto_libbitcoin_crypto_sse41_a_SOURCES = crypto/sha256_sse41.cpp
@ -471,6 +477,7 @@ crypto_libbitcoin_crypto_avx2_a_CPPFLAGS = $(AM_CPPFLAGS)
if ENABLE_AVX2
crypto_libbitcoin_crypto_avx2_a_CXXFLAGS += $(AVX2_CXXFLAGS)
crypto_libbitcoin_crypto_avx2_a_CPPFLAGS += -DENABLE_AVX2
LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_AVX2)
endif
crypto_libbitcoin_crypto_avx2_a_SOURCES = crypto/sha256_avx2.cpp
@ -579,10 +586,8 @@ zcashd_LDADD = \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_ZMQ) \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_CRYPTO_SSE41) \
$(LIBBITCOIN_CRYPTO_AVX2) \
$(LIBZCASH) \
$(LIBRUSTZCASH) \
$(LIBZCASH) \
$(LIBLEVELDB) \
$(LIBLEVELDB_SSE42) \
$(LIBMEMENV) \
@ -594,7 +599,6 @@ zcashd_LDADD += \
$(EVENT_PTHREADS_LIBS) \
$(EVENT_LIBS) \
$(ZMQ_LIBS) \
$(LIBBITCOIN_CRYPTO) \
$(LIBZCASH_LIBS)
# bitcoin-cli binary #
@ -613,11 +617,9 @@ zcash_cli_LDADD = \
$(LIBBITCOIN_UTIL) \
$(BOOST_LIBS) \
$(EVENT_LIBS) \
$(LIBZCASH) \
$(LIBRUSTZCASH) \
$(LIBZCASH) \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_CRYPTO_SSE41) \
$(LIBBITCOIN_CRYPTO_AVX2) \
$(LIBSECP256K1) \
$(LIBZCASH_LIBS)
#
@ -638,11 +640,9 @@ zcash_tx_LDADD = \
$(LIBBITCOIN_COMMON) \
$(LIBBITCOIN_UTIL) \
$(LIBSECP256K1) \
$(LIBZCASH) \
$(LIBRUSTZCASH) \
$(LIBZCASH) \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_CRYPTO_SSE41) \
$(LIBBITCOIN_CRYPTO_AVX2) \
$(LIBZCASH_LIBS)
zcash_tx_LDADD += $(BOOST_LIBS)
@ -754,6 +754,7 @@ endif
$(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
if EMBEDDED_LEVELDB
include Makefile.crc32c.include
include Makefile.leveldb.include
endif

View File

@ -32,15 +32,13 @@ bench_bench_bitcoin_LDADD = \
$(LIBBITCOIN_UNIVALUE) \
$(LIBBITCOIN_UTIL) \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_CRYPTO_SSE41) \
$(LIBBITCOIN_CRYPTO_AVX2) \
$(LIBLEVELDB) \
$(LIBLEVELDB_SSE42) \
$(LIBMEMENV) \
$(LIBSECP256K1) \
$(LIBUNIVALUE) \
$(LIBZCASH) \
$(LIBRUSTZCASH)
$(LIBRUSTZCASH) \
$(LIBZCASH)
if ENABLE_ZMQ
bench_bench_bitcoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)

View File

@ -0,0 +1,75 @@
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
LIBCRC32C_INT = crc32c/libcrc32c.a
LIBLEVELDB_SSE42_INT = leveldb/libleveldb_sse42.a
EXTRA_LIBRARIES += $(LIBCRC32C_INT)
LIBCRC32C = $(LIBCRC32C_INT)
CRC32C_CPPFLAGS_INT =
CRC32C_CPPFLAGS_INT += -I$(srcdir)/crc32c/include
CRC32C_CPPFLAGS_INT += -DHAVE_BUILTIN_PREFETCH=@HAVE_BUILTIN_PREFETCH@
CRC32C_CPPFLAGS_INT += -DHAVE_MM_PREFETCH=@HAVE_MM_PREFETCH@
CRC32C_CPPFLAGS_INT += -DHAVE_STRONG_GETAUXVAL=@HAVE_STRONG_GETAUXVAL@
CRC32C_CPPFLAGS_INT += -DHAVE_WEAK_GETAUXVAL=@HAVE_WEAK_GETAUXVAL@
CRC32C_CPPFLAGS_INT += -DCRC32C_TESTS_BUILT_WITH_GLOG=0
if ENABLE_SSE42
CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=1
else
CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=0
endif
if ENABLE_ARM_CRC
CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=1
else
CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=0
endif
if WORDS_BIGENDIAN
CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=1
else
CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=0
endif
crc32c_libcrc32c_a_CPPFLAGS = $(AM_CPPFLAGS) $(CRC32C_CPPFLAGS_INT) $(CRC32C_CPPFLAGS)
crc32c_libcrc32c_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
crc32c_libcrc32c_a_SOURCES =
crc32c_libcrc32c_a_SOURCES += crc32c/include/crc32c/crc32c.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_arm64.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_arm64_linux_check.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_internal.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_prefetch.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_read_le.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_round_up.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_sse42_check.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_sse42.h
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c.cc
crc32c_libcrc32c_a_SOURCES += crc32c/src/crc32c_portable.cc
if ENABLE_SSE42
LIBCRC32C_SSE42_INT = crc32c/libcrc32c_sse42.a
EXTRA_LIBRARIES += $(LIBCRC32C_SSE42_INT)
LIBCRC32C += $(LIBCRC32C_SSE42_INT)
crc32c_libcrc32c_sse42_a_CPPFLAGS = $(crc32c_libcrc32c_a_CPPFLAGS)
crc32c_libcrc32c_sse42_a_CXXFLAGS = $(crc32c_libcrc32c_a_CXXFLAGS) $(SSE42_CXXFLAGS)
crc32c_libcrc32c_sse42_a_SOURCES = crc32c/src/crc32c_sse42.cc
endif
if ENABLE_ARM_CRC
LIBCRC32C_ARM_CRC_INT = crc32c/libcrc32c_arm_crc.a
EXTRA_LIBRARIES += $(LIBCRC32C_ARM_CRC_INT)
LIBCRC32C += $(LIBCRC32C_ARM_CRC_INT)
crc32c_libcrc32c_arm_crc_a_CPPFLAGS = $(crc32c_libcrc32c_a_CPPFLAGS)
crc32c_libcrc32c_arm_crc_a_CXXFLAGS = $(crc32c_libcrc32c_a_CXXFLAGS) $(ARM_CRC_CXXFLAGS)
crc32c_libcrc32c_arm_crc_a_SOURCES = crc32c/src/crc32c_arm64.cc
endif

View File

@ -77,8 +77,6 @@ zcash_gtest_LDADD = \
$(LIBBITCOIN_ZMQ) \
$(LIBBITCOIN_PROTON) \
$(LIBBITCOIN_CRYPTO) \
$(LIBBITCOIN_CRYPTO_SSE41) \
$(LIBBITCOIN_CRYPTO_AVX2) \
$(LIBUNIVALUE) \
$(LIBLEVELDB) \
$(LIBLEVELDB_SSE42) \
@ -93,8 +91,8 @@ zcash_gtest_LDADD += \
$(EVENT_PTHREADS_LIBS) \
$(EVENT_LIBS) \
$(ZMQ_LIBS) \
$(LIBZCASH) \
$(LIBRUSTZCASH) \
$(LIBZCASH) \
$(LIBZCASH_LIBS)
zcash_gtest_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static

View File

@ -5,27 +5,33 @@
LIBLEVELDB_INT = leveldb/libleveldb.a
LIBMEMENV_INT = leveldb/libmemenv.a
LIBLEVELDB_SSE42_INT = leveldb/libleveldb_sse42.a
EXTRA_LIBRARIES += $(LIBLEVELDB_INT)
EXTRA_LIBRARIES += $(LIBMEMENV_INT)
EXTRA_LIBRARIES += $(LIBLEVELDB_SSE42_INT)
LIBLEVELDB += $(LIBLEVELDB_INT)
LIBLEVELDB += $(LIBLEVELDB_INT) $(LIBCRC32C)
LIBMEMENV += $(LIBMEMENV_INT)
LIBLEVELDB_SSE42 = $(LIBLEVELDB_SSE42_INT)
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
LEVELDB_CPPFLAGS_INT =
LEVELDB_CPPFLAGS_INT += -I$(srcdir)/leveldb
LEVELDB_CPPFLAGS_INT += $(LEVELDB_TARGET_FLAGS)
LEVELDB_CPPFLAGS_INT += -DLEVELDB_ATOMIC_PRESENT
LEVELDB_CPPFLAGS_INT += -I$(srcdir)/crc32c/include
LEVELDB_CPPFLAGS_INT += -D__STDC_LIMIT_MACROS
LEVELDB_CPPFLAGS_INT += -DHAVE_SNAPPY=0 -DHAVE_CRC32C=1
LEVELDB_CPPFLAGS_INT += -DHAVE_FDATASYNC=@HAVE_FDATASYNC@
LEVELDB_CPPFLAGS_INT += -DHAVE_FULLFSYNC=@HAVE_FULLFSYNC@
LEVELDB_CPPFLAGS_INT += -DHAVE_O_CLOEXEC=@HAVE_O_CLOEXEC@
if WORDS_BIGENDIAN
LEVELDB_CPPFLAGS_INT += -DLEVELDB_IS_BIG_ENDIAN=1
else
LEVELDB_CPPFLAGS_INT += -DLEVELDB_IS_BIG_ENDIAN=0
endif
if TARGET_WINDOWS
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_WINDOWS -D__USE_MINGW_ANSI_STDIO=1
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_WINDOWS -D_UNICODE -DUNICODE -D__USE_MINGW_ANSI_STDIO=1
else
LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_POSIX
endif
@ -34,12 +40,8 @@ leveldb_libleveldb_a_CPPFLAGS = $(AM_CPPFLAGS) $(LEVELDB_CPPFLAGS_INT) $(LEVELDB
leveldb_libleveldb_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
leveldb_libleveldb_a_SOURCES=
leveldb_libleveldb_a_SOURCES += leveldb/port/atomic_pointer.h
leveldb_libleveldb_a_SOURCES += leveldb/port/port_example.h
leveldb_libleveldb_a_SOURCES += leveldb/port/port_posix.h
leveldb_libleveldb_a_SOURCES += leveldb/port/win/stdint.h
leveldb_libleveldb_a_SOURCES += leveldb/port/port_stdcxx.h
leveldb_libleveldb_a_SOURCES += leveldb/port/port.h
leveldb_libleveldb_a_SOURCES += leveldb/port/port_win.h
leveldb_libleveldb_a_SOURCES += leveldb/port/thread_annotations.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/db.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/options.h
@ -48,6 +50,7 @@ leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/filter_policy.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/slice.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/table_builder.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/env.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/export.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/c.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/iterator.h
leveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/cache.h
@ -79,6 +82,7 @@ leveldb_libleveldb_a_SOURCES += leveldb/table/format.h
leveldb_libleveldb_a_SOURCES += leveldb/table/iterator_wrapper.h
leveldb_libleveldb_a_SOURCES += leveldb/util/crc32c.h
leveldb_libleveldb_a_SOURCES += leveldb/util/env_posix_test_helper.h
leveldb_libleveldb_a_SOURCES += leveldb/util/env_windows_test_helper.h
leveldb_libleveldb_a_SOURCES += leveldb/util/arena.h
leveldb_libleveldb_a_SOURCES += leveldb/util/random.h
leveldb_libleveldb_a_SOURCES += leveldb/util/posix_logger.h
@ -88,7 +92,9 @@ leveldb_libleveldb_a_SOURCES += leveldb/util/coding.h
leveldb_libleveldb_a_SOURCES += leveldb/util/testutil.h
leveldb_libleveldb_a_SOURCES += leveldb/util/mutexlock.h
leveldb_libleveldb_a_SOURCES += leveldb/util/logging.h
leveldb_libleveldb_a_SOURCES += leveldb/util/no_destructor.h
leveldb_libleveldb_a_SOURCES += leveldb/util/testharness.h
leveldb_libleveldb_a_SOURCES += leveldb/util/windows_logger.h
leveldb_libleveldb_a_SOURCES += leveldb/db/builder.cc
leveldb_libleveldb_a_SOURCES += leveldb/db/c.cc
@ -121,7 +127,6 @@ leveldb_libleveldb_a_SOURCES += leveldb/util/coding.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/comparator.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/crc32c.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/env.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/env_posix.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/filter_policy.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/hash.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/histogram.cc
@ -130,21 +135,12 @@ leveldb_libleveldb_a_SOURCES += leveldb/util/options.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/status.cc
if TARGET_WINDOWS
leveldb_libleveldb_a_SOURCES += leveldb/util/env_win.cc
leveldb_libleveldb_a_SOURCES += leveldb/port/port_win.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/env_windows.cc
else
leveldb_libleveldb_a_SOURCES += leveldb/port/port_posix.cc
leveldb_libleveldb_a_SOURCES += leveldb/util/env_posix.cc
endif
leveldb_libmemenv_a_CPPFLAGS = $(leveldb_libleveldb_a_CPPFLAGS)
leveldb_libmemenv_a_CXXFLAGS = $(leveldb_libleveldb_a_CXXFLAGS)
leveldb_libmemenv_a_SOURCES = leveldb/helpers/memenv/memenv.cc
leveldb_libmemenv_a_SOURCES += leveldb/helpers/memenv/memenv.h
leveldb_libleveldb_sse42_a_CPPFLAGS = $(leveldb_libleveldb_a_CPPFLAGS)
leveldb_libleveldb_sse42_a_CXXFLAGS = $(leveldb_libleveldb_a_CXXFLAGS)
if ENABLE_HWCRC32
leveldb_libleveldb_sse42_a_CPPFLAGS += -DLEVELDB_PLATFORM_POSIX_SSE
leveldb_libleveldb_sse42_a_CXXFLAGS += $(SSE42_CXXFLAGS)
endif
leveldb_libleveldb_sse42_a_SOURCES = leveldb/port/port_posix_sse.cc

View File

@ -138,11 +138,11 @@ if ENABLE_WALLET
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
endif
test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_CRYPTO_SSE41) $(LIBBITCOIN_CRYPTO_AVX2) $(LIBUNIVALUE) \
test_test_bitcoin_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \
$(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)
test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
test_test_bitcoin_LDADD += $(LIBZCASH_SCRIPT) $(BDB_LIBS) $(LIBZCASH) $(LIBRUSTZCASH) $(LIBZCASH_LIBS)
test_test_bitcoin_LDADD += $(LIBZCASH_SCRIPT) $(BDB_LIBS) $(LIBRUSTZCASH) $(LIBZCASH) $(LIBZCASH_LIBS)
test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
if ENABLE_ZMQ

View File

@ -22,7 +22,7 @@ main(int argc, char** argv)
ECC_Start();
auto globalVerifyHandle = new ECCVerifyHandle();
SetupEnvironment();
fPrintToDebugLog = false; // don't want to write to debug.log file
fPrintToDebugLog = false; // don't want to write to debug log file
fs::path sapling_spend = ZC_GetParamsDir() / "sapling-spend.params";
fs::path sapling_output = ZC_GetParamsDir() / "sapling-output.params";

View File

@ -90,16 +90,7 @@ const std::string CLIENT_NAME("MagicBean");
#endif
#endif
#ifndef BUILD_DATE
#ifdef GIT_COMMIT_DATE
#define BUILD_DATE GIT_COMMIT_DATE
#else
#define BUILD_DATE __DATE__ ", " __TIME__
#endif
#endif
const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX);
const std::string CLIENT_DATE(BUILD_DATE);
std::string FormatVersion(int nVersion)
{

View File

@ -16,7 +16,7 @@
//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 5
#define CLIENT_VERSION_MINOR 2
#define CLIENT_VERSION_MINOR 3
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 50
@ -60,7 +60,6 @@ static const int CLIENT_VERSION =
extern const std::string CLIENT_NAME;
extern const std::string CLIENT_BUILD;
extern const std::string CLIENT_DATE;
std::string FormatVersion(int nVersion);

View File

@ -0,0 +1,37 @@
# Build matrix / environment variables are explained on:
# https://www.appveyor.com/docs/appveyor-yml/
# This file can be validated on: https://ci.appveyor.com/tools/validate-yaml
version: "{build}"
environment:
matrix:
# AppVeyor currently has no custom job name feature.
# http://help.appveyor.com/discussions/questions/1623-can-i-provide-a-friendly-name-for-jobs
- JOB: Visual Studio 2017
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
CMAKE_GENERATOR: Visual Studio 15 2017
platform:
- x86
- x64
configuration:
- RelWithDebInfo
- Debug
build_script:
- git submodule update --init --recursive
- mkdir build
- cd build
- if "%platform%"=="x64" set CMAKE_GENERATOR=%CMAKE_GENERATOR% Win64
- cmake --version
- cmake .. -G "%CMAKE_GENERATOR%" -DCRC32C_USE_GLOG=0
-DCMAKE_CONFIGURATION_TYPES="%CONFIGURATION%"
- cmake --build . --config "%CONFIGURATION%"
- cd ..
test_script:
- build\%CONFIGURATION%\crc32c_tests.exe
- build\%CONFIGURATION%\crc32c_capi_tests.exe
- build\%CONFIGURATION%\crc32c_bench.exe

View File

@ -0,0 +1,3 @@
---
Language: Cpp
BasedOnStyle: Google

View File

@ -0,0 +1,8 @@
-Ibuild/include/
-Ibuild/third_party/glog/
-Iinclude/
-Ithird_party/benchmark/include/
-Ithird_party/googletest/googletest/include/
-Ithird_party/googletest/googlemock/include/
-Ithird_party/glog/src/
-std=c++11

8
depend/zcash/src/crc32c/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Editors.
*.sw*
.DS_Store
/.vscode
# Build directory.
build/
out/

View File

@ -0,0 +1,76 @@
# Build matrix / environment variables are explained on:
# http://about.travis-ci.org/docs/user/build-configuration/
# This file can be validated on: http://lint.travis-ci.org/
language: cpp
dist: bionic
osx_image: xcode10.3
compiler:
- gcc
- clang
os:
- linux
- osx
env:
- GLOG=1 SHARED_LIB=0 BUILD_TYPE=Debug
- GLOG=1 SHARED_LIB=0 BUILD_TYPE=RelWithDebInfo
- GLOG=0 SHARED_LIB=0 BUILD_TYPE=Debug
- GLOG=0 SHARED_LIB=0 BUILD_TYPE=RelWithDebInfo
- GLOG=0 SHARED_LIB=1 BUILD_TYPE=Debug
- GLOG=0 SHARED_LIB=1 BUILD_TYPE=RelWithDebInfo
addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
- sourceline: 'ppa:ubuntu-toolchain-r/test'
packages:
- clang-9
- cmake
- gcc-9
- g++-9
- ninja-build
homebrew:
packages:
- cmake
- gcc@9
- llvm@9
- ninja
update: true
install:
# The following Homebrew packages aren't linked by default, and need to be
# prepended to the path explicitly.
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export PATH="$(brew --prefix llvm)/bin:$PATH";
fi
# /usr/bin/gcc points to an older compiler on both Linux and macOS.
- if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi
# /usr/bin/clang points to an older compiler on both Linux and macOS.
#
# Homebrew's llvm package doesn't ship a versioned clang++ binary, so the values
# below don't work on macOS. Fortunately, the path change above makes the
# default values (clang and clang++) resolve to the correct compiler on macOS.
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then
if [ "$CXX" = "clang++" ]; then export CXX="clang++-9" CC="clang-9"; fi;
fi
- echo ${CC}
- echo ${CXX}
- ${CXX} --version
- cmake --version
before_script:
- mkdir -p build && cd build
- cmake .. -G Ninja -DCRC32C_USE_GLOG=$GLOG -DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DBUILD_SHARED_LIBS=$SHARED_LIB -DCMAKE_INSTALL_PREFIX=$HOME/.local
- cmake --build .
- cd ..
script:
- build/crc32c_tests
- build/crc32c_capi_tests
- build/crc32c_bench
- cd build && cmake --build . --target install

View File

@ -0,0 +1,142 @@
# Copyright 2017 The CRC32C Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""YouCompleteMe configuration that interprets a .clang_complete file.
This module implementes the YouCompleteMe configuration API documented at:
https://github.com/Valloric/ycmd#ycm_extra_confpy-specification
The implementation loads and processes a .clang_complete file, documented at:
https://github.com/Rip-Rip/clang_complete/blob/master/README.md
"""
import os
# Flags added to the list in .clang_complete.
BASE_FLAGS = [
'-Werror', # Unlike clang_complete, YCM can also be used as a linter.
'-DUSE_CLANG_COMPLETER', # YCM needs this.
'-xc++', # YCM needs this to avoid compiling headers as C code.
]
# Clang flags that take in paths.
# See https://clang.llvm.org/docs/ClangCommandLineReference.html
PATH_FLAGS = [
'-isystem',
'-I',
'-iquote',
'--sysroot='
]
def DirectoryOfThisScript():
"""Returns the absolute path to the directory containing this script."""
return os.path.dirname(os.path.abspath(__file__))
def MakeRelativePathsInFlagsAbsolute(flags, build_root):
"""Expands relative paths in a list of Clang command-line flags.
Args:
flags: The list of flags passed to Clang.
build_root: The current directory when running the Clang compiler. Should be
an absolute path.
Returns:
A list of flags with relative paths replaced by absolute paths.
"""
new_flags = []
make_next_absolute = False
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith('/'):
new_flag = os.path.join(build_root, flag)
for path_flag in PATH_FLAGS:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith(path_flag):
path = flag[len(path_flag):]
new_flag = path_flag + os.path.join(build_root, path)
break
if new_flag:
new_flags.append(new_flag)
return new_flags
def FindNearest(target, path, build_root):
"""Looks for a file with a specific name closest to a project path.
This is similar to the logic used by a version-control system (like git) to
find its configuration directory (.git) based on the current directory when a
command is invoked.
Args:
target: The file name to search for.
path: The directory where the search starts. The search will explore the
given directory's ascendants using the parent relationship. Should be an
absolute path.
build_root: A directory that acts as a fence for the search. If the search
reaches this directory, it will not advance to its parent. Should be an
absolute path.
Returns:
The path to a file with the desired name. None if the search failed.
"""
candidate = os.path.join(path, target)
if os.path.isfile(candidate):
return candidate
if path == build_root:
return None
parent = os.path.dirname(path)
if parent == path:
return None
return FindNearest(target, parent, build_root)
def FlagsForClangComplete(file_path, build_root):
"""Reads the .clang_complete flags for a source file.
Args:
file_path: The path to the source file. Should be inside the project. Used
to locate the relevant .clang_complete file.
build_root: The current directory when running the Clang compiler for this
file. Should be an absolute path.
Returns:
A list of strings, where each element is a Clang command-line flag.
"""
clang_complete_path = FindNearest('.clang_complete', file_path, build_root)
if clang_complete_path is None:
return None
clang_complete_flags = open(clang_complete_path, 'r').read().splitlines()
return clang_complete_flags
def FlagsForFile(filename, **kwargs):
"""Implements the YouCompleteMe API."""
# kwargs can be used to pass 'client_data' to the YCM configuration. This
# configuration script does not need any extra information, so
# pylint: disable=unused-argument
build_root = DirectoryOfThisScript()
file_path = os.path.realpath(filename)
flags = BASE_FLAGS
clang_flags = FlagsForClangComplete(file_path, build_root)
if clang_flags:
flags += clang_flags
final_flags = MakeRelativePathsInFlagsAbsolute(flags, build_root)
return {'flags': final_flags}

View File

@ -0,0 +1,9 @@
# This is the list of CRC32C authors for copyright purposes.
#
# This does not necessarily list everyone who has contributed code, since in
# some cases, their employer may be the copyright holder. To see the full list
# of contributors, see the revision history in source control.
Google Inc.
Fangming Fang <Fangming.Fang@arm.com>
Vadim Skipin <vadim.skipin@gmail.com>

View File

@ -0,0 +1,423 @@
# Copyright 2017 The CRC32C Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. See the AUTHORS file for names of contributors.
cmake_minimum_required(VERSION 3.1)
project(Crc32c VERSION 1.1.0 LANGUAGES C CXX)
# This project can use C11, but will gracefully decay down to C89.
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED OFF)
set(CMAKE_C_EXTENSIONS OFF)
# This project requires C++11.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# https://github.com/izenecloud/cmake/blob/master/SetCompilerWarningAll.cmake
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Use the highest warning level for Visual Studio.
set(CMAKE_CXX_WARNING_LEVEL 4)
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
# Disable C++ exceptions.
string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-")
add_definitions(-D_HAS_EXCEPTIONS=0)
# Disable RTTI.
string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-")
else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# Use -Wall for clang and gcc.
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
# Use -Wextra for clang and gcc.
if(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
# Use -Werror for clang and gcc.
if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
# Disable C++ exceptions.
string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
# Disable RTTI.
string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
option(CRC32C_BUILD_TESTS "Build CRC32C's unit tests" ON)
option(CRC32C_BUILD_BENCHMARKS "Build CRC32C's benchmarks" ON)
option(CRC32C_USE_GLOG "Build CRC32C's tests with Google Logging" ON)
option(CRC32C_INSTALL "Install CRC32C's header and library" ON)
include(TestBigEndian)
test_big_endian(BYTE_ORDER_BIG_ENDIAN)
include(CheckCXXCompilerFlag)
# Used by glog.
check_cxx_compiler_flag(-Wno-deprecated CRC32C_HAVE_NO_DEPRECATED)
# Used by glog.
check_cxx_compiler_flag(-Wno-sign-compare CRC32C_HAVE_NO_SIGN_COMPARE)
# Used by glog.
check_cxx_compiler_flag(-Wno-unused-parameter CRC32C_HAVE_NO_UNUSED_PARAMETER)
# Used by googletest.
check_cxx_compiler_flag(-Wno-missing-field-initializers
CRC32C_HAVE_NO_MISSING_FIELD_INITIALIZERS)
# Check for __builtin_prefetch support in the compiler.
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
int main() {
char data = 0;
const char* address = &data;
__builtin_prefetch(address, 0, 0);
return 0;
}
" HAVE_BUILTIN_PREFETCH)
# Check for _mm_prefetch support in the compiler.
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#if defined(_MSC_VER)
#include <intrin.h>
#else // !defined(_MSC_VER)
#include <xmmintrin.h>
#endif // defined(_MSC_VER)
int main() {
char data = 0;
const char* address = &data;
_mm_prefetch(address, _MM_HINT_NTA);
return 0;
}
" HAVE_MM_PREFETCH)
# Check for SSE4.2 support in the compiler.
set(OLD_CMAKE_REQURED_FLAGS ${CMAKE_REQUIRED_FLAGS})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /arch:AVX")
else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -msse4.2")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
check_cxx_source_compiles("
#if defined(_MSC_VER)
#include <intrin.h>
#else // !defined(_MSC_VER)
#include <cpuid.h>
#include <nmmintrin.h>
#endif // defined(_MSC_VER)
int main() {
_mm_crc32_u8(0, 0); _mm_crc32_u32(0, 0);
#if defined(_M_X64) || defined(__x86_64__)
_mm_crc32_u64(0, 0);
#endif // defined(_M_X64) || defined(__x86_64__)
return 0;
}
" HAVE_SSE42)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQURED_FLAGS})
# Check for ARMv8 w/ CRC and CRYPTO extensions support in the compiler.
set(OLD_CMAKE_REQURED_FLAGS ${CMAKE_REQUIRED_FLAGS})
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# TODO(pwnall): Insert correct flag when VS gets ARM CRC32C support.
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /arch:NOTYET")
else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -march=armv8-a+crc+crypto")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
check_cxx_source_compiles("
#include <arm_acle.h>
#include <arm_neon.h>
int main() {
__crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0);
vmull_p64(0, 0);
return 0;
}
" HAVE_ARM64_CRC32C)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQURED_FLAGS})
# Check for strong getauxval() support in the system headers.
check_cxx_source_compiles("
#include <arm_acle.h>
#include <arm_neon.h>
#include <sys/auxv.h>
int main() {
getauxval(AT_HWCAP);
return 0;
}
" HAVE_STRONG_GETAUXVAL)
# Check for weak getauxval() support in the compiler.
check_cxx_source_compiles("
unsigned long getauxval(unsigned long type) __attribute__((weak));
#define AT_HWCAP 16
int main() {
getauxval(AT_HWCAP);
return 0;
}
" HAVE_WEAK_GETAUXVAL)
if(CRC32C_USE_GLOG)
# glog requires this setting to avoid using dynamic_cast.
set(DISABLE_RTTI ON CACHE BOOL "" FORCE)
# glog's test targets trigger deprecation warnings, and compiling them burns
# CPU cycles on the CI.
set(BUILD_TESTING_SAVED "${BUILD_TESTING}")
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
add_subdirectory("third_party/glog" EXCLUDE_FROM_ALL)
set(BUILD_TESTING "${BUILD_TESTING_SAVED}" CACHE BOOL "" FORCE)
# glog triggers deprecation warnings on OSX.
# https://github.com/google/glog/issues/185
if(CRC32C_HAVE_NO_DEPRECATED)
set_property(TARGET glog APPEND PROPERTY COMPILE_OPTIONS -Wno-deprecated)
endif(CRC32C_HAVE_NO_DEPRECATED)
# glog triggers sign comparison warnings on gcc.
if(CRC32C_HAVE_NO_SIGN_COMPARE)
set_property(TARGET glog APPEND PROPERTY COMPILE_OPTIONS -Wno-sign-compare)
endif(CRC32C_HAVE_NO_SIGN_COMPARE)
# glog triggers unused parameter warnings on clang.
if(CRC32C_HAVE_NO_UNUSED_PARAMETER)
set_property(TARGET glog
APPEND PROPERTY COMPILE_OPTIONS -Wno-unused-parameter)
endif(CRC32C_HAVE_NO_UNUSED_PARAMETER)
set(CRC32C_TESTS_BUILT_WITH_GLOG 1)
endif(CRC32C_USE_GLOG)
configure_file(
"src/crc32c_config.h.in"
"${PROJECT_BINARY_DIR}/include/crc32c/crc32c_config.h"
)
include_directories("${PROJECT_BINARY_DIR}/include")
# ARM64 CRC32C code is built separately, so we don't accidentally compile
# unsupported instructions into code that gets run without ARM32 support.
add_library(crc32c_arm64 OBJECT "")
target_sources(crc32c_arm64
PRIVATE
"${PROJECT_BINARY_DIR}/include/crc32c/crc32c_config.h"
"src/crc32c_arm64.cc"
"src/crc32c_arm64.h"
)
if(HAVE_ARM64_CRC32C)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# TODO(pwnall): Insert correct flag when VS gets ARM64 CRC32C support.
target_compile_options(crc32c_arm64 PRIVATE "/arch:NOTYET")
else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(crc32c_arm64 PRIVATE "-march=armv8-a+crc+crypto")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif(HAVE_ARM64_CRC32C)
# CMake only enables PIC by default in SHARED and MODULE targets.
if(BUILD_SHARED_LIBS)
set_property(TARGET crc32c_arm64 PROPERTY POSITION_INDEPENDENT_CODE TRUE)
endif(BUILD_SHARED_LIBS)
# SSE4.2 code is built separately, so we don't accidentally compile unsupported
# instructions into code that gets run without SSE4.2 support.
add_library(crc32c_sse42 OBJECT "")
target_sources(crc32c_sse42
PRIVATE
"${PROJECT_BINARY_DIR}/include/crc32c/crc32c_config.h"
"src/crc32c_sse42.cc"
"src/crc32c_sse42.h"
)
if(HAVE_SSE42)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(crc32c_sse42 PRIVATE "/arch:AVX")
else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(crc32c_sse42 PRIVATE "-msse4.2")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif(HAVE_SSE42)
# CMake only enables PIC by default in SHARED and MODULE targets.
if(BUILD_SHARED_LIBS)
set_property(TARGET crc32c_sse42 PROPERTY POSITION_INDEPENDENT_CODE TRUE)
endif(BUILD_SHARED_LIBS)
# Must be included before CMAKE_INSTALL_INCLUDEDIR is used.
include(GNUInstallDirs)
add_library(crc32c ""
# TODO(pwnall): Move the TARGET_OBJECTS generator expressions to the PRIVATE
# section of target_sources when cmake_minimum_required becomes 3.9 or above.
$<TARGET_OBJECTS:crc32c_arm64>
$<TARGET_OBJECTS:crc32c_sse42>
)
target_sources(crc32c
PRIVATE
"${PROJECT_BINARY_DIR}/include/crc32c/crc32c_config.h"
"src/crc32c_arm64.h"
"src/crc32c_arm64_linux_check.h"
"src/crc32c_internal.h"
"src/crc32c_portable.cc"
"src/crc32c_prefetch.h"
"src/crc32c_read_le.h"
"src/crc32c_round_up.h"
"src/crc32c_sse42.h"
"src/crc32c_sse42_check.h"
"src/crc32c.cc"
# Only CMake 3.3+ supports PUBLIC sources in targets exported by "install".
$<$<VERSION_GREATER:CMAKE_VERSION,3.2>:PUBLIC>
"include/crc32c/crc32c.h"
)
target_include_directories(crc32c
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_compile_definitions(crc32c
PRIVATE
CRC32C_HAVE_CONFIG_H=1
)
set_target_properties(crc32c
PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
# Warnings as errors in Visual Studio for this project's targets.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set_property(TARGET crc32c APPEND PROPERTY COMPILE_OPTIONS "/WX")
set_property(TARGET crc32c_arm64 APPEND PROPERTY COMPILE_OPTIONS "/WX")
set_property(TARGET crc32c_sse42 APPEND PROPERTY COMPILE_OPTIONS "/WX")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CRC32C_BUILD_TESTS)
enable_testing()
# Prevent overriding the parent project's compiler/linker settings on Windows.
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(install_gtest OFF)
set(install_gmock OFF)
# This project is tested using GoogleTest.
add_subdirectory("third_party/googletest")
# GoogleTest triggers a missing field initializers warning.
if(CRC32C_HAVE_NO_MISSING_FIELD_INITIALIZERS)
set_property(TARGET gtest
APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
set_property(TARGET gmock
APPEND PROPERTY COMPILE_OPTIONS -Wno-missing-field-initializers)
endif(CRC32C_HAVE_NO_MISSING_FIELD_INITIALIZERS)
add_executable(crc32c_tests "")
target_sources(crc32c_tests
PRIVATE
"${PROJECT_BINARY_DIR}/include/crc32c/crc32c_config.h"
"src/crc32c_arm64_unittest.cc"
"src/crc32c_extend_unittests.h"
"src/crc32c_portable_unittest.cc"
"src/crc32c_prefetch_unittest.cc"
"src/crc32c_read_le_unittest.cc"
"src/crc32c_round_up_unittest.cc"
"src/crc32c_sse42_unittest.cc"
"src/crc32c_unittest.cc"
"src/crc32c_test_main.cc"
)
target_link_libraries(crc32c_tests crc32c gtest)
# Warnings as errors in Visual Studio for this project's targets.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set_property(TARGET crc32c_tests APPEND PROPERTY COMPILE_OPTIONS "/WX")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CRC32C_USE_GLOG)
target_link_libraries(crc32c_tests glog)
endif(CRC32C_USE_GLOG)
add_test(NAME crc32c_tests COMMAND crc32c_tests)
add_executable(crc32c_capi_tests "")
target_sources(crc32c_capi_tests
PRIVATE
"src/crc32c_capi_unittest.c"
)
target_link_libraries(crc32c_capi_tests crc32c)
# Warnings as errors in Visual Studio for this project's targets.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set_property(TARGET crc32c_capi_tests APPEND PROPERTY COMPILE_OPTIONS "/WX")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_test(NAME crc32c_capi_tests COMMAND crc32c_capi_tests)
endif(CRC32C_BUILD_TESTS)
if(CRC32C_BUILD_BENCHMARKS)
add_executable(crc32c_bench "")
target_sources(crc32c_bench
PRIVATE
"${PROJECT_BINARY_DIR}/include/crc32c/crc32c_config.h"
"src/crc32c_benchmark.cc"
)
target_link_libraries(crc32c_bench crc32c)
# This project uses Google benchmark for benchmarking.
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
set(BENCHMARK_ENABLE_EXCEPTIONS OFF CACHE BOOL "" FORCE)
add_subdirectory("third_party/benchmark")
target_link_libraries(crc32c_bench benchmark)
if(CRC32C_USE_GLOG)
target_link_libraries(crc32c_bench glog)
endif(CRC32C_USE_GLOG)
# Warnings as errors in Visual Studio for this project's targets.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set_property(TARGET crc32c_bench APPEND PROPERTY COMPILE_OPTIONS "/WX")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif(CRC32C_BUILD_BENCHMARKS)
if(CRC32C_INSTALL)
install(TARGETS crc32c
EXPORT Crc32cTargets
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(
FILES
"include/crc32c/crc32c.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/crc32c"
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
"${PROJECT_BINARY_DIR}/Crc32cConfigVersion.cmake"
COMPATIBILITY SameMajorVersion
)
install(
EXPORT Crc32cTargets
NAMESPACE Crc32c::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Crc32c"
)
install(
FILES
"Crc32cConfig.cmake"
"${PROJECT_BINARY_DIR}/Crc32cConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Crc32c"
)
endif(CRC32C_INSTALL)

View File

@ -0,0 +1,23 @@
# How to Contribute
We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.
## Contributor License Agreement
Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.
## Code reviews
All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

View File

@ -0,0 +1,5 @@
# Copyright 2017 The CRC32C Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. See the AUTHORS file for names of contributors.
include("${CMAKE_CURRENT_LIST_DIR}/Crc32cTargets.cmake")

View File

@ -0,0 +1,28 @@
Copyright 2017, The CRC32C Authors.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,125 @@
# CRC32C
[![Build Status](https://travis-ci.org/google/crc32c.svg?branch=master)](https://travis-ci.org/google/crc32c)
[![Build Status](https://ci.appveyor.com/api/projects/status/moiq7331pett4xuj/branch/master?svg=true)](https://ci.appveyor.com/project/pwnall/crc32c)
New file format authors should consider
[HighwayHash](https://github.com/google/highwayhash). The initial version of
this code was extracted from [LevelDB](https://github.com/google/leveldb), which
is a stable key-value store that is widely used at Google.
This project collects a few CRC32C implementations under an umbrella that
dispatches to a suitable implementation based on the host computer's hardware
capabilities.
CRC32C is specified as the CRC that uses the iSCSI polynomial in
[RFC 3720](https://tools.ietf.org/html/rfc3720#section-12.1). The polynomial was
introduced by G. Castagnoli, S. Braeuer and M. Herrmann. CRC32C is used in
software such as Btrfs, ext4, Ceph and leveldb.
## Usage
```cpp
#include "crc32c/crc32c.h"
int main() {
const std::uint8_t buffer[] = {0, 0, 0, 0};
std::uint32_t result;
// Process a raw buffer.
result = crc32c::Crc32c(buffer, 4);
// Process a std::string.
std::string string;
string.resize(4);
result = crc32c::Crc32c(string);
// If you have C++17 support, process a std::string_view.
std::string_view string_view(string);
result = crc32c::Crc32c(string_view);
return 0;
}
```
## Prerequisites
This project uses [CMake](https://cmake.org/) for building and testing. CMake is
available in all popular Linux distributions, as well as in
[Homebrew](https://brew.sh/).
This project uses submodules for dependency management.
```bash
git submodule update --init --recursive
```
If you're using [Atom](https://atom.io/), the following packages can help.
```bash
apm install autocomplete-clang build build-cmake clang-format language-cmake \
linter linter-clang
```
If you don't mind more setup in return for more speed, replace
`autocomplete-clang` and `linter-clang` with `you-complete-me`. This requires
[setting up ycmd](https://github.com/Valloric/ycmd#building).
```bash
apm install autocomplete-plus build build-cmake clang-format language-cmake \
linter you-complete-me
```
## Building
The following commands build and install the project.
```bash
mkdir build
cd build
cmake -DCRC32C_BUILD_TESTS=0 -DCRC32C_BUILD_BENCHMARKS=0 .. && make all install
```
## Development
The following command (when executed from `build/`) (re)builds the project and
runs the tests.
```bash
cmake .. && cmake --build . && ctest --output-on-failure
```
### Android testing
The following command builds the project against the Android NDK, which is
useful for benchmarking against ARM processors.
```bash
cmake .. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a \
-DCMAKE_ANDROID_NDK=$HOME/Library/Android/sdk/ndk-bundle \
-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang \
-DCMAKE_ANDROID_STL_TYPE=c++_static -DCRC32C_USE_GLOG=0 \
-DCMAKE_BUILD_TYPE=Release && cmake --build .
```
The following commands install and run the benchmarks.
```bash
adb push crc32c_bench /data/local/tmp
adb shell chmod +x /data/local/tmp/crc32c_bench
adb shell 'cd /data/local/tmp && ./crc32c_bench'
adb shell rm /data/local/tmp/crc32c_bench
```
The following commands install and run the tests.
```bash
adb push crc32c_tests /data/local/tmp
adb shell chmod +x /data/local/tmp/crc32c_tests
adb shell 'cd /data/local/tmp && ./crc32c_tests'
adb shell rm /data/local/tmp/crc32c_tests
```

View File

@ -0,0 +1,89 @@
/* Copyright 2017 The CRC32C Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. See the AUTHORS file for names of contributors. */
#ifndef CRC32C_CRC32C_H_
#define CRC32C_CRC32C_H_
/* The API exported by the CRC32C project. */
#if defined(__cplusplus)
#include <cstddef>
#include <cstdint>
#include <string>
#else /* !defined(__cplusplus) */
#include <stddef.h>
#include <stdint.h>
#endif /* !defined(__cplusplus) */
/* The C API. */
#if defined(__cplusplus)
extern "C" {
#endif /* defined(__cplusplus) */
/* Extends "crc" with the CRC32C of "count" bytes in the buffer pointed by
"data" */
uint32_t crc32c_extend(uint32_t crc, const uint8_t* data, size_t count);
/* Computes the CRC32C of "count" bytes in the buffer pointed by "data". */
uint32_t crc32c_value(const uint8_t* data, size_t count);
#ifdef __cplusplus
} /* end extern "C" */
#endif /* defined(__cplusplus) */
/* The C++ API. */
#if defined(__cplusplus)
namespace crc32c {
// Extends "crc" with the CRC32C of "count" bytes in the buffer pointed by
// "data".
uint32_t Extend(uint32_t crc, const uint8_t* data, size_t count);
// Computes the CRC32C of "count" bytes in the buffer pointed by "data".
inline uint32_t Crc32c(const uint8_t* data, size_t count) {
return Extend(0, data, count);
}
// Computes the CRC32C of "count" bytes in the buffer pointed by "data".
inline uint32_t Crc32c(const char* data, size_t count) {
return Extend(0, reinterpret_cast<const uint8_t*>(data), count);
}
// Computes the CRC32C of the string's content.
inline uint32_t Crc32c(const std::string& string) {
return Crc32c(reinterpret_cast<const uint8_t*>(string.data()),
string.size());
}
} // namespace crc32c
#if __cplusplus > 201402L
#if __has_include(<string_view>)
#include <string_view>
namespace crc32c {
// Computes the CRC32C of the bytes in the string_view.
inline uint32_t Crc32c(const std::string_view& string_view) {
return Crc32c(reinterpret_cast<const uint8_t*>(string_view.data()),
string_view.size());
}
} // namespace crc32c
#endif // __has_include(<string_view>)
#endif // __cplusplus > 201402L
#endif /* defined(__cplusplus) */
#endif // CRC32C_CRC32C_H_

View File

@ -0,0 +1,39 @@
// Copyright 2017 The CRC32C Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include "crc32c/crc32c.h"
#include <cstddef>
#include <cstdint>
#include "./crc32c_arm64.h"
#include "./crc32c_arm64_linux_check.h"
#include "./crc32c_internal.h"
#include "./crc32c_sse42.h"
#include "./crc32c_sse42_check.h"
namespace crc32c {
uint32_t Extend(uint32_t crc, const uint8_t* data, size_t count) {
#if HAVE_SSE42 && (defined(_M_X64) || defined(__x86_64__))
static bool can_use_sse42 = CanUseSse42();
if (can_use_sse42) return ExtendSse42(crc, data, count);
#elif HAVE_ARM64_CRC32C
static bool can_use_arm_linux = CanUseArm64Linux();
if (can_use_arm_linux) return ExtendArm64(crc, data, count);
#endif // HAVE_SSE42 && (defined(_M_X64) || defined(__x86_64__))
return ExtendPortable(crc, data, count);
}
extern "C" uint32_t crc32c_extend(uint32_t crc, const uint8_t* data,
size_t count) {
return crc32c::Extend(crc, data, count);
}
extern "C" uint32_t crc32c_value(const uint8_t* data, size_t count) {
return crc32c::Crc32c(data, count);
}
} // namespace crc32c

View File

@ -0,0 +1,126 @@
// Copyright 2017 The CRC32C Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include "./crc32c_arm64.h"
// In a separate source file to allow this accelerated CRC32C function to be
// compiled with the appropriate compiler flags to enable ARM NEON CRC32C
// instructions.
// This implementation is based on https://github.com/google/leveldb/pull/490.
#include <cstddef>
#include <cstdint>
#include "./crc32c_internal.h"
#ifdef CRC32C_HAVE_CONFIG_H
#include "crc32c/crc32c_config.h"
#endif
#if HAVE_ARM64_CRC32C
#include <arm_acle.h>
#include <arm_neon.h>
#define KBYTES 1032
#define SEGMENTBYTES 256
// compute 8bytes for each segment parallelly
#define CRC32C32BYTES(P, IND) \
do { \
crc1 = __crc32cd( \
crc1, *((const uint64_t *)(P) + (SEGMENTBYTES / 8) * 1 + (IND))); \
crc2 = __crc32cd( \
crc2, *((const uint64_t *)(P) + (SEGMENTBYTES / 8) * 2 + (IND))); \
crc3 = __crc32cd( \
crc3, *((const uint64_t *)(P) + (SEGMENTBYTES / 8) * 3 + (IND))); \
crc0 = __crc32cd( \
crc0, *((const uint64_t *)(P) + (SEGMENTBYTES / 8) * 0 + (IND))); \
} while (0);
// compute 8*8 bytes for each segment parallelly
#define CRC32C256BYTES(P, IND) \
do { \
CRC32C32BYTES((P), (IND)*8 + 0) \
CRC32C32BYTES((P), (IND)*8 + 1) \
CRC32C32BYTES((P), (IND)*8 + 2) \
CRC32C32BYTES((P), (IND)*8 + 3) \
CRC32C32BYTES((P), (IND)*8 + 4) \
CRC32C32BYTES((P), (IND)*8 + 5) \
CRC32C32BYTES((P), (IND)*8 + 6) \
CRC32C32BYTES((P), (IND)*8 + 7) \
} while (0);
// compute 4*8*8 bytes for each segment parallelly
#define CRC32C1024BYTES(P) \
do { \
CRC32C256BYTES((P), 0) \
CRC32C256BYTES((P), 1) \
CRC32C256BYTES((P), 2) \
CRC32C256BYTES((P), 3) \
(P) += 4 * SEGMENTBYTES; \
} while (0)
namespace crc32c {
uint32_t ExtendArm64(uint32_t crc, const uint8_t *buf, size_t size) {
int64_t length = size;
uint32_t crc0, crc1, crc2, crc3;
uint64_t t0, t1, t2;
// k0=CRC(x^(3*SEGMENTBYTES*8)), k1=CRC(x^(2*SEGMENTBYTES*8)),
// k2=CRC(x^(SEGMENTBYTES*8))
const poly64_t k0 = 0x8d96551c, k1 = 0xbd6f81f8, k2 = 0xdcb17aa4;
crc = crc ^ kCRC32Xor;
const uint8_t *p = reinterpret_cast<const uint8_t *>(buf);
while (length >= KBYTES) {
crc0 = crc;
crc1 = 0;
crc2 = 0;
crc3 = 0;
// Process 1024 bytes in parallel.
CRC32C1024BYTES(p);
// Merge the 4 partial CRC32C values.
t2 = (uint64_t)vmull_p64(crc2, k2);
t1 = (uint64_t)vmull_p64(crc1, k1);
t0 = (uint64_t)vmull_p64(crc0, k0);
crc = __crc32cd(crc3, *(uint64_t *)p);
p += sizeof(uint64_t);
crc ^= __crc32cd(0, t2);
crc ^= __crc32cd(0, t1);
crc ^= __crc32cd(0, t0);
length -= KBYTES;
}
while (length >= 8) {
crc = __crc32cd(crc, *(uint64_t *)p);
p += 8;
length -= 8;
}
if (length & 4) {
crc = __crc32cw(crc, *(uint32_t *)p);
p += 4;
}
if (length & 2) {
crc = __crc32ch(crc, *(uint16_t *)p);
p += 2;
}
if (length & 1) {
crc = __crc32cb(crc, *p);
}
return crc ^ kCRC32Xor;
}
} // namespace crc32c
#endif // HAVE_ARM64_CRC32C

View File

@ -0,0 +1,27 @@
// Copyright 2017 The CRC32C Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
// Linux-specific code checking the availability for ARM CRC32C instructions.
#ifndef CRC32C_CRC32C_ARM_LINUX_H_
#define CRC32C_CRC32C_ARM_LINUX_H_
#include <cstddef>
#include <cstdint>
#ifdef CRC32C_HAVE_CONFIG_H
#include "crc32c/crc32c_config.h"
#endif
#if HAVE_ARM64_CRC32C
namespace crc32c {
uint32_t ExtendArm64(uint32_t crc, const uint8_t* data, size_t count);
} // namespace crc32c
#endif // HAVE_ARM64_CRC32C
#endif // CRC32C_CRC32C_ARM_LINUX_H_

Some files were not shown because too many files have changed in this diff Show More