Compare commits

...

730 Commits

Author SHA1 Message Date
luigi1111
ab18fea350 Merge pull request #8096
7430b9e Fix Android OpenSSL build (Howard Chu)
2021-11-30 17:07:33 -05:00
luigi1111
36e94231e8 Merge pull request #8094
6b881af cmake: set 3.5 as minimum version (selsta)
2021-11-30 17:07:05 -05:00
Howard Chu
7430b9e7dc Fix Android OpenSSL build
depends didn't have target-specific overrides for _build_env
so ANDROID_NDK_HOME wasn't being set at build time.
This fix supersedes the manual edit of Configuration/15-android.conf.
Resolves #8095
2021-11-30 04:16:19 +00:00
selsta
6b881af1ac cmake: set 3.5 as minimum version 2021-11-29 15:08:48 +01:00
luigi1111
0ea5cc9bd2 Merge pull request #7977
fc4e574 Add simple script for running gitian-build (Howard Chu)
2021-11-29 00:52:50 -06:00
luigi1111
6a3902b9a5 Merge pull request #8085
39bb22a blocks: update checkpoints.dat (selsta)
2021-11-26 23:06:34 -06:00
luigi1111
dfb818a01b Merge pull request #8084
a4954a9 rpc: fix DoS vector in get_output_distribution (moneromooo-monero)
2021-11-26 23:05:52 -06:00
luigi1111
a96fd84502 Merge pull request #8075
6f80a46 Add python method (Howard Chu)
c09054b Add calcpow RPC (Howard Chu)
2021-11-26 23:04:57 -06:00
luigi1111
bf54ddd048 Merge pull request #8072
7a21487 Update RandomX (Jethro Grassie)
2021-11-26 23:03:50 -06:00
luigi1111
0de147644a Merge pull request #8056
9d6ba37 hidapi: bump hidapi to 0.11.0 (selsta)
2021-11-26 22:59:55 -06:00
selsta
39bb22a114 blocks: update checkpoints.dat 2021-11-26 18:58:17 +01:00
Howard Chu
6f80a46afa Add python method 2021-11-21 01:25:42 +00:00
Howard Chu
c09054bbf9 Add calcpow RPC
Calculate PoW hash for a block candidate
2021-11-20 18:51:45 +00:00
Jethro Grassie
7a2148744c Update RandomX 2021-11-20 00:08:36 -05:00
luigi1111
72e778a04c Merge pull request #8049
782e8a3 Update RandomX to v1.1.10 (tevador)
2021-11-09 22:55:54 -06:00
luigi1111
331c3e4ba3 Merge pull request #8039
c942c2c device: fix ledger error strings, add human friendly messages (selsta)
99b97dc device: Ledger - update status codes (xiphon)
2021-11-09 22:54:50 -06:00
luigi1111
369853979a Merge pull request #8037
df79eb1 depends: openssl 1.1.1k -> 1.1.1l (selsta)
2021-11-09 22:53:18 -06:00
luigi1111
c803f6727a Merge pull request #8032
c9f73f1 slow_hash: don't blow out Mac stack on ARM64 (Howard Chu)
2021-11-09 22:51:03 -06:00
luigi1111
85653bcd83 Merge pull request #8023
3cb7fda build: prepare v0.17.3.0 (selsta)
2021-11-09 22:49:19 -06:00
luigi1111
e4376eed9e Merge pull request #7997
29c03e2 wallet_api: enable set_strict_default_file_permissions (tobtoht)
1c26d34 epee: add missing header (selsta)
1d451a6 depends: update zeromq package to 4.3.4 (selsta)
5180610 cmake: use CMAKE_CURRENT_LIST_DIR for git version (selsta)
5aae00a epee: avoid ADL selecting C++14 std::quoted (selsta)
cf31136 cmake: set cpp14 standard (selsta)
945665f fix median overflow bug (koe)
908ecb3 LMDB: fix deadlock in resized detection (Howard Chu)
a492c4e blockchain: fix pedantic assert (selsta)
1e663e8 Increase timeout for the mining test 4 times (to 240s) (mj-xmr)
4760f8b Wallet2: Update 'approximate_testnet_rolled_back_blocks' (rbrunner7)
76b6120 cmake: set required C/C++ standard to 11 (selsta)
3067987 Fix parallel make of OpenSSL (Howard Chu)
1219c74 add singapore.node.xmr.pm to seed nodes (lza_menace)
689dd52 net_node: add seed node (selsta)
95936a3 depends: update unwind, fix build with ubuntu 21.04 (selsta)
e2c802f Only INFO log for short seed words with ALLOW_SHORT_WORDS active (rbrunner7)
14df8ad epee: don't log raw packet data (moneromooo-monero)
5fa7208 Mac: Enable on ARM, by not enforcing x86_64 (mj-xmr)
fe6ab93 daemon: allow proxy configuration (anon)
52dcc03 bootstrap_daemon: proxy configuration support (xiphon)
a6df656 wallet2: chunk get_outs.bin calls to avoid sanity limits (moneromooo-monero)
2021-11-09 22:47:33 -06:00
selsta
9d6ba37ad4 hidapi: bump hidapi to 0.11.0 2021-11-10 03:16:39 +01:00
tevador
782e8a3c08 Update RandomX to v1.1.10 2021-11-08 21:33:11 +01:00
selsta
c942c2c97b device: fix ledger error strings, add human friendly messages 2021-11-03 00:14:10 +01:00
xiphon
99b97dc389 device: Ledger - update status codes 2021-11-03 00:05:03 +01:00
selsta
df79eb15e2 depends: openssl 1.1.1k -> 1.1.1l 2021-11-02 19:08:18 +01:00
luigi1111
97b7a41bfa Merge pull request #8030
89a0b31 crypto: fix typo in ifdef (selsta)
2021-11-01 12:32:49 -05:00
luigi1111
f68e72b2a2 Merge pull request #8014
103c973 wallet2: fix key encryption when changing ask-password from 0/1 to 2 (moneromooo-monero)
2021-11-01 12:26:41 -05:00
Howard Chu
c9f73f1c7a slow_hash: don't blow out Mac stack on ARM64 2021-10-30 22:28:32 +01:00
selsta
3cb7fda428 build: prepare v0.17.3.0 2021-10-29 22:26:59 +02:00
selsta
89a0b31380 crypto: fix typo in ifdef 2021-10-29 17:58:53 +02:00
luigi1111
fce167d7cc Merge pull request #8022
6c084e1 protocol: fix spurious rejection of downloaded blocks (moneromooo-monero)
2021-10-25 19:03:13 -05:00
luigi1111
b2185fe512 Merge pull request #8007
8bc414b Add README to release archives (Howard Chu)
840cd25 README v12 fork occurred on 2019-11-30 as expected (Howard Chu)
2021-10-25 19:01:24 -05:00
luigi1111
2ac8f5b58e Merge pull request #7996
423b655 socks: ignore any exceptions in shutdown/close (selsta)
2021-10-25 18:58:20 -05:00
moneromooo-monero
a4954a9eeb rpc: fix DoS vector in get_output_distribution
This will prevent people spending old pre-rct outputs using a
stranger's node, which may be a good thing
2021-10-24 17:17:05 +00:00
moneromooo-monero
6c084e1fa3 protocol: fix spurious rejection of downloaded blocks
when kicking a peer for inactivity, clear the set of requested blocks,
or next time we requests blocks from it, we'll probably reject the
incoming blocks due to missing the previous requested blocks
2021-10-23 11:51:30 +00:00
selsta
423b6553a1 socks: ignore any exceptions in shutdown/close 2021-10-22 22:01:01 +02:00
tobtoht
29c03e2d90 wallet_api: enable set_strict_default_file_permissions 2021-10-22 05:51:57 +02:00
selsta
1c26d34a2a epee: add missing header 2021-10-22 04:51:49 +02:00
selsta
1d451a6855 depends: update zeromq package to 4.3.4 2021-10-21 20:02:53 +02:00
selsta
5180610c4b cmake: use CMAKE_CURRENT_LIST_DIR for git version 2021-10-21 20:02:30 +02:00
selsta
5aae00ac79 epee: avoid ADL selecting C++14 std::quoted 2021-10-20 19:35:17 +02:00
moneromooo-monero
103c9733b3 wallet2: fix key encryption when changing ask-password from 0/1 to 2
we reuse the wallet_keys_unlocker object, which does the right thing
in conjunction with other users of decrypt/encrypt (ie, refresh).
2021-10-19 22:00:18 +00:00
selsta
cf31136617 cmake: set cpp14 standard
It's 2021, we can easily switch to C++14 without any troubles.
2021-10-18 07:33:17 +02:00
luigi1111
61e16307cd Merge pull request #8005
3a3fbc3 ARMv8: detect AES support dynamically (Howard Chu)
2021-10-17 23:41:08 -05:00
luigi1111
7ab32cf13a Merge pull request #7993
c599b56 Decrease the 'recent spend window' in gamma re-select to 15 blocks (j-berman)
2021-10-17 23:37:39 -05:00
luigi1111
0ad56647d3 Merge pull request #7870
56589dd UB: virtual methods in destructor at Trezor (mj-xmr)
2021-10-17 23:28:38 -05:00
luigi1111
1aad001d96 Merge pull request #7868
36527c0 UB: virtual method in destructor of WalletImpl v0.17 (mj-xmr)
2021-10-17 23:27:23 -05:00
luigi1111
33fe0e8003 Merge pull request #7861
cf65e5b LMDB: protection against UB, by not calling virtual methods from destructor - v0.17 (mj-xmr)
2021-10-17 23:26:12 -05:00
luigi1111
b8ed1cbbc9 Merge pull request #7798
3d9f348 Fix precision of average_output_time (j-berman)
2021-10-17 23:21:58 -05:00
Howard Chu
8bc414bb55 Add README to release archives
Also add ANONYMITY_NETWORKS.md
2021-10-14 15:40:29 +01:00
Howard Chu
840cd25d27 README v12 fork occurred on 2019-11-30 as expected
Not just an estimated date.
Also fix whitespace alignment.
Note for future: always use backslash-asterisk if adding this
notation, otherwise it screws up rendering on some MD formatters
2021-10-14 15:38:41 +01:00
koe
945665ff70 fix median overflow bug 2021-10-14 02:43:57 +02:00
Howard Chu
908ecb3cee LMDB: fix deadlock in resized detection 2021-10-14 02:42:47 +02:00
selsta
a492c4e3ab blockchain: fix pedantic assert 2021-10-14 02:42:02 +02:00
Howard Chu
3a3fbc3347 ARMv8: detect AES support dynamically 2021-10-11 19:51:11 +01:00
luigi1111
88b80583b8 Merge pull request #7978
4d224de Quicker resource cleanup on p2p socks timeout (Lee *!* Clagett)
2021-10-11 13:03:40 -05:00
luigi1111
532d382d56 Merge pull request #7976
f508612 gitian: cleanup more unused packages (Howard Chu)
b8685bc gitian: omit ccache from gitian builds (Howard Chu)
2021-10-11 13:01:28 -05:00
luigi1111
e6f07c0379 Merge pull request #7959
209c031 rpc: Fix get_transactions failing when not found (Nathan Dorfman)
2021-10-11 12:58:42 -05:00
luigi1111
6f2ebee8ff Merge pull request #7873
d4c7549 node_server: fix race condition (anon)
2909bd1 node_server: add race condition demo (anon)
2021-10-11 12:55:31 -05:00
mj-xmr
1e663e8488 Increase timeout for the mining test 4 times (to 240s) 2021-10-10 12:34:07 +02:00
rbrunner7
4760f8b49b Wallet2: Update 'approximate_testnet_rolled_back_blocks' 2021-10-07 04:54:03 +02:00
luigi1111
123c46d331 Merge pull request #7985
2481333 workflows: add missing dependency, fix mac build (selsta)
2021-10-05 21:45:19 -05:00
selsta
76b61204d1 cmake: set required C/C++ standard to 11
Co-authored-by: Jason Rhinelander <jason@imaginary.ca>
2021-10-06 01:58:51 +02:00
Howard Chu
306798746e Fix parallel make of OpenSSL 2021-10-06 01:58:51 +02:00
lza_menace
1219c74e80 add singapore.node.xmr.pm to seed nodes 2021-10-06 01:58:51 +02:00
selsta
689dd52a9d net_node: add seed node 2021-10-06 01:58:51 +02:00
selsta
95936a3fc3 depends: update unwind, fix build with ubuntu 21.04 2021-10-06 01:58:51 +02:00
rbrunner7
e2c802f6b2 Only INFO log for short seed words with ALLOW_SHORT_WORDS active 2021-10-06 01:58:50 +02:00
moneromooo-monero
14df8ad7a6 epee: don't log raw packet data 2021-10-06 01:58:50 +02:00
mj-xmr
5fa7208ef0 Mac: Enable on ARM, by not enforcing x86_64 2021-10-06 01:58:50 +02:00
anon
fe6ab93fb0 daemon: allow proxy configuration
Co-authored-by: selsta <selsta@sent.at>
Co-authored-by: tobtoht <thotbot@protonmail.com>
2021-10-06 01:58:50 +02:00
xiphon
52dcc03068 bootstrap_daemon: proxy configuration support 2021-10-06 01:58:46 +02:00
moneromooo-monero
a6df656b4e wallet2: chunk get_outs.bin calls to avoid sanity limits 2021-10-06 01:56:27 +02:00
j-berman
c599b56f2c Decrease the "recent spend window" in gamma re-select to 15 blocks
- combined with patching integer truncation (#7798), this gets the algorithm marginally closer to mirroring empirically observed output ages
- 50 was originally chosen assuming integer truncation would remain in the client for that client release version. But patching integer truncation causes the client to select more outputs in the 10-100 block range, and therefore the benefit of choosing a larger recent spend window of 50 has less merit
- 15 seems well-suited to cover the somewhat sizable observable gap in the early window of blocks
2021-10-04 20:12:23 -07:00
selsta
24813330ec workflows: add missing dependency, fix mac build 2021-09-30 22:11:48 +02:00
Howard Chu
fc4e5741ae Add simple script for running gitian-build
This shell script creates a docker image for running the gitian-build.py
script, to avoid version incompatibilities. The builds may be signed
automatically after manually reviewing the build hashes.

Only docker.io and apt-cacher-ng are required to be installed on the
host. The MacOSX SDK should also be present in this directory if Mac
builds are desired. A container named "gitrun" is used to launch
the builds, and all output will reside in this container as well.
2021-09-27 18:03:03 +01:00
Howard Chu
f5086126ca gitian: cleanup more unused packages
These appear to be leftovers inherited from Bitcoin's builder
2021-09-27 17:59:59 +01:00
Howard Chu
b8685bcf24 gitian: omit ccache from gitian builds
It's just wasted overhead since the build VMs are always deleted
and recreated fresh for each run.
2021-09-27 17:59:46 +01:00
Lee *!* Clagett
4d224de6e5 Quicker resource cleanup on p2p socks timeout 2021-09-27 13:47:51 +00:00
luigi1111
2243318000 Merge pull request #7964
d51e3f2 RPC and ZeroMQ APIs to support p2pool (SChernykh)
2021-09-23 22:24:48 -05:00
luigi1111
240cd780fe Merge pull request #7961
24f3e4c simplewallet: don't truncate integ. address in export_transfers (selsta)
2021-09-23 22:23:58 -05:00
luigi1111
0e6b12de78 Merge pull request #7952
8a7f692 support cors wildcard (woodser)
2021-09-23 22:23:17 -05:00
luigi1111
728409ec6d Merge pull request #7929
f4a745d easylogging++: fix missing logs (moneromooo-monero)
2021-09-23 22:18:38 -05:00
moneromooo-monero
f4a745d3b1 easylogging++: fix missing logs 2021-09-23 20:29:50 +00:00
SChernykh
d51e3f21f7 RPC and ZeroMQ APIs to support p2pool
Adds the following:

- "get_miner_data" to RPC API
- "json-miner-data" to ZeroMQ subscriber contexts

Both provide the necessary data to create a custom block template. They are used by p2pool.

Data provided:

- major fork version
- current height
- previous block id
- RandomX seed hash
- network difficulty
- median block weight
- coins mined by the network so far
- mineable mempool transactions
2021-09-21 20:28:11 +02:00
Nathan Dorfman
209c031b93 rpc: Fix get_transactions failing when not found 2021-09-20 17:22:16 -06:00
anon
d4c754923e node_server: fix race condition 2021-09-20 20:58:24 +00:00
anon
2909bd199d node_server: add race condition demo 2021-09-20 20:58:23 +00:00
woodser
8a7f692aab support cors wildcard 2021-09-17 21:24:37 -04:00
j-berman
3d9f34875c Fix precision of average_output_time
The fix as suggested by <jberman> on IRC. Before the fix, it would truncate 1.9 to 1 skewing the output selection.
2021-09-12 10:04:25 +02:00
selsta
24f3e4c72e simplewallet: don't truncate integ. address in export_transfers 2021-09-10 12:27:41 -06:00
luigi1111
665bd8933a Merge pull request #7906
58892be miniupnp: set submodule to upstream, disable install (selsta)
2021-09-09 15:21:50 -04:00
mj-xmr
cf65e5b41b LMDB: protection against UB, by not calling virtual methods from destructor - v0.17 2021-09-09 08:18:21 +02:00
mj-xmr
56589ddab8 UB: virtual methods in destructor at Trezor 2021-09-08 16:19:26 +02:00
mj-xmr
36527c05bd UB: virtual method in destructor of WalletImpl v0.17 2021-09-08 15:33:07 +02:00
luigi1111
2222bea92f Merge pull request #7902
0ae1cd2 v0.17: Fix Boost-1.77: Add missing algorithm header to i18n.cpp (mj-xmr)
2021-08-29 12:30:57 -04:00
luigi1111
f12e75b5e4 Merge pull request #7888
3c15eb8 python-rpc: add missing python api for new freeze/thaw/frozen RPC (moneromooo-monero)
2021-08-29 12:29:57 -04:00
selsta
58892be4ad miniupnp: set submodule to upstream, disable install 2021-08-29 18:17:41 +02:00
mj-xmr
0ae1cd2413 v0.17: Fix Boost-1.77: Add missing algorithm header to i18n.cpp 2021-08-28 15:32:50 +02:00
luigi1111
317eceb725 Merge pull request #7894
c0ce4d5 Wallet2: fix optimize-coinbase for p2pool payouts (SChernykh)
2021-08-26 21:14:12 -04:00
luigi1111
d98787eb1b Merge pull request #7825
ccfed60 cmake: test is a reserved keyword (selsta)
f0fa959 cmake: fix ccache detection (anon)
8dbe2e5 Daemon: Update average block size table (rbrunner7)
94bad34 wallet2: Don't auto lock device on process parsed blocks (tobtoht)
3c23aca ledger: don't lock for software device (tobtoht)
49beb8d ledger: use software device if we have view key (tobtoht)
d188b5f wallet_api: getPassword (tobtoht)
a395f36 depends, docker: fix bintray links (selsta)
0fecd7e blocks: fix cmake syntax (selsta)
76824bf Stop adding more outputs than bulletproof allows (Alex Opie)
67ba733 unit_tests: fix wipeable_string parse_hexstr test with latest gtest (xiphon)
402ba04 cmake: use CMAKE_CURRENT_LIST_DIR in FindLibUSB (selsta)
1565bcb epee: include public openssl header in cmake (selsta)
2e9af2a cmake: treat warnings as error in compiler flag tests (selsta)
db564ef wallet_api: fix typo in exportKeyImages (selsta)
8507917 depends: add getmonero package mirror (selsta)
8716d2a cmake: fix non portable code (selsta)
2021-08-26 21:10:56 -04:00
luigi1111
ca1b1b7332 Merge pull request #7822
99bee1c Apply gamma distr from chain tip when selecting decoys (j-berman)
2021-08-26 21:08:56 -04:00
luigi1111
27c5013acd Merge pull request #7805
1e037d3 build: prepare v0.17.2.3 (selsta)
2021-08-26 21:08:04 -04:00
SChernykh
c0ce4d5089 Wallet2: fix optimize-coinbase for p2pool payouts
RefreshOptimizeCoinbase was an optimization to speed up scanning of coinbase transactions before RingCT (tx version 2) where they split miner reward into multiple denominations, all to the same wallet.

When RingCT was introduced, all coinbase transactions became 1 output only, so this optimization does nothing now.

With p2pool, this optimization will skip scanning p2pool payouts because they use more than 1 output in coinbase transaction.

Fix it by applying this optimization only to pre-RingCT transactions (version < 2).
2021-08-26 11:51:07 +02:00
moneromooo-monero
3c15eb8e81 python-rpc: add missing python api for new freeze/thaw/frozen RPC 2021-08-24 00:25:10 +02:00
luigi1111
c61c09a567 Merge pull request #7882
e48fae3 epee: link with Boost_SYSTEM_LIBRARY (selsta)
2021-08-20 16:51:39 -04:00
luigi1111
b864817629 Merge pull request #7879
be6c61e wallet_api: add make_uri (tobtoht)
2021-08-20 16:50:54 -04:00
luigi1111
a520234c51 Merge pull request #7848
adcf440 Make sure node returns to wallet that real output is unlocked (j-berman)
2021-08-20 16:49:19 -04:00
luigi1111
715ebcb744 Merge pull request #7846
2285c66 Protect client from divide by 0 caused by integer truncation (j-berman)
2021-08-20 16:48:14 -04:00
luigi1111
4073599aaf Merge pull request #7838
6ec9fd6 support freeze, thaw, and frozen in wallet rpc (woodser)
2021-08-20 16:43:18 -04:00
j-berman
2285c66ef1 Protect client from divide by 0 caused by integer truncation 2021-08-19 15:00:59 -07:00
j-berman
99bee1ccf0 Apply gamma distr from chain tip when selecting decoys
- matches the paper by Miller et al to apply the gamma from chain tip, rather than after unlock time
- if the gamma produces an output more recent than the unlock time, the algo packs that output into one of the first 50 spendable blocks, respecting the block density factor
2021-08-19 14:59:12 -07:00
selsta
e48fae3177 epee: link with Boost_SYSTEM_LIBRARY 2021-08-19 19:06:05 +02:00
tobtoht
be6c61e2ee wallet_api: add make_uri 2021-08-19 15:52:01 +02:00
selsta
1e037d372a build: prepare v0.17.2.3 2021-08-19 15:00:42 +02:00
woodser
6ec9fd6c08 support freeze, thaw, and frozen in wallet rpc 2021-08-12 09:13:09 -04:00
selsta
ccfed6008a cmake: test is a reserved keyword 2021-08-12 04:52:51 +02:00
anon
f0fa959383 cmake: fix ccache detection 2021-08-12 04:52:36 +02:00
rbrunner7
8dbe2e57ac Daemon: Update average block size table 2021-08-12 04:42:46 +02:00
luigi1111
64c320130f Merge pull request #7839
925c6b6 provide key images of spent outputs in wallet rpc (woodser)
2021-08-11 22:41:04 -04:00
luigi1111
8f95eaa0b0 Merge pull request #7817
1510b1e unit_tests: fix broken tests (anon)
2021-08-11 22:39:42 -04:00
luigi1111
9f93fe1539 Merge pull request #7810
8eb2b79 p2p: remove blocked addresses/hosts from peerlist (moneromooo-monero)
2021-08-11 22:36:50 -04:00
luigi1111
db6688f584 Merge pull request #7801
07d82af Fixed json serialization of rct::RCTTypeNull (SChernykh)
2021-08-11 22:33:04 -04:00
luigi1111
f00db20a5f Merge pull request #7792
9b84043 fix #7784 - deinit wallet in wallet dtor (Dusan Klinec)
2021-08-11 22:30:53 -04:00
j-berman
adcf440dcd Make sure node returns to wallet that real output is unlocked 2021-08-11 07:26:56 -07:00
woodser
925c6b60e3 provide key images of spent outputs in wallet rpc 2021-08-07 09:36:45 -04:00
tobtoht
94bad34c26 wallet2: Don't auto lock device on process parsed blocks 2021-08-07 03:04:24 +02:00
tobtoht
3c23aca26b ledger: don't lock for software device 2021-08-07 03:04:15 +02:00
tobtoht
49beb8da17 ledger: use software device if we have view key 2021-08-07 03:04:04 +02:00
tobtoht
d188b5f51f wallet_api: getPassword 2021-08-07 03:03:40 +02:00
moneromooo-monero
8eb2b79bad p2p: remove blocked addresses/hosts from peerlist 2021-08-05 19:05:02 +00:00
luigi1111
3eb8f1458b Merge pull request #7791
7e3f211 wallet: rephrase error message on invalid device address (Dusan Klinec)
2021-08-02 18:53:40 -04:00
selsta
a395f363e7 depends, docker: fix bintray links 2021-08-01 18:16:09 +02:00
selsta
0fecd7eb86 blocks: fix cmake syntax 2021-08-01 15:47:11 +02:00
Alex Opie
76824bf827 Stop adding more outputs than bulletproof allows
If more outputs are requested, they are split across
multiple transactions.

#7322
2021-08-01 15:47:11 +02:00
xiphon
67ba733de1 unit_tests: fix wipeable_string parse_hexstr test with latest gtest
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973196
2021-08-01 15:47:11 +02:00
selsta
402ba046e0 cmake: use CMAKE_CURRENT_LIST_DIR in FindLibUSB 2021-08-01 15:47:11 +02:00
selsta
1565bcb1fb epee: include public openssl header in cmake 2021-08-01 15:47:08 +02:00
selsta
2e9af2a1c8 cmake: treat warnings as error in compiler flag tests 2021-08-01 15:47:05 +02:00
selsta
db564efe0b wallet_api: fix typo in exportKeyImages 2021-08-01 15:47:05 +02:00
selsta
85079173db depends: add getmonero package mirror 2021-08-01 15:47:05 +02:00
selsta
8716d2ad9d cmake: fix non portable code 2021-08-01 15:47:05 +02:00
luigi1111
5a34eae063 Merge pull request #7815
7128f73 cmake: don't forbid undefined symbols on openbsd (selsta)
2021-07-28 14:02:43 -04:00
anon
1510b1e550 unit_tests: fix broken tests
boosted_tcp_server: check condition before sleep too
cryptonote_protocol_handler: each instance of BlockchainLMDB requires separate thread due to private thread local fields
2021-07-28 13:38:23 +00:00
selsta
7128f73ec2 cmake: don't forbid undefined symbols on openbsd 2021-07-28 01:23:03 +02:00
luigi1111
8b63bb3c75 Merge pull request #7789
2161bd0 device: set correct ledger min version (selsta)
2021-07-27 17:05:11 -04:00
luigi1111
56ce7fca6f Merge pull request #7781
4f7c38a device_trezor_base: fix typo (anon)
2021-07-27 17:03:46 -04:00
luigi1111
bc252794f0 Merge pull request #7693
ec6ff0d cmake: export all symbols (anon)
ceb8e7c cmake: fix undefined symbols and multiple definitions (anon)
72af8a5 cmake: forbid undefined symbols (anon)
2021-07-27 16:52:59 -04:00
SChernykh
07d82af979 Fixed json serialization of rct::RCTTypeNull
rct::RCTTypeNull doesn't have these fields (ecdhInfo, outPk, txnFee).
2021-07-18 17:19:32 +02:00
Dusan Klinec
9b840439b9 fix #7784 - deinit wallet in wallet dtor 2021-07-14 15:08:06 +02:00
Dusan Klinec
7e3f211791 wallet: rephrase error message on invalid device address 2021-07-14 15:05:28 +02:00
selsta
2161bd0f3a device: set correct ledger min version 2021-07-14 08:31:11 +02:00
anon
ec6ff0d002 cmake: export all symbols 2021-07-13 08:01:26 +02:00
anon
ceb8e7c508 cmake: fix undefined symbols and multiple definitions 2021-07-13 08:01:23 +02:00
anon
72af8a5fce cmake: forbid undefined symbols 2021-07-13 08:01:09 +02:00
anon
4f7c38a444 device_trezor_base: fix typo 2021-07-10 23:52:15 +00:00
luigi1111
7d2e717ee8 Merge pull request #7734
a2d8f87 randomx: bump submodule to v1.1.9 (selsta)
2021-06-16 14:40:45 -05:00
luigi1111
83e378740a Merge pull request #7736
c28d2f7 Fix boost 1.76.0 compatibility (loqs)
2021-06-01 22:12:42 -05:00
loqs
c28d2f7c11 Fix boost 1.76.0 compatibility
Add missing header boost/mpl/contains.hpp
monero-project/monero/issues/7728
2021-05-24 05:32:24 +02:00
selsta
a2d8f876ca randomx: bump submodule to v1.1.9 2021-05-22 23:13:23 +02:00
luigi1111
3701257d61 Merge pull request #7695
1d6f211 workflows: fix windows build (selsta)
2021-05-12 17:00:58 -05:00
luigi1111
90703ba8bd Merge pull request #7687
cb9a2e4 add -framework AppKit for Apple (woodser)
2021-05-12 16:57:02 -05:00
luigi1111
a080c0be9c Merge pull request #7678
dedcd63 wallet_api: import / export output function (tobtoht)
6e22710 expose set_offline to wallet api (benevanoff)
02e9a41 wallet_api: add isDeterministic() (tobtoht)
def5819 wallet_api: add seed_offset param to seed() (tobtoht)
73959c6 wallet_api: store fee for incoming txs in history (Ben Evanoff)
712f362 wallet api: allow wallet to fetch all key images via api (benevanoff)
153d08d Allow tx note edits via TransactionHistory object in wallet/api (dsc)
2abd7b1 wallet_api: TransactionHistory - fill unconfirmed out payments dests (xiphon)
9a50bef Extend TransactionInfo with coinbase and description attributes in wallet/api (dsc)
22bb6a6 Allow AddressBook description edits via wallet/api interface (dsc)
2021-05-12 16:55:38 -05:00
luigi1111
de7565069e Merge pull request #7680
70c5c81 wallet2: Fix rescan_bc keep_ki option (Nathan Dorfman)
2021-05-12 15:29:31 -05:00
selsta
1d6f2114b8 workflows: fix windows build 2021-04-27 14:45:22 +02:00
woodser
cb9a2e4471 add -framework AppKit for Apple 2021-04-26 18:30:32 -04:00
Nathan Dorfman
70c5c81670 wallet2: Fix rescan_bc keep_ki option 2021-04-22 16:15:01 -06:00
luigi1111
d59cd3d222 Merge pull request #7657
6305b90 ITS#9496 fix mdb_env_open bug from #8704 (Howard Chu)
2021-04-22 01:44:50 -04:00
tobtoht
dedcd6304c wallet_api: import / export output function 2021-04-22 04:33:11 +02:00
benevanoff
6e22710f0e expose set_offline to wallet api 2021-04-22 04:33:03 +02:00
tobtoht
02e9a41cbe wallet_api: add isDeterministic() 2021-04-22 04:32:50 +02:00
tobtoht
def58196da wallet_api: add seed_offset param to seed() 2021-04-22 04:32:41 +02:00
Ben Evanoff
73959c623c wallet_api: store fee for incoming txs in history 2021-04-22 04:32:32 +02:00
benevanoff
712f362150 wallet api: allow wallet to fetch all key images via api 2021-04-22 04:32:24 +02:00
dsc
153d08d026 Allow tx note edits via TransactionHistory object in wallet/api 2021-04-22 04:32:14 +02:00
xiphon
2abd7b174b wallet_api: TransactionHistory - fill unconfirmed out payments dests 2021-04-22 04:32:06 +02:00
dsc
9a50bef3cd Extend TransactionInfo with coinbase and description attributes in wallet/api 2021-04-22 04:31:44 +02:00
dsc
22bb6a654d Allow AddressBook description edits via wallet/api interface 2021-04-22 04:31:36 +02:00
luigi1111
38958f722b Merge pull request #7655
9fc9c7d gitian: remove osslsigncode (selsta)
2021-04-16 12:53:55 -05:00
luigi1111
36a68b0cba Merge pull request #7654
df03288 unit_tests: fix boost 1.58 compatibility (anon)
2021-04-16 12:53:28 -05:00
Howard Chu
6305b90596 ITS#9496 fix mdb_env_open bug from #8704
Broken in 9c6eb75c65
2021-04-09 14:25:51 +01:00
selsta
9fc9c7d695 gitian: remove osslsigncode
Unused and archive is offline
2021-04-08 17:13:57 +02:00
anon
df032882a8 unit_tests: fix boost 1.58 compatibility 2021-04-08 11:45:26 +00:00
luigi1111
f6e63ef260 Merge pull request #7647
d7b74a4 Tests: Fix test node_server.bind_same_p2p_port from randomly crashing (mj-xmr)
2021-04-06 12:25:41 -05:00
luigi1111
298208d92b Merge pull request #7350
4a9ae3e fix serialization being different on mac (moneromooo-monero)
2021-04-06 12:21:28 -05:00
mj-xmr
d7b74a4fb0 Tests: Fix test node_server.bind_same_p2p_port from randomly crashing 2021-04-05 17:51:54 +02:00
luigi1111
f719b74cd1 Merge pull request #7638
c18cdd3 build: prepare v0.17.2.0 (selsta)
2021-03-29 22:00:40 -04:00
luigi1111
1d597ad910 Merge pull request #7637
13978a9 depends: openssl 1.1.1i -> 1.1.1k (selsta)
2021-03-29 22:00:06 -04:00
luigi1111
4f6eea9021 Merge pull request #7631
fd869a7 cmake: Don't default to -march=native on OpenBSD (Nathan Dorfman)
2021-03-29 21:58:31 -04:00
luigi1111
076254d113 Merge pull request #7623
c8c7c40 ITS#9500 fix regression from ITS#8662 (Howard Chu)
2021-03-29 21:57:26 -04:00
luigi1111
daa1376370 Merge pull request #7621
21ab1de cryptonote_protocol_handler: fix race condition (anon)
699e82c cryptonote_protocol_handler: add race condition demo (anon)
2021-03-29 21:56:07 -04:00
luigi1111
eed63cef36 Merge pull request #7615
9ca9f12 Fixed issues found by static analysis (SChernykh)
2021-03-29 21:54:25 -04:00
luigi1111
dcdbf7ebcf Merge pull request #7459
d5b78c0 async_protocol_handler_config: fix deadlock (anon) f59b1d5 async_protocol_handler_config: add deadlock demo (anon)
2021-03-29 21:22:54 -04:00
selsta
c18cdd3623 build: prepare v0.17.2.0 2021-03-26 01:53:45 +01:00
selsta
13978a9887 depends: openssl 1.1.1i -> 1.1.1k 2021-03-25 21:45:03 +01:00
Nathan Dorfman
fd869a7b64 cmake: Don't default to -march=native on OpenBSD 2021-03-24 15:48:56 -06:00
Howard Chu
c8c7c40ac8 ITS#9500 fix regression from ITS#8662
mdb_load -a patch broke overwriting with MDB_CURRENT
2021-03-23 21:08:19 +00:00
anon
21ab1de89f cryptonote_protocol_handler: fix race condition 2021-03-22 19:42:45 +00:00
anon
699e82c282 cryptonote_protocol_handler: add race condition demo 2021-03-22 19:42:45 +00:00
luigi1111
9ec4ce36c7 Merge pull request #7419
25588de trezor: simplify recognition of integrated addresses (Dusan Klinec)
2021-03-20 01:54:52 -04:00
SChernykh
9ca9f1214a Fixed issues found by static analysis
- rolling_median: tried to free uninitialized pointer in a constructor
- net_node.inl: erase-remove idiom was used incorrectly. remove_if doesn't actually remove elements, see http://cpp.sh/6fcjv
- bulletproofs.cc: call to sizeof() instead of vector.size(), luckily it only impacts performance and not code logic there
2021-03-18 21:57:13 +01:00
anon
d5b78c08b6 async_protocol_handler_config: fix deadlock 2021-03-12 11:59:05 +00:00
anon
f59b1d5fb5 async_protocol_handler_config: add deadlock demo 2021-03-12 11:59:05 +00:00
moneromooo-monero
4a9ae3eb8b fix serialization being different on mac
On Mac, size_t is a distinct type from uint64_t, and some
types (in wallet cache as well as cold/hot wallet transfer
data) use pairs/containers with size_t as fields. Mac would
save those as full size, while other platforms would save
them as varints. Might apply to other platforms where the
types are distinct.

There's a nasty hack for backward compatibility, which can
go after a couple forks.
2021-03-05 23:41:19 +00:00
luigi1111
837c9aec22 Merge pull request #7390
7fd140e async_protocol_handler_config: remove connection correctly (anon)
c1776be async_protocol_handler_config: add segfault demo (anon)
2021-03-05 13:56:12 -05:00
luigi1111
af46a291ad Merge pull request #7336
d8137dc device_trezor: add redundant check (anon)
c6e1d7b device_trezor: wipe string fields properly (anon)
2021-03-05 13:53:00 -05:00
Dusan Klinec
25588de40c trezor: simplify recognition of integrated addresses
now it is possible to simplify integrated addresses recognition using transaction destination info directly
fixes https://github.com/monero-project/monero-gui/issues/3346
2021-03-03 15:39:12 +01:00
anon
7fd140e4f7 async_protocol_handler_config: remove connection correctly 2021-02-19 22:27:28 +00:00
anon
c1776be54f async_protocol_handler_config: add segfault demo 2021-02-19 22:27:28 +00:00
luigi1111
30bc575505 Merge pull request #7362
332b973 ITS#9007 don't free loose writemap pages (Kris Zyp)
2021-02-18 14:08:58 -05:00
luigi1111
aa408d1c72 Merge pull request #7333
b5667c9 p2p: allow CIDR notation in DNS blocklist (moneromooo-monero)
2021-02-16 11:45:38 -05:00
luigi1111
c8895ccbb7 Merge pull request #7309
6d5e210 boosted_tcp_server: fix connection lifetime (anon)
afec439 boosted_tcp_server: add segfault demo (anon)
2021-02-15 21:56:07 -05:00
luigi1111
975d390d00 Merge pull request #7284
32ab89a docs: Remove outdated bits about anonymity network seed nodes (Nathan Dorfman)
2021-02-15 21:49:50 -05:00
Kris Zyp
332b9734ff ITS#9007 don't free loose writemap pages
Broken in ITS#8756
2021-02-01 16:10:09 +00:00
moneromooo-monero
b5667c9f6c p2p: allow CIDR notation in DNS blocklist 2021-01-21 01:41:31 +00:00
anon
d8137dc523 device_trezor: add redundant check 2021-01-20 22:07:13 +01:00
anon
c6e1d7bcdf device_trezor: wipe string fields properly 2021-01-20 22:07:13 +01:00
anon
6d5e2106b3 boosted_tcp_server: fix connection lifetime 2021-01-19 18:16:01 +01:00
anon
afec439953 boosted_tcp_server: add segfault demo 2021-01-19 18:16:01 +01:00
luigi1111
25670398b1 Merge pull request #7295
fe6dda9 p2p: only log to global when a blocked IP is not already blocked (moneromooo-monero)
2021-01-15 23:53:40 -05:00
moneromooo-monero
fe6dda9453 p2p: only log to global when a blocked IP is not already blocked 2021-01-08 15:50:10 +00:00
Alexander Blair
8fef32e45c Merge pull request #7292
ba3c627c5 Command max_bytes moved from dynamic map to static switch (Lee Clagett)
2021-01-07 17:55:23 -08:00
Alexander Blair
7f1a83b852 Merge pull request #7287
89fe0e1c8 storages: overridable limits for loading portable_storage from binary (moneromooo-monero)
2021-01-07 17:55:13 -08:00
moneromooo-monero
89fe0e1c81 storages: overridable limits for loading portable_storage from binary 2021-01-07 20:24:51 +00:00
luigi1111
b06ccc0416 Merge pull request #7282
5d2dd7a epee: also limit number of strings in portable_storage (moneromooo-monero)
2021-01-06 21:11:53 -05:00
luigi1111
83fa752a84 Merge pull request #7267
c2295f5 protocol: handle receiving a block hash we've not added yet (moneromooo-monero)
2021-01-06 21:09:36 -05:00
luigi1111
7ecdc53e11 Merge pull request #7248
3c7eec1 add a max levin packet size by command type (moneromooo-monero)
2021-01-06 21:08:11 -05:00
Nathan Dorfman
32ab89aa86 docs: Remove outdated bits about anonymity network seed nodes 2021-01-05 23:05:05 -07:00
moneromooo-monero
5d2dd7a328 epee: also limit number of strings in portable_storage
They require at least 24 bytes
2021-01-05 17:56:11 +00:00
Alexander Blair
f3de67bc21 Merge pull request #7269
1128146c4 blockchain: lock access to m_blocks_hash_of_hashes (moneromooo-monero)
2021-01-03 18:29:39 -08:00
Alexander Blair
51057105b9 Merge pull request #7264
31b2572ec build: prepare v0.17.1.9 (selsta)
2021-01-03 18:29:19 -08:00
Alexander Blair
54cf799f0f Merge pull request #7262
0add7ec1c portable_storage: better sanity checking (moneromooo-monero)
2021-01-03 18:28:50 -08:00
moneromooo-monero
3c7eec152c add a max levin packet size by command type 2021-01-03 14:07:58 +00:00
moneromooo-monero
1128146c49 blockchain: lock access to m_blocks_hash_of_hashes
it is accessed both when adding and when prevalidating a set
of new hashes from a peer
2021-01-02 22:20:24 +00:00
moneromooo-monero
c2295f55b8 protocol: handle receiving a block hash we've not added yet 2021-01-02 22:10:44 +00:00
selsta
31b2572ec7 build: prepare v0.17.1.9 2021-01-02 18:13:47 +01:00
moneromooo-monero
0add7ec1cd portable_storage: better sanity checking 2021-01-02 12:36:42 +00:00
Alexander Blair
2107337999 Merge pull request #7251
f0b867b13 Restrict duplicate keys in epee binary format (Lee Clagett)
2021-01-01 22:44:24 -08:00
Alexander Blair
f4e34d50cf Merge pull request #7249
cb296b39b portable_storage: forbid unnamed sections (xiphon)
2021-01-01 22:44:02 -08:00
Alexander Blair
a4ffad75ac Merge pull request #7247
57f7c2e53 protocol: more sanity checks in new chain block hashes (moneromooo-monero)
2021-01-01 22:43:46 -08:00
Alexander Blair
024783f73a Merge pull request #7244
531069859 portable_storage: check object limit where appropriate (moneromooo)
2021-01-01 22:42:43 -08:00
Alexander Blair
db686707cb Merge pull request #7239
e685f52e2 p2p: fix deadlock banning while updating peer lists (moneromooo)
2021-01-01 22:42:17 -08:00
Alexander Blair
5767e6db90 Merge pull request #7235
00253b717 protocol: don't reset last request time on an idle timer (moneromooo-monero)
2021-01-01 22:41:54 -08:00
xiphon
cb296b39bd portable_storage: forbid unnamed sections 2021-01-01 02:06:39 +01:00
moneromooo-monero
57f7c2e53f protocol: more sanity checks in new chain block hashes 2020-12-31 23:34:26 +00:00
moneromooo
531069859f portable_storage: check object limit where appropriate
also fix pedantic off by one in check
2020-12-31 22:35:32 +00:00
binaryFate
00b3502749 Merge pull request #7228 from vtnerd/fix/p2p_memory_usage_017
Add aggressive restrictions to pre-handshake p2p buffer limit
2020-12-31 21:35:00 +01:00
moneromooo
e685f52e25 p2p: fix deadlock banning while updating peer lists 2020-12-31 03:15:11 +00:00
moneromooo-monero
00253b717c protocol: don't reset last request time on an idle timer
this prevents losing time of "idle time" for a peer, which could
otherwise be reset by another timed sync command from the peer
2020-12-30 14:21:57 +00:00
Lee Clagett
7d67a2dde0 Add aggressive restrictions to pre-handshake p2p buffer limit 2020-12-29 19:58:53 -05:00
Alexander Blair
36dfd41e01 Merge pull request #7222
218a10967 rpc: limit the number of txes for get_blocks.bin (moneromooo-monero)
2020-12-29 10:48:05 -08:00
Alexander Blair
bcd7f63a54 Merge pull request #7219
b39ee13d7 portable_storage: remove array element limit (moneromooo-monero)
2020-12-29 10:45:46 -08:00
Alexander Blair
3a477a54a2 Merge pull request #7208
b8bc4d77b ssl: buffered handshake detection (anon)
2020-12-29 10:45:03 -08:00
moneromooo-monero
218a109677 rpc: limit the number of txes for get_blocks.bin 2020-12-29 04:32:33 +00:00
anon
b8bc4d77b7 ssl: buffered handshake detection 2020-12-28 22:21:17 +01:00
moneromooo-monero
b39ee13d70 portable_storage: remove array element limit
some people don't want it
2020-12-28 21:05:12 +00:00
Alexander Blair
a99d6e56b6 Merge pull request #7193
31ae533d6 epee: fix some issues using connections after shutdown (moneromooo-monero)
2020-12-28 11:49:42 -08:00
Alexander Blair
5804add75b Merge pull request #7206
8c8f3d73b protocol: fix false positives dropping peers (moneromooo-monero)
2020-12-28 11:40:26 -08:00
Alexander Blair
75e9e7b39a Merge pull request #7203
0fc927dfb portable_storage: remove overly aggressive cutoff (moneromooo-monero)
2020-12-28 11:40:15 -08:00
Alexander Blair
a87eca5e7d Merge pull request #7197
0443cccb5 cryptonote_basic: guess what got lost porting patches to branches again (moneromooo-monero)
2020-12-28 11:39:58 -08:00
moneromooo-monero
8c8f3d73b5 protocol: fix false positives dropping peers
it'd trigger on reorgs
2020-12-27 14:42:59 +00:00
moneromooo-monero
0fc927dfba portable_storage: remove overly aggressive cutoff 2020-12-27 12:45:13 +00:00
Alexander Blair
d3e582e517 Merge pull request #7198
e42bb297b Revert "Reject existing claimed blocks in sync mode" (luigi1111)
2020-12-26 21:25:52 -08:00
luigi1111
e42bb297b8 Revert "Reject existing claimed blocks in sync mode" 2020-12-27 00:16:56 -05:00
moneromooo-monero
0443cccb5d cryptonote_basic: guess what got lost porting patches to branches again 2020-12-26 23:44:34 +00:00
Alexander Blair
b42d08995e Merge pull request #7191
d5be31ee2 portable_storage: add some sanity checks on data size (moneromooo-monero)
2020-12-26 14:14:31 -08:00
Alexander Blair
138092ddc9 Merge pull request #7189
adcbcd8f8 protocol: drop nodes if they claim new data but only give stale data (moneromooo-monero)
2020-12-26 14:14:16 -08:00
Alexander Blair
4ddde36c50 Merge pull request #7183
ba60541f3 build: prepare v0.17.1.8 (selsta)
2020-12-26 14:00:06 -08:00
Alexander Blair
0873f3193a Merge pull request #7181
e35bbb1e8 ban lists may now include subnets (moneromooo-monero)
2020-12-26 13:59:51 -08:00
Alexander Blair
cbeaeb904b Merge pull request #7174
5c3e84b6a restrict public node checks a little (moneromooo-monero)
2020-12-26 13:59:09 -08:00
Alexander Blair
355be543c7 Merge pull request #7161
07b50c42d rpc: get_info - add 'synchronized' field (xiphon)
2020-12-26 13:58:19 -08:00
Alexander Blair
6cea8ca895 Merge pull request #7155
42ee30929 protocol: reject claimed block hashes that already are in the chain (moneromooo-monero)
a436c3625 protocol: drop peers we can't download anything from in sync mode (moneromooo-monero)
2020-12-26 13:58:06 -08:00
Alexander Blair
e08d37fc7b Merge pull request #7146
3bb748ad9 p2p: remove peers from grey and anchors lists when blocked (moneromooo-monero)
2020-12-26 13:57:54 -08:00
Alexander Blair
1c14b7b3b2 Merge pull request #7139
fb9ef2426 Optional DNS based blocklist (moneromooo-monero)
2020-12-26 13:57:25 -08:00
moneromooo-monero
31ae533d6d epee: fix some issues using connections after shutdown 2020-12-26 14:15:12 +00:00
moneromooo-monero
d5be31ee21 portable_storage: add some sanity checks on data size
especially when allocated size is >> serialized data size
2020-12-26 03:23:12 +00:00
moneromooo-monero
adcbcd8f8b protocol: drop nodes if they claim new data but only give stale data
Some joker is spending time actually doing this
2020-12-25 20:31:23 +00:00
Lee Clagett
ba3c627c57 Command max_bytes moved from dynamic map to static switch 2020-12-23 23:53:27 +00:00
xiphon
07b50c42dd rpc: get_info - add 'synchronized' field 2020-12-23 10:43:47 +00:00
selsta
ba60541f3e build: prepare v0.17.1.8 2020-12-23 02:13:16 +01:00
moneromooo-monero
5c3e84b6ae restrict public node checks a little
do not include blocked hosts in peer lists or public node lists by default,
warn about no https on clearnet and about untrusted peers likely being spies
2020-12-22 23:39:19 +00:00
moneromooo-monero
e35bbb1e88 ban lists may now include subnets 2020-12-22 02:12:58 +00:00
moneromooo-monero
fb9ef24267 Optional DNS based blocklist
If enabled, pulls IPs to block on blocklist.moneropulse.*, and
blocks then for 8 days (so IPs dropping from the list will
eventually get unblocked, and DNS failures don't result in
instant clearing of the blocklist).

Enable with --enable-dns-blocklist
2020-12-20 02:34:24 +00:00
luigi1111
ee8d740cba Merge pull request #7152
cf4461f Fix byte_stream::put_n (Lee Clagett)
2020-12-19 17:26:51 -06:00
luigi1111
e0e2eb2bf5 Merge pull request #7144
a569483 p2p: ignore incoming peer list entries when we have them blocked (moneromooo-monero)
2020-12-19 17:25:11 -06:00
luigi1111
ecedaf2975 Merge pull request #7142
905cc07 daemon: the ban command can now load IPs from a file (ban @filename) (moneromooo-monero)
2020-12-19 17:23:52 -06:00
luigi1111
94897cf8f7 Merge pull request #7140
55e4007 Depends: Bump qt to 5.15.1 (TheCharlatan)
2020-12-19 17:21:05 -06:00
luigi1111
e38f3dbfb2 Merge pull request #7157
a4cdcd9 rpc: add a busy_syncing field to get_info (moneromooo-monero)
2020-12-17 14:33:51 -06:00
moneromooo-monero
a4cdcd9bd0 rpc: add a busy_syncing field to get_info
true if and pretty much only if new blocks are being added
2020-12-17 18:11:56 +00:00
moneromooo-monero
42ee309292 protocol: reject claimed block hashes that already are in the chain 2020-12-17 03:00:39 +00:00
Lee Clagett
f0b867b13d Restrict duplicate keys in epee binary format 2020-12-17 01:04:00 +00:00
moneromooo-monero
a436c36256 protocol: drop peers we can't download anything from in sync mode
instead of the (incorrect) check for whether we think we might have
a user for it at some point in the near future. We can reconnect.
2020-12-16 20:20:17 +00:00
Lee Clagett
cf4461f40b Fix byte_stream::put_n 2020-12-14 16:20:51 +00:00
moneromooo-monero
905cc07c8b daemon: the ban command can now load IPs from a file (ban @filename) 2020-12-14 12:26:37 +00:00
moneromooo-monero
3bb748ad94 p2p: remove peers from grey and anchors lists when blocked 2020-12-13 23:27:56 +00:00
moneromooo-monero
a569483c19 p2p: ignore incoming peer list entries when we have them blocked 2020-12-13 23:14:22 +00:00
TheCharlatan
55e4007c48 Depends: Bump qt to 5.15.1 2020-12-13 16:09:00 +01:00
luigi1111
54a4071473 Merge pull request #7131
c1d6547 protocol: include first new block in chain entry response (moneromooo-monero)
2020-12-12 22:05:41 -06:00
luigi1111
4f70af3af1 Merge pull request #7128
b6b2c9b protocol: stricter checks on received chain hash list (moneromooo)
2020-12-12 22:03:59 -06:00
luigi1111
31390dce4d Merge pull request #7124
d6069f7 protocol: revert incoming chain height check against local chain (moneromooo-monero)
2020-12-12 22:02:20 -06:00
moneromooo-monero
c1d654708f protocol: include first new block in chain entry response 2020-12-12 01:36:56 +00:00
moneromooo
b6b2c9b8e8 protocol: stricter checks on received chain hash list 2020-12-11 18:47:28 +00:00
moneromooo-monero
d6069f7ded protocol: revert incoming chain height check against local chain
We can actually request a chain that's further away from what we
have as we buffer more and more
2020-12-11 02:37:33 +00:00
Alexander Blair
7a9ba3f154 Merge pull request #7122
3a3370096 protocol: one more sanity check on usable data from a peer (moneromooo-monero)
2020-12-10 17:57:18 -08:00
Alexander Blair
575f6b5f13 Merge pull request #7120
105afa555 protocol: fix asking for pruned blocks for v10 (moneromooo-monero)
2020-12-10 17:57:07 -08:00
Alexander Blair
d6b2c676a9 Merge pull request #7118
ef1524ecc protocol: add a sanity check to the number of block hashes sent (moneromooo-monero)
2020-12-10 17:56:53 -08:00
Alexander Blair
5d39df5d92 Merge pull request #7116
a700e6103 build: prepare v0.17.1.7 (selsta)
2020-12-10 17:56:38 -08:00
Alexander Blair
91f941120d Merge pull request #7115
45d9a282d cmake: fix "release" version string on tagged releases (moneromooo-monero)
2020-12-10 17:56:15 -08:00
Alexander Blair
f9eee6f193 Merge pull request #7111
d729730d3 protocol: drop origin IP if a block fails to verify in sync mode (moneromooo-monero)
2020-12-10 17:55:59 -08:00
Alexander Blair
37800ceb5b Merge pull request #7107
f47f1a069 protocol: more restrictive checks on chain entry response (moneromooo-monero)
2020-12-10 17:55:42 -08:00
Alexander Blair
b311043ec6 Merge pull request #7101
b4b3cd3ad depends: Update OpenSSL to 1.1.1i (Howard Chu)
2020-12-10 17:55:27 -08:00
moneromooo-monero
3a3370096e protocol: one more sanity check on usable data from a peer 2020-12-10 23:02:38 +00:00
moneromooo-monero
105afa5557 protocol: fix asking for pruned blocks for v10
Old format is still alloewd there, this is a two fork update
2020-12-10 22:56:52 +00:00
moneromooo-monero
d729730d38 protocol: drop origin IP if a block fails to verify in sync mode
It would otherwise be possible for a peer to send bad blocks,
then disconnect and reconnect again, escaping bans
2020-12-10 22:00:01 +00:00
luigi1111
f570ce1349 Merge pull request #7109
e83a220 protocol: fix switchting to adding blocks if noone's adding the next span (moneromooo-monero)
2020-12-10 15:49:20 -06:00
moneromooo-monero
ef1524ecca protocol: add a sanity check to the number of block hashes sent 2020-12-10 19:26:50 +00:00
moneromooo-monero
45d9a282d1 cmake: fix "release" version string on tagged releases
It would not say "release" if we're on a previous tag
2020-12-10 19:12:41 +00:00
selsta
a700e6103b build: prepare v0.17.1.7 2020-12-10 20:12:27 +01:00
moneromooo-monero
f47f1a0691 protocol: more restrictive checks on chain entry response 2020-12-10 17:24:16 +00:00
moneromooo-monero
e83a220603 protocol: fix switchting to adding blocks if noone's adding the next span 2020-12-10 15:46:29 +00:00
Howard Chu
b4b3cd3ad3 depends: Update OpenSSL to 1.1.1i
Remove some obsolete patches (they were integrated upstream).
Tweak to work with Android support (they second-guess our CC definition, etc).
2020-12-09 19:20:34 +00:00
luigi1111
f7aa91f70d Merge pull request #7076
37bb594 Do not use peer_id tracking method over i2p/tor (Lee Clagett)
2020-12-07 10:26:15 -06:00
luigi1111
f9a70e4260 Merge pull request #7073
446b3c8 p2p: drop peers that spam peer lists (moneromooo-monero)
2020-12-07 10:25:38 -06:00
luigi1111
f105a0ef38 Merge pull request #7071
21b3ff2 p2p: fix race condition accessing a deleted context (moneromooo-monero)
2020-12-07 10:23:57 -06:00
luigi1111
1cb3ea0447 Merge pull request #7065
b34d50f build: prepare v0.17.1.6 (selsta)
2020-12-07 10:22:38 -06:00
luigi1111
43788ffd2a Merge pull request #7063
7982ef5 crypto: fix non zero scalar being 0 after reducing (moneromooo-monero)
2020-12-07 10:20:19 -06:00
luigi1111
6d35b667cf Merge pull request #7054
ce26c5b protocol: drop peers that don't reply to queries (moneromooo)
9427b5a keep only the last seen node on a given host in the white list (moneromooo)
fa79148 protocol: drop peers that decrease claimed height (moneromooo)
1382b17 protocol: add scoring system to drop peers that don't behave (moneromooo)
2020-12-07 10:04:08 -06:00
moneromooo
ce26c5b2dd protocol: drop peers that don't reply to queries 2020-12-06 15:57:23 +00:00
moneromooo-monero
21b3ff2c90 p2p: fix race condition accessing a deleted context 2020-12-06 12:42:11 +00:00
moneromooo-monero
446b3c865b p2p: drop peers that spam peer lists
There's always some people who just want to abuse things
2020-12-05 13:41:48 +00:00
moneromooo
9427b5a6d5 keep only the last seen node on a given host in the white list 2020-12-04 01:55:05 +00:00
moneromooo
fa79148e0c protocol: drop peers that decrease claimed height 2020-12-04 01:55:04 +00:00
moneromooo
1382b17aa1 protocol: add scoring system to drop peers that don't behave 2020-12-04 01:55:01 +00:00
moneromooo-monero
7982ef5a73 crypto: fix non zero scalar being 0 after reducing 2020-12-04 01:00:22 +00:00
selsta
b34d50fa76 build: prepare v0.17.1.6 2020-12-03 21:37:33 +01:00
Alexander Blair
0833680c74 Merge pull request #7059
93135907d wallet2: set propagation timeout to current max timeout (selsta)
2020-12-03 12:20:14 -08:00
selsta
93135907dd wallet2: set propagation timeout to current max timeout 2020-12-03 02:24:52 +01:00
Alexander Blair
065bb292df Merge pull request #7010
a8cd073fc Add rpc-restricted-bind-ip option (Howard Chu)
2020-12-01 14:22:39 -08:00
luigi1111
3942a1cd04 Merge pull request #7044
efca5b8 wallet2: check imported multisig curve points are in main subgroup (moneromooo-monero)
2020-11-25 09:31:25 -06:00
luigi1111
e4c0cb0ff3 Merge pull request #7039
9d7f473 cryptonote_core: dandelion - use local height or median height if syncing (xiphon)
2020-11-25 09:14:26 -06:00
xiphon
9d7f473af0 cryptonote_core: dandelion - use local height or median height if syncing 2020-11-25 01:26:03 +00:00
Alexander Blair
41652c9aa1 Merge pull request #7040
af4fb4729 rpc: skip non-synced bootstrap daemons in --no-sync mode too (xiphon)
2020-11-24 11:21:40 -08:00
Alexander Blair
0a0ceb62f0 Merge pull request #7038
5bb83ab04 build: prepare v0.17.1.5 (selsta)
2020-11-24 11:20:33 -08:00
Alexander Blair
8e7b762092 Merge pull request #7037
8e829e034 rpc: on_send_raw_tx - add missing CHECK_CORE_READY (xiphon)
2020-11-24 11:19:32 -08:00
Alexander Blair
551e6c9168 Merge pull request #7028
9b7ed2fd8 Change Dandelion++ fluff probability to 20%, and embargo timeout to 39s (Lee Clagett)
2020-11-24 11:19:07 -08:00
Alexander Blair
c09d142972 Merge pull request #7026
e8468c5dc Fix timeout checks for forwarded and Dandelion++ stem txes (Lee Clagett)
2020-11-24 11:17:59 -08:00
Crypto City
efca5b8af9 wallet2: check imported multisig curve points are in main subgroup 2020-11-24 16:24:03 +00:00
luigi1111
251c64f195 Merge pull request #7011
398e64c Better log message for unusable anon networks (hyc)
2020-11-23 16:15:50 -06:00
selsta
5bb83ab042 build: prepare v0.17.1.5 2020-11-23 15:22:35 +01:00
xiphon
af4fb4729e rpc: skip non-synced bootstrap daemons in --no-sync mode too 2020-11-23 12:24:01 +00:00
xiphon
8e829e034f rpc: on_send_raw_tx - add missing CHECK_CORE_READY 2020-11-22 16:11:19 +00:00
Howard Chu
398e64ccbe Better log message for unusable anon networks 2020-11-16 12:37:40 +00:00
Howard Chu
a8cd073fcc Add rpc-restricted-bind-ip option
Fixes #6369
2020-11-11 12:19:13 +00:00
luigi1111
f690e4984d Merge pull request #6997
752837b build: prepare v0.17.1.3 (selsta)
2020-11-07 13:10:15 -06:00
luigi1111
ebc9197326 Merge pull request #6996
981e0b5 epee: readline_buffer - fix thread safety, fix sync() after stop() (xiphon)
2020-11-07 13:09:18 -06:00
luigi1111
81f9fa947b Merge pull request #6994
6f48a14 Fix i2p/tor seed nodes (vtnerd)
2020-11-07 13:08:00 -06:00
selsta
752837b2c8 build: prepare v0.17.1.3 2020-11-07 18:19:08 +01:00
xiphon
981e0b5cc3 epee: readline_buffer - fix thread safety, fix sync() after stop() 2020-11-07 15:32:02 +00:00
Lee Clagett
6f48a146f8 Fix i2p/tor seed nodes 2020-11-07 00:37:49 -05:00
luigi1111
1a3bef15b9 Merge pull request #6993
44c93bb p2p: fix accessing non existent element of map (moneromooo-monero)
2020-11-06 18:53:22 -06:00
moneromooo-monero
44c93bb47a p2p: fix accessing non existent element of map 2020-11-07 00:17:47 +00:00
luigi1111
c3fc96f0cf Merge pull request #6992
f3dd25c build: prepare v0.17.1.2 (selsta)
2020-11-06 17:34:32 -06:00
luigi1111
07f6ecd227 Merge pull request #6991
4985afd p2p: add a tor seed (moneromooo-monero)
2020-11-06 17:32:28 -06:00
moneromooo-monero
4985afddb3 p2p: add a tor seed 2020-11-06 23:21:10 +00:00
luigi1111
4191dc8981 Merge pull request #6990
263579b Add support for i2p and tor seed nodes (vtnerd)
2020-11-06 17:15:11 -06:00
luigi1111
32581fb223 Merge pull request #6985
91f1be9 net_node: add tor / i2p seed nodes (selsta)
2020-11-06 17:12:42 -06:00
selsta
f3dd25c0e0 build: prepare v0.17.1.2 2020-11-07 00:12:39 +01:00
luigi1111
33dc825d6f Merge pull request #6983
35186b1 p2p: fix endianness when checking IPv6 addresses mapping to IPv4 (moneromooo-monero)
2020-11-05 19:09:43 -06:00
selsta
91f1be9ea2 net_node: add tor / i2p seed nodes 2020-11-05 21:41:11 +01:00
moneromooo-monero
35186b1b84 p2p: fix endianness when checking IPv6 addresses mapping to IPv4 2020-11-05 16:05:54 +00:00
luigi1111
bddd5653e1 Merge pull request #6981
b36c4f3 p2p: make this work with boost <= 1.65 (pffff) (moneromooo-monero)
2020-11-04 20:57:49 -06:00
moneromooo-monero
b36c4f354b p2p: make this work with boost <= 1.65 (pffff) 2020-11-04 23:01:47 +00:00
luigi1111
1ba4c8dbc2 Merge pull request #6979
92d19c4 p2p: rewrite boost's make_address_v4 to cater for < 1.66 (moneromooo-monero)
2020-11-04 16:28:43 -06:00
moneromooo
92d19c48da p2p: rewrite boost's make_address_v4 to cater for < 1.66 2020-11-04 20:26:50 +00:00
luigi1111
01606ee52e Merge pull request #6974
58cde83 Switch to Dandelion++ fluff mode if no out connections for stem mode (vtnerd)
2020-11-04 10:40:49 -06:00
luigi1111
81d2389c24 Merge pull request #6972
8965489 protocol: reject empty incoming block messages (moneromooo-monero)
2020-11-04 10:39:53 -06:00
luigi1111
ef64c4e22f Merge pull request #6967
fa63d4b Fix tx flush callback queueing (vtnerd)
2020-11-04 10:38:08 -06:00
luigi1111
7fa01f342c Merge pull request #6966
42403c7 Fix CLI and unrestricted RPC relay_tx with stempool (vtnerd)
2020-11-04 10:37:18 -06:00
luigi1111
4603ec9765 Merge pull request #6962
1a627e1 p2p: use /16 filtering on IPv4-within-IPv6 addresses (moneromooo-monero)
2020-11-04 10:36:23 -06:00
luigi1111
0be71bcea9 Merge pull request #6961
f55f3fe net_node: add --ban-list option (selsta)
2020-11-04 10:35:07 -06:00
moneromooo-monero
1a627e1f89 p2p: use /16 filtering on IPv4-within-IPv6 addresses
IPv6 addresses include a range that can map IPv4 addresses,
which allowed those mapped addresses to bypass filtering.

This filter should be replaced by AS filtering at some point.
2020-11-03 17:36:25 +00:00
luigi1111
c1229a4432 Merge pull request #6965
d695340 rpc: on_send_raw_tx (bootstrap) - send to bootstrap daemon and P2P (xiphon)
2020-11-03 11:23:17 -06:00
luigi1111
9f68111b69 Merge pull request #6964
5090cdc p2p: remove banned peers from the white list (moneromooo-monero)
2020-11-03 11:22:27 -06:00
luigi1111
d1e79f2086 Merge pull request #6963
df1061c p2p: give all hosts the same chance of being picked for connecting (moneromooo-monero)
2020-11-03 11:21:26 -06:00
moneromooo-monero
8965489acb protocol: reject empty incoming block messages 2020-11-03 13:08:19 +00:00
xiphon
d6953406c9 rpc: on_send_raw_tx (bootstrap) - send to bootstrap daemon and P2P 2020-11-02 19:47:54 +00:00
moneromooo
5090cdc9f5 p2p: remove banned peers from the white list 2020-11-02 19:03:12 +00:00
moneromooo
df1061c87d p2p: give all hosts the same chance of being picked for connecting
even if some run more than one node
2020-11-02 19:01:43 +00:00
selsta
f55f3fe81c net_node: add --ban-list option 2020-11-02 17:26:02 +01:00
Lee Clagett
9b7ed2fd8b Change Dandelion++ fluff probability to 20%, and embargo timeout to 39s
A 20% fluff probability increases the precision of a spy connected to
every node by 10% on average, compared to a network using 0% fluff
probability. The current value (10% fluff) should increase precision by
~5% compared to baseline.

This decreases the expected stem length from 10 to 5. The embargo
timeout was therefore lowered to 39s; the fifth node in a stem is
expected to have a 90% chance of being the first to timeout, which is
the same probability we currently have with an expected stem length of
10 nodes.
2020-10-21 13:11:07 +00:00
Lee Clagett
e8468c5dcf Fix timeout checks for forwarded and Dandelion++ stem txes 2020-10-21 00:02:11 +00:00
Riccardo Spagni
76cc82c292 Merge pull request #6916
81aaa4ec7 bump default number of connections from 8 to 12 (moneromooo-monero)
2020-10-18 17:40:24 +02:00
Riccardo Spagni
81a23c73d2 Merge pull request #6914
f9a9d2ee2 wallet2: wait for propagation timeout before marking tx as failed (xiphon)
2020-10-18 17:40:05 +02:00
Riccardo Spagni
4b86583492 Merge pull request #6912
6e594e53b Allow setting start block on export (Howard Chu)
2020-10-18 17:39:43 +02:00
Riccardo Spagni
30918a27ab Merge pull request #6907
39e30d548 wallet2_api: implement stop() to interrupt refresh() loop once (xiphon)
2020-10-18 17:38:47 +02:00
Riccardo Spagni
940b042e28 Merge pull request #6911
c028f4c4d build: prepare v0.17.1.1 (selsta)
2020-10-18 17:25:33 +02:00
selsta
c028f4c4d8 build: prepare v0.17.1.1 2020-10-18 16:11:37 +02:00
xiphon
f9a9d2ee28 wallet2: wait for propagation timeout before marking tx as failed 2020-10-18 13:59:54 +00:00
moneromooo-monero
81aaa4ec7b bump default number of connections from 8 to 12 2020-10-18 13:25:38 +00:00
Howard Chu
6e594e53bb Allow setting start block on export
And make import honor the starting block# recorded in a bootstrap file
2020-10-18 14:02:30 +01:00
Alexander Blair
e88b9170db Merge pull request #6906
1120df3c5 blockchain: fix sync at v14 boundary (moneromooo-monero)
2020-10-18 05:55:36 -07:00
xiphon
39e30d5481 wallet2_api: implement stop() to interrupt refresh() loop once 2020-10-18 11:59:23 +00:00
moneromooo-monero
1120df3c53 blockchain: fix sync at v14 boundary
Miners with MLSAG txes which they'd already verified included
a couple in that block, but the consensus rules had changed
in the meantime, so that block is technically invalid and any
node which did not already have those two txes in their txpool
could not sync. Grandfather them in, since it has no effect in
practice.
2020-10-18 11:50:32 +00:00
Lee Clagett
42403c7acc Fix CLI and unrestricted RPC relay_tx with stempool 2020-10-14 13:02:27 +00:00
Lee Clagett
fa63d4b3f0 Fix tx flush callback queueing 2020-10-14 13:01:34 +00:00
luigi1111
4d855fcca7 Merge pull request #6894
e49ad98 fix next_seed_height regression in getblocktemplate rpc (xnbya)
2020-10-13 10:54:21 -05:00
luigi1111
8ae0110d54 Merge pull request #6893
4cf3545 core_rpc_server: on_get_blocks - forward bootstrap daemon error (xiphon)
2020-10-13 10:53:20 -05:00
luigi1111
a9178e3584 Merge pull request #6888
a2e37eb build: prepare v0.17.1.0 (selsta)
2020-10-13 10:51:07 -05:00
luigi1111
bbe6ee39e5 Merge pull request #6887
518a2cd Force CMAKE_SKIP_RPATH=ON (hyc)
2020-10-13 10:49:58 -05:00
luigi1111
94a86cf855 Merge pull request #6884
6352090 Dandelion++: skip desynced peers in stem phase (xiphon)
2020-10-13 10:48:00 -05:00
luigi1111
745d90c4a4 Merge pull request #6883
c407b92 wallet2: fix missing m_state field in wallet serialization (moneromooo-monero)
2020-10-13 10:46:37 -05:00
luigi1111
e60be2289e Merge pull request #6880
250c48a tx_pool: silence spammy harmless warning till we fix the bug (moneromooo-monero)
2020-10-13 10:45:26 -05:00
luigi1111
5ef94b29c3 Merge pull request #6870
826a844 cmake: Version - use CMAKE_CURRENT_LIST_DIR (xiphon)
2020-10-13 10:43:31 -05:00
luigi1111
33281c1e2e Merge pull request #6869
b4c7756 cmake: CheckTrezor - use ${CMAKE_CURRENT_LIST_DIR} to locate tests (xiphon)
2020-10-13 10:42:08 -05:00
Howard Chu
518a2cdab4 Force CMAKE_SKIP_RPATH=ON
Fix empty RPATH token issue. Only affects Linux and FreeBSD.
2020-10-13 14:22:50 +01:00
luigi1111
8235854e8a Merge pull request #6868
4665906 Fix lgamma/signgam dependency (hyc)
2020-10-12 20:21:18 -05:00
xiphon
4cf3545a31 core_rpc_server: on_get_blocks - forward bootstrap daemon error 2020-10-13 00:44:59 +00:00
selsta
a2e37eb3d8 build: prepare v0.17.1.0 2020-10-13 01:13:06 +02:00
xiphon
6352090e6d Dandelion++: skip desynced peers in stem phase 2020-10-12 16:39:40 +00:00
moneromooo-monero
c407b92e80 wallet2: fix missing m_state field in wallet serialization 2020-10-12 15:35:37 +00:00
moneromooo-monero
250c48a289 tx_pool: silence spammy harmless warning till we fix the bug 2020-10-12 13:41:12 +00:00
Alexis Enston
e49ad98a9b fix next_seed_height regression in getblocktemplate rpc 2020-10-12 14:08:35 +01:00
Lee Clagett
37bb59485f Do not use peer_id tracking method over i2p/tor 2020-10-11 13:19:25 +00:00
Lee Clagett
263579b217 Add support for i2p and tor seed nodes 2020-10-09 14:07:40 +00:00
Howard Chu
4665906ddd Fix lgamma/signgam dependency
This is a new indirect dependency due to the use of poisson_distribution,
introduced in PR#6354 commit 67ade8005
2020-10-08 02:08:00 +01:00
xiphon
826a84478d cmake: Version - use CMAKE_CURRENT_LIST_DIR 2020-10-07 20:21:25 +00:00
xiphon
b4c775663a cmake: CheckTrezor - use ${CMAKE_CURRENT_LIST_DIR} to locate tests 2020-10-06 14:37:00 +00:00
Lee Clagett
58cde83fb0 Switch to Dandelion++ fluff mode if no out connections for stem mode 2020-10-06 13:52:01 +00:00
luigi1111
1a9a984d26 Merge pull request #6845
0473abf link libzmq against libgssapi_krb5 if found (moneromooo-monero)
2020-09-25 18:19:47 -05:00
luigi1111
05405024c0 Merge pull request #6843
c02d24f build: prepare v0.17.0.1 (selsta)
2020-09-25 18:18:51 -05:00
luigi1111
d65f9a3064 Merge pull request #6842
9e6187a fix a couple bugs found by OSS-fuzz (moneromooo-monero)
2020-09-25 18:17:53 -05:00
luigi1111
d39f8237e0 Merge pull request #6835
4846743 daemon: Windows - fix FAT32 warning, trailing backslash is required (xiphon)
2020-09-25 18:16:19 -05:00
moneromooo-monero
0473abf51d link libzmq against libgssapi_krb5 if found 2020-09-25 14:38:12 +00:00
selsta
c02d24f838 build: prepare v0.17.0.1 2020-09-25 02:15:13 +02:00
moneromooo-monero
9e6187a736 fix a couple bugs found by OSS-fuzz
- index out of bounds when importing outputs
- accessing invalid CLSAG data
2020-09-24 15:33:40 +00:00
xiphon
4846743fdc daemon: Windows - fix FAT32 warning, trailing backslash is required 2020-09-20 13:57:44 +00:00
luigi1111
d27d4526fe Merge pull request #6819
c3f354e simplewallet fix wrong persistent-rpc-client-id name in help (moneromooo-monero)
2020-09-15 19:59:36 -05:00
luigi1111
5b3614e6a9 Merge pull request #6816
929ea98 Remove unused macros from cryptonote_config.h (TheCharlatan)
2020-09-15 19:58:39 -05:00
luigi1111
2b1488ef6f Merge pull request #6793
de9a9fb update error message 'No unlocked balance in the specified account' (woodser)
2020-09-15 19:56:49 -05:00
luigi1111
ea587de300 Merge pull request #6745
80e535c wallet2: adapt to deterministic unlock time (TheCharlatan)
4971219 blockchain: deterministic UNIX time unlock checks (moneromooo-monero)
2020-09-15 19:55:03 -05:00
TheCharlatan
80e535c95a wallet2: adapt to deterministic unlock time 2020-09-15 11:40:31 +00:00
moneromooo-monero
4971219c2c blockchain: deterministic UNIX time unlock checks
Based on a patch by TheCharlatan <seb.kung@gmail.com>
2020-09-15 11:40:28 +00:00
moneromooo-monero
c3f354e6c1 simplewallet fix wrong persistent-rpc-client-id name in help 2020-09-14 20:50:35 +00:00
luigi1111
9bba1a24ea Merge pull request #6815
ef4325f wallet2: fix tx sanity check triggering on pre-rct outputs (monermooo-monero)
2020-09-14 11:47:06 -05:00
luigi1111
2993d2004a Merge pull request #6813
a3844e2 Fix typo in command line argument description (reinaldoacosta)
2020-09-14 11:45:55 -05:00
luigi1111
244ae22795 Merge pull request #6812
f240b1d build: prepare v0.17 (selsta)
2020-09-14 11:44:06 -05:00
selsta
f240b1dd88 build: prepare v0.17 2020-09-14 16:52:42 +02:00
TheCharlatan
929ea98662 Remove unused macros from cryptonote_config.h 2020-09-14 00:20:58 +02:00
moneromooo-monero
ef4325fd41 wallet2: fix tx sanity check triggering on pre-rct outputs 2020-09-12 17:51:41 +00:00
Reinaldulin
a3844e257e Fix typo in command line argument description 2020-09-09 10:18:32 -04:00
luigi1111
836067b68b Merge pull request #6805
fc2cb22 blockchain: fix pow skipping for old blocks without precalc hash (moneromooo-monero)
2020-09-07 15:31:20 -05:00
luigi1111
9c9c689db4 Merge pull request #6804
5498142 rpc: assume randomx from v13 onwards (moneromooo-monero)
2020-09-07 14:34:46 -05:00
luigi1111
df0dcea061 Merge pull request #6803
1b9fe07 Revert 'unbound: update to get build fixes' (moneromooo-monero)
2020-09-07 14:33:30 -05:00
luigi1111
3a761e10d2 Merge pull request #6800
036da6d Let stagenet hardfork happen before mainnet. (normoes)
2020-09-07 14:32:28 -05:00
luigi1111
fd657c7706 Merge pull request #6798
4e44306 enable CLSAG support for Trezor client (ph4r05)
2020-09-07 14:30:41 -05:00
moneromooo-monero
fc2cb224a9 blockchain: fix pow skipping for old blocks without precalc hash 2020-09-07 01:57:19 +00:00
moneromooo-monero
5498142e8f rpc: assume randomx from v13 onwards 2020-09-07 01:13:06 +00:00
moneromooo-monero
1b9fe0761c Revert "unbound: update to get build fixes"
This reverts commit 541a7c81a1.

It breaks the depends build
2020-09-06 18:15:52 +00:00
Riccardo Spagni
aefa7740c3 Merge pull request #6111
d20ff4f64 functional_tests: add a large (many randomx epochs) p2p reorg test (moneromooo-monero)
6a0b3b1f8 functional_tests: add randomx tests (moneromooo-monero)
9d42649d5 core: fix mining from a block that's not the current top (moneromooo-monero)
2020-09-06 15:49:37 +02:00
Riccardo Spagni
2a7086caa8 Merge pull request #6802
541a7c81a unbound: update to get build fixes (moneromooo-monero)
2020-09-06 15:49:08 +02:00
moneromooo-monero
541a7c81a1 unbound: update to get build fixes 2020-09-06 11:47:55 +00:00
Norman Moeschter
036da6d45b Let stagenet hardfork happen before mainnet. 2020-09-04 22:47:05 +01:00
Dusan Klinec
4e4430603f enable CLSAG support for Trezor client 2020-09-04 01:24:58 +02:00
luigi1111
9fb2243db0 Merge pull request #6794
b09cc3d hardforks: add v13/v14 for testnet (moneromooo-monero)
2020-09-03 12:27:18 -05:00
luigi1111
ee0b02d0db Merge pull request #6757
6a37da8 threadpool: guard against exceptions in jobs, and armour plating (moneromooo-monero)
2020-09-03 12:25:59 -05:00
moneromooo-monero
b09cc3d03d hardforks: add v13/v14 for testnet 2020-09-02 17:56:48 +00:00
woodser
de9a9fb340 update error message "No unlocked balance in the specified account" 2020-09-01 17:30:00 -04:00
moneromooo-monero
6a37da837e threadpool: guard against exceptions in jobs, and armour plating
Those would, if uncaught, exit run and leave the waiter to wait
indefinitely for the number of active jobs to reach 0
2020-09-01 14:33:33 +00:00
luigi1111
2d8a197b91 Merge pull request #6789
bdcf587 net: fix get_tcp_endpoint, boost address_v4 ip in host byte order (xiphon)
2020-08-31 16:58:13 -05:00
luigi1111
77ffea0825 Merge pull request #6788
5245ba1 Made spelling, grammar, and punctuation changes. Squashed commits into one as requested. (cryptographicfool)
2020-08-31 16:57:17 -05:00
luigi1111
94b056c06e Merge pull request #6786
975ae22 Fix send scalar z in plaintext (grydz)
333ae55 Update minimal Ledger Monero app version (grydz)
0a3c5a6 Update protocol version with Ledger's HW (grydz)
2020-08-31 16:54:51 -05:00
luigi1111
54d5f098f2 Merge pull request #6783
30c1cf8 repo: update 'sponsor' link (selsta)
2020-08-31 16:52:53 -05:00
luigi1111
a70374d3e6 Merge pull request #6782
c3f9913 supercop: update submodule (selsta)
2020-08-31 16:51:44 -05:00
luigi1111
a51ccc036f Merge pull request #6770
bdc6b10 Fix ZMQ pruned bulletproof transactions (vtnerd)
2020-08-31 16:50:18 -05:00
luigi1111
61dd04b681 Merge pull request #6600
fa06c39 Bind signature to full address and signing mode (SarangNoether)
743608e wallet: allow signing a message with spend or view key (moneromooo-monero)
2020-08-31 16:49:03 -05:00
xiphon
bdcf587c79 net: fix get_tcp_endpoint, boost address_v4 ip in host byte order 2020-08-29 18:07:46 +00:00
Sarang Noether
fa06c39d97 Bind signature to full address and signing mode 2020-08-28 19:38:00 -04:00
moneromooo-monero
743608ec16 wallet: allow signing a message with spend or view key 2020-08-28 19:25:17 -04:00
luigi1111
5946002105 Merge pull request #6787
e6c81c5 ringct: fix CLSAG serialization after boost/epee changes (moneromooo-monero)
2020-08-28 18:08:03 -05:00
luigi1111
51bf6b5842 Merge pull request #6785
4a9bd8f core_tests: remove hardcoded hf version (monermooo-monero)
1dc427d core_tests: fix failures after v13 (moneromooo-monero)
2020-08-28 18:06:23 -05:00
cryptographicfool
5245ba132b Made spelling, grammar, and punctuation changes. Squashed commits into one as requested.
Made some corrections as suggested.
2020-08-28 18:23:54 +00:00
moneromooo-monero
e6c81c5ea7 ringct: fix CLSAG serialization after boost/epee changes
also fix a an assert message refering t MLSAG
2020-08-28 11:52:54 +00:00
François Colas
975ae22211 Fix send scalar z in plaintext
The scalar z has not been generated on the HW thus it can't be sent
encrypted. The value is derived from the exported private view key.
2020-08-28 12:01:57 +02:00
François Colas
333ae55fef Update minimal Ledger Monero app version 2020-08-28 12:00:25 +02:00
François Colas
0a3c5a605b Update protocol version with Ledger's HW 2020-08-28 11:59:02 +02:00
moneromooo-monero
1dc427def9 core_tests: fix failures after v13
v13 enforces claiming the full block reward, so we need to keep
track of tx fees to add them to the coinbase
2020-08-28 00:18:39 +00:00
moneromooo-monero
4a9bd8f70f core_tests: remove hardcoded hf version 2020-08-28 00:14:04 +00:00
Alexander Blair
44cd8a13ec Merge pull request #6769
b641e0a2c Add clear method to byte_stream (Lee Clagett)
2020-08-27 12:05:16 -07:00
Alexander Blair
39a087406d Merge pull request #6739
1660fe8a2 draft support of clsag (cslashm)
703944c4d CLSAG device support (Sarang Noether)
aff87b5f6 Added balance check to MLSAG/CLSAG performance tests (Sarang Noether)
f964a92c5 Updated MLSAG and CLSAG tests for consistency (Sarang Noether)
5aa1575e9 CLSAG verification performance test (Sarang Noether)
641b08c92 CLSAG optimizations (Sarang Noether)
82ee01699 Integrate CLSAGs into monero (moneromooo-monero)
8cd1d6df8 unit_tests: add ge_triple_scalarmult_base_vartime test (moneromooo-monero)
4b328c661 CLSAG signatures (Sarang Noether)
2020-08-27 12:03:24 -07:00
moneromooo-monero
d20ff4f648 functional_tests: add a large (many randomx epochs) p2p reorg test 2020-08-27 15:13:04 +00:00
moneromooo-monero
6a0b3b1f8a functional_tests: add randomx tests 2020-08-27 15:13:03 +00:00
moneromooo-monero
9d42649d58 core: fix mining from a block that's not the current top 2020-08-27 15:13:00 +00:00
cslashm
1660fe8a25 draft support of clsag 2020-08-27 12:44:18 +00:00
Sarang Noether
703944c4d4 CLSAG device support 2020-08-27 12:44:04 +00:00
Sarang Noether
aff87b5f6a Added balance check to MLSAG/CLSAG performance tests 2020-08-27 12:44:04 +00:00
Sarang Noether
f964a92c57 Updated MLSAG and CLSAG tests for consistency 2020-08-27 12:44:04 +00:00
Sarang Noether
5aa1575e91 CLSAG verification performance test 2020-08-27 12:44:04 +00:00
Sarang Noether
641b08c920 CLSAG optimizations 2020-08-27 12:44:04 +00:00
moneromooo-monero
82ee01699c Integrate CLSAGs into monero
They are allowed from v12, and MLSAGs are rejected from v13.
2020-08-27 12:44:04 +00:00
moneromooo-monero
8cd1d6df8f unit_tests: add ge_triple_scalarmult_base_vartime test 2020-08-27 12:44:01 +00:00
Sarang Noether
4b328c6616 CLSAG signatures 2020-08-27 12:43:29 +00:00
selsta
30c1cf83fc repo: update "sponsor" link 2020-08-27 14:39:30 +02:00
Alexander Blair
c695470cff Merge pull request #6771
7c7ccbd2a depends: fix broken links for ds_store / mac_alias (selsta)
2020-08-27 03:08:01 -07:00
Alexander Blair
0c101f1236 Merge pull request #6767
07442a605 Fix build with Boost 1.74 (moneromooo-monero)
2020-08-27 03:07:32 -07:00
Alexander Blair
8aaeff46ee Merge pull request #6766
12ffc79b2 qrcodegen: fix compilation with old gcc, use modern cmake (selsta)
2020-08-27 03:04:10 -07:00
Alexander Blair
27b49033fd Merge pull request #6763
728ba38b1 rpc: always send raw txes through P2P (don't use bootstrap daemon) (xiphon)
2020-08-27 03:02:30 -07:00
Alexander Blair
05390fd2d4 Merge pull request #6762
3614f78d5 README: update list of third party monero packages (erciccione)
2020-08-27 03:02:12 -07:00
Alexander Blair
aa56bf66a6 Merge pull request #6761
9f05df199 travis: j3 -> j2 on i686-w64-mingw32 (selsta)
2020-08-27 03:01:47 -07:00
Alexander Blair
b04da25e4d Merge pull request #6760
844fb4e94 enforce claiming maximum coinbase amount (moneromooo-monero)
2020-08-27 03:01:28 -07:00
Alexander Blair
4fe2858b4d Merge pull request #6746
20f603c6b Fix broken multisig pubkey sorting (Jason Rhinelander)
2020-08-27 02:58:53 -07:00
Alexander Blair
dd7fd2ef80 Merge pull request #6753
4ff2074c7 cryptonote_protocol: don't synced pruned blocks before v11 (cohcho)
2020-08-27 02:58:45 -07:00
Alexander Blair
a06c83db73 Merge pull request #6752
85899230d simplewallet: allow setting tx keys when sending to a subaddress (moneromooo-monero)
e916201f1 wallet2: fix setting tx keys when another is already set (moneromooo-monero)
2020-08-27 02:58:23 -07:00
Alexander Blair
42519b48a7 Merge pull request #6731
db5d6e460 wallet2: fix wrong name when checking RPC cost (moneromooo-monero)
2020-08-27 02:55:48 -07:00
Alexander Blair
bad5d8d6f0 Merge pull request #6690
7175dcb10 replace most boost serialization with existing monero serialization (moneromooo-monero)
2020-08-27 02:54:30 -07:00
Alexander Blair
3f392341e7 Merge pull request #6660
839e1f4ba functional_tests: add p2p functional tests (moneromooo-monero)
2020-08-27 02:53:41 -07:00
Alexander Blair
38914fe6fa Merge pull request #6613
55363c594 Avoid some temporary strings when reading off the database (moneromooo-monero)
2020-08-27 02:52:59 -07:00
selsta
c3f991332f supercop: update submodule 2020-08-27 01:22:15 +02:00
moneromooo-monero
839e1f4bab functional_tests: add p2p functional tests
Tests tx/block propagation and reorgs
2020-08-26 23:00:27 +00:00
Alexander Blair
aadd72202f Merge pull request #6610
b6e904e54 README: mention pruning (moneromooo-monero)
2020-08-26 12:53:55 -07:00
Alexander Blair
a6f1fa0194 Merge pull request #6607
eb1b321fe miner: increase min/max intervals to full extents (moneromooo-monero)
2020-08-26 12:53:09 -07:00
moneromooo-monero
844fb4e940 enforce claiming maximum coinbase amount
Claiming a slightly lesser amount does not yield the size gains
that were seen pre rct, so this closes a fingerprinting vector
2020-08-21 12:36:53 +00:00
selsta
7c7ccbd2a5 depends: fix broken links for ds_store / mac_alias 2020-08-20 21:33:23 +02:00
Lee Clagett
bdc6b10d62 Fix ZMQ pruned bulletproof transactions 2020-08-19 00:36:06 -04:00
Lee Clagett
b641e0a2c0 Add clear method to byte_stream 2020-08-17 21:30:34 -04:00
luigi1111
765db1ae7a Revert "Use domain-separated ChaCha20 for in-memory key encryption"
This reverts commit 921dd8dde5.
2020-08-17 14:08:59 -05:00
moneromooo-monero
7175dcb107 replace most boost serialization with existing monero serialization
This reduces the attack surface for data that can come from
malicious sources (exported output and key images, multisig
transactions...) since the monero serialization is already
exposed to the outside, and the boost lib we were using had
a few known crashers.

For interoperability, a new load-deprecated-formats wallet
setting is added (off by default). This allows loading boost
format data if there is no alternative. It will likely go
at some point, along with the ability to load those.

Notably, the peer lists file still uses the boost serialization
code, as the data it stores is define in epee, while the new
serialization code is in monero, and migrating it was fairly
hairy. Since this file is local and not obtained from anyone
else, the marginal risk is minimal, but it could be migrated
later if needed.

Some tests and tools also do, this will stay as is for now.
2020-08-17 16:23:58 +00:00
moneromooo-monero
55363c5941 Avoid some temporary strings when reading off the database 2020-08-17 14:02:27 +00:00
Alexander Blair
43a4fd9e16 Merge pull request #6736
05ad4fa39 epee: further defending against exceptions in command handlers (moneromooo-monero)
2020-08-16 12:56:35 -07:00
Alexander Blair
43f5369bec Merge pull request #6733
4f01cf4b4 Tweak format, add option for difficulty (Howard Chu)
429d49512 Add options to print daily coin emission and fees (Howard Chu)
d745d2433 Don't forget size of prunable txn part (Howard Chu)
2020-08-16 12:56:03 -07:00
Alexander Blair
d73b1b6560 Merge pull request #6727
13eee1d6a rpc: reject wrong sized txid (moneromooo-monero)
92e6b7df2 easylogging++: fix crash with reentrant logging (moneromooo-monero)
6dd95d530 epee: guard against exceptions in RPC handlers (moneromooo-monero)
90016ad74 blockchain: guard against exceptions in add_new_block/children (moneromooo-monero)
2020-08-16 12:55:25 -07:00
Alexander Blair
569d07d60b Merge pull request #6722
c1b03fb1a rpc: return empty txid get_outs rather than 00..00 when not requested (moneromooo-monero)
2020-08-16 12:54:42 -07:00
Alexander Blair
7db379cc82 Merge pull request #6720
86abf558c epee: Remove unused functions in local_ip.h (Jean Pierre Dudey)
2020-08-16 12:54:17 -07:00
Alexander Blair
10ad0d7eb2 Merge pull request #6718
85efc88c1 Fix overflow issue in epee:misc_utils::rolling_median_t and median(), with unit test (koe)
2020-08-16 12:53:50 -07:00
Alexander Blair
01b512f3a9 Merge pull request #6716
76c16822d wallet2_api: implement runtime proxy configuration (xiphon)
2020-08-16 12:52:21 -07:00
Alexander Blair
f40b9e34e0 Merge pull request #6715
3d6bc0a68 wallet2: throw a error on wallet initialization failure (xiphon)
2020-08-16 12:51:57 -07:00
Alexander Blair
65d7d8312d Merge pull request #6712
01cd3d934 For NetBSD, add instructions to README.md and define to ea_config.h (thomasvaughan)
2020-08-16 12:51:41 -07:00
Alexander Blair
43f91ee12e Merge pull request #6703
8baa7bb23 daemon: don't print "(pruned)" for coinbase txes (moneromooo-monero)
2020-08-16 12:50:43 -07:00
Alexander Blair
d3e611fda2 Merge pull request #6698
a3933a2a5 Update RandomX to v1.1.8 (tevador)
2020-08-16 12:50:26 -07:00
Alexander Blair
79e93a8af8 Merge pull request #6691
6111689cf cmake: allow custom openssl path on macOS (selsta)
2020-08-16 12:48:07 -07:00
Alexander Blair
0b0da2aa81 Merge pull request #6689
afd002c31 daemon: print sampling time in print_net_stats (moneromooo-monero)
ec7bba079 util: fix kilo prefix typo (K instead of k) (moneromooo-monero)
2020-08-16 12:47:36 -07:00
Alexander Blair
236256f114 Merge pull request #6679
2f1ad3b3d updates: mac gui .tar.bz2 -> .dmg (selsta)
2020-08-16 12:46:51 -07:00
Alexander Blair
eba2189925 Merge pull request #6677
f9e3fcdf3 add trezor support to sweep_single (Dusan Klinec)
2020-08-16 12:46:27 -07:00
Alexander Blair
6b2d3deb20 Merge pull request #6662
e33428012 python-rpc: fix bad in_peers parameter (moneromooo-monero)
2020-08-16 12:45:56 -07:00
Alexander Blair
bc48494731 Merge pull request #6661
267ce5b71 avoid a couple needless copies (moneromooo-monero)
2020-08-16 12:45:37 -07:00
Alexander Blair
adcadd9ed0 Merge pull request #6634
01c384c5d workflows: update msys2 setup action v0 -> v1 (selsta)
2020-08-16 12:45:14 -07:00
Alexander Blair
8f02e7a7fc Merge pull request #6632
ef694d028 fix warning by removing std::move() on temporary http_client object (woodser)
2020-08-16 12:44:59 -07:00
Alexander Blair
976a9e0c72 Merge pull request #6618
2d5d74ff5 Mention correct libusb and libudev dependencies (MaxXor)
2020-08-16 12:44:28 -07:00
Alexander Blair
c6c4ead44e Merge pull request #6614
fb31167b1 Wallet, daemon: From 'help_advanced' back to 'help', and new 'apropos' command (rbrunner7)
2020-08-16 12:44:03 -07:00
Alexander Blair
a08df6eb1b Merge pull request #6603
4e2377995 Change ZMQ-JSON txextra to hex and remove unnecessary base fields (Lee Clagett)
2020-08-16 12:43:38 -07:00
Alexander Blair
009ca6fcd3 Merge pull request #6601
98c151ecb Optimize ZMQ-JSON vector reading; GetBlocksFast reads 24%+ faster (Lee Clagett)
60627c9f2 Switch to insitu parsing for ZMQ-JSON; GetBlocksFast reads 13%+ faster (Lee Clagett)
fe96e66eb Fix pruned tx for ZMQ's GetBlocksFast (Lee Clagett)
2020-08-16 12:43:11 -07:00
Alexander Blair
9eebe01c58 Merge pull request #6593
6f5411d30 tests: fix missing error on missing python entry point (moneromooo-monero)
c6dc2850c python-rpc: add missing sync_txpool python entry point (moneromooo-monero)
2020-08-16 12:41:10 -07:00
Alexander Blair
0f5eb0e70c Merge pull request #6546
eda167585 wallet_rpc_server: use unlock_time in suggested confirmations calc (moneromooo-monero)
2020-08-16 12:40:51 -07:00
Alexander Blair
461651fce5 Merge pull request #6542
35665df20 protocol: don't drop a connection if we can't get a compatible chain (moneromooo-monero)
2020-08-16 12:40:37 -07:00
Alexander Blair
b61a9afa5d Merge pull request #6500
a07c8abcc Update expat.mk (ArqTras)
2020-08-16 12:40:17 -07:00
Alexander Blair
6d29ee6c52 Merge pull request #6493
921dd8dde Use domain-separated ChaCha20 for in-memory key encryption (Sarang Noether)
2020-08-16 12:39:59 -07:00
Alexander Blair
e2e09d00c2 Merge pull request #6337
a11ec4ac1 Support for supercop ASM in wallet, and benchmark for supercop (Lee Clagett)
2020-08-16 12:38:44 -07:00
erciccione
3614f78d5f README: update list of third party monero packages
Removed AUR package, since doesn't seem to exist anymore and added Debian package (the CCS-funded one)
2020-08-16 21:38:11 +02:00
Alexander Blair
13549d590e Merge pull request #6329
6bfcd3101 Updates InProofV1, OutProofV1, and ReserveProofV1 to new V2 variants that include all public proof parameters in Schnorr challenges, along with hash function domain separators. Includes new randomized unit tests. (Sarang Noether)
2020-08-16 12:37:43 -07:00
xiphon
728ba38b11 rpc: always send raw txes through P2P (don't use bootstrap daemon)
It turns out that some remote (bootstrap) nodes silently drop /
don't broadcast client's transactions.
2020-08-16 17:34:28 +00:00
moneromooo-monero
07442a6059 Fix build with Boost 1.74
Thanks iDunk for testing
2020-08-16 16:23:26 +00:00
selsta
12ffc79b27 qrcodegen: fix compilation with old gcc, use modern cmake 2020-08-16 18:06:55 +02:00
selsta
9f05df1996 travis: j3 -> j2 on i686-w64-mingw32 2020-08-15 02:42:23 +02:00
Lee Clagett
4e2377995d Change ZMQ-JSON txextra to hex and remove unnecessary base fields 2020-08-14 23:01:00 +00:00
Lee Clagett
98c151ecb8 Optimize ZMQ-JSON vector reading; GetBlocksFast reads 24%+ faster 2020-08-14 19:47:19 +00:00
Lee Clagett
60627c9f24 Switch to insitu parsing for ZMQ-JSON; GetBlocksFast reads 13%+ faster 2020-08-14 19:46:59 +00:00
Lee Clagett
fe96e66ebe Fix pruned tx for ZMQ's GetBlocksFast 2020-08-14 19:46:33 +00:00
moneromooo-monero
85899230d1 simplewallet: allow setting tx keys when sending to a subaddress
The tx key derivation is different then
2020-08-10 21:25:51 +00:00
cohcho
4ff2074c74 cryptonote_protocol: don't synced pruned blocks before v11
There are a few Borromean proofs txes in the v8 era, and these
aren't supported by get_pruned_transaction_weight. Moreover, only
only the most recent variant of bulletproofs is currently supported.
2020-08-10 16:17:39 +00:00
Sarang Noether
921dd8dde5 Use domain-separated ChaCha20 for in-memory key encryption 2020-08-09 19:11:54 -04:00
Sarang Noether
6bfcd31015 Updates InProofV1, OutProofV1, and ReserveProofV1 to new V2 variants that include all public proof parameters in Schnorr challenges, along with hash function domain separators. Includes new randomized unit tests. 2020-08-09 18:42:15 -04:00
Alexander Blair
c108c5e2f0 Merge pull request #6354
67ade8005 Add randomized delay when forwarding txes from i2p/tor -> ipv4/6 (Lee Clagett)
2020-08-09 06:42:49 -07:00
moneromooo-monero
e916201f12 wallet2: fix setting tx keys when another is already set
insert doesn't actually insert if another element with the
same key is already in the map
2020-08-08 14:40:03 +00:00
Jason Rhinelander
20f603c6be Fix broken multisig pubkey sorting
The sort predicate is a boolean ordered-before value, but these are
returning the memcmp value directly, and thus returns true whenever the
pubkeys aren't equal.  This means:

- it isn't actually sorting.

- it can (and does) segfault for some inputs.
2020-08-05 12:42:27 -03:00
Alexander Blair
9414194b1e Merge pull request #6571
1d31e6c00 net_node: remove dead seed nodes (selsta)
2020-08-05 07:57:54 -07:00
Alexander Blair
d9deb2c2fe Merge pull request #6418
e5214a2ca Adding ZMQ/Pub support for txpool_add and chain_main events (Lee Clagett)
2020-08-05 07:54:31 -07:00
Howard Chu
4f01cf4b46 Tweak format, add option for difficulty
Set input, output, ringsize averages to 2 decimal places precision
Add option to show min/max/av per-block difficulty
2020-08-03 13:13:14 +01:00
moneromooo-monero
05ad4fa397 epee: further defending against exceptions in command handlers 2020-08-02 00:22:47 +00:00
Howard Chu
429d495121 Add options to print daily coin emission and fees
Closes #6735
2020-08-01 20:48:42 +01:00
Howard Chu
d745d24333 Don't forget size of prunable txn part
Fixes #6732
2020-08-01 13:41:38 +01:00
moneromooo-monero
db5d6e4602 wallet2: fix wrong name when checking RPC cost 2020-07-31 14:17:23 +00:00
moneromooo-monero
13eee1d6ab rpc: reject wrong sized txid
Reporter requested credit to be given to Decred
2020-07-30 22:52:14 +00:00
moneromooo-monero
92e6b7df2c easylogging++: fix crash with reentrant logging 2020-07-30 22:52:13 +00:00
moneromooo-monero
6dd95d5308 epee: guard against exceptions in RPC handlers 2020-07-30 22:52:12 +00:00
moneromooo-monero
90016ad744 blockchain: guard against exceptions in add_new_block/children
Reporter requested credit to be given to Decred
2020-07-30 22:52:11 +00:00
moneromooo-monero
c1b03fb1a6 rpc: return empty txid get_outs rather than 00..00 when not requested
It's more obvious there's no txid, and it saves space
2020-07-25 17:01:21 +00:00
moneromooo-monero
8baa7bb238 daemon: don't print "(pruned)" for coinbase txes
Pruned coinbase txes are the same as unpruned ones, so the
prunable data is empty
2020-07-24 13:42:20 +00:00
rbrunner7
fb31167b12 Wallet, daemon: From 'help_advanced' back to 'help', and new 'apropos' command 2020-07-24 07:12:11 +02:00
koe
85efc88c1e Fix overflow issue in epee:misc_utils::rolling_median_t and median(), with unit test 2020-07-23 03:36:05 -05:00
Jean Pierre Dudey
86abf558cb epee: Remove unused functions in local_ip.h
Signed-off-by: Jean Pierre Dudey <me@jeandudey.tech>
2020-07-22 19:06:01 -05:00
xiphon
76c16822d0 wallet2_api: implement runtime proxy configuration 2020-07-20 13:45:12 +00:00
xiphon
3d6bc0a680 wallet2: throw a error on wallet initialization failure 2020-07-20 04:40:34 +00:00
thomasvaughan
01cd3d9342 For NetBSD, add instructions to README.md and define to ea_config.h 2020-07-19 12:53:57 +00:00
Alexander Blair
5d850dde99 Merge pull request #6586
40b73d2a6 cmake: insert CMAKE_CURRENT_SOURCE_DIR in CMAKE_MODULE_PATH (xiphon)
2020-07-19 03:43:07 -07:00
Alexander Blair
2a82258dff Merge pull request #6580
ed901798d version: update name (selsta)
2020-07-19 03:42:43 -07:00
Alexander Blair
3434cc24a2 Merge pull request #6578
a6803231e daemon: complain if data dir resides on FAT32 volume (Windows) (xiphon)
2020-07-19 03:41:55 -07:00
Alexander Blair
9871fefbf9 Merge pull request #6565
72cdfa4a2 fix a few typos in error messages (moneromooo-monero)
2020-07-19 03:40:19 -07:00
Alexander Blair
c0a6e1aab9 Merge pull request #6557
bd69e3b37 testdb: add override in a couple places where it's missing (moneromooo-monero)
2020-07-19 03:39:53 -07:00
Alexander Blair
bb0241da6e Merge pull request #6538
7178bb5c8 keccak: remove aligned check (moneromooo-monero)
2020-07-19 03:38:53 -07:00
Alexander Blair
61e5208181 Merge pull request #6537
5e0ea6e95 simplewallet: add missing calls to on_command (moneromooo-monero)
2020-07-19 03:38:07 -07:00
Alexander Blair
6d6c691a0f Merge pull request #6536
bd9653663 db_lmdb: test for mmap support at init time (moneromooo-monero)
2020-07-19 03:37:15 -07:00
Alexander Blair
36d50d93f2 Merge pull request #6534
7bd66b01b daemon: guard against rare 'difficulty drift' bug with checkpoints and recalculation (stoffu)
2020-07-19 03:36:39 -07:00
Alexander Blair
912cbad6db Merge pull request #6529
153977aed libzmq should be libzmq4. (russoj88)
2020-07-19 03:35:14 -07:00
Alexander Blair
814e617117 Merge pull request #6526
5d882f4f1 blockchain: fix theoretical race getting bulk timestamps (moneromooo-monero)
2020-07-19 03:34:52 -07:00
Alexander Blair
3ba6c7fd30 Merge pull request #6516
8656a8c9f remove double includes (sumogr)
2020-07-19 03:34:28 -07:00
Alexander Blair
a0d179e528 Merge pull request #6512
5ef0607da Update copyright year to 2020 (SomaticFanatic)
2020-07-19 03:32:59 -07:00
Alexander Blair
616558d512 Merge pull request #6509
71693f06 systemd: Make sure required folders exist (Age Bosma)
2020-07-19 03:32:03 -07:00
Alexander Blair
7cd0d7f324 Merge pull request #6501
3843a6ab Made ccache optional (opt out) and tidied up the FindCcache.cmake (mj-xmr)
2020-07-19 03:29:26 -07:00
Alexander Blair
65938d26f6 Merge pull request #6497
db8563cb performance_tests: some windows fixes (moneromooo-monero)
2020-07-19 03:27:55 -07:00
Alexander Blair
2fa20016a7 Merge pull request #6489
7765da6e Keys: Add key for rbrunner7 (rbrunner7)
2020-07-19 03:27:34 -07:00
Alexander Blair
5041de8a3b Merge pull request #6488
99684e3e simplewallet: add show_qr_code command (selsta)
2020-07-16 06:14:30 -07:00
Alexander Blair
66235c7f02 Merge pull request #6476
6d41d9e8 contrib: remove codefresh pipeline (selsta)
2020-07-16 06:13:20 -07:00
Alexander Blair
17823be66d Merge pull request #6475
91182330 snap: remove from repo (selsta)
2020-07-16 06:12:26 -07:00
luigi1111
cb882dfc55 Merge pull request #6670
332d607 tx_pool: mine stem txes in fake chain mode (moneromooo-monero)
2020-07-09 12:45:05 -05:00
moneromooo-monero
332d60719a tx_pool: mine stem txes in fake chain mode
This fixes the functional tests, since txes would not be mined
after being sent to the daemon (they'd be waiting for the
dandelion timeout first)
2020-07-09 14:52:13 +00:00
luigi1111
9f93a1b632 Merge pull request #6650
0fd6cce blockchain: fix timestamp/difficulty cache getting out of sync (moneromooo-monero)
2020-07-08 20:38:03 -05:00
moneromooo-monero
0fd6ccef21 blockchain: fix timestamp/difficulty cache getting out of sync
The cache is discarded when a block is popped, but then gets
rebuilt when the difficulty for next block is requested.
While this is all properly locked, it does not take into account
the delay caused by a database transaction being only committed
(and thus its effects made visible to other threads) later on,
which means another thread could request difficulty between
the pop and the commit, which would end up using stale database
view to build the cache, but that cache would not be invalidated
again when the transaction gets committed, which would cause the
cache to not match the new database data.

To fix this, we now keep track of when the cache is invalidated
so we can invalidate it again upon database transaction commit
to ensure it gets calculated again with fresh data next time it
is nedeed.
2020-07-08 22:31:51 +00:00
luigi1111
803f58553b Merge pull request #6675
3721d56 epee: fix array underflow in unicode parsing (moneromooo-monero)
2020-07-08 17:27:53 -05:00
luigi1111
99b14ccd6a Merge pull request #6647
4d8d121 Fix D++ block template check (vtnerd)
2020-07-08 17:25:01 -05:00
luigi1111
18bb011afe Merge pull request #6629
795e186 blockchain: fix total_height in getblocks.bin response (moneromooo-monero)
2020-07-08 17:23:28 -05:00
luigi1111
e8d87fccc2 Merge pull request #6627
4df8f9c rpc: fix loading rpc payment data from file (moneromooo-monero)
2020-07-08 17:22:33 -05:00
luigi1111
0376195015 Merge pull request #6611
dc1a053 rpc: fix comparison of seconds vs microseconds (moneromooo-monero)
2020-07-08 17:21:31 -05:00
luigi1111
3057f52f89 Merge pull request #6599
6e4a55b rpc: fix relay_tx error return mixup (moneromooo-monero)
9b86e14 functional_tests: add simple relay_tx test (moneromooo-monero)
2020-07-08 17:20:29 -05:00
luigi1111
228101a72e Merge pull request #6597
ec46069 Fix incorrect lenght of command INS_PREFIX_HASH (grydz)
2020-07-08 17:18:10 -05:00
luigi1111
81c2586358 Merge pull request #6588
bcef52d daemon: remove time based 'update needed' status string (moneromooo-monero)
2020-07-08 17:15:19 -05:00
luigi1111
340e1943ac Merge pull request #6587
94befec fix typo in pick_preferred_rct_inputs (Parean)
2020-07-08 17:14:09 -05:00
luigi1111
be170c485c Merge pull request #6584
78d435a rpc: don't display invalid json errors on default log level (moneromooo-monero)
2020-07-08 17:12:43 -05:00
luigi1111
8b3fa2d373 Merge pull request #6574
7ebb351 rpc: lock access to the rpc payment object (moneromooo-monero)
2020-07-08 17:11:32 -05:00
luigi1111
634262f3f5 Merge pull request #6568
f037121 cryptonote_core: remove 'We are most likely forked' message (moneromooo-monero)
2020-07-08 17:10:39 -05:00
luigi1111
f1334ebf64 Merge pull request #6566
567402c protocol: move the 'peer claims higher version' warning to debug (moneromooo-monero)
2020-07-08 17:08:58 -05:00
luigi1111
35e2520115 Merge pull request #6559
15538f7 ByteSlice: Fix persisting ptr to std::moved SSO buffer (Doy-lee)
2020-07-08 17:07:50 -05:00
luigi1111
ee817e00bb Merge pull request #6550
ca60d60 easylogging++: sanitize log payload (moneromooo-monero)
2020-07-08 17:06:26 -05:00
luigi1111
ed903578d7 Merge pull request #6544
5741b4d blockchain: detect and log bad difficulty calculations (moneromooo-monero)
2020-07-08 17:04:41 -05:00
luigi1111
7d903bc992 Merge pull request #6528
b73f4e7 [master]: Update gitian yml files (iDunk5400)
2020-07-08 17:03:37 -05:00
selsta
ed901798d9 version: update name 2020-07-06 23:22:25 +02:00
tevador
a3933a2a5e Update RandomX to v1.1.8 2020-07-04 15:24:39 +02:00
selsta
6111689cfa cmake: allow custom openssl path on macOS 2020-06-25 20:31:16 +02:00
moneromooo-monero
afd002c31f daemon: print sampling time in print_net_stats 2020-06-25 13:03:59 +00:00
moneromooo-monero
ec7bba0793 util: fix kilo prefix typo (K instead of k) 2020-06-25 13:03:24 +00:00
selsta
2f1ad3b3d2 updates: mac gui .tar.bz2 -> .dmg 2020-06-22 02:55:22 +02:00
Dusan Klinec
f9e3fcdf3e add trezor support to sweep_single 2020-06-21 23:17:58 +02:00
moneromooo-monero
3721d5688f epee: fix array underflow in unicode parsing
Reported by minerscan

Also independently found by OSS-Fuzz just recently
2020-06-21 18:22:16 +00:00
selsta
99684e3ec3 simplewallet: add show_qr_code command
Thanks to iDunk for helping with Windows.
2020-06-21 20:15:10 +02:00
luigi1111
93257997bd Merge pull request #6656
bde7f1c fuzz_tests: fix init check in oss-fuzz mode (moneromooo-monero)
c4b7420 Do not use PIE with OSS-Fuzz (moneromooo-monero)
c4df8b1 fix leaks in fuzz tests (moneromooo-monero)
38ca1bb fuzz_tests: add a tx extra fuzz test (moneromooo-monero)
2020-06-19 10:17:51 -05:00
moneromooo-monero
e334280127 python-rpc: fix bad in_peers parameter 2020-06-17 14:34:16 +00:00
luigi1111
b3d6382d40 Merge pull request #6637
58e1c8b repo: update donation fund address (selsta)
2020-06-15 15:54:22 -05:00
moneromooo-monero
267ce5b718 avoid a couple needless copies 2020-06-14 18:05:35 +00:00
moneromooo-monero
bde7f1c5cc fuzz_tests: fix init check in oss-fuzz mode 2020-06-14 16:10:49 +00:00
moneromooo-monero
c4b74208c7 Do not use PIE with OSS-Fuzz 2020-06-14 14:03:18 +00:00
moneromooo-monero
c4df8b1390 fix leaks in fuzz tests 2020-06-14 12:54:13 +00:00
moneromooo-monero
38ca1bb389 fuzz_tests: add a tx extra fuzz test 2020-06-14 12:54:10 +00:00
Lee Clagett
4d8d121462 Fix D++ block template check 2020-06-12 22:05:52 -04:00
selsta
58e1c8b031 repo: update donation fund address 2020-06-09 12:19:39 +02:00
stoffu
7bd66b01bf daemon: guard against rare 'difficulty drift' bug with checkpoints and recalculation
On startup, it checks against the difficulty checkpoints, and if any mismatch is found, recalculates all the blocks with wrong difficulties. Additionally, once a week it recalculates difficulties of blocks after the last difficulty checkpoint.
2020-06-09 10:40:51 +09:00
luigi1111
ff4d470629 Merge pull request #6576
4d3c2d0 rpc: add a sanity limit to a few RPC in restricted mode (moneromooo-monero)
2020-06-08 14:27:05 -05:00
luigi1111
c4f4091dd4 Merge pull request #6561
c17fe81 wallet2: fix multisig data clearing stomping on a vector (moneromooo-monero)
2020-06-08 14:21:33 -05:00
luigi1111
445f74c71a Merge pull request #6556
5ed37ba serialization: fix bad rapidjson api usage (moneromooo-monero)
2020-06-08 14:18:09 -05:00
luigi1111
28745b1b63 Merge pull request #6553
bb5c5df cryptonote_protocol: reject requests/notifications before handshake (moneromooo-monero)
f1d0457 cryptonote_protocol: stricter limit to number of objects requested (moneromooo-monero)
2020-06-08 14:16:42 -05:00
luigi1111
e17c864ba2 Merge pull request #6549
82d21f5 easylogging++: sanitize log payload (moneromooo-monero)
7d0b7e8 [master] MMS: New 'config_checksum' subcommand (rbrunner7)
2020-06-08 14:12:08 -05:00
luigi1111
e27604ff10 Merge pull request #6539
85164a8 epee: use memwipe rather than memset for md5 secrets (moneromooo-monero)
2020-06-08 14:09:22 -05:00
luigi1111
3a577f1ce7 Merge pull request #6525
86cf811 simplewallet: don't complain about incoming payment ids on change (moneromooo-monero)
2020-06-08 14:07:45 -05:00
luigi1111
967285a9fa Merge pull request #6522
29e563b Fixed bugs for take_slice and byte_stream->byte_slice (vtnerd)
2020-06-08 14:05:05 -05:00
luigi1111
09667700e8 Merge pull request #6519
ab44293 trezor: add new firmware version support (ph4r05)
2020-06-08 14:03:57 -05:00
luigi1111
37c359e765 Merge pull request #6514
4baee20 build: prepare v0.16.0.0 release (selsta)
2020-06-08 14:02:00 -05:00
selsta
01c384c5de workflows: update msys2 setup action v0 -> v1 2020-06-07 21:03:33 +02:00
woodser
ef694d028f fix warning by removing std::move() on temporary http_client object 2020-06-06 11:38:32 -04:00
moneromooo-monero
795e18632c blockchain: fix total_height in getblocks.bin response 2020-06-05 15:27:07 +00:00
moneromooo-monero
4df8f9c414 rpc: fix loading rpc payment data from file
Got broken after making one of those micro optimizations requested on review..
2020-06-05 11:21:24 +00:00
MaxXor
2d5d74ff5c Mention correct libusb and libudev dependencies 2020-06-02 14:00:31 +02:00
moneromooo-monero
b6e904e547 README: mention pruning 2020-06-01 17:48:11 +00:00
luigi1111
992b7ce30f Merge pull request #6612
7aeb503 Fix boost <1.60 compilation and fix boost 1.73+ warnings (vtnerd)
2020-06-01 08:52:12 -05:00
Lee Clagett
7aeb503547 Fix boost <1.60 compilation and fix boost 1.73+ warnings 2020-05-31 21:18:11 -04:00
moneromooo-monero
dc1a053081 rpc: fix comparison of seconds vs microseconds 2020-05-31 22:28:23 +00:00
moneromooo-monero
eb1b321fe2 miner: increase min/max intervals to full extents
This prevents setting target to, eg, 65 being ignored

and remove an unused constant
2020-05-31 12:36:47 +00:00
luigi1111
7e78da7772 Merge pull request #6582
2314dae workflows: fix windows build (selsta)
2020-05-28 12:53:58 -05:00
moneromooo-monero
9b86e14c5a functional_tests: add simple relay_tx test 2020-05-28 12:49:17 +00:00
moneromooo-monero
6e4a55ba7e rpc: fix relay_tx error return mixup 2020-05-28 11:33:27 +00:00
luigi1111
d6d4a03b85 Merge pull request #6535
81773f5 fuzz_tests: refactor and add OSS-Fuzz compatibility (moneromooo-monero)
cb4edc1 cmake: ASAN and PIE don't mix (moneromooo-monero)
2020-05-27 18:27:06 -05:00
luigi1111
463d044f5e Merge pull request #6531
f35ced6 build: fix boost 1.73 compatibility (selsta)
2020-05-27 18:25:33 -05:00
François Colas
ec46069248 Fix incorrect lenght of command INS_PREFIX_HASH
buffer_send[4] (LC) is an unsigned char, len should not
exceed 254 (255 - 1 for the option).
2020-05-27 18:06:19 +02:00
moneromooo-monero
6f5411d305 tests: fix missing error on missing python entry point 2020-05-27 13:11:01 +00:00
moneromooo-monero
c6dc2850c2 python-rpc: add missing sync_txpool python entry point 2020-05-27 13:11:00 +00:00
moneromooo-monero
bcef52d430 daemon: remove time based "update needed" status string 2020-05-24 21:44:03 +00:00
xiphon
40b73d2a6c cmake: insert CMAKE_CURRENT_SOURCE_DIR in CMAKE_MODULE_PATH 2020-05-24 16:47:06 +00:00
rbrunner7
7d0b7e83ef [master] MMS: New 'config_checksum' subcommand 2020-05-24 10:23:55 +02:00
moneromooo-monero
82d21f5b3c easylogging++: sanitize log payload
Some of it might be coming from untrusted sources

Reported by itsunixiknowthis
2020-05-24 08:38:59 +02:00
moneromooo-monero
78d435a5fa rpc: don't display invalid json errors on default log level
It's not something the user needs to know, and will display
attacker controlled data
2020-05-23 12:26:49 +00:00
selsta
2314dae8c8 workflows: fix windows build 2020-05-23 02:30:09 +02:00
xiphon
a6803231e6 daemon: complain if data dir resides on FAT32 volume (Windows) 2020-05-21 15:23:44 +00:00
moneromooo-monero
4d3c2d0b7b rpc: add a sanity limit to a few RPC in restricted mode 2020-05-20 19:17:49 +00:00
Doyle
15538f7e3f ByteSlice: Fix persisting ptr to std::moved SSO buffer
The Bug:
1. Construct `byte_slice.portion_` with `epee::span(buffer)` which copies a pointer to the SSO buffer to `byte_slice.portion_`
2. It constructs `byte_slice.storage_` with `std::move(buffer)` (normally this swap pointers, but SSO means a memcpy and clear on the original SSO buffer)
3. `slice.data()` returns a pointer from `slice.portion_` that points to the original SSO cleared buffer, `slice.storage_` has the actual string.
2020-05-20 10:13:58 +10:00
selsta
1d31e6c000 net_node: remove dead seed nodes 2020-05-20 01:06:03 +02:00
moneromooo-monero
7ebb351c2d rpc: lock access to the rpc payment object 2020-05-19 18:26:28 +00:00
moneromooo-monero
f0371210e9 cryptonote_core: remove "We are most likely forked" message
It's time based and we don't have forks every 6 months anymore
2020-05-19 16:27:24 +00:00
moneromooo-monero
567402c508 protocol: move the "peer claims higher version" warning to debug
Because there's a neverending supply of cunts claiming a wrong
version just to say "look at me" I guess
2020-05-19 16:14:53 +00:00
moneromooo-monero
72cdfa4a20 fix a few typos in error messages
Reported by adrelanos
2020-05-19 15:59:26 +00:00
moneromooo-monero
c17fe815a2 wallet2: fix multisig data clearing stomping on a vector 2020-05-19 10:45:40 +00:00
moneromooo-monero
f1d0457523 cryptonote_protocol: stricter limit to number of objects requested
Reported by xnbya
2020-05-19 10:33:03 +00:00
moneromooo-monero
bb5c5dff15 cryptonote_protocol: reject requests/notifications before handshake
Reported by xnbya
2020-05-19 10:33:02 +00:00
moneromooo-monero
ca60d60fea easylogging++: sanitize log payload
Some of it might be coming from untrusted sources

Reported by itsunixiknowthis
2020-05-19 10:31:28 +00:00
moneromooo-monero
bd69e3b37a testdb: add override in a couple places where it's missing 2020-05-18 14:17:48 +00:00
moneromooo-monero
5ed37ba83c serialization: fix bad rapidjson api usage 2020-05-18 14:17:23 +00:00
moneromooo-monero
5741b4d74d blockchain: detect and log bad difficulty calculations 2020-05-17 12:44:45 +00:00
moneromooo-monero
eda1675858 wallet_rpc_server: use unlock_time in suggested confirmations calc 2020-05-17 01:03:32 +00:00
moneromooo-monero
35665df206 protocol: don't drop a connection if we can't get a compatible chain
This can now happen if:
- we have a pruned db
- we have not connected to the monero network for a while
- we connect to a node
- that node asks us for history
- we only have a pruned version of the most recent common block

In that case, it's better to not reply but keep the connection alive,
so we can sync off it.
2020-05-16 19:55:31 +00:00
moneromooo-monero
85164a8daf epee: use memwipe rather than memset for md5 secrets
That's used by HTTP auth now
2020-05-16 18:12:55 +00:00
moneromooo-monero
7178bb5c84 keccak: remove aligned check
Some tools report the alignment check as UB, which seems a bit
dubious, but since the performance difference between the two
versions is minimal, I'll go with the safe version
2020-05-16 12:28:27 +00:00
Lee Clagett
a11ec4ac1d Support for supercop ASM in wallet, and benchmark for supercop 2020-05-16 10:25:17 +00:00
moneromooo-monero
5e0ea6e95c simplewallet: add missing calls to on_command
It resets the inactivity time
2020-05-16 00:48:44 +00:00
moneromooo-monero
bd96536637 db_lmdb: test for mmap support at init time
It'll make it clearer when a DB init failure is due to being
on a filesystem which does not support mmap
2020-05-16 00:20:22 +00:00
moneromooo-monero
cb4edc1f45 cmake: ASAN and PIE don't mix
Binaries built with both crash on startup with maybe 25% probability
2020-05-15 17:18:50 +00:00
moneromooo-monero
81773f55a4 fuzz_tests: refactor and add OSS-Fuzz compatibility 2020-05-15 17:18:27 +00:00
Lee Clagett
67ade80055 Add randomized delay when forwarding txes from i2p/tor -> ipv4/6 2020-05-15 07:57:35 +00:00
selsta
f35ced6d7f build: fix boost 1.73 compatibility 2020-05-14 22:57:53 +02:00
moneromooo-monero
86cf811a39 simplewallet: don't complain about incoming payment ids on change 2020-05-13 23:28:31 +00:00
russoj88
153977aed4 libzmq should be libzmq4. 2020-05-13 14:21:18 -07:00
iDunk5400
b73f4e78d0 [master]: Update gitian yml files 2020-05-13 22:08:00 +02:00
selsta
4baee200a7 build: prepare v0.16.0.0 release 2020-05-13 16:15:03 +02:00
moneromooo-monero
5d882f4f14 blockchain: fix theoretical race getting bulk timestamps 2020-05-13 13:42:41 +00:00
Dusan Klinec
ab4429346d trezor: add new firmware version support 2020-05-12 16:31:36 +02:00
Lee Clagett
29e563bb1e Fixed bugs for take_slice and byte_stream->byte_slice 2020-05-12 01:26:37 -04:00
sumogr
8656a8c9ff remove double includes 2020-05-11 13:53:17 +00:00
SomaticFanatic
5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
Age Bosma
71693f06a1 systemd: Make sure required folders exist
The default monero.conf file depends on the existence of the folders `/var/log/monero/` and `/var/lib/monero/`.
This change makes sure systemd will create them, together with the proper permissions, if they don't exist.
`StateDirectory` can be considered an extra safety in case the user `monero` happens to have been created with specifying `/var/lib/monero/` as a home folder but without actually creating it.
2020-05-06 14:57:47 +02:00
mj-xmr
3843a6aba5 Made ccache optional (opt out) and tidied up the FindCcache.cmake 2020-05-04 09:46:31 +02:00
Lee Clagett
e5214a2ca2 Adding ZMQ/Pub support for txpool_add and chain_main events 2020-05-04 02:06:35 +00:00
ArqTras
a07c8abcc1 Update expat.mk 2020-05-03 22:37:58 +02:00
moneromooo-monero
db8563cb46 performance_tests: some windows fixes
Too many iterations cause std::bad_alloc for the timings vector,
and the micro prefix displays as some other character, so use u.

Reported by iDunk
2020-05-03 14:11:45 +00:00
rbrunner7
7765da6eb2 Keys: Add key for rbrunner7 2020-04-29 22:15:42 +02:00
selsta
6d41d9e8f9 contrib: remove codefresh pipeline 2020-04-25 00:25:55 +02:00
selsta
91182330d7 snap: remove from repo 2020-04-25 00:15:37 +02:00
739 changed files with 17774 additions and 4808 deletions

2
.github/FUNDING.yml vendored
View File

@@ -1 +1 @@
custom: https://web.getmonero.org/get-started/contributing/
custom: https://www.getmonero.org/get-started/contributing/

View File

@@ -10,23 +10,25 @@ jobs:
with:
submodules: recursive
- name: update brew and install dependencies
run: brew update && brew install boost hidapi zmq libpgm miniupnpc ldns expat libunwind-headers protobuf
run: brew update && brew install boost hidapi openssl zmq libpgm miniupnpc ldns expat libunwind-headers protobuf
- name: build
run: make -j3
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- uses: numworks/setup-msys2@v1
- name: update pacman
run: msys2do pacman -Syu --noconfirm
- name: install monero dependencies
run: msys2do pacman -S --noconfirm mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf-c mingw-w64-x86_64-libusb git
- uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf-c mingw-w64-x86_64-libusb git
- name: build
run: msys2do make release-static-win64 -j2
run: make release-static-win64 -j2
build-ubuntu:
runs-on: ubuntu-latest

7
.gitmodules vendored
View File

@@ -4,8 +4,7 @@
branch = monero
[submodule "external/miniupnp"]
path = external/miniupnp
url = https://github.com/monero-project/miniupnp
branch = monero
url = https://github.com/miniupnp/miniupnp
[submodule "external/rapidjson"]
path = external/rapidjson
url = https://github.com/Tencent/rapidjson
@@ -15,3 +14,7 @@
[submodule "external/randomx"]
path = external/randomx
url = https://github.com/tevador/RandomX
[submodule "external/supercop"]
path = external/supercop
url = https://github.com/monero-project/supercop
branch = monero

View File

@@ -25,7 +25,7 @@ env:
# ARM v8
- HOST=aarch64-linux-gnu PACKAGES="python3 gperf g++-aarch64-linux-gnu"
# i686 Win
- HOST=i686-w64-mingw32 DEP_OPTS="NO_QT=1" PACKAGES="python3 g++-mingw-w64-i686 qttools5-dev-tools"
- HOST=i686-w64-mingw32 DEP_OPTS="NO_QT=1" PACKAGES="python3 g++-mingw-w64-i686 qttools5-dev-tools" MAKEJOBS=-j2
# i686 Linux
- HOST=i686-pc-linux-gnu PACKAGES="gperf cmake g++-multilib python3-zmq"
# Win64

View File

@@ -36,10 +36,6 @@ with additional exclusive IPv4 address(es).
## Usage
Anonymity networks have no seed nodes (the feature is still considered
experimental), so a user must specify an address. If configured properly,
additional peers can be found through typical p2p peerlist sharing.
### Outbound Connections
Connecting to an anonymous address requires the command line option
@@ -54,8 +50,9 @@ separate process. On most systems the configuration will look like:
which tells `monerod` that ".onion" p2p addresses can be forwarded to a socks
proxy at IP 127.0.0.1 port 9050 with a max of 10 outgoing connections and
".b32.i2p" p2p addresses can be forwarded to a socks proxy at IP 127.0.0.1 port
9000 with the default max outgoing connections. Since there are no seed nodes
for anonymity connections, peers must be manually specified:
9000 with the default max outgoing connections.
If desired, peers can be manually specified:
```
--add-exclusive-node rveahdfho7wo4b2m.onion:28083

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#
@@ -31,7 +31,7 @@
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_SOURCE_DIR}/cmake")
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckLinkerFlag)
@@ -43,15 +43,28 @@ if (IOS)
INCLUDE(CmakeLists_IOS.txt)
endif()
cmake_minimum_required(VERSION 2.8.7)
cmake_minimum_required(VERSION 3.5)
message(STATUS "CMake version ${CMAKE_VERSION}")
project(monero)
include(FindCcache) # Has to be included after the project() macro, to be able to read the CXX variable.
option (USE_CCACHE "Use ccache if a usable instance is found" ON)
if (USE_CCACHE)
include(FindCcache) # Has to be included after the project() macro, to be able to read the CXX variable.
else()
message(STATUS "ccache deselected")
endif()
enable_language(C ASM)
# Require C11/C++11 and disable extensions for all targets
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
function (die msg)
if (NOT WIN32)
string(ASCII 27 Esc)
@@ -66,16 +79,18 @@ function (die msg)
endfunction ()
function (add_c_flag_if_supported flag var)
string(REPLACE "-" "_" supported ${flag}_c)
check_c_compiler_flag(${flag} ${supported})
set(TMP "-Werror ${flag}")
string(REGEX REPLACE "[- ]" "_" supported ${TMP}_c)
check_c_compiler_flag(${TMP} ${supported})
if(${${supported}})
set(${var} "${${var}} ${flag}" PARENT_SCOPE)
endif()
endfunction()
function (add_cxx_flag_if_supported flag var)
string(REPLACE "-" "_" supported ${flag}_cxx)
check_cxx_compiler_flag(${flag} ${supported})
set(TMP "-Werror ${flag}")
string(REGEX REPLACE "[- ]" "_" supported ${TMP}_cxx)
check_cxx_compiler_flag(${TMP} ${supported})
if(${${supported}})
set(${var} "${${var}} ${flag}" PARENT_SCOPE)
endif()
@@ -106,6 +121,66 @@ function (add_definition_if_library_exists library function header var)
endif()
endfunction()
# Function to forbid undefined symbols and also verify
# 1) Test project with all types of libraries and without undefined symbols can compile successfully
# 2) Test project with all types of libraries and undefined symbols can not compile successfully
function(forbid_undefined_symbols)
unset(TMP)
# https://www.unix.com/man-page/linux/1/ld, --no-undefined, Report unresolved symbol references from regular object files.
add_linker_flag_if_supported(-Wl,--no-undefined TMP)
# https://www.unix.com/man-page/osx/1/ld/, -undefined, Specifies how undefined symbols are to be treated.
add_linker_flag_if_supported(-Wl,-undefined,error TMP)
string(APPEND CMAKE_SHARED_LINKER_FLAGS ${TMP})
string(APPEND CMAKE_MODULE_LINKER_FLAGS ${TMP})
set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} PARENT_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS} PARENT_SCOPE)
set(TEST_PROJECT "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_project")
foreach(EXPECT IN ITEMS TRUE FALSE)
file(REMOVE_RECURSE "${TEST_PROJECT}")
file(MAKE_DIRECTORY "${TEST_PROJECT}")
file(WRITE "${TEST_PROJECT}/CMakeLists.txt"
[=[
cmake_minimum_required(VERSION 3.1)
project(test)
option(EXPECT_SUCCESS "" ON)
file(WRITE "${CMAKE_SOURCE_DIR}/incorrect_source.cpp" "void undefined_symbol(); void symbol() { undefined_symbol(); }")
if (EXPECT_SUCCESS)
file(APPEND "${CMAKE_SOURCE_DIR}/incorrect_source.cpp" " void undefined_symbol() {}; ")
endif()
add_library(l0 SHARED incorrect_source.cpp)
add_library(l1 MODULE incorrect_source.cpp)
add_library(l2 STATIC incorrect_source.cpp)
add_library(l3 OBJECT incorrect_source.cpp)
]=]
)
try_compile(SUCCESS "${TEST_PROJECT}/build" "${TEST_PROJECT}" test
CMAKE_FLAGS
"-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}"
"-DCMAKE_MODULE_LINKER_FLAGS=${CMAKE_MODULE_LINKER_FLAGS}"
"-DEXPECT_SUCCESS=${EXPECT}"
)
if (NOT ${SUCCESS} STREQUAL ${EXPECT})
message(FATAL_ERROR "Undefined symbols test failure: expect(${EXPECT}), success(${SUCCESS})")
endif()
file(REMOVE_RECURSE "${TEST_PROJECT}")
endforeach()
endfunction()
if (NOT (CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*"))
forbid_undefined_symbols()
endif()
if (MINGW)
function(export_all_symbols)
unset(TMP)
add_linker_flag_if_supported(-Wl,--export-all-symbols TMP)
string(APPEND CMAKE_SHARED_LINKER_FLAGS ${TMP})
string(APPEND CMAKE_MODULE_LINKER_FLAGS ${TMP})
set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} PARENT_SCOPE)
set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS} PARENT_SCOPE)
endfunction()
export_all_symbols()
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
message(STATUS "Setting default build type: ${CMAKE_BUILD_TYPE}")
@@ -205,6 +280,7 @@ if(NOT MANUAL_SUBMODULES)
check_submodule(external/rapidjson)
check_submodule(external/trezor-common)
check_submodule(external/randomx)
check_submodule(external/supercop)
endif()
endif()
@@ -262,6 +338,12 @@ else()
endif()
option(BUILD_DEBUG_UTILITIES "Build debug utilities." DEFAULT_BUILD_DEBUG_UTILITIES)
if(OSSFUZZ)
message(STATUS "Using OSS-Fuzz fuzzing system")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOSSFUZZ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOSSFUZZ")
endif()
# Check whether we're on a 32-bit or 64-bit system
if(CMAKE_SIZEOF_VOID_P EQUAL "8")
set(DEFAULT_BUILD_64 ON)
@@ -300,7 +382,7 @@ endif()
# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
# set(BSDI TRUE)
include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external)
include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external external/supercop/include)
if(APPLE)
include_directories(SYSTEM /usr/include/malloc)
@@ -419,8 +501,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
endif ()
if (APPLE AND NOT IOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -fvisibility=default -std=c++11")
if (NOT OpenSSL_DIR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
if (NOT OPENSSL_ROOT_DIR)
EXECUTE_PROCESS(COMMAND brew --prefix openssl
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -437,6 +519,10 @@ if(STATIC AND NOT IOS)
endif()
endif()
if (WIN32)
list(APPEND OPENSSL_LIBRARIES ws2_32 crypt32)
endif()
find_package(HIDAPI)
add_definition_if_library_exists(c memset_s "string.h" HAVE_MEMSET_S)
@@ -445,6 +531,9 @@ add_definition_if_function_found(strptime HAVE_STRPTIME)
add_definitions(-DAUTO_INITIALIZE_EASYLOGGINGPP)
set(MONERO_GENERATED_HEADERS_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated_include")
include_directories(${MONERO_GENERATED_HEADERS_DIR})
# Generate header for embedded translations
# Generate header for embedded translations, use target toolchain if depends, otherwise use the
# lrelease and lupdate binaries from the host
@@ -486,6 +575,17 @@ endif()
# Trezor support check
include(CheckTrezor)
# As of OpenBSD 6.8, -march=<anything> breaks the build
function(set_default_arch)
if (OPENBSD)
set(ARCH default)
else()
set(ARCH native)
endif()
set(ARCH ${ARCH} CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all")
endfunction()
if(MSVC)
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline")
@@ -499,7 +599,7 @@ if(MSVC)
else()
include(TestCXXAcceptsFlag)
if (NOT ARCH)
set(ARCH native CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all")
set_default_arch()
endif()
message(STATUS "Building on ${CMAKE_SYSTEM_PROCESSOR} for ${ARCH}")
if(ARCH STREQUAL "default")
@@ -562,7 +662,7 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAG}")
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized")
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(ARM)
set(WARNINGS "${WARNINGS} -Wno-error=inline-asm")
endif()
@@ -583,14 +683,14 @@ else()
endif()
set(C_WARNINGS "-Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes")
set(CXX_WARNINGS "-Wno-reorder -Wno-missing-field-initializers")
try_compile(STATIC_ASSERT_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test-static-assert.c" COMPILE_DEFINITIONS "-std=c11")
try_compile(STATIC_ASSERT_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test-static-assert.c" CMAKE_FLAGS -DCMAKE_C_STANDARD=11)
if(STATIC_ASSERT_RES)
set(STATIC_ASSERT_FLAG "")
else()
set(STATIC_ASSERT_FLAG "-Dstatic_assert=_Static_assert")
endif()
try_compile(STATIC_ASSERT_CPP_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test-static-assert.cpp" COMPILE_DEFINITIONS "-std=c++11")
try_compile(STATIC_ASSERT_CPP_RES "${CMAKE_CURRENT_BINARY_DIR}/static-assert" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/test-static-assert.cpp" CMAKE_FLAGS -DCMAKE_CXX_STANDARD=11)
if(STATIC_ASSERT_CPP_RES)
set(STATIC_ASSERT_CPP_FLAG "")
else()
@@ -646,7 +746,8 @@ else()
endif()
# linker
if (NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)))
if (NOT SANITIZE AND NOT OSSFUZZ AND NOT (WIN32 AND (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)))
# PIE executables randomly crash at startup with ASAN
# Windows binaries die on startup with PIE when compiled with GCC <9.x
add_linker_flag_if_supported(-pie LD_SECURITY_FLAGS)
endif()
@@ -678,8 +779,8 @@ else()
message(STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}")
message(STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${COVERAGE_FLAGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${COVERAGE_FLAGS} ${PIC_FLAG} ${C_SECURITY_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_CPP_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${COVERAGE_FLAGS} ${PIC_FLAG} ${CXX_SECURITY_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LD_SECURITY_FLAGS} ${LD_BACKCOMPAT_FLAGS}")
# With GCC 6.1.1 the compiled binary malfunctions due to aliasing. Until that
@@ -768,7 +869,8 @@ else()
endif(ARM)
if(ANDROID AND NOT BUILD_GUI_DEPS STREQUAL "ON" OR IOS)
# random crash on startup when asan is on if pie is enabled
if(NOT SANITIZE AND ANDROID AND NOT BUILD_GUI_DEPS STREQUAL "ON" OR IOS)
#From Android 5: "only position independent executables (PIE) are supported"
message(STATUS "Enabling PIE executable")
set(PIC_FLAG "")
@@ -796,7 +898,7 @@ else()
endif()
set(USE_LTO ${USE_LTO_DEFAULT} CACHE BOOL "Use Link-Time Optimization (Release mode only)")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled, so explicitly disable
set(USE_LTO false)
endif()
@@ -903,10 +1005,12 @@ list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
if (HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED)
if (APPLE)
if(DEPENDS)
list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework IOKit")
list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework AppKit -framework IOKit")
else()
find_library(COREFOUNDATION CoreFoundation)
find_library(APPKIT AppKit)
find_library(IOKIT IOKit)
list(APPEND EXTRA_LIBRARIES ${APPKIT})
list(APPEND EXTRA_LIBRARIES ${IOKIT})
list(APPEND EXTRA_LIBRARIES ${COREFOUNDATION})
endif()
@@ -941,7 +1045,7 @@ if(ANDROID)
set(ATOMIC libatomic.a)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=user-defined-warnings")
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND ARCH_WIDTH EQUAL "32" AND NOT IOS AND NOT FREEBSD)
if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND ARCH_WIDTH EQUAL "32" AND NOT IOS AND NOT FREEBSD)
find_library(ATOMIC atomic)
if (ATOMIC_FOUND)
list(APPEND EXTRA_LIBRARIES ${ATOMIC})
@@ -952,6 +1056,7 @@ find_path(ZMQ_INCLUDE_PATH zmq.h)
find_library(ZMQ_LIB zmq)
find_library(PGM_LIBRARY pgm)
find_library(NORM_LIBRARY norm)
find_library(GSSAPI_LIBRARY gssapi_krb5)
find_library(PROTOLIB_LIBRARY protolib)
find_library(SODIUM_LIBRARY sodium)
@@ -967,6 +1072,9 @@ endif()
if(NORM_LIBRARY)
set(ZMQ_LIB "${ZMQ_LIB};${NORM_LIBRARY}")
endif()
if(GSSAPI_LIBRARY)
set(ZMQ_LIB "${ZMQ_LIB};${GSSAPI_LIBRARY}")
endif()
if(PROTOLIB_LIBRARY)
set(ZMQ_LIB "${ZMQ_LIB};${PROTOLIB_LIBRARY}")
endif()
@@ -974,6 +1082,7 @@ if(SODIUM_LIBRARY)
set(ZMQ_LIB "${ZMQ_LIB};${SODIUM_LIBRARY}")
endif()
include(external/supercop/functions.cmake) # place after setting flags and before src directory inclusion
add_subdirectory(contrib)
add_subdirectory(src)
@@ -1021,8 +1130,6 @@ option(BUILD_GUI_DEPS "Build GUI dependencies." OFF)
option(INSTALL_VENDORED_LIBUNBOUND "Install libunbound binary built from source vendored with this repo." OFF)
CHECK_C_COMPILER_FLAG(-std=c11 HAVE_C11)
find_package(PythonInterp)
find_program(iwyu_tool_path NAMES iwyu_tool.py iwyu_tool)
if (iwyu_tool_path AND PYTHONINTERP_FOUND)

View File

@@ -1,4 +1,4 @@
# Portions Copyright (c) 2017-2019, The Monero Project
# Portions Copyright (c) 2017-2020, The Monero Project
# This file is based off of the https://code.google.com/archive/p/ios-cmake/
# It has been altered for Monero iOS development
#

View File

@@ -46,7 +46,7 @@ ARG BOOST_VERSION=1_70_0
ARG BOOST_VERSION_DOT=1.70.0
ARG BOOST_HASH=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778
RUN set -ex \
&& curl -s -L -o boost_${BOOST_VERSION}.tar.bz2 https://dl.bintray.com/boostorg/release/${BOOST_VERSION_DOT}/source/boost_${BOOST_VERSION}.tar.bz2 \
&& curl -s -L -o boost_${BOOST_VERSION}.tar.bz2 https://downloads.sourceforge.net/project/boost/boost/${BOOST_VERSION_DOT}/boost_${BOOST_VERSION}.tar.bz2 \
&& echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c \
&& tar -xvf boost_${BOOST_VERSION}.tar.bz2 \
&& cd boost_${BOOST_VERSION} \

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014-2019, The Monero Project
Copyright (c) 2014-2020, The Monero Project
All rights reserved.

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#

111
README.md
View File

@@ -1,6 +1,6 @@
# Monero
Copyright (c) 2014-2019 The Monero Project.
Copyright (c) 2014-2020 The Monero Project.
Portions Copyright (c) 2012-2013 The Cryptonote developers.
## Table of Contents
@@ -22,6 +22,7 @@ Portions Copyright (c) 2012-2013 The Cryptonote developers.
- [Dependencies](#dependencies)
- [Internationalization](#Internationalization)
- [Using Tor](#using-tor)
- [Pruning](#Pruning)
- [Debugging](#Debugging)
- [Known issues](#known-issues)
@@ -72,11 +73,11 @@ Monero is a private, secure, untraceable, decentralised digital currency. You ar
**Privacy:** Monero uses a cryptographically sound system to allow you to send and receive funds without your transactions being easily revealed on the blockchain (the ledger of transactions that everyone has). This ensures that your purchases, receipts, and all transfers remain absolutely private by default.
**Security:** Using the power of a distributed peer-to-peer consensus network, every transaction on the network is cryptographically secured. Individual wallets have a 25 word mnemonic seed that is only displayed once, and can be written down to backup the wallet. Wallet files are encrypted with a passphrase to ensure they are useless if stolen.
**Security:** Using the power of a distributed peer-to-peer consensus network, every transaction on the network is cryptographically secured. Individual wallets have a 25-word mnemonic seed that is only displayed once and can be written down to backup the wallet. Wallet files are encrypted with a passphrase to ensure they are useless if stolen.
**Untraceability:** By taking advantage of ring signatures, a special property of a certain type of cryptography, Monero is able to ensure that transactions are not only untraceable, but have an optional measure of ambiguity that ensures that transactions cannot easily be tied back to an individual user or computer.
**Untraceability:** By taking advantage of ring signatures, a special property of a certain type of cryptography, Monero is able to ensure that transactions are not only untraceable but have an optional measure of ambiguity that ensures that transactions cannot easily be tied back to an individual user or computer.
**Decentralization:** The utility of monero depends on its decentralised peer-to-peer consensus network - anyone should be able to run the monero software, validate the integrity of the blockchain, and participate in all aspects of the monero network using consumer-grade commodity hardware. Decentralization of the monero network is maintained by software development that minimizes the costs of running the monero software and inhibits the proliferation of specialized, non-commodity hardware.
**Decentralization:** The utility of Monero depends on its decentralised peer-to-peer consensus network - anyone should be able to run the monero software, validate the integrity of the blockchain, and participate in all aspects of the monero network using consumer-grade commodity hardware. Decentralization of the monero network is maintained by software development that minimizes the costs of running the monero software and inhibits the proliferation of specialized, non-commodity hardware.
## About this project
@@ -84,13 +85,13 @@ This is the core implementation of Monero. It is open source and completely free
As with many development projects, the repository on Github is considered to be the "staging" area for the latest changes. Before changes are merged into that branch on the main repository, they are tested by individual developers in their own branches, submitted as a pull request, and then subsequently tested by contributors who focus on testing and code reviews. That having been said, the repository should be carefully considered before using it in a production environment, unless there is a patch in the repository for a particular show-stopping issue you are experiencing. It is generally a better idea to use a tagged release for stability.
**Anyone is welcome to contribute to Monero's codebase!** If you have a fix or code change, feel free to submit it as a pull request directly to the "master" branch. In cases where the change is relatively small or does not affect other parts of the codebase it may be merged in immediately by any one of the collaborators. On the other hand, if the change is particularly large or complex, it is expected that it will be discussed at length either well in advance of the pull request being submitted, or even directly on the pull request.
**Anyone is welcome to contribute to Monero's codebase!** If you have a fix or code change, feel free to submit it as a pull request directly to the "master" branch. In cases where the change is relatively small or does not affect other parts of the codebase, it may be merged in immediately by any one of the collaborators. On the other hand, if the change is particularly large or complex, it is expected that it will be discussed at length either well in advance of the pull request being submitted, or even directly on the pull request.
## Supporting the project
Monero is a 100% community-sponsored endeavor. If you want to join our efforts, the easiest thing you can do is support the project financially. Both Monero and Bitcoin donations can be made to **donate.getmonero.org** if using a client that supports the [OpenAlias](https://openalias.org) standard. Alternatively you can send XMR to the Monero donation address via the `donate` command (type `help` in the command-line wallet for details).
Monero is a 100% community-sponsored endeavor. If you want to join our efforts, the easiest thing you can do is support the project financially. Both Monero and Bitcoin donations can be made to **donate.getmonero.org** if using a client that supports the [OpenAlias](https://openalias.org) standard. Alternatively, you can send XMR to the Monero donation address via the `donate` command (type `help` in the command-line wallet for details).
The Monero donation address is: `44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A` (viewkey: `f359631075708155cc3d92a32b75a7d02a5dcf27756707b47a2b31b21c389501`)
The Monero donation address is: `888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H` (viewkey: `f359631075708155cc3d92a32b75a7d02a5dcf27756707b47a2b31b21c389501`)
The Bitcoin donation address is: `1KTexdemPdxSBcG55heUuTjDRYqbC5ZL8H`
@@ -132,7 +133,9 @@ Dates are provided in the format YYYY-MM-DD.
| 1686275 | 2018-10-19 | v9 | v0.13.0.0 | v0.13.0.4 | bulletproofs required
| 1788000 | 2019-03-09 | v10 | v0.14.0.0 | v0.14.1.2 | New PoW based on Cryptonight-R, new block weight algorithm, slightly more efficient RingCT format
| 1788720 | 2019-03-10 | v11 | v0.14.0.0 | v0.14.1.2 | forbid old RingCT transaction format
| 1978433 | 2019-11-30* | v12 | v0.15.0.0 | v0.15.0.0 | New PoW based on RandomX, only allow >= 2 outputs, change to the block median used to calculate penalty, v1 coinbases are forbidden, rct sigs in coinbase forbidden, 10 block lock time for incoming outputs
| 1978433 | 2019-11-30 | v12 | v0.15.0.0 | v0.16.0.0 | New PoW based on RandomX, only allow >= 2 outputs, change to the block median used to calculate penalty, v1 coinbases are forbidden, rct sigs in coinbase forbidden, 10 block lock time for incoming outputs
| 2210000 | 2020-10-17 | v13 | v0.17.0.0 | v0.17.3.0 | New CLSAG transaction format
| 2210720 | 2020-10-18 | v14 | v0.17.1.1 | v0.17.3.0 | forbid old MLSAG transaction format
| XXXXXXX | XXX-XX-XX | XXX | vX.XX.X.X | vX.XX.X.X | XXX |
X's indicate that these details have not been determined as of commit date.
@@ -149,7 +152,7 @@ Approximately three months prior to a scheduled software upgrade, a branch from
The following table summarizes the tools and libraries required to build. A
few of the libraries are also included in this repository (marked as
"Vendored"). By default, the build uses the library installed on the system,
"Vendored"). By default, the build uses the library installed on the system
and ignores the vendored sources. However, if no library is found installed on
the system, then the vendored source will be built and used. The vendored
sources are also used for statically-linked builds because distribution
@@ -158,7 +161,7 @@ library archives (`.a`).
| Dep | Min. version | Vendored | Debian/Ubuntu pkg | Arch pkg | Void pkg | Fedora pkg | Optional | Purpose |
| ------------ | ------------- | -------- | -------------------- | ------------ | ------------------ | ------------------- | -------- | --------------- |
| GCC | 4.7.3 | NO | `build-essential` | `base-devel` | `base-devel` | `gcc` | NO | |
| GCC | 5 | NO | `build-essential` | `base-devel` | `base-devel` | `gcc` | NO | |
| CMake | 3.5 | NO | `cmake` | `cmake` | `cmake` | `cmake` | NO | |
| pkg-config | any | NO | `pkg-config` | `base-devel` | `base-devel` | `pkgconf` | NO | |
| Boost | 1.58 | NO | `libboost-all-dev` | `boost` | `boost-devel` | `boost-devel` | NO | C++ libraries |
@@ -178,10 +181,10 @@ library archives (`.a`).
| Graphviz | any | NO | `graphviz` | `graphviz` | `graphviz` | `graphviz` | YES | Documentation |
| lrelease | ? | NO | `qttools5-dev-tools` | `qt5-tools` | `qt5-tools` | `qt5-linguist` | YES | Translations |
| libhidapi | ? | NO | `libhidapi-dev` | `hidapi` | `hidapi-devel` | `hidapi-devel` | YES | Hardware wallet |
| libusb | ? | NO | `libusb-dev` | `libusb` | `libusb-devel` | `libusb-devel` | YES | Hardware wallet |
| libusb | ? | NO | `libusb-1.0-0-dev` | `libusb` | `libusb-devel` | `libusbx-devel` | YES | Hardware wallet |
| libprotobuf | ? | NO | `libprotobuf-dev` | `protobuf` | `protobuf-devel` | `protobuf-devel` | YES | Hardware wallet |
| protoc | ? | NO | `protobuf-compiler` | `protobuf` | `protobuf` | `protobuf-compiler` | YES | Hardware wallet |
| libudev | ? | No | `libudev-dev` | `systemd` | `eudev-libudev-devel` | `systemd-devel` | YES | Hardware wallet |
[1] On Debian/Ubuntu `libgtest-dev` only includes sources and headers. You must
build the library binary manually. This can be done with the following command ```sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libg* /usr/lib/ ```
@@ -189,13 +192,13 @@ build the library binary manually. This can be done with the following command `
Install all dependencies at once on Debian/Ubuntu:
``` sudo apt update && sudo apt install build-essential cmake pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpgm-dev qttools5-dev-tools libhidapi-dev libusb-dev libprotobuf-dev protobuf-compiler ```
``` sudo apt update && sudo apt install build-essential cmake pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev```
Install all dependencies at once on macOS with the provided Brewfile:
``` brew update && brew bundle --file=contrib/brew/Brewfile ```
FreeBSD one liner for required to build dependencies
```pkg install git gmake cmake pkgconf boost-libs libzmq libsodium```
FreeBSD 12.1 one-liner required to build dependencies:
```pkg install git gmake cmake pkgconf boost-libs libzmq4 libsodium```
### Cloning the repository
@@ -219,7 +222,7 @@ invokes cmake commands as needed.
```bash
cd monero
git checkout release-v0.15
git checkout release-v0.17
make
```
@@ -287,12 +290,12 @@ Tested on a Raspberry Pi Zero with a clean install of minimal Raspbian Stretch (
* If using an external hard disk without an external power supply, ensure it gets enough power to avoid hardware issues when syncing, by adding the line "max_usb_current=1" to /boot/config.txt
* Clone monero and checkout the most recent release version:
* Clone Monero and checkout the most recent release version:
```bash
git clone https://github.com/monero-project/monero.git
cd monero
git checkout tags/v0.15.0.0
git checkout tags/v0.17.3.0
```
* Build:
@@ -313,7 +316,7 @@ Tested on a Raspberry Pi Zero with a clean install of minimal Raspbian Stretch (
#### *Note for Raspbian Jessie users:*
If you are using the older Raspbian Jessie image, compiling Monero is a bit more complicated. The version of Boost available in the Debian Jessie repositories is too old to use with Monero, and thus you must compile a newer version yourself. The following explains the extra steps, and has been tested on a Raspberry Pi 2 with a clean install of minimal Raspbian Jessie.
If you are using the older Raspbian Jessie image, compiling Monero is a bit more complicated. The version of Boost available in the Debian Jessie repositories is too old to use with Monero, and thus you must compile a newer version yourself. The following explains the extra steps and has been tested on a Raspberry Pi 2 with a clean install of minimal Raspbian Jessie.
* As before, `apt-get update && apt-get upgrade` to install all of the latest software, and increase the system swap size
@@ -325,7 +328,7 @@ If you are using the older Raspbian Jessie image, compiling Monero is a bit more
```
* Then, install the dependencies for Monero except `libunwind` and `libboost-all-dev`
* Then, install the dependencies for Monero except for `libunwind` and `libboost-all-dev`
* Install the latest version of boost (this may first require invoking `apt-get remove --purge libboost*-dev` to remove a previous version if you're not using a clean install):
@@ -346,7 +349,7 @@ If you are using the older Raspbian Jessie image, compiling Monero is a bit more
* Wait ~4 hours
* From here, follow the [general Raspberry Pi instructions](#on-the-raspberry-pi) from the "Clone monero and checkout most recent release version" step.
* From here, follow the [general Raspberry Pi instructions](#on-the-raspberry-pi) from the "Clone Monero and checkout most recent release version" step.
#### On Windows:
@@ -409,10 +412,10 @@ application.
cd monero
```
* If you would like a specific [version/tag](https://github.com/monero-project/monero/tags), do a git checkout for that version. eg. 'v0.15.0.0'. If you don't care about the version and just want binaries from master, skip this step:
* If you would like a specific [version/tag](https://github.com/monero-project/monero/tags), do a git checkout for that version. eg. 'v0.17.3.0'. If you don't care about the version and just want binaries from master, skip this step:
```bash
git checkout v0.15.0.0
git checkout v0.17.3.0
```
* If you are on a 64-bit system, run:
@@ -446,7 +449,7 @@ application.
### On FreeBSD:
The project can be built from scratch by following instructions for Linux above(but use `gmake` instead of `make`).
If you are running monero in a jail, you need to add `sysvsem="new"` to your jail configuration, otherwise lmdb will throw the error message: `Failed to open lmdb environment: Function not implemented`.
If you are running Monero in a jail, you need to add `sysvsem="new"` to your jail configuration, otherwise lmdb will throw the error message: `Failed to open lmdb environment: Function not implemented`.
Monero is also available as a port or package as 'monero-cli`.
@@ -459,7 +462,7 @@ Running the test suite also requires `py-requests` package.
Build monero: `env DEVELOPER_LOCAL_TOOLS=1 BOOST_ROOT=/usr/local gmake release-static`
Note: you may encounter the following error, when compiling the latest version of monero as a normal user:
Note: you may encounter the following error when compiling the latest version of Monero as a normal user:
```
LLVM ERROR: out of memory
@@ -468,6 +471,14 @@ c++: error: unable to execute command: Abort trap (core dumped)
Then you need to increase the data ulimit size to 2GB and try again: `ulimit -d 2000000`
### On NetBSD:
Check that the dependencies are present: `pkg_info -c libexecinfo boost-headers boost-libs protobuf readline libusb1 zeromq git-base pkgconf gmake cmake | more`, and install any that are reported missing, using `pkg_add` or from your pkgsrc tree. Readline is optional but worth having.
Third-party dependencies are usually under `/usr/pkg/`, but if you have a custom setup, adjust the "/usr/pkg" (below) accordingly.
Clone the monero repository recursively and checkout the most recent release as described above. Then build monero: `gmake BOOST_ROOT=/usr/pkg LDFLAGS="-Wl,-R/usr/pkg/lib" release`. The resulting executables can be found in `build/NetBSD/[Release version]/Release/bin/`.
### On Solaris:
The default Solaris linker can't be used, you have to install GNU ld, then run cmake manually with the path to your copy of GNU ld:
@@ -543,6 +554,10 @@ The produced binaries still link libc dynamically. If the binary is compiled on
Packages are available for
* Debian Buster
See the [instructions in the whonix/monero-gui repository](https://gitlab.com/whonix/monero-gui#how-to-install-monero-using-apt-get)
* Debian Bullseye and Sid
```bash
@@ -550,9 +565,8 @@ Packages are available for
```
More info and versions in the [Debian package tracker](https://tracker.debian.org/pkg/monero).
* Arch Linux (via [AUR](https://aur.archlinux.org/)):
- Stable release: [`monero`](https://aur.archlinux.org/packages/monero)
- Bleeding edge: [`monero-git`](https://aur.archlinux.org/packages/monero-git)
* Arch Linux (via Community packages):
[`monero`](https://www.archlinux.org/packages/community/x86_64/monero/)
* Void Linux:
@@ -566,18 +580,33 @@ More info and versions in the [Debian package tracker](https://tracker.debian.or
guix package -i monero
```
* Gentoo [Monero overlay](https://github.com/gentoo-monero/gentoo-monero)
```bash
emerge --noreplace eselect-repository
eselect repository enable monero
emaint sync -r monero
echo '*/*::monero ~amd64' >> /etc/portage/package.accept_keywords
emerge net-p2p/monero
```
* macOS (homebrew)
```bash
brew install monero
```
* Docker
```bash
# Build using all available cores
docker build -t monero .
# or build using a specific number of cores (reduce RAM requirement)
docker build --build-arg NPROC=1 -t monero .
# either run in foreground
docker run -it -v /monero/chain:/root/.bitmonero -v /monero/wallet:/wallet -p 18080:18080 monero
# or in background
docker run -it -d -v /monero/chain:/root/.bitmonero -v /monero/wallet:/wallet -p 18080:18080 monero
```
@@ -590,7 +619,7 @@ Packaging for your favorite distribution would be a welcome contribution!
## Running monerod
The build places the binary in `bin/` sub-directory within the build directory
from which cmake was invoked (repository root by default). To run in
from which cmake was invoked (repository root by default). To run in the
foreground:
```bash
@@ -601,7 +630,7 @@ To list all available options, run `./bin/monerod --help`. Options can be
specified either on the command line or in a configuration file passed by the
`--config-file` argument. To specify an option in the configuration file, add
a line with the syntax `argumentname=value`, where `argumentname` is the name
of the argument without the leading dashes, for example `log-level=1`.
of the argument without the leading dashes, for example, `log-level=1`.
To run in background:
@@ -626,7 +655,7 @@ See [README.i18n.md](README.i18n.md).
## Using Tor
> There is a new, still experimental, [integration with Tor](ANONYMITY_NETWORKS.md). The
> feature allows connecting over IPv4 and Tor simulatenously - IPv4 is used for
> feature allows connecting over IPv4 and Tor simultaneously - IPv4 is used for
> relaying blocks and relaying transactions received by peers whereas Tor is
> used solely for relaying transactions received over local RPC. This provides
> privacy and better protection against surrounding node (sybil) attacks.
@@ -671,6 +700,16 @@ DNS_PUBLIC=tcp torsocks ./monerod --p2p-bind-ip 127.0.0.1 --no-igd --rpc-bind-ip
--data-dir /home/amnesia/Persistent/your/directory/to/the/blockchain
```
## Pruning
As of May 2020, the full Monero blockchain file is about 80 GB. One can store a pruned blockchain, which is about 28 GB.
A pruned blockchain can only serve part of the historical chain data to other peers, but is otherwise identical in
functionality to the full blockchain.
To use a pruned blockchain, it is best to start the initial sync with --prune-blockchain. However, it is also possible
to prune an existing blockchain using the monero-blockchain-prune tool or using the --prune-blockchain monerod option
with an existing chain. If an existing chain exists, pruning will temporarily require disk space to store both the full
and pruned blockchains.
## Debugging
This section contains general instructions for debugging failed installs or problems encountered with Monero. First, ensure you are running the latest version built from the Github repo.
@@ -715,7 +754,7 @@ Print the stack trace with `bt`
coredumpctl -1 gdb
```
#### To run monero within gdb:
#### To run Monero within gdb:
Type `gdb /path/to/monerod`

63
ZMQ.md Normal file
View File

@@ -0,0 +1,63 @@
# The Current/Future Status of ZMQ in Monero
## ZMQ Pub/Sub
Client `ZMQ_SUB` sockets must "subscribe" to topics before it receives any data.
This allows filtering on the server side, so network traffic is reduced. Monero
allows for filtering on: (1) format, (2) context, and (3) event.
* **format** refers to the _wire_ format (i.e. JSON) used to send event
information.
* **context** allows for a reduction in fields for the event, so the
daemon doesn't waste cycles serializing fields that get ignored.
* **event** refers to status changes occurring within the daemon (i.e. new
block to main chain).
* Formats:
* `json`
* Contexts:
* `full` - the entire block or transaction is transmitted (the hash can be
computed remotely).
* `minimal` - the bare minimum for a remote client to react to an event is
sent.
* Events:
* `chain_main` - changes to the primary/main blockchain.
* `txpool_add` - new _publicly visible_ transactions in the mempool.
Includes previously unseen transactions in a block but _not_ the
`miner_tx`. Does not "re-publish" after a reorg. Includes `do_not_relay`
transactions.
* `miner_data` - provides the necessary data to create a custom block template
Available only in the `full` context.
The subscription topics are formatted as `format-context-event`, with prefix
matching supported by both Monero and ZMQ. The `format`, `context` and `event`
will _never_ have hyphens or colons in their name. For example, subscribing to
`json-minimal-chain_main` will send minimal information in JSON when changes
to the main/primary blockchain occur. Whereas, subscribing to `json-minimal`
will send minimal information in JSON on all available events supported by the
daemon.
The Monero daemon will ensure that events prefixed by `chain` will be sent in
"chain-order" - the `prev_id` (hash) field will _always_ refer to a previous
block. On rollbacks/reorgs, the event will reference an earlier block in the
chain instead of the last block. The Monero daemon also ensures that
`txpool_add` events are sent before `chain_*` events - the `chain_*` messages
will only serialize miner transactions since the other transactions were
previously published via `txpool_add`. This prevents transactions from being
serialized twice, even when the transaction was first observed in a block.
ZMQ Pub/Sub will drop messages if the network is congested, so the above rules
for send order are used for detecting lost messages. A missing gap in `height`
or `prev_id` for `chain_*` events indicates a lost pub message. Missing
`txpool_add` messages can only be detected at the next `chain_` message.
Since blockchain events can be dropped, clients will likely want to have a
timeout against `chain_main` events. The `GetLastBlockHeader` RPC is useful
for checking the current chain state. Dropped messages should be rare in most
conditions.
The Monero daemon will send a `txpool_add` pub exactly once for each
transaction, even after a reorg or restarts. Clients should use the
`GetTransactionPool` after a reorg to get all transactions that have been put
back into the tx pool or been invalidated due to a double-spend.

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#

View File

@@ -91,7 +91,7 @@ endif()
# Protobuf compilation test
if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON)
execute_process(COMMAND ${Protobuf_PROTOC_EXECUTABLE} -I "${CMAKE_SOURCE_DIR}/cmake" -I "${Protobuf_INCLUDE_DIR}" "${CMAKE_SOURCE_DIR}/cmake/test-protobuf.proto" --cpp_out ${CMAKE_BINARY_DIR} RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE ERR)
execute_process(COMMAND ${Protobuf_PROTOC_EXECUTABLE} -I "${CMAKE_CURRENT_LIST_DIR}" -I "${Protobuf_INCLUDE_DIR}" "${CMAKE_CURRENT_LIST_DIR}/test-protobuf.proto" --cpp_out ${CMAKE_BINARY_DIR} RESULT_VARIABLE RET OUTPUT_VARIABLE OUT ERROR_VARIABLE ERR)
if(RET)
message(STATUS "Protobuf test generation failed: ${OUT} ${ERR}")
endif()
@@ -100,7 +100,7 @@ if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON)
"${CMAKE_BINARY_DIR}"
SOURCES
"${CMAKE_BINARY_DIR}/test-protobuf.pb.cc"
"${CMAKE_SOURCE_DIR}/cmake/test-protobuf.cpp"
"${CMAKE_CURRENT_LIST_DIR}/test-protobuf.cpp"
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES=${Protobuf_INCLUDE_DIR};${CMAKE_BINARY_DIR}"
"-DCMAKE_CXX_STANDARD=11"

View File

@@ -41,17 +41,27 @@
find_program(CCACHE_FOUND ccache)
if (CCACHE_FOUND)
set(TEMP_CPP_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test-program.cpp")
file(WRITE "${TEMP_CPP_FILE}" "int main() { return 0; }")
execute_process(COMMAND "${CCACHE_FOUND}" "${CMAKE_CXX_COMPILER}" "${TEMP_CPP_FILE}" RESULT_VARIABLE RET)
if (${RET} EQUAL 0)
message("found usable ccache: ${CCACHE_FOUND}")
# Try to compile a test program with ccache, in order to verify if it really works. (needed on exotic setups)
set(TEST_PROJECT "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/CMakeTmp")
file(WRITE "${TEST_PROJECT}/CMakeLists.txt" [=[
cmake_minimum_required(VERSION 3.5)
project(test)
option (CCACHE "")
file(WRITE "${CMAKE_SOURCE_DIR}/test.cpp" "int main() { return 0; }")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE}")
add_executable(main test.cpp)
]=])
try_compile(RET "${TEST_PROJECT}/build" "${TEST_PROJECT}" "test" CMAKE_FLAGS -DCCACHE="${CCACHE_FOUND}")
unset(TEST_PROJECT)
if (${RET})
# Success
message(STATUS "Found usable ccache: ${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_FOUND}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_FOUND}")
else()
message("found ccache ${CCACHE_FOUND}, but is UNUSABLE! Return code: ${RET}")
endif()
message(STATUS "Found ccache ${CCACHE_FOUND}, but is UNUSABLE! Return code: ${RET}")
endif()
else()
message("ccache NOT found!")
message(STATUS "ccache NOT found! Please install it for faster rebuilds.")
endif()

View File

@@ -134,7 +134,7 @@ if ( LibUSB_FOUND )
try_compile(LibUSB_COMPILE_TEST_PASSED
${CMAKE_BINARY_DIR}
"${CMAKE_SOURCE_DIR}/cmake/test-libusb-version.c"
"${CMAKE_CURRENT_LIST_DIR}/test-libusb-version.c"
CMAKE_FLAGS
"-DINCLUDE_DIRECTORIES=${LibUSB_INCLUDE_DIRS}"
"-DLINK_DIRECTORIES=${LibUSB_LIBRARIES}"

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#
@@ -32,7 +32,7 @@
function (get_version_tag_from_git GIT)
execute_process(COMMAND "${GIT}" rev-parse --short=9 HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE RET
OUTPUT_VARIABLE COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -48,29 +48,21 @@ function (get_version_tag_from_git GIT)
message(STATUS "You are currently on commit ${COMMIT}")
# Get all the tags
execute_process(COMMAND "${GIT}" rev-list --tags --max-count=1 --abbrev-commit
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
execute_process(COMMAND "${GIT}" tag -l --points-at HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE RET
OUTPUT_VARIABLE TAGGEDCOMMIT
OUTPUT_VARIABLE TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT TAGGEDCOMMIT)
message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.")
# Check if we're building that tagged commit or a different one
if(TAG)
message(STATUS "You are building a tagged release")
set(VERSIONTAG "release")
set(VERSION_IS_RELEASE "true")
else()
message(STATUS "You are ahead of or behind a tagged release")
set(VERSIONTAG "${COMMIT}")
set(VERSION_IS_RELEASE "false")
else()
message(STATUS "The most recent tag was at ${TAGGEDCOMMIT}")
# Check if we're building that tagged commit or a different one
if(COMMIT STREQUAL TAGGEDCOMMIT)
message(STATUS "You are building a tagged release")
set(VERSIONTAG "release")
set(VERSION_IS_RELEASE "true")
else()
message(STATUS "You are ahead of or behind a tagged release")
set(VERSIONTAG "${COMMIT}")
set(VERSION_IS_RELEASE "false")
endif()
endif()
endif()

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#
@@ -28,7 +28,7 @@
function (write_version tag)
set(VERSIONTAG "${tag}" CACHE STRING "The tag portion of the Monero software version" FORCE)
configure_file("${CMAKE_SOURCE_DIR}/src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp")
configure_file("${CMAKE_CURRENT_LIST_DIR}/../src/version.cpp.in" "${CMAKE_BINARY_DIR}/version.cpp")
endfunction ()
find_package(Git QUIET)

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#

View File

@@ -1,18 +0,0 @@
version: '1.0'
steps:
init_submodules:
title: Init Submodules
commands:
- git submodule update --init --recursive
image: codefreshio/git-image:latest
working_directory: ${{main_clone}}
BuildingDockerImage:
title: Building Docker Image
type: build
image_name: monero
working_directory: ./
tag: '${{CF_BRANCH_TAG_NORMALIZED}}'
dockerfile: Dockerfile
build_arguments:
- NPROC=1

View File

@@ -3,7 +3,7 @@
SOURCES_PATH ?= $(BASEDIR)/sources
BASE_CACHE ?= $(BASEDIR)/built
SDK_PATH ?= $(BASEDIR)/SDKs
FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources
FALLBACK_DOWNLOAD_PATH ?= https://downloads.getmonero.org/depends-sources
BUILD = $(shell ./config.guess)
HOST ?= $(BUILD)

View File

@@ -32,7 +32,7 @@ endef
define fetch_file
( test -f $$($(1)_source_dir)/$(4) || \
( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \
$(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5))))
$(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(4),$(4),$(5))))
endef
define int_get_build_recipe_hash
@@ -133,6 +133,11 @@ $(1)_config_env+=$($(1)_config_env_$(host_arch)) $($(1)_config_env_$(host_arch)_
$(1)_config_env+=$($(1)_config_env_$(host_os)) $($(1)_config_env_$(host_os)_$(release_type))
$(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$(host_arch)_$(host_os)_$(release_type))
$(1)_build_env+=$$($(1)_build_env_$(release_type))
$(1)_build_env+=$($(1)_build_env_$(host_arch)) $($(1)_build_env_$(host_arch)_$(release_type))
$(1)_build_env+=$($(1)_build_env_$(host_os)) $($(1)_build_env_$(host_os)_$(release_type))
$(1)_build_env+=$($(1)_build_env_$(host_arch)_$(host_os)) $($(1)_build_env_$(host_arch)_$(host_os)_$(release_type))
$(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig
$(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig
$(1)_config_env+=PATH="$(build_prefix)/bin:$(PATH)"

View File

@@ -1,6 +1,6 @@
package=boost
$(package)_version=1_64_0
$(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/
$(package)_download_path=https://downloads.sourceforge.net/project/boost/boost/1.64.0/
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332
$(package)_dependencies=libiconv

View File

@@ -1,7 +1,8 @@
package=eudev
$(package)_version=v3.2.6
$(package)_download_path=https://github.com/gentoo/eudev/archive/
$(package)_file_name=$($(package)_version).tar.gz
$(package)_download_file=$($(package)_version).tar.gz
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=a96ecb8637667897b8bd4dee4c22c7c5f08b327be45186e912ce6bc768385852
define $(package)_set_vars

View File

@@ -1,6 +1,6 @@
package=expat
$(package)_version=2.2.4
$(package)_download_path=https://downloads.sourceforge.net/project/expat/expat/$($(package)_version)
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_4
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=03ad85db965f8ab2d27328abcf0bc5571af6ec0a414874b2066ee3fdd372019e

View File

@@ -1,7 +1,8 @@
package=gtest
$(package)_version=1.8.1
$(package)_download_path=https://github.com/google/googletest/archive/
$(package)_file_name=release-$($(package)_version).tar.gz
$(package)_download_file=release-$($(package)_version).tar.gz
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c
$(package)_cxxflags=-std=c++11
$(package)_cxxflags_linux=-fPIC

View File

@@ -1,9 +1,10 @@
package=hidapi
$(package)_version=0.9.0
$(package)_version=0.11.0
$(package)_download_path=https://github.com/libusb/hidapi/archive
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=630ee1834bdd5c5761ab079fd04f463a89585df8fcae51a7bfe4229b1e02a652
$(package)_sha256_hash=391d8e52f2d6a5cf76e2b0c079cfefe25497ba1d4659131297081fc0cd744632
$(package)_linux_dependencies=libusb eudev
$(package)_patches=missing_win_include.patch
define $(package)_set_vars
$(package)_config_opts=--enable-static --disable-shared
@@ -16,6 +17,10 @@ $(package)_config_opts_linux+=libusb_CFLAGS=-I$(host_prefix)/include/libusb-1.0
$(package)_config_opts_linux+=--with-pic
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/missing_win_include.patch
endef
define $(package)_config_cmds
./bootstrap &&\
$($(package)_autoconf) $($(package)_config_opts) AR_FLAGS=$($(package)_arflags)

View File

@@ -1,7 +1,8 @@
package=native_cctools
$(package)_version=807d6fd1be5d2224872e381870c0a75387fe05e6
$(package)_download_path=https://github.com/theuni/cctools-port/archive
$(package)_file_name=$($(package)_version).tar.gz
$(package)_download_file=$($(package)_version).tar.gz
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a
$(package)_build_subdir=cctools
$(package)_clang_version=3.7.1

View File

@@ -1,9 +1,9 @@
package=native_ds_store
$(package)_version=1.1.0
$(package)_download_path=https://bitbucket.org/al45tair/ds_store/get
$(package)_download_file=v$($(package)_version).tar.bz2
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=921596764d71d1bbd3297a90ef6d286f718794d667e4f81d91d14053525d64c1
$(package)_download_path=https://github.com/al45tair/ds_store/archive/
$(package)_download_file=v$($(package)_version).tar.gz
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=a9f4c0755c6be7224ff7029e188dd262e830bb81e801424841db9eb0780ec8ed
$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
$(package)_dependencies=native_biplist

View File

@@ -1,9 +1,9 @@
package=native_mac_alias
$(package)_version=1.1.0
$(package)_download_path=https://bitbucket.org/al45tair/mac_alias/get
$(package)_download_file=v$($(package)_version).tar.bz2
$(package)_file_name=$(package)-$($(package)_version).tar.bz2
$(package)_sha256_hash=87ad827e66790028361e43fc754f68ed041a9bdb214cca03c853f079b04fb120
$(package)_download_path=https://github.com/al45tair/mac_alias/archive/
$(package)_download_file=v$($(package)_version).tar.gz
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=b10cb44ecb64fc25283fae7a9cf365d2829377d84e37b9c21100aca8757509be
$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages
$(package)_patches=python3.patch

View File

@@ -1,36 +1,30 @@
package=openssl
$(package)_version=1.0.2r
$(package)_download_path=https://ftp.openssl.org/source/old/1.0.2
$(package)_version=1.1.1l
$(package)_download_path=https://www.openssl.org/source
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=ae51d08bba8a83958e894946f15303ff894d75c2b8bbd44a852b64e3fe11d0d6
$(package)_patches=fix_arflags.patch
$(package)_sha256_hash=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
$(package)_patches=fix_darwin.patch
define $(package)_set_vars
$(package)_config_env=AR="$($(package)_ar)" ARFLAGS=$($(package)_arflags) RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"
$(package)_config_env_android=ANDROID_NDK_HOME="$(host_prefix)/native" PATH="$(host_prefix)/native/bin" CC=clang AR=ar RANLIB=ranlib
$(package)_build_env_android=ANDROID_NDK_HOME="$(host_prefix)/native"
$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl
$(package)_config_opts+=no-capieng
$(package)_config_opts+=no-dso
$(package)_config_opts+=no-dtls1
$(package)_config_opts+=no-ec_nistp_64_gcc_128
$(package)_config_opts+=no-gost
$(package)_config_opts+=no-gmp
$(package)_config_opts+=no-heartbeats
$(package)_config_opts+=no-jpake
$(package)_config_opts+=no-krb5
$(package)_config_opts+=no-libunbound
$(package)_config_opts+=no-md2
$(package)_config_opts+=no-rc5
$(package)_config_opts+=no-rdrand
$(package)_config_opts+=no-rfc3779
$(package)_config_opts+=no-rsax
$(package)_config_opts+=no-sctp
$(package)_config_opts+=no-sha0
$(package)_config_opts+=no-shared
$(package)_config_opts+=no-ssl-trace
$(package)_config_opts+=no-ssl2
$(package)_config_opts+=no-ssl3
$(package)_config_opts+=no-static_engine
$(package)_config_opts+=no-store
$(package)_config_opts+=no-unit-test
$(package)_config_opts+=no-weak-ssl-ciphers
$(package)_config_opts+=no-zlib
@@ -42,8 +36,8 @@ $(package)_config_opts_x86_64_linux=linux-x86_64
$(package)_config_opts_i686_linux=linux-generic32
$(package)_config_opts_arm_linux=linux-generic32
$(package)_config_opts_aarch64_linux=linux-generic64
$(package)_config_opts_arm_android=--static android-armv7 no-asm
$(package)_config_opts_aarch64_android=--static android no-asm
$(package)_config_opts_arm_android=--static android-arm
$(package)_config_opts_aarch64_android=--static android-arm64
$(package)_config_opts_riscv64_linux=linux-generic64
$(package)_config_opts_mipsel_linux=linux-generic32
$(package)_config_opts_mips_linux=linux-generic32
@@ -55,10 +49,8 @@ $(package)_config_opts_x86_64_freebsd=BSD-x86_64
endef
define $(package)_preprocess_cmds
sed -i.old "/define DATE/d" util/mkbuildinf.pl && \
sed -i.old "s|engines apps test|engines|" Makefile.org && \
sed -i -e "s/-mandroid //" Configure && \
patch < $($(package)_patch_dir)/fix_arflags.patch
sed -i.old 's|"engines", "apps", "test", "util", "tools", "fuzz"|"engines", "tools"|' Configure && \
patch -p1 < $($(package)_patch_dir)/fix_darwin.patch
endef
define $(package)_config_cmds
@@ -66,11 +58,11 @@ define $(package)_config_cmds
endef
define $(package)_build_cmds
$(MAKE) -j1 build_libs libcrypto.pc libssl.pc openssl.pc
$(MAKE) build_libs
endef
define $(package)_stage_cmds
$(MAKE) INSTALL_PREFIX=$($(package)_staging_dir) -j1 install_sw
$(MAKE) DESTDIR=$($(package)_staging_dir) install_sw
endef
define $(package)_postprocess_cmds

View File

@@ -1,6 +1,9 @@
packages:=boost openssl zeromq libiconv
# ccache is useless in gitian builds
ifneq ($(GITIAN),1)
native_packages := native_ccache
endif
hardware_packages := hidapi protobuf libusb
hardware_native_packages := native_protobuf
@@ -8,8 +11,8 @@ hardware_native_packages := native_protobuf
android_native_packages = android_ndk
android_packages = ncurses readline sodium
darwin_native_packages = native_biplist native_ds_store native_mac_alias $(hardware_native_packages)
darwin_packages = sodium ncurses readline $(hardware_packages)
darwin_native_packages = $(hardware_native_packages)
darwin_packages = ncurses readline sodium $(hardware_packages)
# not really native...
freebsd_native_packages = freebsd_base
@@ -31,6 +34,6 @@ mingw32_packages = icu4c sodium $(hardware_packages)
mingw32_native_packages = $(hardware_native_packages)
ifneq ($(build_os),darwin)
darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus
darwin_native_packages += native_cctools
endif

View File

@@ -1,18 +1,18 @@
PACKAGE=qt
$(package)_version=5.7.1
$(package)_download_path=http://linorg.usp.br/Qt/archive/qt/5.7/5.7.1/submodules
$(package)_suffix=opensource-src-$($(package)_version).tar.gz
$(package)_version=5.15.1
$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules
$(package)_suffix=everywhere-src-$($(package)_version).tar.xz
$(package)_file_name=qtbase-$($(package)_suffix)
$(package)_sha256_hash=95f83e532d23b3ddbde7973f380ecae1bac13230340557276f75f2e37984e410
$(package)_sha256_hash=33960404d579675b7210de103ed06a72613bfc4305443e278e2d32a3eb1f3d8c
$(package)_build_subdir=qtbase
$(package)_qt_libs=corelib
$(package)_patches=pidlist_absolute.patch fix_qt_pkgconfig.patch qfixed-coretext.patch
$(package)_patches=fix_qt_pkgconfig.patch fix_no_printer.patch fix_rcc_determinism.patch no-xlib.patch
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
$(package)_qttranslations_sha256_hash=3a15aebd523c6d89fb97b2d3df866c94149653a26d27a00aac9b6d3020bc5a1d
$(package)_qttranslations_sha256_hash=46e0c0e3a511fbcc803a4146204062e47f6ed43b34d98a3c27372a03b8746bd8
$(package)_qttools_file_name=qttools-$($(package)_suffix)
$(package)_qttools_sha256_hash=22d67de915cb8cd93e16fdd38fa006224ad9170bd217c2be1e53045a8dd02f0f
$(package)_qttools_sha256_hash=c98ee5f0f980bf68cbf0c94d62434816a92441733de50bd9adbe9b9055f03498
$(package)_extra_sources = $($(package)_qttranslations_file_name)
$(package)_extra_sources += $($(package)_qttools_file_name)
@@ -24,28 +24,26 @@ $(package)_config_opts += -bindir $(build_prefix)/bin
$(package)_config_opts += -c++std c++11
$(package)_config_opts += -confirm-license
$(package)_config_opts += -dbus-runtime
$(package)_config_opts += -no-alsa
$(package)_config_opts += -no-audio-backend
$(package)_config_opts += -hostprefix $(build_prefix)
$(package)_config_opts += -no-compile-examples
$(package)_config_opts += -no-cups
$(package)_config_opts += -no-egl
$(package)_config_opts += -no-eglfs
$(package)_config_opts += -no-feature-style-windowsmobile
$(package)_config_opts += -no-feature-style-windowsce
$(package)_config_opts += -no-evdev
$(package)_config_opts += -no-gui
$(package)_config_opts += -no-freetype
$(package)_config_opts += -no-gif
$(package)_config_opts += -no-glib
$(package)_config_opts += -no-gstreamer
$(package)_config_opts += -no-icu
$(package)_config_opts += -no-ico
$(package)_config_opts += -no-iconv
$(package)_config_opts += -no-kms
$(package)_config_opts += -no-linuxfb
$(package)_config_opts += -no-libjpeg
$(package)_config_opts += -no-libudev
$(package)_config_opts += -no-mitshm
$(package)_config_opts += -no-mtdev
$(package)_config_opts += -no-pulseaudio
$(package)_config_opts += -no-openvg
$(package)_config_opts += -no-reduce-relocations
$(package)_config_opts += -no-qml-debug
$(package)_config_opts += -no-sql-db2
$(package)_config_opts += -no-sql-ibase
$(package)_config_opts += -no-sql-oci
@@ -56,8 +54,6 @@ $(package)_config_opts += -no-sql-psql
$(package)_config_opts += -no-sql-sqlite
$(package)_config_opts += -no-sql-sqlite2
$(package)_config_opts += -no-use-gold-linker
$(package)_config_opts += -no-xinput2
$(package)_config_opts += -no-xrender
$(package)_config_opts += -nomake examples
$(package)_config_opts += -nomake tests
$(package)_config_opts += -opensource
@@ -65,25 +61,46 @@ $(package)_config_opts += -no-openssl
$(package)_config_opts += -optimized-qmake
$(package)_config_opts += -pch
$(package)_config_opts += -pkg-config
$(package)_config_opts += -prefix $(host_prefix)
$(package)_config_opts += -no-libpng
$(package)_config_opts += -no-libjpeg
$(package)_config_opts += -qt-pcre
$(package)_config_opts += -qt-harfbuzz
$(package)_config_opts += -no-zlib
$(package)_config_opts += -reduce-exports
$(package)_config_opts += -static
$(package)_config_opts += -silent
$(package)_config_opts += -v
$(package)_config_opts += -no-feature-printer
$(package)_config_opts += -no-feature-bearermanagement
$(package)_config_opts += -no-feature-colordialog
$(package)_config_opts += -no-feature-dial
$(package)_config_opts += -no-feature-filesystemwatcher
$(package)_config_opts += -no-feature-fontcombobox
$(package)_config_opts += -no-feature-ftp
$(package)_config_opts += -no-feature-image_heuristic_mask
$(package)_config_opts += -no-feature-keysequenceedit
$(package)_config_opts += -no-feature-lcdnumber
$(package)_config_opts += -no-feature-pdf
$(package)_config_opts += -no-feature-printdialog
$(package)_config_opts += -no-gui
$(package)_config_opts += -no-freetype
$(package)_config_opts += -no-sm
$(package)_config_opts += -no-fontconfig
$(package)_config_opts += -no-opengl
$(package)_config_opts += -no-xkb
$(package)_config_opts += -no-xcb
$(package)_config_opts += -no-xshape
$(package)_build_env = QT_RCC_TEST=1
$(package)_config_opts += -no-feature-printer
$(package)_config_opts += -no-feature-printpreviewdialog
$(package)_config_opts += -no-feature-printpreviewwidget
$(package)_config_opts += -no-feature-sessionmanager
$(package)_config_opts += -no-feature-sql
$(package)_config_opts += -no-feature-statemachine
$(package)_config_opts += -no-feature-syntaxhighlighter
$(package)_config_opts += -no-feature-textbrowser
$(package)_config_opts += -no-feature-textodfwriter
$(package)_config_opts += -no-feature-topleveldomain
$(package)_config_opts += -no-feature-udpsocket
$(package)_config_opts += -no-feature-undocommand
$(package)_config_opts += -no-feature-undogroup
$(package)_config_opts += -no-feature-undostack
$(package)_config_opts += -no-feature-undoview
$(package)_config_opts += -no-feature-vnc
$(package)_config_opts += -no-feature-wizard
$(package)_config_opts_linux = -no-fontconfig
$(package)_config_opts_linux += -no-opengl
$(package)_config_opts_linux += -no-xcb
$(package)_config_opts_linux += -no-feature-xlib
endef
define $(package)_fetch_cmds
@@ -108,14 +125,24 @@ endef
define $(package)_preprocess_cmds
sed -i.old "s|FT_Get_Font_Format|FT_Get_X11_Font_Format|" qtbase/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp && \
sed -i.old "s|updateqm.commands = \$$$$\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|" qttranslations/translations/translations.pro && \
sed -i.old "/updateqm.depends =/d" qttranslations/translations/translations.pro && \
patch -p1 < $($(package)_patch_dir)/pidlist_absolute.patch && \
patch -p1 < $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \
patch -p1 < $($(package)_patch_dir)/qfixed-coretext.patch && \
sed -i.old "s/src_plugins.depends = src_sql src_network/src_plugins.depends = src_network/" qtbase/src/src.pro && \
cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \
sed -i.old "s/arm-linux-gnueabi-/$(host)-/g" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \
patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \
patch -p1 -i $($(package)_patch_dir)/fix_no_printer.patch && \
echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf
echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \
patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \
echo "QMAKE_LINK_OBJECT_MAX = 10" >> qtbase/mkspecs/win32-g++/qmake.conf && \
echo "QMAKE_LINK_OBJECT_SCRIPT = object_script" >> qtbase/mkspecs/win32-g++/qmake.conf && \
sed -i.old "s|QMAKE_CFLAGS += |!host_build: QMAKE_CFLAGS = $($(package)_cflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
sed -i.old "s|QMAKE_CXXFLAGS += |!host_build: QMAKE_CXXFLAGS = $($(package)_cxxflags) $($(package)_cppflags) |" qtbase/mkspecs/win32-g++/qmake.conf && \
sed -i.old "0,/^QMAKE_LFLAGS_/s|^QMAKE_LFLAGS_|!host_build: QMAKE_LFLAGS = $($(package)_ldflags)\n&|" qtbase/mkspecs/win32-g++/qmake.conf && \
sed -i.old "s/LIBRARY_PATH/(CROSS_)?\0/g" qtbase/mkspecs/features/toolchain.prf
endef
define $(package)_config_cmds

View File

@@ -1,8 +1,8 @@
package=unwind
$(package)_version=1.2
$(package)_version=1.5.0
$(package)_download_path=https://download.savannah.nongnu.org/releases/libunwind
$(package)_file_name=lib$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=1de38ffbdc88bd694d10081865871cd2bfbb02ad8ef9e1606aee18d65532b992
$(package)_sha256_hash=90337653d92d4a13de590781371c604f9031cdb50520366aa1e3a91e1efb1017
$(package)_patches=fix_obj_order.patch
define $(package)_preprocess_cmds
@@ -12,7 +12,7 @@ endef
define $(package)_config_cmds
cp -f $(BASEDIR)/config.guess config/config.guess &&\
cp -f $(BASEDIR)/config.sub config/config.sub &&\
$($(package)_autoconf) --disable-shared --enable-static AR_FLAGS=$($(package)_arflags)
$($(package)_autoconf) --disable-shared --enable-static --disable-tests --disable-documentation AR_FLAGS=$($(package)_arflags)
endef
define $(package)_build_cmds

View File

@@ -1,9 +1,9 @@
package=zeromq
$(package)_version=4.1.7
$(package)_download_path=https://github.com/zeromq/zeromq4-1/releases/download/v$($(package)_version)/
$(package)_version=4.3.4
$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=31c383cfcd3be1dc8a66e448c403029e793687e70473b89c4cc0bd626e7da299
$(package)_patches=9114d3957725acd34aa8b8d011585812f3369411.patch 9e6745c12e0b100cd38acecc16ce7db02905e27c.patch ffe62d3398d5e0191f554f61049aa7ec9fc892ae.patch
$(package)_sha256_hash=c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5
$(package)_patches=06aba27b04c5822cb88a69677382a0f053367143.patch
define $(package)_set_vars
$(package)_config_opts=--without-documentation --disable-shared --without-libsodium --disable-curve
@@ -13,10 +13,7 @@ define $(package)_set_vars
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/9114d3957725acd34aa8b8d011585812f3369411.patch && \
patch -p1 < $($(package)_patch_dir)/9e6745c12e0b100cd38acecc16ce7db02905e27c.patch && \
patch -p1 < $($(package)_patch_dir)/ffe62d3398d5e0191f554f61049aa7ec9fc892ae.patch && \
./autogen.sh
patch -p1 < $($(package)_patch_dir)/06aba27b04c5822cb88a69677382a0f053367143.patch
endef
define $(package)_config_cmds
@@ -24,7 +21,7 @@ define $(package)_config_cmds
endef
define $(package)_build_cmds
$(MAKE) libzmq.la
$(MAKE) src/libzmq.la
endef
define $(package)_stage_cmds

View File

@@ -0,0 +1,21 @@
From a77b066311da42ed7654e39c0356a3b951b2e296 Mon Sep 17 00:00:00 2001
From: selsta <selsta@sent.at>
Date: Wed, 10 Nov 2021 02:28:54 +0100
Subject: [PATCH] windows: add missing include for mingw32
---
windows/hid.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/windows/hid.c b/windows/hid.c
index 24756a4..6d8394c 100644
--- a/windows/hid.c
+++ b/windows/hid.c
@@ -33,6 +33,7 @@ typedef LONG NTSTATUS;
#endif
#ifdef __MINGW32__
+#include <devpropdef.h>
#include <ntdef.h>
#include <winbase.h>
#endif

View File

@@ -1,24 +0,0 @@
--- Makefile.org.O 2019-02-26 14:20:20.000000000 +0000
+++ Makefile.org 2019-11-15 13:05:54.370086856 +0000
@@ -63,8 +63,8 @@
PEX_LIBS=
EX_LIBS=
EXE_EXT=
-ARFLAGS=
-AR=ar $(ARFLAGS) r
+ARFLAGS= r
+AR=ar $(ARFLAGS)
RANLIB= ranlib
RC= windres
NM= nm
--- Configure.O 2019-02-26 14:20:20.000000000 +0000
+++ Configure 2019-11-16 07:43:14.933990774 +0000
@@ -1251,7 +1251,7 @@
my $shared_extension = $fields[$idx_shared_extension];
my $ranlib = $ENV{'RANLIB'} || $fields[$idx_ranlib];
my $ar = $ENV{'AR'} || "ar";
-my $arflags = $fields[$idx_arflags];
+my $arflags = $ENV{'ARFLAGS'} || $fields[$idx_arflags];
my $windres = $ENV{'RC'} || $ENV{'WINDRES'} || "windres";
my $multilib = $fields[$idx_multilib];

View File

@@ -0,0 +1,60 @@
From 96ac8f13f4d0ee96baf5724d9f96c44c34b8606c Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen@gmail.com>
Date: Tue, 24 Aug 2021 22:40:14 +0100
Subject: [PATCH] Darwin platform allows to build on releases before
Yosemite/ios 8.
issue #16407 #16408
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16409)
---
crypto/rand/rand_unix.c | 5 +----
include/crypto/rand.h | 10 ++++++++++
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
index 43f1069d151d..0f4525106af7 100644
--- a/crypto/rand/rand_unix.c
+++ b/crypto/rand/rand_unix.c
@@ -34,9 +34,6 @@
#if defined(__OpenBSD__)
# include <sys/param.h>
#endif
-#if defined(__APPLE__)
-# include <CommonCrypto/CommonRandom.h>
-#endif
#if defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__)
# include <sys/types.h>
@@ -381,7 +378,7 @@ static ssize_t syscall_random(void *buf, size_t buflen)
if (errno != ENOSYS)
return -1;
}
-# elif defined(__APPLE__)
+# elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
return (ssize_t)buflen;
diff --git a/include/crypto/rand.h b/include/crypto/rand.h
index 5350d3a93119..674f840fd13c 100644
--- a/include/crypto/rand.h
+++ b/include/crypto/rand.h
@@ -20,6 +20,16 @@
# include <openssl/rand.h>
+# if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
+# include <Availability.h>
+# if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000) || \
+ (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
+# define OPENSSL_APPLE_CRYPTO_RANDOM 1
+# include <CommonCrypto/CommonCryptoError.h>
+# include <CommonCrypto/CommonRandom.h>
+# endif
+# endif
+
/* forward declaration */
typedef struct rand_pool_st RAND_POOL;

View File

@@ -0,0 +1,19 @@
--- x/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h
+++ y/qtbase/src/plugins/platforms/cocoa/qprintengine_mac_p.h
@@ -52,6 +52,7 @@
//
#include <QtCore/qglobal.h>
+#include <qpa/qplatformprintdevice.h>
#ifndef QT_NO_PRINTER
--- x/qtbase/src/plugins/plugins.pro
+++ y/qtbase/src/plugins/plugins.pro
@@ -9,6 +9,3 @@ qtHaveModule(gui) {
!android:qtConfig(library): SUBDIRS *= generic
}
qtHaveModule(widgets): SUBDIRS += styles
-
-!winrt:qtHaveModule(printsupport): \
- SUBDIRS += printsupport

View File

@@ -1,11 +1,11 @@
--- old/qtbase/mkspecs/features/qt_module.prf
+++ new/qtbase/mkspecs/features/qt_module.prf
@@ -245,7 +245,7 @@
@@ -269,7 +269,7 @@ load(qt_installs)
load(qt_targets)
# this builds on top of qt_common
-!internal_module:!lib_bundle:if(unix|mingw) {
+unix|mingw {
-!internal_module:if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) {
+if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) {
CONFIG += create_pc
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
host_build: \

View File

@@ -0,0 +1,15 @@
--- old/qtbase/src/tools/rcc/rcc.cpp
+++ new/qtbase/src/tools/rcc/rcc.cpp
@@ -207,7 +207,11 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib)
if (lib.formatVersion() >= 2) {
// last modified time stamp
const QDateTime lastModified = m_fileInfo.lastModified();
- lib.writeNumber8(quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0));
+ quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0);
+ static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong();
+ if (sourceDate != 0)
+ lastmod = sourceDate;
+ lib.writeNumber8(lastmod);
if (text || pass1)
lib.writeChar('\n');
}

View File

@@ -0,0 +1,69 @@
From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001
From: Carl Dong <contact@carldong.me>
Date: Thu, 18 Jul 2019 17:22:05 -0400
Subject: [PATCH] Wrap xlib related code blocks in #if's
They are not necessary to compile QT.
---
qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
index 7c62c2e2b3..c05c6c0a07 100644
--- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -49,7 +49,9 @@
#include <QtGui/QWindow>
#include <QtGui/QBitmap>
#include <QtGui/private/qguiapplication_p.h>
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
#include <X11/cursorfont.h>
+#endif
#include <xcb/xfixes.h>
#include <xcb/xcb_image.h>
@@ -391,6 +393,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window)
xcb_flush(xcb_connection());
}
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
static int cursorIdForShape(int cshape)
{
int cursorId = 0;
@@ -444,6 +447,7 @@ static int cursorIdForShape(int cshape)
}
return cursorId;
}
+#endif
xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
{
@@ -556,7 +560,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
{
xcb_connection_t *conn = xcb_connection();
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
int cursorId = cursorIdForShape(cshape);
+#endif
xcb_cursor_t cursor = XCB_NONE;
// Try Xcursor first
@@ -586,6 +592,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
// Non-standard X11 cursors are created from bitmaps
cursor = createNonStandardCursor(cshape);
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
// Create a glpyh cursor if everything else failed
if (!cursor && cursorId) {
cursor = xcb_generate_id(conn);
@@ -593,6 +600,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
cursorId, cursorId + 1,
0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0);
}
+#endif
if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) {
const char *name = cursorNames[cshape].front();
---
2.22.0

View File

@@ -1,37 +0,0 @@
diff -dur old/qtbase/src/plugins/platforms/windows/qwindowscontext.h new/qtbase/src/plugins/platforms/windows/qwindowscontext.h
--- old/qtbase/src/plugins/platforms/windows/qwindowscontext.h
+++ new/qtbase/src/plugins/platforms/windows/qwindowscontext.h
@@ -136,10 +136,18 @@
inline void init();
typedef HRESULT (WINAPI *SHCreateItemFromParsingName)(PCWSTR, IBindCtx *, const GUID&, void **);
+#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
+ typedef HRESULT (WINAPI *SHGetKnownFolderIDList)(const GUID &, DWORD, HANDLE, ITEMIDLIST **);
+#else
typedef HRESULT (WINAPI *SHGetKnownFolderIDList)(const GUID &, DWORD, HANDLE, PIDLIST_ABSOLUTE *);
+#endif
typedef HRESULT (WINAPI *SHGetStockIconInfo)(int , int , _SHSTOCKICONINFO *);
typedef HRESULT (WINAPI *SHGetImageList)(int, REFIID , void **);
+#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
+ typedef HRESULT (WINAPI *SHCreateItemFromIDList)(const ITEMIDLIST *, REFIID, void **);
+#else
typedef HRESULT (WINAPI *SHCreateItemFromIDList)(PCIDLIST_ABSOLUTE, REFIID, void **);
+#endif
SHCreateItemFromParsingName sHCreateItemFromParsingName;
SHGetKnownFolderIDList sHGetKnownFolderIDList;
diff -dur old/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp new/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
--- old/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ new/qtbase/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -1016,7 +1016,11 @@
qWarning() << __FUNCTION__ << ": Invalid CLSID: " << url.path();
return Q_NULLPTR;
}
+#if defined(Q_CC_MINGW) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 3)
+ ITEMIDLIST *idList;
+#else
PIDLIST_ABSOLUTE idList;
+#endif
HRESULT hr = QWindowsContext::shell32dll.sHGetKnownFolderIDList(uuid, 0, 0, &idList);
if (FAILED(hr)) {
qErrnoWarning("%s: SHGetKnownFolderIDList(%s)) failed", __FUNCTION__, qPrintable(url.toString()));

View File

@@ -1,34 +0,0 @@
From dbdd5f0ffbce52c8b789ed09f1aa3f1da6c02e23 Mon Sep 17 00:00:00 2001
From: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Date: Fri, 30 Mar 2018 11:58:16 -0700
Subject: [PATCH] QCoreTextFontEngine: Fix build with Xcode 9.3
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Error message:
.../qfontengine_coretext.mm:827:20: error: qualified reference to
'QFixed' is a constructor name rather than a type in this context
return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
Change-Id: Iebe26b3b087a16b10664208fc8851cbddb47f043
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
---
src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git old/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm new/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 25ff69d877d..98b753eff96 100644
--- old/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ new/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -824,7 +824,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
QFixed QCoreTextFontEngine::emSquareSize() const
{
- return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+ return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
}
QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
--
2.16.3

View File

@@ -1,9 +1,9 @@
--- config/ltmain.sh.O 2017-01-13 16:00:54.000000000 +0000
+++ config/ltmain.sh 2019-11-17 06:46:51.994402494 +0000
@@ -7957,6 +7957,8 @@
esac
done
--- config/ltmain.sh.0 2020-11-10 17:25:26.000000000 +0100
+++ config/ltmain.sh 2021-09-11 19:39:36.000000000 +0200
@@ -10768,6 +10768,8 @@
fi
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
tool_oldlib=$func_to_tool_file_result
+ oldobjs=`for obj in $oldobjs; do echo $obj; done | sort`
+ oldobjs=" `echo $oldobjs`"
eval cmds=\"$old_archive_cmds\"

View File

@@ -0,0 +1,22 @@
From 06aba27b04c5822cb88a69677382a0f053367143 Mon Sep 17 00:00:00 2001
From: sabotagebeats <27985126+sabotagebeats@users.noreply.github.com>
Date: Thu, 22 Jul 2021 21:53:19 -0700
Subject: [PATCH] fix: building libzmq fails with error src/clock.cpp:131:16:
error: unused variable 'nsecs_per_usec'
---
src/clock.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/clock.cpp b/src/clock.cpp
index 93da90a8e..63c0100a5 100644
--- a/src/clock.cpp
+++ b/src/clock.cpp
@@ -195,6 +195,7 @@ uint64_t zmq::clock_t::now_us ()
#else
+ LIBZMQ_UNUSED (nsecs_per_usec);
// Use POSIX gettimeofday function to get precise time.
struct timeval tv;
int rc = gettimeofday (&tv, NULL);

View File

@@ -1,22 +0,0 @@
From 9114d3957725acd34aa8b8d011585812f3369411 Mon Sep 17 00:00:00 2001
From: Jeroen Ooms <jeroenooms@gmail.com>
Date: Tue, 20 Oct 2015 13:10:38 +0200
Subject: [PATCH] enable static libraries on mingw
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 393505b..e92131a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,7 +265,7 @@ case "${host_os}" in
libzmq_dso_visibility="no"
if test "x$enable_static" = "xyes"; then
- AC_MSG_ERROR([Building static libraries is not supported under MinGW32])
+ CPPFLAGS="-DZMQ_STATIC"
fi
# Set FD_SETSIZE to 1024

View File

@@ -1,22 +0,0 @@
From 9e6745c12e0b100cd38acecc16ce7db02905e27c Mon Sep 17 00:00:00 2001
From: David Millard <dmillard10@gmail.com>
Date: Tue, 10 May 2016 13:53:53 -0700
Subject: [PATCH] Fix autotools for static MinGW builds
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 5a0fa14..def6ea7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -259,7 +259,7 @@ case "${host_os}" in
libzmq_dso_visibility="no"
if test "x$enable_static" = "xyes"; then
- CPPFLAGS="-DZMQ_STATIC"
+ CPPFLAGS="-DZMQ_STATIC $CPPFLAGS"
fi
# Set FD_SETSIZE to 1024

View File

@@ -1,38 +0,0 @@
From ffe62d3398d5e0191f554f61049aa7ec9fc892ae Mon Sep 17 00:00:00 2001
From: Gregory Lemercier <greglemercier@free.fr>
Date: Sun, 7 Oct 2018 18:06:54 +0200
Subject: [PATCH] Fix build on arm64 architectures with some strict compilers
This patch fixes an issue that occurs on 64-bit architetures under
strict compiler rules. The code initially checked that the received
size stored in 'uint64_t' was not bigger than the max value of a
'size_t' variable, which is legitimate on 32-bit architectures where
'size_t' variables are stored on 32 bits. On 64-bit architectures,
this test no longer makes sense since 'uint64_t' and 'size_t' types
have the same size. The issue is fixed by ignoring this portion
of code when built for arm64.
---
src/v1_decoder.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/v1_decoder.cpp b/src/v1_decoder.cpp
index b002dc9d..2c8c97a7 100644
--- a/src/v1_decoder.cpp
+++ b/src/v1_decoder.cpp
@@ -114,11 +114,13 @@ int zmq::v1_decoder_t::eight_byte_size_ready ()
return -1;
}
+#ifndef __aarch64__
// Message size must fit within range of size_t data type.
if (payload_length - 1 > std::numeric_limits <size_t>::max ()) {
errno = EMSGSIZE;
return -1;
}
+#endif
const size_t msg_size = static_cast <size_t> (payload_length - 1);
--
2.20.1

View File

@@ -1,5 +1,6 @@
# Set the system name to one of Android, Darwin, FreeBSD, Linux, or Windows
SET(CMAKE_SYSTEM_NAME @depends@)
SET(CMAKE_SYSTEM_PROCESSOR @arch@)
SET(CMAKE_BUILD_TYPE @release_type@)
OPTION(STATIC "Link libraries statically" ON)
@@ -55,7 +56,7 @@ SET(Boost_NO_SYSTEM_PATHS ON)
SET(Boost_USE_STATIC_LIBS ON)
SET(Boost_USE_STATIC_RUNTIME ON)
SET(OpenSSL_DIR @prefix@/lib)
SET(OPENSSL_ROOT_DIR @prefix@)
SET(ARCHITECTURE @arch@)
# for libraries and headers in the target directories
@@ -63,14 +64,14 @@ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host
set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target
set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR} CACHE STRING "" FORCE)
# specify the cross compiler to be used. Darwin uses clang provided by the SDK.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(CMAKE_C_COMPILER @prefix@/native/bin/clang)
SET(CMAKE_C_COMPILER_TARGET x86_64-apple-darwin11)
SET(CMAKE_CXX_COMPILER @prefix@/native/bin/clang++ -stdlib=libc++)
SET(CMAKE_CXX_COMPILER_TARGET x86_64-apple-darwin11)
SET(CMAKE_ASM_COMPILER_TARGET x86_64-apple-darwin11)
SET(CMAKE_ASM-ATT_COMPILER_TARGET x86_64-apple-darwin11)
SET(_CMAKE_TOOLCHAIN_PREFIX x86_64-apple-darwin11-)
SET(APPLE True)
SET(BUILD_TAG "mac-x64")
@@ -79,7 +80,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
SET(PORT OFF)
SET(CMAKE_OSX_SYSROOT "@sdk@/MacOSX10.11.sdk/")
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.08")
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 14)
SET(CMAKE_OSX_ARCHITECTURES "x86_64")
SET(LLVM_ENABLE_PIC OFF)
SET(LLVM_ENABLE_PIE OFF)

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.5)
set(Boost_USE_MULTITHREADED ON)
#set(Boost_DEBUG 1)
find_package(Boost COMPONENTS system filesystem thread date_time chrono regex )

View File

@@ -117,6 +117,9 @@ namespace epee
check(more);
}
//! Reset write position, but do not release internal memory. \post `size() == 0`.
void clear() noexcept { next_write_ = buffer_.get(); }
/*! Copy `length` bytes starting at `ptr` to end of stream.
\throw std::range_error If exceeding max size_t value.
\throw std::bad_alloc If allocation fails. */
@@ -185,7 +188,7 @@ namespace epee
void put_n(const std::uint8_t ch, const std::size_t count)
{
check(count);
std::memset(tellp(), count, ch);
std::memset(tellp(), ch, count);
next_write_ += count;
}

View File

@@ -465,7 +465,7 @@ eof:
bool run_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, std::function<std::string(void)> prompt, const std::string& usage = "")
{
async_console_handler console_handler;
return console_handler.run(ptsrv, boost::bind<bool>(no_srv_param_adapter<t_server, t_handler>, _1, _2, handlr), prompt, usage);
return console_handler.run(ptsrv, std::bind<bool>(no_srv_param_adapter<t_server, t_handler>, std::placeholders::_1, std::placeholders::_2, handlr), prompt, usage);
}
template<class t_server, class t_handler>
@@ -543,6 +543,31 @@ eof:
return it->second.second;
}
std::vector<std::string> get_command_list(const std::vector<std::string>& keywords = std::vector<std::string>())
{
std::vector<std::string> list;
list.reserve(m_command_handlers.size());
for(auto const& x:m_command_handlers)
{
bool take = true;
for(auto const& y:keywords)
{
bool in_usage = x.second.second.first.find(y) != std::string::npos;
bool in_description = x.second.second.second.find(y) != std::string::npos;
if (!(in_usage || in_description))
{
take = false;
break;
}
}
if (take)
{
list.push_back(x.first);
}
}
return list;
}
void set_handler(const std::string& cmd, const callback& hndlr, const std::string& usage = "", const std::string& description = "")
{
lookup::mapped_type & vt = m_command_handlers[cmd];
@@ -634,7 +659,7 @@ eof:
bool run_handling(std::function<std::string(void)> prompt, const std::string& usage_string, std::function<void(void)> exit_handler = NULL)
{
return m_console_handler.run(boost::bind(&console_handlers_binder::process_command_str, this, _1), prompt, usage_string, exit_handler);
return m_console_handler.run(std::bind(&console_handlers_binder::process_command_str, this, std::placeholders::_1), prompt, usage_string, exit_handler);
}
void print_prompt()

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -277,7 +277,7 @@ namespace md5
/* Zeroize sensitive information.
*/
MD5_memset ((POINTER)context, 0, sizeof (*context));
memwipe ((POINTER)context, sizeof (*context));
}
/* MD5 basic transformation. Transforms state based on block.
@@ -369,7 +369,7 @@ namespace md5
/* Zeroize sensitive information.
*/
MD5_memset ((POINTER)x, 0, sizeof (x));
memwipe ((POINTER)x, sizeof (x));
}
/* Note: Replace "for loop" with standard memcpy if possible.
@@ -431,9 +431,9 @@ namespace md5
MD5Update(&hmac->octx, k_opad, 64); /* apply outer pad */
/* scrub the pads and key context (if used) */
MD5_memset( (POINTER)&k_ipad, 0, sizeof(k_ipad));
MD5_memset( (POINTER)&k_opad, 0, sizeof(k_opad));
MD5_memset( (POINTER)&tk, 0, sizeof(tk));
memwipe( (POINTER)&k_ipad, sizeof(k_ipad));
memwipe( (POINTER)&k_opad, sizeof(k_opad));
memwipe( (POINTER)&tk, sizeof(tk));
/* and we're done. */
}
@@ -459,7 +459,7 @@ namespace md5
state->istate[lupe] = htonl(hmac.ictx.state[lupe]);
state->ostate[lupe] = htonl(hmac.octx.state[lupe]);
}
MD5_memset( (POINTER)&hmac, 0, sizeof(hmac));
memwipe( (POINTER)&hmac, sizeof(hmac));
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2017-2019, The Monero Project
// Copyright (c) 2017-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -106,6 +106,14 @@ namespace misc_utils
return true;
}
template <typename T>
T get_mid(const T &a, const T &b)
{
//returns the average of two numbers; overflow safe and works with at least all integral and floating point types
//(a+b)/2 = (a/2) + (b/2) + ((a - 2*(a/2)) + (b - 2*(b/2)))/2
return (a/2) + (b/2) + ((a - 2*(a/2)) + (b - 2*(b/2)))/2;
}
template<class type_vec_type>
type_vec_type median(std::vector<type_vec_type> &v)
{
@@ -122,7 +130,7 @@ namespace misc_utils
return v[n];
}else
{//2, 4, 6...
return (v[n-1] + v[n])/2;
return get_mid<type_vec_type>(v[n-1],v[n]);
}
}

View File

@@ -64,6 +64,7 @@ namespace http
abstract_http_client() {}
virtual ~abstract_http_client() {}
bool set_server(const std::string& address, boost::optional<login> user, ssl_options_t ssl_options = ssl_support_t::e_ssl_support_autodetect);
virtual bool set_proxy(const std::string& address);
virtual void set_server(std::string host, std::string port, boost::optional<login> user, ssl_options_t ssl_options = ssl_support_t::e_ssl_support_autodetect) = 0;
virtual void set_auto_connect(bool auto_connect) = 0;
virtual bool connect(std::chrono::milliseconds timeout) = 0;

View File

@@ -48,12 +48,9 @@
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/array.hpp>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp> //! \TODO Convert to std::shared_ptr
#include <boost/enable_shared_from_this.hpp>
#include <boost/interprocess/detail/atomic.hpp>
#include <boost/thread/thread.hpp>
#include <memory>
#include "byte_slice.h"
#include "net_utils_base.h"
#include "syncobj.h"

View File

@@ -32,7 +32,6 @@
#include <boost/bind.hpp>
#include <boost/foreach.hpp>
#include <boost/uuid/random_generator.hpp>
#include <boost/chrono.hpp>
@@ -208,17 +207,16 @@ PRAGMA_WARNING_DISABLE_VS(4355)
buffer_ssl_init_fill = 0;
if (is_income && m_ssl_support != epee::net_utils::ssl_support_t::e_ssl_support_disabled)
socket().async_receive(boost::asio::buffer(buffer_),
boost::asio::socket_base::message_peek,
strand_.wrap(
boost::bind(&connection<t_protocol_handler>::handle_receive, self,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred)));
std::bind(&connection<t_protocol_handler>::handle_receive, self,
std::placeholders::_1,
std::placeholders::_2)));
else
async_read_some(boost::asio::buffer(buffer_),
strand_.wrap(
boost::bind(&connection<t_protocol_handler>::handle_read, self,
boost::asio::placeholders::error,
boost::asio::placeholders::bytes_transferred)));
std::bind(&connection<t_protocol_handler>::handle_read, self,
std::placeholders::_1,
std::placeholders::_2)));
#if !defined(_WIN32) || !defined(__i686)
// not supported before Windows7, too lazy for runtime check
// Just exclude for 32bit windows builds
@@ -271,8 +269,6 @@ PRAGMA_WARNING_DISABLE_VS(4355)
//_dbg3("[sock " << socket().native_handle() << "] add_ref, m_peer_number=" << mI->m_peer_number);
CRITICAL_REGION_LOCAL(self->m_self_refs_lock);
//_dbg3("[sock " << socket().native_handle() << "] add_ref 2, m_peer_number=" << mI->m_peer_number);
if(m_was_shutdown)
return false;
++m_reference_count;
m_self_ref = std::move(self);
return true;
@@ -335,6 +331,9 @@ PRAGMA_WARNING_DISABLE_VS(4355)
TRY_ENTRY();
//_info("[sock " << socket().native_handle() << "] Async read calledback.");
if (m_was_shutdown)
return;
if (!e)
{
double current_speed_down;
@@ -361,6 +360,9 @@ PRAGMA_WARNING_DISABLE_VS(4355)
CRITICAL_REGION_LOCAL( epee::net_utils::network_throttle_manager::m_lock_get_global_throttle_in );
delay = epee::net_utils::network_throttle_manager::get_global_throttle_in().get_sleep_time_after_tick( bytes_transferred );
}
if (m_was_shutdown)
return;
delay *= 0.5;
long int ms = (long int)(delay * 100);
@@ -432,6 +434,9 @@ PRAGMA_WARNING_DISABLE_VS(4355)
std::size_t bytes_transferred)
{
TRY_ENTRY();
if (m_was_shutdown) return;
if (e)
{
// offload the error case
@@ -439,13 +444,11 @@ PRAGMA_WARNING_DISABLE_VS(4355)
return;
}
reset_timer(get_timeout_from_bytes_read(bytes_transferred), false);
buffer_ssl_init_fill += bytes_transferred;
if (buffer_ssl_init_fill <= get_ssl_magic_size())
MTRACE("we now have " << buffer_ssl_init_fill << "/" << get_ssl_magic_size() << " bytes needed to detect SSL");
if (buffer_ssl_init_fill < get_ssl_magic_size())
{
socket().async_receive(boost::asio::buffer(buffer_.data() + buffer_ssl_init_fill, buffer_.size() - buffer_ssl_init_fill),
boost::asio::socket_base::message_peek,
strand_.wrap(
boost::bind(&connection<t_protocol_handler>::handle_receive, connection<t_protocol_handler>::shared_from_this(),
boost::asio::placeholders::error,
@@ -471,7 +474,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
if (m_ssl_support == epee::net_utils::ssl_support_t::e_ssl_support_enabled)
{
// Handshake
if (!handshake(boost::asio::ssl::stream_base::server))
if (!handshake(boost::asio::ssl::stream_base::server, boost::asio::const_buffer(buffer_.data(), buffer_ssl_init_fill)))
{
MERROR("SSL handshake failed");
boost::interprocess::ipcdetail::atomic_write32(&m_want_close_connection, 1);
@@ -486,6 +489,11 @@ PRAGMA_WARNING_DISABLE_VS(4355)
return;
}
}
else
{
handle_read(e, buffer_ssl_init_fill);
return;
}
async_read_some(boost::asio::buffer(buffer_),
strand_.wrap(
@@ -552,7 +560,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
{ // LOCK: chunking
epee::critical_region_t<decltype(m_chunking_lock)> send_guard(m_chunking_lock); // *** critical ***
MDEBUG("do_send() will SPLIT into small chunks, from packet="<<message_size<<" B for ptr="<<message_data);
MDEBUG("do_send() will SPLIT into small chunks, from packet="<<message_size<<" B for ptr="<<(const void*)message_data);
// 01234567890
// ^^^^ (pos=0, len=4) ; pos:=pos+len, pos=4
// ^^^^ (pos=4, len=4) ; pos:=pos+len, pos=8
@@ -565,14 +573,14 @@ PRAGMA_WARNING_DISABLE_VS(4355)
while (!message.empty()) {
byte_slice chunk = message.take_slice(chunksize_good);
MDEBUG("chunk_start="<<(void*)chunk.data()<<" ptr="<<message_data<<" pos="<<(chunk.data() - message_data));
MDEBUG("chunk_start="<<(void*)chunk.data()<<" ptr="<<(const void*)message_data<<" pos="<<(chunk.data() - message_data));
MDEBUG("part of " << message.size() << ": pos="<<(chunk.data() - message_data) << " len="<<chunk.size());
bool ok = do_send_chunk(std::move(chunk)); // <====== ***
all_ok = all_ok && ok;
if (!all_ok) {
MDEBUG("do_send() DONE ***FAILED*** from packet="<<message_size<<" B for ptr="<<message_data);
MDEBUG("do_send() DONE ***FAILED*** from packet="<<message_size<<" B for ptr="<<(const void*)message_data);
MDEBUG("do_send() SEND was aborted in middle of big package - this is mostly harmless "
<< " (e.g. peer closed connection) but if it causes trouble tell us at #monero-dev. " << message_size);
return false; // partial failure in sending
@@ -580,7 +588,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
// (in catch block, or uniq pointer) delete buf;
} // each chunk
MDEBUG("do_send() DONE SPLIT from packet="<<message_size<<" B for ptr="<<message_data);
MDEBUG("do_send() DONE SPLIT from packet="<<message_size<<" B for ptr="<<(const void*)message_data);
MDEBUG("do_send() m_connection_type = " << m_connection_type);
@@ -652,6 +660,8 @@ PRAGMA_WARNING_DISABLE_VS(4355)
boost::this_thread::sleep(boost::posix_time::milliseconds( ms ) );
m_send_que_lock.lock();
_dbg1("sleep for queue: " << ms);
if (m_was_shutdown)
return false;
if (retry > retry_limit) {
MWARNING("send que size is more than ABSTRACT_SERVER_SEND_QUE_MAX_COUNT(" << ABSTRACT_SERVER_SEND_QUE_MAX_COUNT << "), shutting down connection");
@@ -688,7 +698,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
reset_timer(get_default_timeout(), false);
async_write(boost::asio::buffer(m_send_que.front().data(), size_now ) ,
strand_.wrap(
boost::bind(&connection<t_protocol_handler>::handle_write, self, _1, _2)
std::bind(&connection<t_protocol_handler>::handle_write, self, std::placeholders::_1, std::placeholders::_2)
)
);
//_dbg3("(chunk): " << size_now);
@@ -749,7 +759,8 @@ PRAGMA_WARNING_DISABLE_VS(4355)
template<class t_protocol_handler>
void connection<t_protocol_handler>::reset_timer(boost::posix_time::milliseconds ms, bool add)
{
if (ms.total_milliseconds() < 0)
const auto tms = ms.total_milliseconds();
if (tms < 0 || (add && tms == 0))
{
MWARNING("Ignoring negative timeout " << ms);
return;
@@ -892,7 +903,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
CHECK_AND_ASSERT_MES( size_now == m_send_que.front().size(), void(), "Unexpected queue size");
async_write(boost::asio::buffer(m_send_que.front().data(), size_now) ,
strand_.wrap(
boost::bind(&connection<t_protocol_handler>::handle_write, connection<t_protocol_handler>::shared_from_this(), _1, _2)
std::bind(&connection<t_protocol_handler>::handle_write, connection<t_protocol_handler>::shared_from_this(), std::placeholders::_1, std::placeholders::_2)
)
);
//_dbg3("(normal)" << size_now);
@@ -1402,7 +1413,7 @@ POP_WARNINGS
shared_context->connect_mut.lock(); shared_context->ec = ec_; shared_context->cond.notify_one(); shared_context->connect_mut.unlock();
};
sock_.async_connect(remote_endpoint, boost::bind<void>(connect_callback, _1, local_shared_context));
sock_.async_connect(remote_endpoint, std::bind<void>(connect_callback, std::placeholders::_1, local_shared_context));
while(local_shared_context->ec == boost::asio::error::would_block)
{
bool r = local_shared_context->cond.timed_wait(lock, boost::get_system_time() + boost::posix_time::milliseconds(conn_timeout));

View File

@@ -8,7 +8,7 @@
// ! (how ever if in some wonderful juristdictions that is not the case, then why not make another sub-class withat that members and licence it as epee part)
// ! Working on above premise, IF this is valid in your juristdictions, then consider this code as released as:
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//
@@ -132,10 +132,10 @@ class connection_basic { // not-templated base class for rapid developmet of som
ssl_support_t get_ssl_support() const { return m_ssl_support; }
void disable_ssl() { m_ssl_support = epee::net_utils::ssl_support_t::e_ssl_support_disabled; }
bool handshake(boost::asio::ssl::stream_base::handshake_type type)
bool handshake(boost::asio::ssl::stream_base::handshake_type type, boost::asio::const_buffer buffer = {})
{
//m_state != nullptr verified in constructor
return m_state->ssl_options().handshake(socket_, type);
return m_state->ssl_options().handshake(socket_, type, buffer);
}
template<typename MutableBufferSequence, typename ReadHandler>

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -885,14 +885,6 @@ namespace net_utils
}
};
typedef http_simple_client_template<blocked_mode_client> http_simple_client;
class http_simple_client_factory : public http_client_factory
{
public:
std::unique_ptr<abstract_http_client> create() override {
return std::unique_ptr<epee::net_utils::http::abstract_http_client>(new epee::net_utils::http::http_simple_client());
}
};
}
}
}

View File

@@ -668,7 +668,7 @@ namespace net_utils
// Cross-origin resource sharing
if(m_query_info.m_header_info.m_origin.size())
{
if (std::binary_search(m_config.m_access_control_origins.begin(), m_config.m_access_control_origins.end(), m_query_info.m_header_info.m_origin))
if (std::binary_search(m_config.m_access_control_origins.begin(), m_config.m_access_control_origins.end(), "*") || std::binary_search(m_config.m_access_control_origins.begin(), m_config.m_access_control_origins.end(), m_query_info.m_header_info.m_origin))
{
buf += "Access-Control-Allow-Origin: ";
buf += m_query_info.m_header_info.m_origin;

View File

@@ -42,8 +42,17 @@
MINFO("HTTP [" << m_conn_context.m_remote_address.host_str() << "] " << query_info.m_http_method_str << " " << query_info.m_URI); \
response.m_response_code = 200; \
response.m_response_comment = "Ok"; \
if(!handle_http_request_map(query_info, response, m_conn_context)) \
{response.m_response_code = 404;response.m_response_comment = "Not found";} \
try \
{ \
if(!handle_http_request_map(query_info, response, m_conn_context)) \
{response.m_response_code = 404;response.m_response_comment = "Not found";} \
} \
catch (const std::exception &e) \
{ \
MERROR(m_conn_context << "Exception in handle_http_request_map: " << e.what()); \
response.m_response_code = 500; \
response.m_response_comment = "Internal Server Error"; \
} \
return true; \
}
@@ -69,9 +78,11 @@
uint64_t ticks1 = epee::misc_utils::get_tick_count(); \
boost::value_initialized<command_type::response> resp;\
MINFO(m_conn_context << "calling " << s_pattern); \
if(!callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), &m_conn_context)) \
bool res = false; \
try { res = callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), &m_conn_context); } \
catch (const std::exception &e) { MERROR(m_conn_context << "Failed to " << #callback_f << "(): " << e.what()); } \
if (!res) \
{ \
MERROR(m_conn_context << "Failed to " << #callback_f << "()"); \
response_info.m_response_code = 500; \
response_info.m_response_comment = "Internal Server Error"; \
return true; \
@@ -97,9 +108,11 @@
uint64_t ticks1 = misc_utils::get_tick_count(); \
boost::value_initialized<command_type::response> resp;\
MINFO(m_conn_context << "calling " << s_pattern); \
if(!callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), &m_conn_context)) \
bool res = false; \
try { res = callback_f(static_cast<command_type::request&>(req), static_cast<command_type::response&>(resp), &m_conn_context); } \
catch (const std::exception &e) { MERROR(m_conn_context << "Failed to " << #callback_f << "()"); } \
if (!res) \
{ \
MERROR(m_conn_context << "Failed to " << #callback_f << "()"); \
response_info.m_response_code = 500; \
response_info.m_response_comment = "Internal Server Error"; \
return true; \
@@ -184,7 +197,10 @@
fail_resp.jsonrpc = "2.0"; \
fail_resp.id = req.id; \
MINFO(m_conn_context << "Calling RPC method " << method_name); \
if(!callback_f(req.params, resp.result, fail_resp.error, &m_conn_context)) \
bool res = false; \
try { res = callback_f(req.params, resp.result, fail_resp.error, &m_conn_context); } \
catch (const std::exception &e) { MERROR(m_conn_context << "Failed to " << #callback_f << "(): " << e.what()); } \
if (!res) \
{ \
epee::serialization::store_t_to_json(static_cast<epee::json_rpc::error_response&>(fail_resp), response_info.m_body); \
return true; \
@@ -203,7 +219,10 @@
fail_resp.jsonrpc = "2.0"; \
fail_resp.id = req.id; \
MINFO(m_conn_context << "calling RPC method " << method_name); \
if(!callback_f(req.params, resp.result, fail_resp.error, response_info, &m_conn_context)) \
bool res = false; \
try { res = callback_f(req.params, resp.result, fail_resp.error, response_info, &m_conn_context); } \
catch (const std::exception &e) { MERROR(m_conn_context << "Failed to " << #callback_f << "(): " << e.what()); } \
if (!res) \
{ \
epee::serialization::store_t_to_json(static_cast<epee::json_rpc::error_response&>(fail_resp), response_info.m_body); \
return true; \
@@ -217,7 +236,10 @@
{ \
PREPARE_OBJECTS_FROM_JSON(command_type) \
MINFO(m_conn_context << "calling RPC method " << method_name); \
if(!callback_f(req.params, resp.result, &m_conn_context)) \
bool res = false; \
try { res = callback_f(req.params, resp.result, &m_conn_context); } \
catch (const std::exception &e) { MERROR(m_conn_context << "Failed to " << #callback_f << "(): " << e.what()); } \
if (!res) \
{ \
epee::json_rpc::error_response fail_resp = AUTO_VAL_INIT(fail_resp); \
fail_resp.jsonrpc = "2.0"; \

View File

@@ -31,7 +31,7 @@
#include <boost/thread.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include "net/abstract_tcp_server2.h"
#include "http_protocol_handler.h"

View File

@@ -72,7 +72,8 @@ namespace levin
#define LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED 0
#define LEVIN_DEFAULT_MAX_PACKET_SIZE 100000000 //100MB by default
#define LEVIN_INITIAL_MAX_PACKET_SIZE 256*1024 // 256 KiB before handshake
#define LEVIN_DEFAULT_MAX_PACKET_SIZE 100000000 //100MB by default after handshake
#define LEVIN_PACKET_REQUEST 0x00000001
#define LEVIN_PACKET_RESPONSE 0x00000002

View File

@@ -84,7 +84,8 @@ class async_protocol_handler_config
public:
typedef t_connection_context connection_context;
uint64_t m_max_packet_size;
uint64_t m_initial_max_packet_size;
uint64_t m_max_packet_size;
uint64_t m_invoke_timeout;
int invoke(int command, const epee::span<const uint8_t> in_buff, std::string& buff_out, boost::uuids::uuid connection_id);
@@ -105,7 +106,7 @@ public:
size_t get_in_connections_count();
void set_handler(levin_commands_handler<t_connection_context>* handler, void (*destroy)(levin_commands_handler<t_connection_context>*) = NULL);
async_protocol_handler_config():m_pcommands_handler(NULL), m_pcommands_handler_destroy(NULL), m_max_packet_size(LEVIN_DEFAULT_MAX_PACKET_SIZE), m_invoke_timeout(LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED)
async_protocol_handler_config():m_pcommands_handler(NULL), m_pcommands_handler_destroy(NULL), m_initial_max_packet_size(LEVIN_INITIAL_MAX_PACKET_SIZE), m_max_packet_size(LEVIN_DEFAULT_MAX_PACKET_SIZE), m_invoke_timeout(LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED)
{}
~async_protocol_handler_config() { set_handler(NULL, NULL); }
void del_out_connections(size_t count);
@@ -162,6 +163,7 @@ public:
net_utils::i_service_endpoint* m_pservice_endpoint;
config_type& m_config;
t_connection_context& m_connection_context;
std::atomic<uint64_t> m_max_packet_size;
net_utils::buffer m_cache_in_buffer;
stream_state m_state;
@@ -289,7 +291,8 @@ public:
m_current_head(bucket_head2()),
m_pservice_endpoint(psnd_hndlr),
m_config(config),
m_connection_context(conn_context),
m_connection_context(conn_context),
m_max_packet_size(config.m_initial_max_packet_size),
m_cache_in_buffer(4 * 1024),
m_state(stream_state_head)
{
@@ -399,13 +402,14 @@ public:
}
// these should never fail, but do runtime check for safety
CHECK_AND_ASSERT_MES(m_config.m_max_packet_size >= m_cache_in_buffer.size(), false, "Bad m_cache_in_buffer.size()");
CHECK_AND_ASSERT_MES(m_config.m_max_packet_size - m_cache_in_buffer.size() >= m_fragment_buffer.size(), false, "Bad m_cache_in_buffer.size() + m_fragment_buffer.size()");
const uint64_t max_packet_size = m_max_packet_size;
CHECK_AND_ASSERT_MES(max_packet_size >= m_cache_in_buffer.size(), false, "Bad m_cache_in_buffer.size()");
CHECK_AND_ASSERT_MES(max_packet_size - m_cache_in_buffer.size() >= m_fragment_buffer.size(), false, "Bad m_cache_in_buffer.size() + m_fragment_buffer.size()");
// flipped to subtraction; prevent overflow since m_max_packet_size is variable and public
if(cb > m_config.m_max_packet_size - m_cache_in_buffer.size() - m_fragment_buffer.size())
if(cb > max_packet_size - m_cache_in_buffer.size() - m_fragment_buffer.size())
{
MWARNING(m_connection_context << "Maximum packet size exceed!, m_max_packet_size = " << m_config.m_max_packet_size
MWARNING(m_connection_context << "Maximum packet size exceed!, m_max_packet_size = " << max_packet_size
<< ", packet received " << m_cache_in_buffer.size() + cb
<< ", connection will be closed.");
return false;
@@ -430,7 +434,7 @@ public:
//async call scenario
boost::shared_ptr<invoke_response_handler_base> response_handler = m_invoke_response_handlers.front();
response_handler->reset_timer();
MDEBUG(m_connection_context << "LEVIN_PACKET partial msg received. len=" << cb);
MDEBUG(m_connection_context << "LEVIN_PACKET partial msg received. len=" << cb << ", current total " << m_cache_in_buffer.size() << "/" << m_current_head.m_cb << " (" << (100.0f * m_cache_in_buffer.size() / (m_current_head.m_cb ? m_current_head.m_cb : 1)) << "%)");
}
}
break;
@@ -465,6 +469,14 @@ public:
temp = std::move(m_fragment_buffer);
m_fragment_buffer.clear();
std::memcpy(std::addressof(m_current_head), std::addressof(temp[0]), sizeof(bucket_head2));
const size_t max_bytes = m_connection_context.get_max_bytes(m_current_head.m_command);
if(m_current_head.m_cb > std::min<size_t>(max_packet_size, max_bytes))
{
MERROR(m_connection_context << "Maximum packet size exceed!, m_max_packet_size = " << std::min<size_t>(max_packet_size, max_bytes)
<< ", packet header received " << m_current_head.m_cb << ", command " << m_current_head.m_command
<< ", connection will be closed.");
return false;
}
buff_to_invoke = {reinterpret_cast<const uint8_t*>(temp.data()) + sizeof(bucket_head2), temp.size() - sizeof(bucket_head2)};
}
@@ -519,6 +531,10 @@ public:
m_current_head.m_command, buff_to_invoke, return_buff, m_connection_context
);
// peer_id remains unset if dropped
if (m_current_head.m_command == m_connection_context.handshake_command() && m_connection_context.handshake_complete())
m_max_packet_size = m_config.m_max_packet_size;
bucket_head2 head = make_header(m_current_head.m_command, return_buff.size(), LEVIN_PACKET_RESPONSE, false);
head.m_return_code = SWAP32LE(return_code);
return_buff.insert(0, reinterpret_cast<const char*>(&head), sizeof(head));
@@ -577,10 +593,11 @@ public:
m_cache_in_buffer.erase(sizeof(bucket_head2));
m_state = stream_state_body;
m_oponent_protocol_ver = m_current_head.m_protocol_version;
if(m_current_head.m_cb > m_config.m_max_packet_size)
const size_t max_bytes = m_connection_context.get_max_bytes(m_current_head.m_command);
if(m_current_head.m_cb > std::min<size_t>(max_packet_size, max_bytes))
{
LOG_ERROR_CC(m_connection_context, "Maximum packet size exceed!, m_max_packet_size = " << m_config.m_max_packet_size
<< ", packet header received " << m_current_head.m_cb
LOG_ERROR_CC(m_connection_context, "Maximum packet size exceed!, m_max_packet_size = " << std::min<size_t>(max_packet_size, max_bytes)
<< ", packet header received " << m_current_head.m_cb << ", command " << m_current_head.m_command
<< ", connection will be closed.");
return false;
}
@@ -634,6 +651,9 @@ public:
boost::interprocess::ipcdetail::atomic_write32(&m_invoke_buf_ready, 0);
CRITICAL_REGION_BEGIN(m_invoke_response_handlers_lock);
if (command == m_connection_context.handshake_command())
m_max_packet_size = m_config.m_max_packet_size;
if(!send_message(command, in_buff, LEVIN_PACKET_REQUEST, true))
{
LOG_ERROR_CC(m_connection_context, "Failed to do_send");
@@ -675,6 +695,9 @@ public:
boost::interprocess::ipcdetail::atomic_write32(&m_invoke_buf_ready, 0);
if (command == m_connection_context.handshake_command())
m_max_packet_size = m_config.m_max_packet_size;
if (!send_message(command, in_buff, LEVIN_PACKET_REQUEST, true))
{
LOG_ERROR_CC(m_connection_context, "Failed to send request");
@@ -777,36 +800,32 @@ void async_protocol_handler_config<t_connection_context>::del_connection(async_p
template<class t_connection_context>
void async_protocol_handler_config<t_connection_context>::delete_connections(size_t count, bool incoming)
{
std::vector <boost::uuids::uuid> connections;
std::vector<typename connections_map::mapped_type> connections;
auto scope_exit_handler = misc_utils::create_scope_leave_handler([&connections]{
for (auto &aph: connections)
aph->finish_outer_call();
});
CRITICAL_REGION_BEGIN(m_connects_lock);
for (auto& c: m_connects)
{
if (c.second->m_connection_context.m_is_income == incoming)
connections.push_back(c.first);
if (c.second->start_outer_call())
connections.push_back(c.second);
}
// close random connections from the provided set
// TODO or better just keep removing random elements (performance)
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
shuffle(connections.begin(), connections.end(), std::default_random_engine(seed));
while (count > 0 && connections.size() > 0)
{
try
{
auto i = connections.end() - 1;
async_protocol_handler<t_connection_context> *conn = m_connects.at(*i);
del_connection(conn);
conn->close();
connections.erase(i);
}
catch (const std::out_of_range &e)
{
MWARNING("Connection not found in m_connects, continuing");
}
--count;
}
for (size_t i = 0; i < connections.size() && i < count; ++i)
m_connects.erase(connections[i]->get_connection_id());
CRITICAL_REGION_END();
for (size_t i = 0; i < connections.size() && i < count; ++i)
connections[i]->close();
}
//------------------------------------------------------------------------------------------
template<class t_connection_context>
@@ -868,23 +887,35 @@ int async_protocol_handler_config<t_connection_context>::invoke_async(int comman
template<class t_connection_context> template<class callback_t>
bool async_protocol_handler_config<t_connection_context>::foreach_connection(const callback_t &cb)
{
CRITICAL_REGION_LOCAL(m_connects_lock);
for(auto& c: m_connects)
{
async_protocol_handler<t_connection_context>* aph = c.second;
if(!cb(aph->get_context_ref()))
std::vector<typename connections_map::mapped_type> conn;
auto scope_exit_handler = misc_utils::create_scope_leave_handler([&conn]{
for (auto &aph: conn)
aph->finish_outer_call();
});
CRITICAL_REGION_BEGIN(m_connects_lock);
conn.reserve(m_connects.size());
for (auto &e: m_connects)
if (e.second->start_outer_call())
conn.push_back(e.second);
CRITICAL_REGION_END()
for (auto &aph: conn)
if (!cb(aph->get_context_ref()))
return false;
}
return true;
}
//------------------------------------------------------------------------------------------
template<class t_connection_context> template<class callback_t>
bool async_protocol_handler_config<t_connection_context>::for_connection(const boost::uuids::uuid &connection_id, const callback_t &cb)
{
CRITICAL_REGION_LOCAL(m_connects_lock);
async_protocol_handler<t_connection_context>* aph = find_connection(connection_id);
if (!aph)
async_protocol_handler<t_connection_context>* aph = nullptr;
if (find_and_lock_connection(connection_id, aph) != LEVIN_OK)
return false;
auto scope_exit_handler = misc_utils::create_scope_leave_handler(
boost::bind(&async_protocol_handler<t_connection_context>::finish_outer_call, aph));
if(!cb(aph->get_context_ref()))
return false;
return true;
@@ -947,12 +978,14 @@ int async_protocol_handler_config<t_connection_context>::send(byte_slice message
template<class t_connection_context>
bool async_protocol_handler_config<t_connection_context>::close(boost::uuids::uuid connection_id)
{
CRITICAL_REGION_LOCAL(m_connects_lock);
async_protocol_handler<t_connection_context>* aph = find_connection(connection_id);
if (!aph)
async_protocol_handler<t_connection_context>* aph = nullptr;
if (find_and_lock_connection(connection_id, aph) != LEVIN_OK)
return false;
auto scope_exit_handler = misc_utils::create_scope_leave_handler(
boost::bind(&async_protocol_handler<t_connection_context>::finish_outer_call, aph));
if (!aph->close())
return false;
CRITICAL_REGION_LOCAL(m_connects_lock);
m_connects.erase(connection_id);
return true;
}

View File

@@ -28,8 +28,6 @@
#pragma once
#include <string>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/asio/ip/address_v6.hpp>
#include "int-util.h"
// IP addresses are kept in network byte order
@@ -40,30 +38,6 @@ namespace epee
{
namespace net_utils
{
inline
bool is_ipv6_local(const std::string& ip)
{
auto addr = boost::asio::ip::address_v6::from_string(ip);
// ipv6 link-local unicast addresses are fe80::/10
bool is_link_local = addr.is_link_local();
auto addr_bytes = addr.to_bytes();
// ipv6 unique local unicast addresses start with fc00::/7 -- (fcXX or fdXX)
bool is_unique_local_unicast = (addr_bytes[0] == 0xfc || addr_bytes[0] == 0xfd);
return is_link_local || is_unique_local_unicast;
}
inline
bool is_ipv6_loopback(const std::string& ip)
{
// ipv6 loopback is ::1
return boost::asio::ip::address_v6::from_string(ip).is_loopback();
}
inline
bool is_ip_local(uint32_t ip)
{

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2019, The Monero Project
// Copyright (c) 2019-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -178,7 +178,7 @@ namespace net_utils
// SSL Options
if (m_ssl_options.support == epee::net_utils::ssl_support_t::e_ssl_support_enabled || m_ssl_options.support == epee::net_utils::ssl_support_t::e_ssl_support_autodetect)
{
if (!m_ssl_options.handshake(*m_ssl_socket, boost::asio::ssl::stream_base::client, addr, timeout))
if (!m_ssl_options.handshake(*m_ssl_socket, boost::asio::ssl::stream_base::client, {}, addr, timeout))
{
if (m_ssl_options.support == epee::net_utils::ssl_support_t::e_ssl_support_autodetect)
{

View File

@@ -132,6 +132,7 @@ namespace net_utils
bool handshake(
boost::asio::ssl::stream<boost::asio::ip::tcp::socket> &socket,
boost::asio::ssl::stream_base::handshake_type type,
boost::asio::const_buffer buffer = {},
const std::string& host = {},
std::chrono::milliseconds timeout = std::chrono::seconds(15)) const;
};

View File

@@ -236,6 +236,7 @@ namespace net_utils
virtual address_type get_type_id() const = 0;
virtual zone get_zone() const = 0;
virtual bool is_blockable() const = 0;
virtual std::uint16_t port() const = 0;
};
template<typename T>
@@ -266,6 +267,7 @@ namespace net_utils
virtual address_type get_type_id() const override { return value.get_type_id(); }
virtual zone get_zone() const override { return value.get_zone(); }
virtual bool is_blockable() const override { return value.is_blockable(); }
virtual std::uint16_t port() const override { return value.port(); }
};
std::shared_ptr<interface> self;
@@ -312,6 +314,7 @@ namespace net_utils
address_type get_type_id() const { return self ? self->get_type_id() : address_type::invalid; }
zone get_zone() const { return self ? self->get_zone() : zone::invalid; }
bool is_blockable() const { return self ? self->is_blockable() : false; }
std::uint16_t port() const { return self ? self->port() : 0; }
template<typename Type> const Type &as() const { return as_mutable<const Type>(); }
BEGIN_KV_SERIALIZE_MAP()

View File

@@ -2,7 +2,7 @@
/// @author rfree (current maintainer in monero.cc project)
/// @brief implementaion for throttling of connection (count and rate-limit speed etc)
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -2,7 +2,7 @@
/// @author rfree (current maintainer in monero.cc project)
/// @brief interface for throttling of connection (count and rate-limit speed etc)
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//
@@ -44,10 +44,7 @@
#include <boost/shared_ptr.hpp>
#include <atomic>
#include <boost/asio.hpp>
#include <boost/array.hpp>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/interprocess/detail/atomic.hpp>
#include <boost/thread/thread.hpp>
@@ -63,7 +60,6 @@
#include <boost/utility/value_init.hpp>
#include <boost/asio/deadline_timer.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread/thread.hpp>
#include "misc_language.h"
#include "pragma_comp_defs.h"
#include <sstream>

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2019, The Monero Project
// Copyright (c) 2019-2020, The Monero Project
//
// All rights reserved.
//
@@ -34,6 +34,8 @@
#pragma once
#include "misc_language.h"
#include <stdlib.h>
#include <stdint.h>
@@ -139,7 +141,6 @@ public:
rolling_median_t(rolling_median_t &&m)
{
free(data);
memcpy(this, &m, sizeof(rolling_median_t));
m.data = NULL;
}
@@ -226,7 +227,7 @@ public:
Item v = data[heap[0]];
if (minCt < maxCt)
{
v = (v + data[heap[-1]]) / 2;
v = get_mid<Item>(v, data[heap[-1]]);
}
return v;
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2017-2019, The Monero Project
// Copyright (c) 2017-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -1,6 +1,7 @@
#include <math.h>
#include <limits>
#include <algorithm>
#include "misc_language.h"
#include "stats.h"
enum
@@ -86,7 +87,7 @@ Tpod Stats<T, Tpod>::get_median() const
}
else
{
median = (sorted[(sorted.size() - 1) / 2] + sorted[sorted.size() / 2]) / 2;
median = epee::misc_utils::get_mid(sorted[(sorted.size() - 1) / 2], sorted[sorted.size() / 2]);
}
set_cached(bit_median);
}

View File

@@ -97,7 +97,12 @@ namespace epee
return false;
}
return serialization::load_t_from_binary(result_struct, epee::strspan<uint8_t>(pri->m_body));
static const constexpr epee::serialization::portable_storage::limits_t default_http_bin_limits = {
65536 * 3, // objects
65536 * 3, // fields
65536 * 3, // strings
};
return serialization::load_t_from_binary(result_struct, epee::strspan<uint8_t>(pri->m_body), &default_http_bin_limits);
}
template<class t_request, class t_response, class t_transport>

View File

@@ -28,6 +28,7 @@
#include "portable_storage_template_helper.h"
#include <boost/utility/value_init.hpp>
#include <functional>
#include "span.h"
#include "net/levin_base.h"
@@ -49,6 +50,11 @@ namespace
snprintf(buf, sizeof(buf), "command-%u", command);
return on_levin_traffic(context, initiator, sent, error, bytes, buf);
}
static const constexpr epee::serialization::portable_storage::limits_t default_levin_limits = {
8192, // objects
16384, // fields
16384, // strings
};
}
namespace epee
@@ -74,7 +80,7 @@ namespace epee
return false;
}
serialization::portable_storage stg_ret;
if(!stg_ret.load_from_binary(buff_to_recv))
if(!stg_ret.load_from_binary(buff_to_recv, &default_levin_limits))
{
LOG_ERROR("Failed to load_from_binary on command " << command);
return false;
@@ -120,7 +126,7 @@ namespace epee
return false;
}
typename serialization::portable_storage stg_ret;
if(!stg_ret.load_from_binary(buff_to_recv))
if(!stg_ret.load_from_binary(buff_to_recv, &default_levin_limits))
{
on_levin_traffic(context, true, false, true, buff_to_recv.size(), command);
LOG_ERROR("Failed to load_from_binary on command " << command);
@@ -151,7 +157,7 @@ namespace epee
return false;
}
serialization::portable_storage stg_ret;
if(!stg_ret.load_from_binary(buff))
if(!stg_ret.load_from_binary(buff, &default_levin_limits))
{
on_levin_traffic(context, true, false, true, buff.size(), command);
LOG_ERROR("Failed to load_from_binary on command " << command);
@@ -201,7 +207,7 @@ namespace epee
int buff_to_t_adapter(int command, const epee::span<const uint8_t> in_buff, std::string& buff_out, callback_t cb, t_context& context )
{
serialization::portable_storage strg;
if(!strg.load_from_binary(in_buff))
if(!strg.load_from_binary(in_buff, &default_levin_limits))
{
on_levin_traffic(context, false, false, true, in_buff.size(), command);
LOG_ERROR("Failed to load_from_binary in command " << command);
@@ -235,7 +241,7 @@ namespace epee
int buff_to_t_adapter(t_owner* powner, int command, const epee::span<const uint8_t> in_buff, callback_t cb, t_context& context)
{
serialization::portable_storage strg;
if(!strg.load_from_binary(in_buff))
if(!strg.load_from_binary(in_buff, &default_levin_limits))
{
on_levin_traffic(context, false, false, true, in_buff.size(), command);
LOG_ERROR("Failed to load_from_binary in notify " << command);
@@ -290,24 +296,25 @@ namespace epee
#define BEGIN_INVOKE_MAP2(owner_type) \
template <class t_context> int handle_invoke_map(bool is_notify, int command, const epee::span<const uint8_t> in_buff, std::string& buff_out, t_context& context, bool& handled) \
{ \
try { \
typedef owner_type internal_owner_type_name;
#define HANDLE_INVOKE2(command_id, func, type_name_in, typename_out) \
if(!is_notify && command_id == command) \
{handled=true;return epee::net_utils::buff_to_t_adapter<internal_owner_type_name, type_name_in, typename_out>(this, command, in_buff, buff_out, boost::bind(func, this, _1, _2, _3, _4), context);}
{handled=true;return epee::net_utils::buff_to_t_adapter<internal_owner_type_name, type_name_in, typename_out>(this, command, in_buff, buff_out, std::bind(func, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), context);}
#define HANDLE_INVOKE_T2(COMMAND, func) \
if(!is_notify && COMMAND::ID == command) \
{handled=true;return epee::net_utils::buff_to_t_adapter<internal_owner_type_name, typename COMMAND::request, typename COMMAND::response>(command, in_buff, buff_out, boost::bind(func, this, _1, _2, _3, _4), context);}
{handled=true;return epee::net_utils::buff_to_t_adapter<internal_owner_type_name, typename COMMAND::request, typename COMMAND::response>(command, in_buff, buff_out, std::bind(func, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4), context);}
#define HANDLE_NOTIFY2(command_id, func, type_name_in) \
if(is_notify && command_id == command) \
{handled=true;return epee::net_utils::buff_to_t_adapter<internal_owner_type_name, type_name_in>(this, command, in_buff, boost::bind(func, this, _1, _2, _3), context);}
{handled=true;return epee::net_utils::buff_to_t_adapter<internal_owner_type_name, type_name_in>(this, command, in_buff, std::bind(func, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), context);}
#define HANDLE_NOTIFY_T2(NOTIFY, func) \
if(is_notify && NOTIFY::ID == command) \
{handled=true;return epee::net_utils::buff_to_t_adapter<internal_owner_type_name, typename NOTIFY::request>(this, command, in_buff, boost::bind(func, this, _1, _2, _3), context);}
{handled=true;return epee::net_utils::buff_to_t_adapter<internal_owner_type_name, typename NOTIFY::request>(this, command, in_buff, std::bind(func, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3), context);}
#define CHAIN_INVOKE_MAP2(func) \
@@ -335,7 +342,13 @@ namespace epee
LOG_ERROR("Unknown command:" << command); \
on_levin_traffic(context, false, false, true, in_buff.size(), "invalid-command"); \
return LEVIN_ERROR_CONNECTION_HANDLER_NOT_DEFINED; \
} \
catch (const std::exception &e) { \
MERROR("Error in handle_invoke_map: " << e.what()); \
return LEVIN_ERROR_CONNECTION_TIMEDOUT; /* seems kinda appropriate */ \
} \
}
}
}

View File

@@ -196,7 +196,7 @@ namespace misc_utils
uint32_t dst = 0;
for (int i = 0; i < 4; ++i)
{
const unsigned char tmp = isx[(int)*++it];
const unsigned char tmp = isx[(unsigned char)*++it];
CHECK_AND_ASSERT_THROW_MES(tmp != 0xff, "Bad Unicode encoding");
dst = dst << 4 | tmp;
}

View File

@@ -40,6 +40,8 @@
#include "span.h"
#include "int-util.h"
#include <boost/mpl/contains.hpp>
namespace epee
{
namespace serialization
@@ -54,6 +56,13 @@ namespace epee
typedef epee::serialization::harray harray;
typedef storage_entry meta_entry;
struct limits_t
{
size_t n_objects;
size_t n_fields;
size_t n_strings; // not counting field names
};
portable_storage(){}
virtual ~portable_storage(){}
hsection open_section(const std::string& section_name, hsection hparent_section, bool create_if_notexist = false);
@@ -84,8 +93,8 @@ namespace epee
//-------------------------------------------------------------------------------
bool store_to_binary(binarybuffer& target);
bool load_from_binary(const epee::span<const uint8_t> target);
bool load_from_binary(const std::string& target) { return load_from_binary(epee::strspan<uint8_t>(target)); }
bool load_from_binary(const epee::span<const uint8_t> target, const limits_t *limits = NULL);
bool load_from_binary(const std::string& target, const limits_t *limits = NULL) { return load_from_binary(epee::strspan<uint8_t>(target), limits); }
template<class trace_policy>
bool dump_as_xml(std::string& targetObj, const std::string& root_name = "");
bool dump_as_json(std::string& targetObj, size_t indent = 0, bool insert_newlines = true);
@@ -150,7 +159,7 @@ namespace epee
CATCH_ENTRY("portable_storage::store_to_binary", false)
}
inline
bool portable_storage::load_from_binary(const epee::span<const uint8_t> source)
bool portable_storage::load_from_binary(const epee::span<const uint8_t> source, const limits_t *limits)
{
m_root.m_entries.clear();
if(source.size() < sizeof(storage_block_header))
@@ -173,6 +182,8 @@ namespace epee
}
TRY_ENTRY();
throwable_buffer_reader buf_reader(source.data()+sizeof(storage_block_header), source.size()-sizeof(storage_block_header));
if (limits)
buf_reader.set_limits(limits->n_objects, limits->n_fields, limits->n_strings);
buf_reader.read(m_root);
return true;//TODO:
CATCH_ENTRY("portable_storage::load_from_binary", false);
@@ -282,6 +293,7 @@ namespace epee
static_assert(std::is_rvalue_reference<entry_type&&>(), "unexpected copy of value");
TRY_ENTRY();
CHECK_AND_ASSERT(psection, nullptr);
CHECK_AND_ASSERT(!pentry_name.empty(), nullptr);
auto ins_res = psection->m_entries.emplace(pentry_name, std::forward<entry_type>(entry));
return &ins_res.first->second;
CATCH_ENTRY("portable_storage::insert_new_entry_get_storage_entry", nullptr);

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2019, The Monero Project
// Copyright (c) 2019-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -42,6 +42,24 @@ namespace epee
{
namespace serialization
{
template<typename T>
struct ps_min_bytes {
static constexpr const size_t strict = 4096; // actual low bound
};
template<> struct ps_min_bytes<uint64_t> { static constexpr const size_t strict = 8; };
template<> struct ps_min_bytes<int64_t> { static constexpr const size_t strict = 8; };
template<> struct ps_min_bytes<uint32_t> { static constexpr const size_t strict = 4; };
template<> struct ps_min_bytes<int32_t> { static constexpr const size_t strict = 4; };
template<> struct ps_min_bytes<uint16_t> { static constexpr const size_t strict = 2; };
template<> struct ps_min_bytes<int16_t> { static constexpr const size_t strict = 2; };
template<> struct ps_min_bytes<uint8_t> { static constexpr const size_t strict = 1; };
template<> struct ps_min_bytes<int8_t> { static constexpr const size_t strict = 1; };
template<> struct ps_min_bytes<double> { static constexpr const size_t strict = 8; };
template<> struct ps_min_bytes<bool> { static constexpr const size_t strict = 1; };
template<> struct ps_min_bytes<std::string> { static constexpr const size_t strict = 2; };
template<> struct ps_min_bytes<section> { static constexpr const size_t strict = 1; };
template<> struct ps_min_bytes<array_entry> { static constexpr const size_t strict = 1; };
struct throwable_buffer_reader
{
throwable_buffer_reader(const void* ptr, size_t sz);
@@ -61,6 +79,9 @@ namespace epee
void read(section& sec);
void read(std::string& str);
void read(array_entry &ae);
template<class t_type>
size_t min_bytes() const;
void set_limits(size_t objects, size_t fields, size_t strings);
private:
struct recursuion_limitation_guard
{
@@ -81,6 +102,13 @@ namespace epee
const uint8_t* m_ptr;
size_t m_count;
size_t m_recursion_count;
size_t m_objects;
size_t m_fields;
size_t m_strings;
size_t max_objects;
size_t max_fields;
size_t max_strings;
};
inline throwable_buffer_reader::throwable_buffer_reader(const void* ptr, size_t sz)
@@ -92,6 +120,12 @@ namespace epee
m_ptr = (uint8_t*)ptr;
m_count = sz;
m_recursion_count = 0;
m_objects = 0;
m_fields = 0;
m_strings = 0;
max_objects = std::numeric_limits<size_t>::max();
max_fields = std::numeric_limits<size_t>::max();
max_strings = std::numeric_limits<size_t>::max();
}
inline
void throwable_buffer_reader::read(void* target, size_t count)
@@ -108,6 +142,7 @@ namespace epee
RECURSION_LIMITATION();
uint8_t name_len = 0;
read(name_len);
CHECK_AND_ASSERT_THROW_MES(name_len > 0, "Section name is missing");
sce_name.resize(name_len);
read((void*)sce_name.data(), name_len);
}
@@ -138,7 +173,18 @@ namespace epee
//for pod types
array_entry_t<type_name> sa;
size_t size = read_varint();
CHECK_AND_ASSERT_THROW_MES(size <= m_count, "Size sanity check failed");
CHECK_AND_ASSERT_THROW_MES(size <= m_count / ps_min_bytes<type_name>::strict, "Size sanity check failed");
if (std::is_same<type_name, section>())
{
CHECK_AND_ASSERT_THROW_MES(size <= max_objects - m_objects, "Too many objects");
m_objects += size;
}
else if (std::is_same<type_name, std::string>())
{
CHECK_AND_ASSERT_THROW_MES(size <= max_strings - m_strings, "Too many strings");
m_strings += size;
}
sa.reserve(size);
//TODO: add some optimization here later
while(size--)
@@ -204,6 +250,8 @@ namespace epee
inline storage_entry throwable_buffer_reader::read_se<std::string>()
{
RECURSION_LIMITATION();
CHECK_AND_ASSERT_THROW_MES(m_strings + 1 <= max_strings, "Too many strings");
m_strings += 1;
return storage_entry(read<std::string>());
}
@@ -212,6 +260,8 @@ namespace epee
inline storage_entry throwable_buffer_reader::read_se<section>()
{
RECURSION_LIMITATION();
CHECK_AND_ASSERT_THROW_MES(m_objects < max_objects, "Too many objects");
++m_objects;
section s;//use extra variable due to vs bug, line "storage_entry se(section()); " can't be compiled in visual studio
storage_entry se(std::move(s));
section& section_entry = boost::get<section>(se);
@@ -263,12 +313,16 @@ namespace epee
RECURSION_LIMITATION();
sec.m_entries.clear();
size_t count = read_varint();
CHECK_AND_ASSERT_THROW_MES(count <= max_fields - m_fields, "Too many object fields");
m_fields += count;
while(count--)
{
//read section name string
std::string sec_name;
read_sec_name(sec_name);
sec.m_entries.emplace(std::move(sec_name), load_storage_entry());
const auto insert_loc = sec.m_entries.lower_bound(sec_name);
CHECK_AND_ASSERT_THROW_MES(insert_loc == sec.m_entries.end() || insert_loc->first != sec_name, "duplicate key: " << sec_name);
sec.m_entries.emplace_hint(insert_loc, std::move(sec_name), load_storage_entry());
}
}
inline
@@ -289,5 +343,12 @@ namespace epee
RECURSION_LIMITATION();
CHECK_AND_ASSERT_THROW_MES(false, "Reading array entry is not supported");
}
inline
void throwable_buffer_reader::set_limits(size_t objects, size_t fields, size_t strings)
{
max_objects = objects;
max_fields = fields;
max_strings = strings;
}
}
}

View File

@@ -84,10 +84,10 @@ namespace epee
}
//-----------------------------------------------------------------------------------------------------------
template<class t_struct>
bool load_t_from_binary(t_struct& out, const epee::span<const uint8_t> binary_buff)
bool load_t_from_binary(t_struct& out, const epee::span<const uint8_t> binary_buff, const epee::serialization::portable_storage::limits_t *limits = NULL)
{
portable_storage ps;
bool rs = ps.load_from_binary(binary_buff);
bool rs = ps.load_from_binary(binary_buff, limits);
if(!rs)
return false;

View File

@@ -211,6 +211,7 @@ namespace epee
for(const section_pair& se: sec.m_entries)
{
CHECK_AND_ASSERT_THROW_MES(se.first.size() < std::numeric_limits<uint8_t>::max(), "storage_entry_name is too long: " << se.first.size() << ", val: " << se.first);
CHECK_AND_ASSERT_THROW_MES(!se.first.empty(), "storage_entry_name is empty");
uint8_t len = static_cast<uint8_t>(se.first.size());
strm.write((const char*)&len, sizeof(len));
strm.write(se.first.data(), size_t(len));

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2017-2019, The Monero Project
// Copyright (c) 2017-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2014-2019, The Monero Project
# Copyright (c) 2014-2020, The Monero Project
#
# All rights reserved.
#
@@ -27,7 +27,7 @@
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
add_library(epee STATIC byte_slice.cpp byte_stream.cpp hex.cpp abstract_http_client.cpp http_auth.cpp mlog.cpp net_helper.cpp net_utils_base.cpp string_tools.cpp
add_library(epee byte_slice.cpp byte_stream.cpp hex.cpp abstract_http_client.cpp http_auth.cpp mlog.cpp net_helper.cpp net_utils_base.cpp string_tools.cpp
wipeable_string.cpp levin_base.cpp memwipe.c connection_basic.cpp network_throttle.cpp network_throttle-detail.cpp mlocker.cpp buffer.cpp net_ssl.cpp
int-util.cpp)
@@ -35,9 +35,7 @@ if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW)))
add_library(epee_readline STATIC readline_buffer.cpp)
endif()
if(HAVE_C11)
SET_PROPERTY(SOURCE memwipe.c PROPERTY COMPILE_FLAGS -std=c11)
endif()
set_property(SOURCE memwipe.c PROPERTY C_STANDARD 11)
# Build and install libepee if we're building for GUI
if (BUILD_GUI_DEPS)
@@ -60,14 +58,23 @@ target_link_libraries(epee
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
PRIVATE
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${OPENSSL_LIBRARIES}
PRIVATE
${EXTRA_LIBRARIES})
if (USE_READLINE AND (GNU_READLINE_FOUND OR (DEPENDS AND NOT MINGW)))
target_link_libraries(epee_readline
PUBLIC
easylogging
${Boost_SYSTEM_LIBRARY}
PRIVATE
${GNU_READLINE_LIBRARY})
endif()
target_include_directories(epee
PUBLIC
"${EPEE_INCLUDE_DIR_BASE}"
"${OPENSSL_INCLUDE_DIR}")

View File

@@ -137,6 +137,11 @@ namespace http
set_server(std::move(parsed.host), std::to_string(parsed.port), std::move(user), std::move(ssl_options));
return true;
}
bool epee::net_utils::http::abstract_http_client::set_proxy(const std::string& address)
{
return false;
}
}
}
}

View File

@@ -26,6 +26,7 @@
// 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.
#include <limits>
#include <string.h>
#include "net/buffer.h"

View File

@@ -133,10 +133,13 @@ namespace epee
template<typename T>
byte_slice::byte_slice(const adapt_buffer, T&& buffer)
: storage_(nullptr), portion_(to_byte_span(to_span(buffer)))
: storage_(nullptr), portion_(nullptr)
{
if (!buffer.empty())
{
storage_ = allocate_slice<adapted_byte_slice<T>>(0, std::move(buffer));
portion_ = to_byte_span(to_span(static_cast<adapted_byte_slice<T> *>(storage_.get())->buffer));
}
}
byte_slice::byte_slice(std::initializer_list<span<const std::uint8_t>> sources)
@@ -173,9 +176,14 @@ namespace epee
byte_slice::byte_slice(byte_stream&& stream) noexcept
: storage_(nullptr), portion_(stream.data(), stream.size())
{
std::uint8_t* const data = stream.take_buffer().release() - sizeof(raw_byte_slice);
new (data) raw_byte_slice{};
storage_.reset(reinterpret_cast<raw_byte_slice*>(data));
if (stream.size())
{
std::uint8_t* const data = stream.take_buffer().release() - sizeof(raw_byte_slice);
new (data) raw_byte_slice{};
storage_.reset(reinterpret_cast<raw_byte_slice*>(data));
}
else
portion_ = nullptr;
}
byte_slice::byte_slice(byte_slice&& source) noexcept
@@ -205,14 +213,17 @@ namespace epee
byte_slice byte_slice::take_slice(const std::size_t max_bytes) noexcept
{
byte_slice out{};
std::uint8_t const* const ptr = data();
out.portion_ = {ptr, portion_.remove_prefix(max_bytes)};
if (portion_.empty())
out.storage_ = std::move(storage_); // no atomic inc/dec
else
out = {storage_.get(), out.portion_};
if (max_bytes)
{
std::uint8_t const* const ptr = data();
out.portion_ = {ptr, portion_.remove_prefix(max_bytes)};
if (portion_.empty())
out.storage_ = std::move(storage_); // no atomic inc/dec
else
out = {storage_.get(), out.portion_};
}
return out;
}

View File

@@ -2,7 +2,7 @@
/// @author rfree (current maintainer in monero.cc project)
/// @brief base for connection, contains e.g. the ratelimit hooks
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2014-2019, The Monero Project
// Copyright (c) 2014-2020, The Monero Project
//
// All rights reserved.
//
@@ -209,12 +209,7 @@ namespace
}
template<typename T>
using quoted_result = boost::joined_range<
const boost::joined_range<const boost::string_ref, const T>, const boost::string_ref
>;
template<typename T>
quoted_result<T> quoted(const T& arg)
auto quoted_(const T& arg) // avoid ADL selecting C++14 std::quoted
{
return boost::range::join(boost::range::join(ceref(u8"\""), arg), ceref(u8"\""));
}
@@ -242,13 +237,13 @@ namespace
{
str.append(u8"Digest ");
add_first_field(str, u8"algorithm", algorithm);
add_field(str, u8"nonce", quoted(user.server.nonce));
add_field(str, u8"realm", quoted(user.server.realm));
add_field(str, u8"response", quoted(response));
add_field(str, u8"uri", quoted(uri));
add_field(str, u8"username", quoted(user.credentials.username));
add_field(str, u8"nonce", quoted_(user.server.nonce));
add_field(str, u8"realm", quoted_(user.server.realm));
add_field(str, u8"response", quoted_(response));
add_field(str, u8"uri", quoted_(uri));
add_field(str, u8"username", quoted_(user.credentials.username));
if (!user.server.opaque.empty())
add_field(str, u8"opaque", quoted(user.server.opaque));
add_field(str, u8"opaque", quoted_(user.server.opaque));
}
//! Implements superseded algorithm specified in RFC 2069
@@ -674,8 +669,8 @@ namespace
Digest::name, (i == 0 ? boost::string_ref{} : sess_algo)
);
add_field(out, u8"algorithm", algorithm);
add_field(out, u8"realm", quoted(auth_realm));
add_field(out, u8"nonce", quoted(nonce));
add_field(out, u8"realm", quoted_(auth_realm));
add_field(out, u8"nonce", quoted_(nonce));
add_field(out, u8"stale", is_stale ? ceref("true") : ceref("false"));
fields.push_back(std::make_pair(std::string(server_auth_field), std::move(out)));

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