Skip to content

Commit af52517

Browse files
authored
[3.3.1] Consolidation of PR's and fixes
2 parents d7289f6 + 1b6e616 commit af52517

File tree

344 files changed

+106682
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+106682
-53
lines changed

.github/scripts/02-copy-build-dependencies.sh

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
OS=${1}
44
GITHUB_WORKSPACE=${2}
5+
GITHUB_REF=${3}
56

67
if [[ ! ${OS} || ! ${GITHUB_WORKSPACE} ]]; then
78
echo "Error: Invalid options"
@@ -16,17 +17,38 @@ if [[ ${OS} == "arm32v7-disable-wallet" || ${OS} == "linux-disable-wallet" ]]; t
1617
OS=`echo ${OS} | cut -d"-" -f1`
1718
fi
1819

19-
echo "----------------------------------------"
20-
echo "Retrieving Dependencies for ${OS}"
21-
echo "----------------------------------------"
20+
if [[ ${GITHUB_REF} =~ "release" ]]; then
21+
echo "----------------------------------------"
22+
echo "Building Dependencies for ${OS}"
23+
echo "----------------------------------------"
2224

23-
cd ${GITHUB_WORKSPACE}
24-
curl -O https://raven-build-resources.s3.amazonaws.com/${OS}/raven-${OS}-dependencies.tar.gz
25-
curl -O https://raven-build-resources.s3.amazonaws.com/${OS}/SHASUM
26-
if [[ $(sha256sum -c ${GITHUB_WORKSPACE}/SHASUM) ]]; then
27-
cd ${GITHUB_WORKSPACE}/depends
28-
tar zxvf ${GITHUB_WORKSPACE}/raven-${OS}-dependencies.tar.gz
25+
cd depends
26+
if [[ ${OS} == "windows" ]]; then
27+
make HOST=x86_64-w64-mingw32 -j2
28+
elif [[ ${OS} == "osx" ]]; then
29+
cd ${GITHUB_WORKSPACE}
30+
curl -O https://raven-build-resources.s3.amazonaws.com/osx/MacOSX10.11.sdk.tar.gz
31+
mkdir -p ${GITHUB_WORKSPACE}/depends/SDKs
32+
cd ${GITHUB_WORKSPACE}/depends/SDKs && tar -zxf ${GITHUB_WORKSPACE}/MacOSX10.11.sdk.tar.gz
33+
cd ${GITHUB_WORKSPACE}/depends && make HOST=x86_64-apple-darwin14 -j2
34+
elif [[ ${OS} == "linux" || ${OS} == "linux-disable-wallet" ]]; then
35+
make HOST=x86_64-linux-gnu -j2
36+
elif [[ ${OS} == "arm32v7" || ${OS} == "arm32v7-disable-wallet" ]]; then
37+
make HOST=arm-linux-gnueabihf -j2
38+
fi
2939
else
30-
echo "SHASUM doesn't match"
31-
exit 1
32-
fi
40+
echo "----------------------------------------"
41+
echo "Retrieving Dependencies for ${OS}"
42+
echo "----------------------------------------"
43+
44+
cd /tmp
45+
curl -O https://raven-build-resources.s3.amazonaws.com/${OS}/raven-${OS}-dependencies.tar.gz
46+
curl -O https://raven-build-resources.s3.amazonaws.com/${OS}/SHASUM
47+
if [[ $(sha256sum -c /tmp/SHASUM) ]]; then
48+
cd ${GITHUB_WORKSPACE}/depends
49+
tar zxvf /tmp/raven-${OS}-dependencies.tar.gz
50+
else
51+
echo "SHASUM doesn't match"
52+
exit 1
53+
fi
54+
fi

.github/scripts/04-configure-build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ elif [[ ${OS} == "linux" || ${OS} == "linux-disable-wallet" ]]; then
2121
elif [[ ${OS} == "arm32v7" || ${OS} == "arm32v7-disable-wallet" ]]; then
2222
if [[ ${OS} == "arm32v7-disable-wallet" ]]; then
2323
EXTRA_OPTS="--disable-wallet"
24+
CONFIG_SITE=${GITHUB_WORKSPACE}/depends/arm-linux-gnueabihf/share/config.site ./configure --prefix=/ --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++ --disable-tests --with-libs=no --with-gui=no ${EXTRA_OPTS}
25+
else
26+
CONFIG_SITE=${GITHUB_WORKSPACE}/depends/arm-linux-gnueabihf/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking --enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests CFLAGS="-O2 -g" CXXFLAGS="-O2 -g" LDFLAGS="-static-libstdc++"
2427
fi
25-
CONFIG_SITE=${GITHUB_WORKSPACE}/depends/arm-linux-gnueabihf/share/config.site ./configure --prefix=/ --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++ --disable-tests --with-libs=no --with-gui=no ${EXTRA_OPTS}
2628
else
2729
echo "You must pass an OS."
2830
echo "Usage: ${0} <operating system> <github workspace path> <disable wallet (true | false)>"
2931
exit 1
30-
fi
32+
fi

