Skip to content

Commit

Permalink
Merge zcash core 'v2.0.1'
Browse files Browse the repository at this point in the history
Conflicts:
	README.md
	src/chainparams.cpp
	src/metrics.cpp
  • Loading branch information
Tomas-M committed Oct 15, 2018
2 parents bccc5c7 + e8f5e59 commit 028647c
Show file tree
Hide file tree
Showing 178 changed files with 6,986 additions and 1,665 deletions.
1 change: 1 addition & 0 deletions COPYING
@@ -1,5 +1,6 @@
Copyright (c) 2016-2018 The Zcash developers
Copyright (c) 2009-2018 The Bitcoin Core developers
Copyright (c) 2009-2018 Bitcoin Developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
VoteCoin 2.0.0
VoteCoin 2.0.1
==============

What is VoteCoin?
Expand Down
14 changes: 11 additions & 3 deletions configure.ac
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_REVISION, 1)
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)))
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
Expand Down Expand Up @@ -483,8 +483,9 @@ if test x$use_hardening != xno; then
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
],[AC_MSG_ERROR(Cannot enable -D_FORTIFY_SOURCE=2)])

if test x$BUILD_OS = xdarwin; then
if test x$BUILD_OS = xdarwin || test x$TARGET_OS = xwindows; then
# Xcode's ld (at least ld64-302.3) doesn't support -z
# mingw-w64's ld (at least mingw-w64 4.0.4-2) also appears to not support -z
AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"],[AC_MSG_WARN(Cannot enable RELRO)])
AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"],[AC_MSG_WARN(Cannot enable BIND_NOW)])
else
Expand Down Expand Up @@ -732,7 +733,14 @@ AC_CHECK_LIB([gmp],[[__gmpn_sub_n]],GMP_LIBS=-lgmp, [AC_MSG_ERROR(libgmp missing
AC_CHECK_HEADER([gmpxx.h],,AC_MSG_ERROR(libgmpxx headers missing))
AC_CHECK_LIB([gmpxx],[main],GMPXX_LIBS=-lgmpxx, [AC_MSG_ERROR(libgmpxx missing)])

RUST_LIBS="-lrustzcash -ldl"
RUST_LIBS="-lrustzcash"
case $host in
*mingw*)
;;
*)
RUST_LIBS="$RUST_LIBS -ldl"
;;
esac

dnl Check for OpenMP support
AX_OPENMP(
Expand Down
46 changes: 23 additions & 23 deletions contrib/ci-workers/README.md
Expand Up @@ -5,58 +5,58 @@ installation for use as a Buildbot worker in Zcash's CI.

# Criteria for Adding Workers

a. Don't add workers until users complain about a problem on a platform
that doesn't yet have workers or if we anticipate many users will use
a platform, we may pre-emptively add an unsupported worker for it.
a. Don't add workers until users complain about a problem on a platform that
doesn't yet have workers. However, if we anticipate many users will use a
platform, we may pre-emptively add an unsupported worker for it.

b. Prioritize the platforms that seem to have the most users.

c. When adding workers start by adding workers for the "most common"
variant of any distro, then if users later encounter problems with a
sub-variant, we can consider adding new workers at that point.
Example: add Ubuntu Desktop before Xubuntu, on the assumption the
former has a larger population base.
c. When adding workers, start by adding workers for the "most common" variant of
any distro. Then if users later encounter problems with a sub-variant, we can
consider adding new workers at that point. Example: add Ubuntu Desktop before
Xubuntu, on the assumption the former has a larger population base, and the
latter only materially differs in the GUI.

# Setting up a latent worker on Amazon EC2

- Add a regular (non-latent) worker to the master.cfg for dev-ci.z.cash, and
deploy the changes.
1. Add a regular (non-latent) worker to the master.cfg for dev-ci.z.cash, and
deploy the changes.
- This enables the Ansible playbook to run to completion, ending in the worker
connecting to the master.

- Start a basic EC2 instance using the template AMI for the target OS.
2. Start a basic EC2 instance using the template AMI for the target OS.
- Choose the smallest instance size, it won't be used for building Zcash.

- Figure out which user to log into the instance with.
3. Figure out which user to log into the instance with.
- E.g. for the Ubuntu template, use "ubuntu" instead of "root"
- If you get an Ansible error later with a message like "Failed to connect to
the host via ssh: Received message too long 1349281121\r\n", that means the
instance is sending a text string in response to the SSH connection, and the
Ansible protocol is balking. Try manually logging in with the same
credentials to diagnose.

- Create `inventory/hosts` containing the following:
4. Create `inventory/hosts` containing the following:

[zcash-ci-worker-unix]
some-name ansible_host=<INSTANCE_IP> ansible_ssh_user=<USERNAME>

- Run `ansible-playbook -e buildbot_worker_host_template=templates/host.ec2.j2 -i inventory/hosts unix.yml`,
passing in the worker's Buildbot name and password.
5. Run `ansible-playbook -e buildbot_worker_host_template=templates/host.ec2.j2 -i inventory/hosts unix.yml`,
passing in the worker's Buildbot name and password.
- After a successful run, the worker should be connected to dev-ci.z.cash and
visible in its worker list.

- Create an AMI from the instance. This is the worker AMI to put into the
master.cfg for dev-ci.z.cash.
6. Create an AMI from the instance. This is the worker AMI to put into the
master.cfg for dev-ci.z.cash.
- 16 GB of storage should be sufficient.

- SSH into the instance, and edit the worker config to connect to ci.z.cash.
7. SSH into the instance, and edit the worker config to connect to ci.z.cash.

- Create an AMI from the instance. This is the worker AMI to put into the
master.cfg for ci.z.cash.
8. Create an AMI from the instance. This is the worker AMI to put into the
master.cfg for ci.z.cash.
- 16 GB of storage should be sufficient.

- Delete the instance (it is no longer needed).
9. Delete the instance (it is no longer needed).

- Edit the master.cfg to turn the new worker into a latent (using the new AMI
IDs), add it to the appropriate worker groups, set up new builders etc.
10. Edit the master.cfg to turn the new worker into a latent (using the new AMI
IDs), add it to the appropriate worker groups, set up new builders etc.
- Deploy this via the normal PR review process.
2 changes: 2 additions & 0 deletions contrib/ci-workers/files/bashrc
@@ -0,0 +1,2 @@
export PATH=$HOME/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export EDITOR=vim
10 changes: 10 additions & 0 deletions contrib/ci-workers/tasks/install-brew.yml
@@ -0,0 +1,10 @@
---
- name: Check if brew is installed
stat:
path: /usr/local/bin/brew
register: brew_check

- name: Fail if brew is unavailable
fail:
msg: 'brew is not installed! Please install Homebrew: https://docs.brew.sh/Installation.html'
when: not brew_check.stat.exists
23 changes: 23 additions & 0 deletions contrib/ci-workers/templates/buildbot-worker.plist.j2
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.buildbot.worker</string>
<key>ProgramArguments</key>
<array>
<string>{{ buildbot_worker_dir }}/venv/bin/buildbot-worker</string>
<string>start</string>
<string>{{ buildbot_worker_name }}</string>
</array>
<key>WorkingDirectory</key>
<string>{{ buildbot_worker_dir }}</string>
<key>UserName</key>
<string>{{ buildbot_worker_user }}</string>
<key>KeepAlive</key>
<dict>
<key>NetworkState</key>
<true/>
</dict>
</dict>
</plist>
10 changes: 5 additions & 5 deletions contrib/ci-workers/templates/buildbot-worker.service.j2
Expand Up @@ -5,11 +5,11 @@ After=network.target

[Service]
Type=forking
PIDFile=/home/{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/twistd.pid
WorkingDirectory=/home/{{ buildbot_worker_user }}
ExecStart={{ pip_bin_dir }}/buildbot-worker start {{ buildbot_worker_name }}
ExecReload={{ pip_bin_dir }}/buildbot-worker restart {{ buildbot_worker_name }}
ExecStop={{ pip_bin_dir }}/buildbot-worker stop {{ buildbot_worker_name }}
PIDFile={{ buildbot_worker_dir }}/{{ buildbot_worker_name }}/twistd.pid
WorkingDirectory={{ buildbot_worker_dir }}
ExecStart={{ buildbot_worker_dir }}/venv/bin/buildbot-worker start {{ buildbot_worker_name }}
ExecReload={{ buildbot_worker_dir }}/venv/bin/buildbot-worker restart {{ buildbot_worker_name }}
ExecStop={{ buildbot_worker_dir }}/venv/bin/buildbot-worker stop {{ buildbot_worker_name }}
Restart=always
User={{ buildbot_worker_user }}

Expand Down
2 changes: 1 addition & 1 deletion contrib/ci-workers/templates/host.j2
@@ -1,3 +1,3 @@
OS: {{ ansible_distribution }} {{ ansible_distribution_version }}
Memory: {{ ansible_memtotal_mb }} MB
CPU: {{ ansible_processor[1] }}
CPU: {{ ansible_processor if ansible_processor is string else ansible_processor[1] }} ({{ ansible_processor_cores }} cores)
75 changes: 66 additions & 9 deletions contrib/ci-workers/unix.yml
Expand Up @@ -50,6 +50,7 @@

- name: Gathering Facts
setup:
tags: deps

- name: Fail if Python is the wrong version
fail:
Expand All @@ -66,34 +67,44 @@
- "vars/{{ ansible_distribution }}.yml"
- "vars/{{ ansible_os_family }}.yml"
skip: true
tags: deps

- name: Collate dependencies
set_fact:
package_deps: "{{ buildbot_deps + fetch_deps + conf_deps + build_deps + link_deps + dist_deps }}"
python_modules: "{{ buildbot_modules + rpc_test_modules }}"
tags: deps

- name: Install Homebrew [MacOSX]
include: tasks/install-brew.yml
when: ansible_distribution == 'MacOSX'
tags: deps

- name: Update rolling release [Arch Linux]
pacman:
update_cache: yes
upgrade: yes
when: ansible_distribution == 'Archlinux'
tags: deps

- name: Install required packages
package:
name: "{{ item }}"
state: present
with_items: "{{ package_deps }}"
become_user: "{{ ansible_ssh_user if ansible_distribution == 'MacOSX' else 'root' }}"
tags: deps

- name: Install pip [CentOS]
- name: Install pip [CentOS, MacOSX]
include: tasks/install-pip.yml
when: ansible_distribution == 'CentOS'
when: ansible_distribution in ['CentOS', 'MacOSX']

- name: Install required Python modules
- name: Install required Python system modules
pip:
name: "{{ item }}"
state: latest
with_items: "{{ python_modules }}"
notify: restart buildbot-worker
executable: "{{ '/usr/local/bin/pip' if ansible_distribution == 'MacOSX' else omit }}"
with_items: "{{ system_modules }}"

- name: Set up the Buildbot worker user
user:
Expand All @@ -102,9 +113,28 @@
shell: /bin/bash
state: present

- name: Get absolute path to Buildbot worker home directory
command: echo ~
register: homedir
become_user: "{{ buildbot_worker_user }}"

- name: Save absolute path to Buildbot worker home directory
set_fact:
buildbot_worker_dir: "{{ homedir.stdout }}"

- name: Install required Python modules
pip:
name: "{{ item }}"
state: latest
virtualenv: "~{{ buildbot_worker_user }}/venv"
virtualenv_command: "{{ '/usr/local/bin/virtualenv' if ansible_distribution == 'MacOSX' else omit }}"
with_items: "{{ python_modules }}"
become_user: "{{ buildbot_worker_user }}"
notify: restart buildbot-worker

- name: Create Buildbot worker
command: >
buildbot-worker create-worker ~/{{ buildbot_worker_name }}
~{{ buildbot_worker_user }}/venv/bin/buildbot-worker create-worker ~/{{ buildbot_worker_name }}
{{ buildbot_master_host }}:{{ buildbot_master_port }}
{{ buildbot_worker_name|quote }} {{ buildbot_worker_password|quote }}
args:
Expand All @@ -116,15 +146,23 @@
content: "{{ buildbot_worker_admin }}"
dest: "~{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/info/admin"
owner: "{{ buildbot_worker_user }}"
group: "{{ buildbot_worker_user }}"
group: "{{ omit if ansible_distribution == 'MacOSX' else buildbot_worker_user }}"
mode: "0644"

- name: Set host details for Buildbot worker
template:
src: "{{ buildbot_worker_host_template }}"
dest: "~{{ buildbot_worker_user }}/{{ buildbot_worker_name }}/info/host"
owner: "{{ buildbot_worker_user }}"
group: "{{ buildbot_worker_user }}"
group: "{{ omit if ansible_distribution == 'MacOSX' else buildbot_worker_user }}"
mode: "0644"

- name: Install custom bashrc for virtualenv
copy:
src: bashrc
dest: "~{{ buildbot_worker_user }}/.bashrc"
owner: "{{ buildbot_worker_user }}"
group: "{{ omit if ansible_distribution == 'MacOSX' else buildbot_worker_user }}"
mode: "0644"

- name: Copy Buildbot worker systemd service unit
Expand All @@ -134,13 +172,32 @@
owner: root
group: root
mode: "0644"
when: ansible_distribution != 'MacOSX'
notify: reload systemd

- name: Start Buildbot worker.
- name: Copy Buildbot worker launchd service unit
template:
src: templates/buildbot-worker.plist.j2
dest: "/Library/LaunchDaemons/net.buildbot.worker.plist"
owner: root
group: wheel
mode: "0644"
when: ansible_distribution == 'MacOSX'

- name: Start Buildbot worker
service:
name: buildbot-worker
state: started
enabled: yes
when: ansible_distribution != 'MacOSX'

- name: Load Buildbot worker service [MacOSX]
command: launchctl load /Library/LaunchDaemons/net.buildbot.worker.plist
when: ansible_distribution == 'MacOSX'

- name: Start Buildbot worker [MacOSX]
command: launchctl start net.buildbot.worker
when: ansible_distribution == 'MacOSX'

handlers:
- name: restart buildbot-worker
Expand Down
2 changes: 1 addition & 1 deletion contrib/ci-workers/vars/Archlinux.yml
Expand Up @@ -2,6 +2,6 @@
buildbot_deps:
- python2-pip
build_deps:
- cmake
- multilib/gcc
- make
pip_bin_dir: /usr/bin
2 changes: 1 addition & 1 deletion contrib/ci-workers/vars/CentOS.yml
Expand Up @@ -2,6 +2,7 @@
buildbot_deps: [] # Empty to remove python-pip
build_deps:
- bzip2
- cmake
- gcc
- gcc-c++
- make
Expand All @@ -10,4 +11,3 @@ dist_deps:
- pkgconfig # Required until b556beda264308e040f8d88aca4f2f386a0183d9 is pulled in
- python-devel
- redhat-rpm-config
pip_bin_dir: /usr/bin
2 changes: 1 addition & 1 deletion contrib/ci-workers/vars/Debian.yml
@@ -1,6 +1,6 @@
---
build_deps:
- build-essential # Depends on g++, libc6-dev, make
- cmake
dist_deps:
- pkg-config # Required until b556beda264308e040f8d88aca4f2f386a0183d9 is pulled in
- python-dev
1 change: 1 addition & 0 deletions contrib/ci-workers/vars/Fedora.yml
@@ -1,5 +1,6 @@
---
build_deps:
- cmake
- gcc
- gcc-c++
- make
Expand Down
1 change: 1 addition & 0 deletions contrib/ci-workers/vars/FreeBSD.yml
Expand Up @@ -2,6 +2,7 @@
buildbot_deps:
- py27-pip
build_deps:
- cmake
- gcc
- gmake
dist_deps:
Expand Down
6 changes: 6 additions & 0 deletions contrib/ci-workers/vars/MacOSX.yml
@@ -0,0 +1,6 @@
---
buildbot_deps:
- coreutils # For gnproc etc.
# Most are already installed
build_deps:
- cmake
3 changes: 1 addition & 2 deletions contrib/ci-workers/vars/Ubuntu.yml
@@ -1,5 +1,4 @@
---
build_deps:
- build-essential # Depends on g++, libc6-dev, make
dist_deps:
- pkg-config # Required until b556beda264308e040f8d88aca4f2f386a0183d9 is pulled in
- cmake

0 comments on commit 028647c

Please sign in to comment.