diff --git a/configure.ac b/configure.ac index decf2b2e6..401183575 100644 --- a/configure.ac +++ b/configure.ac @@ -799,7 +799,11 @@ AX_CHECK_COMPILE_FLAG([-fwrapv],[CXXFLAGS="$CXXFLAGS -fwrapv"]) AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],[CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"]) AX_CHECK_COMPILE_FLAG([-Wno-builtin-declaration-mismatch],[CXXFLAGS="$CXXFLAGS -Wno-builtin-declaration-mismatch"],,[[$CXXFLAG_WERROR]]) -LIBZCASH_LIBS="-lgmp -lgmpxx -lboost_system -lcrypto -lsodium $RUST_LIBS" +if test x$TARGET_OS != xwindows; then + LIBZCASH_LIBS="-lgmp -lgmpxx -lboost_system -lcrypto -lsodium $RUST_LIBS" +else + LIBZCASH_LIBS="-lgmp -lgmpxx -lboost_system-mt-s -lcrypto -lsodium $RUST_LIBS" +fi AC_MSG_CHECKING([whether to build bitcoind]) AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes]) diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index b986aecec..0028d3f6f 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -7,19 +7,11 @@ build_darwin_OTOOL: = $(shell xcrun -f otool) build_darwin_NM: = $(shell xcrun -f nm) build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) build_darwin_SHA256SUM = shasum -a 256 -#<<<<<<< HEAD -##build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o +build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o #darwin host on darwin builder. overrides darwin host preferences. -#darwin_CC= gcc-5 -#darwin_CXX= g++-5 -#======= -build_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o - -#darwin host on darwin builder. overrides darwin host preferences. -darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) -darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++ -#>>>>>>> zcash/master +darwin_CC= gcc-5 +darwin_CXX= g++-5 darwin_AR:=$(shell xcrun -f ar) darwin_RANLIB:=$(shell xcrun -f ranlib) darwin_STRIP:=$(shell xcrun -f strip) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 4f1748657..70211078b 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,15 +1,9 @@ OSX_MIN_VERSION=10.8 OSX_SDK_VERSION=10.11 OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk -#<<<<<<< HEAD -#LD64_VERSION=241.9 -#darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -#darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -#======= LD64_VERSION=253.9 -darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++ -#>>>>>>> zcash/master +darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) +darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) darwin_CFLAGS=-pipe darwin_CXXFLAGS=$(darwin_CFLAGS) diff --git a/depends/packages/googletest.mk b/depends/packages/googletest.mk index b9fa3e7e8..1275593f5 100644 --- a/depends/packages/googletest.mk +++ b/depends/packages/googletest.mk @@ -14,7 +14,8 @@ endif ifeq ($(build_os),darwin) $(package)_install=ginstall define $(package)_build_cmds - $(MAKE) -C make gtest.a + $(MAKE) -C googlemock/make gmock.a && \ + $(MAKE) -C googletest/make gtest.a endef else $(package)_install=install diff --git a/depends/packages/librustzcash.mk b/depends/packages/librustzcash.mk index bfd8fef1e..30fe6bc60 100644 --- a/depends/packages/librustzcash.mk +++ b/depends/packages/librustzcash.mk @@ -7,6 +7,15 @@ $(package)_sha256_hash=a5760a90d4a1045c8944204f29fa2a3cf2f800afee400f88bf89bbfe2 $(package)_git_commit=91348647a86201a9482ad4ad68398152dc3d635e $(package)_dependencies=rust +#TODO test latest librustzcash - ca333 +# package=librustzcash +# $(package)_version=0.1 +# $(package)_download_path=https://github.com/zcash/$(package)/archive/ +# $(package)_file_name=$(package)-$($(package)_git_commit).tar.gz +# $(package)_download_file=$($(package)_git_commit).tar.gz +# $(package)_sha256_hash=b63ba98d569d332764f27706038c04d03ac7e2c836dc15dc4eaa24b04b8c7f4a +# $(package)_git_commit=6cc1813ae3bb1e42224fd8ca0a8977b95c576738 +# $(package)_dependencies=rust $(rust_crates) ifeq ($(host_os),mingw32) define $(package)_build_cmds diff --git a/depends/packages/libsodium.mk b/depends/packages/libsodium.mk index 91e6f27b7..efa5d90de 100644 --- a/depends/packages/libsodium.mk +++ b/depends/packages/libsodium.mk @@ -1,17 +1,20 @@ +ifeq ($(build_os),darwin) +package=libsodium +$(package)_version=1.0.11 +$(package)_download_path=https://supernetorg.bintray.com/misc +$(package)_file_name=libsodium-1.0.11.tar.gz +$(package)_sha256_hash=a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765 +$(package)_dependencies= +$(package)_config_opts= +else package=libsodium -#<<<<<<< HEAD -#$(package)_version=1.0.11 -#$(package)_download_path=https://supernetorg.bintray.com/misc -#$(package)_file_name=libsodium-1.0.11.tar.gz -#$(package)_sha256_hash=a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765 -#======= $(package)_version=1.0.15 $(package)_download_path=https://download.libsodium.org/libsodium/releases/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=fb6a9e879a2f674592e4328c5d9f79f082405ee4bb05cb6e679b90afe9e178f4 -#>>>>>>> zcash/master $(package)_dependencies= $(package)_config_opts= +endif define $(package)_preprocess_cmds cd $($(package)_build_subdir); ./autogen.sh diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 3c78e29c3..9174db320 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -1,7 +1,12 @@ rust_packages := rust librustzcash -proton_packages := proton -zcash_packages := libgmp libsodium +ifeq ($(build_os),darwin) + zcash_packages := libsnark libgmp libsodium +else + proton_packages := proton + zcash_packages := libgmp libsodium +endif + ifeq ($(host_os),linux) packages := boost openssl libevent zeromq $(zcash_packages) googletest #googlemock else diff --git a/depends/packages/proton.mk b/depends/packages/proton.mk index aa49f380f..39428f54b 100644 --- a/depends/packages/proton.mk +++ b/depends/packages/proton.mk @@ -1,6 +1,6 @@ package=proton $(package)_version=0.17.0 -$(package)_download_path=http://apache.cs.utah.edu/qpid/proton/$($(package)_version) +$(package)_download_path=https://archive.apache.org/dist/qpid/proton/$($(package)_version) $(package)_file_name=qpid-proton-$($(package)_version).tar.gz $(package)_sha256_hash=6ffd26d3d0e495bfdb5d9fefc5349954e6105ea18cc4bb191161d27742c5a01a $(package)_patches=minimal-build.patch @@ -21,4 +21,3 @@ endef define $(package)_stage_cmds cd build; $(MAKE) VERBOSE=1 DESTDIR=$($(package)_staging_prefix_dir) install endef - diff --git a/depends/packages/rust.mk b/depends/packages/rust.mk index eb28c76d1..2e3f0b204 100644 --- a/depends/packages/rust.mk +++ b/depends/packages/rust.mk @@ -1,23 +1,16 @@ package=rust $(package)_version=1.16.0 $(package)_download_path=https://static.rust-lang.org/dist -#<<<<<<< HEAD -#ifeq ($(build_os),darwin) -#$(package)_file_name=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz -#$(package)_sha256_hash=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926 -#else ifeq ($(host_os),mingw32) -#$(package)_file_name=rust-$($(package)_version)-i686-unknown-linux-gnu.tar.gz -#$(package)_sha256_hash=b5859161ebb182d3b75fa14a5741e5de87b088146fb0ef4a30f3b2439c6179c5 -#else -#$(package)_file_name=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz -#$(package)_sha256_hash=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd -#endif -#======= -$(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz -$(package)_sha256_hash_linux=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd -$(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz -$(package)_sha256_hash_darwin=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926 -#>>>>>>> zcash/master +ifeq ($(build_os),darwin) +$(package)_file_name=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz +$(package)_sha256_hash=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926 +else ifeq ($(host_os),mingw32) +$(package)_file_name=rust-$($(package)_version)-i686-unknown-linux-gnu.tar.gz +$(package)_sha256_hash=b5859161ebb182d3b75fa14a5741e5de87b088146fb0ef4a30f3b2439c6179c5 +else +$(package)_file_name=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz +$(package)_sha256_hash=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd +endif define $(package)_stage_cmds ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig diff --git a/doc/beefy-node-reference-komodo.conf b/doc/beefy-node-reference-komodo.conf new file mode 100644 index 000000000..43308e333 --- /dev/null +++ b/doc/beefy-node-reference-komodo.conf @@ -0,0 +1,12 @@ +rpcuser=minion +rpcpassword=1235baf8-3725-11e8-b9ec-1239db4ec123 +txindex=1 +server=1 +rpcworkqueue=64 +addnode=5.9.102.210 +addnode=78.47.196.146 +addnode=178.63.69.164 +addnode=88.198.65.74 +addnode=5.9.122.241 +addnode=144.76.94.38 +addnode=89.248.166.91 diff --git a/src/cryptoconditions/compile b/src/cryptoconditions/compile index a85b723c7..2ab71e4ea 100755 --- a/src/cryptoconditions/compile +++ b/src/cryptoconditions/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -342,6 +343,6 @@ exit $ret # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/src/cryptoconditions/src/cryptoconditions.c b/src/cryptoconditions/src/cryptoconditions.c index 2f136917e..6fd54f245 100644 --- a/src/cryptoconditions/src/cryptoconditions.c +++ b/src/cryptoconditions/src/cryptoconditions.c @@ -13,7 +13,12 @@ #include "src/eval.c" #include "src/json_rpc.c" #include -#include + +#ifdef __LP64__ +#include +#else +#include // Index into CTransaction.vjoinsplit +#endif struct CCType *CCTypeRegistry[] = { diff --git a/src/cryptoconditions/src/json_rpc.c b/src/cryptoconditions/src/json_rpc.c index 42c13612c..13cffec1d 100644 --- a/src/cryptoconditions/src/json_rpc.c +++ b/src/cryptoconditions/src/json_rpc.c @@ -1,8 +1,12 @@ #include "cryptoconditions.h" #include "internal.h" #include -#include +#ifdef __LP64__ +#include +#else +#include // Index into CTransaction.vjoinsplit +#endif static cJSON *jsonCondition(CC *cond) { cJSON *root = cJSON_CreateObject(); diff --git a/src/cryptoconditions/src/secp256k1.c b/src/cryptoconditions/src/secp256k1.c index 73f7a9164..78b9c4e9e 100644 --- a/src/cryptoconditions/src/secp256k1.c +++ b/src/cryptoconditions/src/secp256k1.c @@ -1,6 +1,11 @@ #define _GNU_SOURCE 1 +#if __linux #include +#elif defined(_WIN32) || defined(_WIN64) +#include +#endif + #include #include diff --git a/src/paymentdisclosure.h b/src/paymentdisclosure.h index e6a995ab4..fddb25bbe 100644 --- a/src/paymentdisclosure.h +++ b/src/paymentdisclosure.h @@ -73,7 +73,11 @@ struct PaymentDisclosurePayload { uint8_t version; // 0 = experimental, 1 = first production version, etc. uint256 esk; // zcash/NoteEncryption.cpp uint256 txid; // primitives/transaction.h + #ifdef __LP64__ + uint64_t js; + #else size_t js; // Index into CTransaction.vjoinsplit + #endif uint8_t n; // Index into JSDescription fields of length ZC_NUM_JS_OUTPUTS libzcash::PaymentAddress zaddr; // zcash/Address.hpp std::string message; // parameter to RPC call diff --git a/src/snark/AUTHORS b/src/snark/AUTHORS index 1b2d7a247..cdc8d66af 100644 --- a/src/snark/AUTHORS +++ b/src/snark/AUTHORS @@ -17,3 +17,6 @@ External contributors: Tadanori TERUYA Sean Bowe Daira Hopwood + @mugatu on forum.z.cash + David Mercer + Joshua Yabut diff --git a/src/snark/Makefile b/src/snark/Makefile index b865f992f..17dcfdc6e 100644 --- a/src/snark/Makefile +++ b/src/snark/Makefile @@ -6,6 +6,13 @@ #* @copyright MIT license (see LICENSE file) #*******************************************************************************/ +# Determine building operating system +ifeq ($(OS),Windows_NT) + uname_S := Windows +else + uname_S := $(shell uname -s) +endif + # To override these, use "make OPTFLAGS=..." etc. CURVE = BN128 OPTFLAGS = -O2 -march=native -mtune=native @@ -106,18 +113,9 @@ EXECUTABLES_WITH_GTEST = EXECUTABLES_WITH_SUPERCOP = \ libsnark/zk_proof_systems/ppzkadsnark/r1cs_ppzkadsnark/examples/demo_r1cs_ppzkadsnark -GTEST_TESTS = libsnark/gtests +GTEST_TESTS = -GTEST_SRCS = \ - libsnark/algebra/curves/tests/test_bilinearity.cpp \ - libsnark/algebra/curves/tests/test_groups.cpp \ - libsnark/algebra/fields/tests/test_bigint.cpp \ - libsnark/algebra/fields/tests/test_fields.cpp \ - libsnark/gadgetlib1/gadgets/hashes/sha256/tests/test_sha256_gadget.cpp \ - libsnark/gadgetlib1/gadgets/merkle_tree/tests/test_merkle_tree_gadgets.cpp \ - libsnark/relations/arithmetic_programs/qap/tests/test_qap.cpp \ - libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/tests/test_r1cs_ppzksnark.cpp \ - libsnark/gtests.cpp +GTEST_SRCS = DOCS = README.html @@ -175,6 +173,7 @@ all: \ $(if $(NO_GTEST),,$(EXECUTABLES_WITH_GTEST) $(GTEST_TESTS)) \ $(if $(NO_SUPERCOP),,$(EXECUTABLES_WITH_SUPERCOP)) \ $(EXECUTABLES) \ + $(LIBSNARK_A) \ $(if $(NO_DOCS),,doc) doc: $(DOCS) diff --git a/src/snark/README.md b/src/snark/README.md index 89183b43a..d5aa34006 100644 --- a/src/snark/README.md +++ b/src/snark/README.md @@ -14,7 +14,7 @@ Copyright (c) 2012-2014 SCIPR Lab and contributors (see [AUTHORS] file). [TOC]