.github/workflows/build-raven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: sudo ${SCRIPTS}/00-install-deps.sh ${{ MATRIX.OS }}
3737

3838
- name: Copy Build Dependencies
39-
run: ${SCRIPTS}/02-copy-build-dependencies.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }}
39+
run: ${SCRIPTS}/02-copy-build-dependencies.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }} ${{ GITHUB.BASE_REF }} ${{ GITHUB.REF }}
4040

4141
- name: Add Dependencies to the System PATH
4242
run: ${SCRIPTS}/03-export-path.sh ${{ MATRIX.OS }} ${{ GITHUB.WORKSPACE }}

Makefile.am

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,21 @@ CLEANFILES = $(OSX_DMG) $(RAVEN_WIN_INSTALLER)
292292

293293
DISTCHECK_CONFIGURE_FLAGS = --enable-man
294294

295-
clean-local:
295+
doc/doxygen/.stamp: doc/Doxyfile FORCE
296+
$(MKDIR_P) $(@D)
297+
$(DOXYGEN) $^
298+
$(AM_V_at) touch $@
299+
300+
if HAVE_DOXYGEN
301+
docs: doc/doxygen/.stamp
302+
else
303+
docs:
304+
@echo "error: doxygen not found"
305+
endif
306+
307+
clean-docs:
308+
rm -rf doc/doxygen
309+
310+
clean-local: clean-docs
296311
rm -rf coverage_percent.txt test_raven.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
297312
rm -rf test/functional/__pycache__

assets/tools/vanity_address_gen.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
from ravenrpc import Ravencoin # pip install ravenrpc
2+
import sys
3+
import os
4+
import time
5+
6+
# Requires ravenrpc==0.2.4
7+
#
8+
# usage:
9+
# ```
10+
# python vanity_address_gen.py ( rpcuser ) ( rpcpass ) ( prefix ) ( ignore_case=True )
11+
# ```
12+
13+
14+
15+
def valid_base58(s):
16+
for c in ('0', 'O', 'l', '1'):
17+
if c in s:
18+
print(f'Cannot use charachter "{c}" in prefix!!')
19+
exit()
20+
21+
def success_odds(prefix, ignore_case):
22+
odds = 1
23+
for letter in prefix[1:]:
24+
if letter in ('o', 'l') or not ignore_case:
25+
odds *= 58
26+
else:
27+
odds *= 29
28+
return odds
29+
30+
def create_rvn_inst():
31+
try:
32+
rvn = Ravencoin(sys.argv[1], sys.argv[2])
33+
except IndexError:
34+
print('You must provide a valid rpc username and rpc password!')
35+
exit()
36+
return rvn
37+
38+
def get_args():
39+
try:
40+
prefix = sys.argv[3]
41+
except IndexError:
42+
print('Missing options!\n'
43+
'Usage: `python gen.py <rpcuser> <rpcpass> <prefix> <ignore case (default True)>`')
44+
exit()
45+
ignore_case = sys.argv[4] if len(sys.argv) > 4 else True
46+
if prefix[0] != 'R':
47+
print('Please start your prefix with an "R"\n'
48+
'Usage: `python gen.py <rpcuser> <rpcpass> <prefix> <ignore case (default True)>`')
49+
exit()
50+
return prefix, ignore_case, create_rvn_inst()
51+
52+
def validate_rvn(rvn):
53+
if rvn.getinfo() == '':
54+
print('Run ravend')
55+
exit()
56+
57+
def display_stats(count, start, addr, prefix, odds):
58+
addr_sec = count/(time.time() - start)
59+
os.system('cls' if os.name == 'nt' else 'clear')
60+
print(f'Tried {count} addresses\n'
61+
f'Seconds Spent: {time.time() - start}\n'
62+
f'Ave. Addresses/sec: {addr_sec}\n'
63+
f'Lastest Address: {addr}\n'
64+
f'Prefix: {prefix}\n'
65+
f'You have a 1 in {odds} chance per address!\n'
66+
f'At this rate, you will find your address in ~{odds/addr_sec/60} minutes!\n'
67+
'To stop, press Ctrl-C', flush=True, end='')
68+
69+
70+
def main():
71+
prefix, ignore_case, rvn = get_args()
72+
validate_rvn(rvn)
73+
valid_base58(prefix)
74+
start = time.time()
75+
odds = success_odds(prefix, ignore_case)
76+
count = 0
77+
address = rvn.getnewaddress()['result']
78+
try:
79+
while not address.lower().startswith(prefix.lower()) if ignore_case else address.startswith(prefix):
80+
address = rvn.getnewaddress()['result']
81+
count += 1
82+
if count % 100 == 1:
83+
display_stats(count, start, address, prefix, odds)
84+
except KeyboardInterrupt:
85+
exit()
86+
print(f'\nFound an address that starts with {prefix}!\n It is saved to your wallet. Use it freely!\n{address}')
87+
88+
if __name__ == '__main__':
89+
main()

configure.ac

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
22
AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 3)
44
define(_CLIENT_VERSION_MINOR, 3)
5-
define(_CLIENT_VERSION_REVISION, 0)
5+
define(_CLIENT_VERSION_REVISION, 1)
66
define(_CLIENT_VERSION_BUILD, 0)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
88
define(_COPYRIGHT_YEAR, 2019)
@@ -94,6 +94,12 @@ AC_PATH_TOOL(READELF, readelf)
9494
AC_PATH_TOOL(CPPFILT, c++filt)
9595
AC_PATH_TOOL(OBJCOPY, objcopy)
9696

97+
AC_PATH_PROG(DOXYGEN, doxygen)
98+
if test -z "$DOXYGEN"; then
99+
AC_MSG_WARN([Doxygen not found])
100+
fi
101+
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
102+
97103
AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)
98104

99105
# Enable wallet
@@ -1242,7 +1248,7 @@ AC_SUBST(PROTOBUF_LIBS)
12421248
AC_SUBST(QR_LIBS)
12431249
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
12441250
AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
1245-
AC_CONFIG_FILES([doc/Doxyfile])
1251+
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
12461252
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
12471253
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
12481254
AC_CONFIG_LINKS([test/util/raven-util-test.py:test/util/raven-util-test.py])

crash

31 Bytes
Binary file not shown.

doc/developer-notes.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,21 @@ Not OK (used plenty in the current source, but not picked up):
129129
//
130130
```
131131

132-
A full list of comment syntaxes picked up by doxygen can be found at http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html,
132+
A full list of comment syntaxes picked up by doxygen can be found at
133+
http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html,
133134
but if possible use one of the above styles.
134135

136+
The Ravencoin Doxygen documentation can be generated by running `make docs` from the top-level
137+
directory of the repository.
138+
That creates the documentation in the directory "doc/doxygen" and the it can be accessed by a browser at:
139+
doc/doxygen/html/index.html
140+
The documentation can by deleted by running `make clean-docs`.
141+
142+
Before running `make docs`, you will need to install dependencies `doxygen` and `dot` (a component
143+
of `graphviz`). For example,
144+
on MacOS via Homebrew: `brew install doxygen --with-graphviz`
145+
on Debian/Ubuntu: `sudo install doxygen graphviz`
146+
135147
Development tips and tricks
136148
---------------------------
137149

src/consensus/tx_verify.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,7 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe
259259
bool fIsOwner;
260260
if (txout.scriptPubKey.IsAssetScript(nType, fIsOwner))
261261
isAsset = true;
262-
263-
// Make sure that all asset tx have a nValue of zero RVN
264-
if (isAsset && txout.nValue != 0)
265-
return state.DoS(100, false, REJECT_INVALID, "bad-txns-asset-tx-amount-isn't-zero");
266-
262+
267263
// Check for transfers that don't meet the assets units only if the assetCache is not null
268264
if (isAsset) {
269265
// Get the transfer transaction data from the scriptPubKey
@@ -304,6 +300,14 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fChe
304300
if (transfer.nAmount < QUALIFIER_ASSET_MIN_AMOUNT || transfer.nAmount > QUALIFIER_ASSET_MAX_AMOUNT)
305301
return state.DoS(100, false, REJECT_INVALID, "bad-txns-transfer-qualifier-amount-must be between 1 - 100");
306302
}
303+
304+
// Specific check and error message to go with to make sure the amount is 0
305+
if (txout.nValue != 0)
306+
return state.DoS(100, false, REJECT_INVALID, "bad-txns-asset-transfer-amount-isn't-zero");
307+
} else if (nType == TX_NEW_ASSET) {
308+
// Specific check and error message to go with to make sure the amount is 0
309+
if (txout.nValue != 0)
310+
return state.DoS(100, false, REJECT_INVALID, "bad-txns-asset-issued-amount-isn't-zero");
307311
}
308312
}
309313
}

src/fs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111

1212
#include <boost/filesystem.hpp>
1313
#include <boost/filesystem/fstream.hpp>
14+
15+
#ifdef WIN32
1416
#include <boost/filesystem/detail/utf8_codecvt_facet.hpp>
17+
#endif
1518

1619
/** Filesystem operations and types */
1720
namespace fs = boost::filesystem;

0 commit comments

Comments
 (0)