Commit Graph

5531 Commits

Author SHA1 Message Date
Martijn Otto
057c279cb4
epee: add SSL support
RPC connections now have optional tranparent SSL.

An optional private key and certificate file can be passed,
using the --{rpc,daemon}-ssl-private-key and
--{rpc,daemon}-ssl-certificate options. Those have as
argument a path to a PEM format private private key and
certificate, respectively.
If not given, a temporary self signed certificate will be used.

SSL can be enabled or disabled using --{rpc}-ssl, which
accepts autodetect (default), disabled or enabled.

Access can be restricted to particular certificates using the
--rpc-ssl-allowed-certificates, which takes a list of
paths to PEM encoded certificates. This can allow a wallet to
connect to only the daemon they think they're connected to,
by forcing SSL and listing the paths to the known good
certificates.

To generate long term certificates:

openssl genrsa -out /tmp/KEY 4096
openssl req -new -key /tmp/KEY -out /tmp/REQ
openssl x509 -req -days 999999 -sha256 -in /tmp/REQ -signkey /tmp/KEY -out /tmp/CERT

/tmp/KEY is the private key, and /tmp/CERT is the certificate,
both in PEM format. /tmp/REQ can be removed. Adjust the last
command to set expiration date, etc, as needed. It doesn't
make a whole lot of sense for monero anyway, since most servers
will run with one time temporary self signed certificates anyway.

SSL support is transparent, so all communication is done on the
existing ports, with SSL autodetection. This means you can start
using an SSL daemon now, but you should not enforce SSL yet or
nothing will talk to you.
2019-03-05 14:16:08 +01:00
Dusan Klinec
5ea17909ca
device/trezor: debugging features, trezor tests 2019-03-05 14:02:45 +01:00
Riccardo Spagni
e65221d690
Merge pull request #5119
f024a10b db_lmdb: make mdb_block_info format conversion more future proof (moneromooo-monero)
2019-03-05 14:12:24 +02:00
Riccardo Spagni
5b9c3df5c1
Merge pull request #5103
ceb72be3 p2p: avoid busy loop when we have nothing to connect to (moneromooo-monero)
2019-03-05 14:09:42 +02:00
Riccardo Spagni
ed6aa76cca
Merge pull request #5100
c4851024 wallet_rpc_server: avoid repeated string allocations when parsing (moneromooo-monero)
88c85c18 cryptonote: avoid double parsing blocks when syncing (moneromooo-monero)
9feda0ee cryptonote: speed up calculating coinbase tx prunable hash (moneromooo-monero)
238401d4 core: avoid double parsing blocks after hoh (moneromooo-monero)
dc5a7609 blockchain: avoid unneeded block copy (moneromooo-monero)
79b4e9f3 save some database calls when getting top block hash and height (moneromooo-monero)
98278808 blockchain: avoid pointless transaction copy and temporary (moneromooo-monero)
07d655e4 blockchain: avoid duplicate block hash computation (moneromooo-monero)
f75d51ab core: avoid calculating tx prefix hash when we don't need it (moneromooo-monero)
b044d03a Avoid repeated (de)serialization when syncing (moneromooo-monero)
b747e836 wallet2: don't calculate prefix hash when we don't need it (moneromooo-monero)
e69477bf db: speedup block addition (moneromooo-monero)
2019-03-05 14:09:19 +02:00
moneromooo-monero
f024a10b68
db_lmdb: make mdb_block_info format conversion more future proof
If mdb_block_info changes again, the v2 to v3 conversion would
convert to an incorrect format.
2019-03-05 12:06:23 +00:00
moneromooo-monero
ceb72be329
p2p: avoid busy loop when we have nothing to connect to 2019-03-05 12:00:45 +00:00
moneromooo-monero
c4851024ce
wallet_rpc_server: avoid repeated string allocations when parsing 2019-03-05 11:58:22 +00:00
moneromooo-monero
88c85c18e0
cryptonote: avoid double parsing blocks when syncing 2019-03-05 11:58:18 +00:00
moneromooo-monero
9feda0eeba
cryptonote: speed up calculating coinbase tx prunable hash
It's a hash of an empty buffer, so we can avoid keccak
2019-03-05 11:58:16 +00:00
moneromooo-monero
238401d4e9
core: avoid double parsing blocks after hoh 2019-03-05 11:58:13 +00:00
moneromooo-monero
dc5a76095c
blockchain: avoid unneeded block copy 2019-03-05 11:58:10 +00:00
moneromooo-monero
79b4e9f377
save some database calls when getting top block hash and height 2019-03-05 11:58:05 +00:00
moneromooo-monero
9827880877
blockchain: avoid pointless transaction copy and temporary 2019-03-05 11:58:02 +00:00
moneromooo-monero
07d655e438
blockchain: avoid duplicate block hash computation 2019-03-05 11:58:00 +00:00
moneromooo-monero
f75d51abda
core: avoid calculating tx prefix hash when we don't need it 2019-03-05 11:57:57 +00:00
moneromooo-monero
b044d03a51
Avoid repeated (de)serialization when syncing 2019-03-05 11:57:55 +00:00
Riccardo Spagni
082149c580
fix merge errors, update recommended version to 0.14.0.2 2019-03-05 13:46:35 +02:00
Riccardo Spagni
f3b368c659
update checkpoints hash 2019-03-05 13:06:36 +02:00
Riccardo Spagni
e518f2b1c0
update checkpoints, update README for 0.14.1 release 2019-03-05 13:05:41 +02:00
moneromooo-monero
b747e836c8
wallet2: don't calculate prefix hash when we don't need it 2019-03-05 10:28:55 +00:00
moneromooo-monero
e69477bf25
db: speedup block addition
by avoiding repeated (de)serialization
2019-03-05 10:28:52 +00:00
moneromooo-monero
108c625b3f
CryptonightR: define out i386/x86_64 specific code on other archs 2019-03-05 10:24:24 +00:00
moneromooo-monero
1b8757dddc
slow-hash: fix build on arm 2019-03-05 10:24:24 +00:00
moneromooo-monero
23abe60705
check load_t_from_json return values 2019-03-04 22:38:06 +00:00
moneromooo-monero
e396146aee
default initialize rpc structures 2019-03-04 22:38:03 +00:00
moneromooo-monero
ef93b0995c
various: remove unused variables 2019-03-04 22:24:49 +00:00
Riccardo Spagni
2f7108f9d7
Merge pull request #5156
3d2772a0 wallet-rpc: get balance for all accounts and subaddresses (stoffu)
2019-03-04 21:33:07 +02:00
Riccardo Spagni
6984a4d69c
Merge pull request #5154
8a1ff079 wallet-rpc: get transfers for all accounts and subaddresses (Jethro Grassie)
2019-03-04 21:32:42 +02:00
Riccardo Spagni
5260111631
Merge pull request #5146
4a9257b4 Support docker for gitian builds (TheCharlatan)
2019-03-04 21:32:30 +02:00
Riccardo Spagni
8e3bd389ea
Merge pull request #5143
1f5680c8 simplewallet: add help for ask-password options (moneromooo-monero)
c7c74caf simplewallet: mark confirm-missing-payment-id as obsolete (moneromooo-monero)
2019-03-04 21:31:33 +02:00
Riccardo Spagni
27db0e3bb9
Merge pull request #5141
5c81a9f1 wallet_rpc_server: add a validate_address RPC (moneromooo-monero)
2019-03-04 21:30:45 +02:00
Riccardo Spagni
5ab6d68a40
Merge pull request #5140
a3973fc9 debug compilation fix: net lib missing common deps (Dusan Klinec)
2019-03-04 21:30:14 +02:00
Riccardo Spagni
66014706bb
Merge pull request #5131
d2c95ab9 Don't decrypt keys in view only wallets in wallet_keys_unlocker (Doyle)
2019-03-04 21:28:09 +02:00
Riccardo Spagni
42adc50766
Merge pull request #5125
8298f42e miner: it can now autodetect the optimal number of threads (moneromooo-monero)
2019-03-04 21:27:16 +02:00
Riccardo Spagni
372c0da086
Merge pull request #5111
6a3608d3 cryptonote_protocol_handler: pad tx messages when using tor/i2p (moneromooo-monero)
2019-03-04 21:24:32 +02:00
Riccardo Spagni
196022530b
Merge pull request #5108
1c9d5285 blockchain_prune: don't prune before v10 (moneromooo-monero)
2019-03-04 21:24:09 +02:00
Riccardo Spagni
a28237c9ca
Merge pull request #5102
1eef0565 performance_tests: better stats, and keep track of timing history (moneromooo-monero)
2019-03-04 21:22:51 +02:00
Riccardo Spagni
e1a177f0da
Merge pull request #5092
eec79276 blockchain: fix default genesis block timestamp (moneromooo-monero)
2019-03-04 21:21:08 +02:00
Riccardo Spagni
4466f4504e
Merge pull request #5091
123fc2a2 i2p: initial support (Jethro Grassie)
2019-03-04 21:20:34 +02:00
Riccardo Spagni
b0d326bf2a
Merge pull request #5084
9d58749b wallet2: fix hashchain going out of sync on refresh error (moneromooo-monero)
2019-03-04 21:19:12 +02:00
Riccardo Spagni
9d415495bf
Merge pull request #5082
1bc5f9fa bulletproofs: speed up vector_power_sum (moneromooo-monero)
2019-03-04 21:18:53 +02:00
Riccardo Spagni
11daa98c0a
Merge pull request #5081
d78addcb db_lmdb: don't unnecessarily cast to double on the way to uint64_t (moneromooo-monero)
2019-03-04 21:18:24 +02:00
Riccardo Spagni
46fd181cca
Merge pull request #4054
24569454 epee: add SSL support (moneromooo-monero)
2019-03-04 21:17:21 +02:00
Riccardo Spagni
9547e3f451
Merge pull request #5224
807903bb hardfork: fix fork determination for historical heights (moneromooo)
2019-03-04 17:17:34 +02:00
Riccardo Spagni
de6d6c0e29
Merge pull request #5217
fa2fbc39 wallet2: fix mishandling rct outputs in coinbase tx (moneromooo-monero)
2019-03-04 17:15:06 +02:00
moneromooo-monero
5f67e7f547
blockchain: forbid older BP rct versions from v11 2019-03-04 15:08:12 +00:00
Riccardo Spagni
09020235bf
Merge pull request #5175
85088d9f db_lmdb: fix missing mdb_dbi_close in migration (moneromooo-monero)
2019-03-04 17:06:58 +02:00
Riccardo Spagni
815c8a48ab
Merge pull request #5174
0de14396 tests: add a CNv4 JIT test (moneromooo-monero)
24d281c3 crypto: plug CNv4 JIT into cn_slow_hash (moneromooo-monero)
78ab59ea crypto: clear cache after generating random program (moneromooo-monero)
b9a61884 performance_tests: add tests for new Cryptonight variants (moneromooo-monero)
fff23bf7 CNv4 JIT compiler for x86-64 and tests (SChernykh)
3dde67d8 blockchain: add v10 fork heights (moneromooo-monero)
2019-03-04 17:06:37 +02:00
Riccardo Spagni
8c53ac2dd1
Merge pull request #5132
2dbc487e Add support for V10 protocol with BulletProofV2 and short amount. (cslashm)
63cc02c0 Fix dummy decryption in debug mode (cslashm)
f0e55ceb fix log namespace (cslashm)
460da140 New scheme key destination contrfol (cslashm)
2019-03-04 14:58:45 +02:00
moneromooo-monero
0de14396b9
tests: add a CNv4 JIT test 2019-03-04 11:56:55 +00:00
moneromooo-monero
24d281c324
crypto: plug CNv4 JIT into cn_slow_hash
Enabled by setting the MONERO_USE_CNV4_JIT env var to 1
2019-03-04 11:56:55 +00:00
moneromooo-monero
78ab59ea44
crypto: clear cache after generating random program 2019-03-04 11:56:46 +00:00
SChernykh
fff23bf7c6
CNv4 JIT compiler for x86-64 and tests
Minimalistic JIT code generator for random math sequence in CryptonightR.

Usage:
- Allocate writable and executable memory
- Call v4_generate_JIT_code with "buf" pointed to memory allocated on the previous step
- Call the generated code instead of "v4_random_math(code, r)", omit the "code" parameter
2019-03-04 11:56:29 +00:00
moneromooo-monero
3dde67d82d
blockchain: add v10 fork heights 2019-03-04 11:56:22 +00:00
moneromooo-monero
a17da7202b
Print the reason why a notification spec failed to parse 2019-03-04 11:48:46 +00:00
moneromooo-monero
356d813799
blockchain: include number of discarded blocks in --reorg-notify 2019-03-04 11:48:44 +00:00
moneromooo-monero
4d598e3d4d
core: add a few more block rate window sizes
The 10 minute one will never trigger for 0 blocks, as it's still
fairly likely to happen even without the actual hash rate changing
much, so we add a 20 minute window, where it will (for 0 blocks)
and a one hour window.
2019-03-04 11:48:42 +00:00
moneromooo-monero
d4fb9641e0
core: add --block-rate-notify
This runs a command whenever the block rate deviates too much
from the expectation
2019-03-04 11:48:39 +00:00
moneromooo-monero
28b6dbf263
notify: fix tokenizing being too strict 2019-03-04 11:48:36 +00:00
moneromooo
807903bbbf
hardfork: fix fork determination for historical heights 2019-03-04 11:19:59 +00:00
Riccardo Spagni
1b4fa00d7c
Merge pull request #5126
f1fb06b1 Fixed path to int-util.h (SChernykh)
9da0892b Adding cnv4-2 tweaks (SChernykh)
f51397b3 Cryptonight variant 4 aka CryptonightR (SChernykh)
2019-03-04 12:10:16 +02:00
Riccardo Spagni
55305559c1
Merge pull request #5124
b8787f43 ArticMine's new block weight algorithm (moneromooo-monero)
2019-03-04 12:09:13 +02:00
Riccardo Spagni
35e0bf2e06
Merge pull request #5122
52964501 ringct: fix v1 ecdhInfo serialization (moneromooo-monero)
2019-03-04 12:08:26 +02:00
Riccardo Spagni
4f06639d63
Merge pull request #5120
45b7df70 wallet_rpc_server: remove detached short payment ids support (moneromooo-monero)
2019-03-04 12:07:40 +02:00
Riccardo Spagni
e62ae67d16
Merge pull request #5118
49b2a48a simplewallet: tell the user to complain to the recipient (moneromooo-monero)
2019-03-04 12:07:02 +02:00
moneromooo-monero
b8787f4302
ArticMine's new block weight algorithm
This curbs runaway growth while still allowing substantial
spikes in block weight

Original specification from ArticMine:

here is the scaling proposal
Define: LongTermBlockWeight
Before fork:
LongTermBlockWeight = BlockWeight
At or after fork:
LongTermBlockWeight = min(BlockWeight, 1.4*LongTermEffectiveMedianBlockWeight)
Note: To avoid possible consensus issues over rounding the LongTermBlockWeight for a given block should be calculated to the nearest byte, and stored as a integer in the block itself. The stored LongTermBlockWeight is then used for future calculations of the LongTermEffectiveMedianBlockWeight and not recalculated each time.
Define:   LongTermEffectiveMedianBlockWeight
LongTermEffectiveMedianBlockWeight = max(300000, MedianOverPrevious100000Blocks(LongTermBlockWeight))
Change Definition of EffectiveMedianBlockWeight
From (current definition)
EffectiveMedianBlockWeight  = max(300000, MedianOverPrevious100Blocks(BlockWeight))
To (proposed definition)
EffectiveMedianBlockWeight  = min(max(300000, MedianOverPrevious100Blocks(BlockWeight)), 50*LongTermEffectiveMedianBlockWeight)
Notes:
1) There are no other changes to the existing penalty formula, median calculation, fees etc.
2) There is the requirement to store the LongTermBlockWeight of a block unencrypted in the block itself. This  is to avoid possible consensus issues over rounding and also to prevent the calculations from becoming unwieldy as we move away from the fork.
3) When the  EffectiveMedianBlockWeight cap is reached it is still possible to mine blocks up to 2x the EffectiveMedianBlockWeight by paying the corresponding penalty.

Note: the long term block weight is stored in the database, but not in the actual block itself,
since it requires recalculating anyway for verification.
2019-03-04 09:33:58 +00:00
moneromooo-monero
fa2fbc3917
wallet2: fix mishandling rct outputs in coinbase tx
Reported by cutcoin
2019-03-03 18:55:12 +00:00
Joel
364516975a Simplify RPC endpoint, emoving second RPC endpoint generate_from_view_key 2019-03-02 23:14:35 +01:00
moneromooo-monero
9c4d403ae0
dns_utils: use fallback if the default resolver does not support DNSSEC 2019-02-27 11:08:56 +00:00
moneromooo-monero
4921c79494
cn_deserialize: remove some unused code 2019-02-26 17:57:03 +00:00
moneromooo-monero
eef164f7cc
cryptonote_protocol_handler: search for syncing peers in "cruise mode"
When all our outgoing peer slots are filled, we cycle one peer at
a time looking for syncing peers until we have at least two such
peers. This brings two advantages:

- Peers without incoming connections will find more syncing peers
that before, thereby strengthening network decentralization

- Peers will have more resistance to isolation attacks, as they
are more likely to find a "good" peer than they were before
2019-02-26 12:45:28 +00:00
moneromooo-monero
7d88d8f27c
discontinue use of alloca
NetBSD emits:
warning: Warning: reference to the libc supplied alloca(3); this most likely will not work. Please use the compiler provided version of alloca(3), by supplying the appropriate compiler flags (e.g. not -std=c89).

and man 3 alloca says:

       Normally,  gcc(1)  translates  calls  to  alloca()  with  inlined code.  This is not done when either the -ansi, -std=c89, -std=c99, or the
       -std=c11 option is given and the header <alloca.h> is not included.  Otherwise, (without an -ansi or -std=c* option) the glibc  version  of
       <stdlib.h> includes <alloca.h> and that contains the lines:

           #ifdef  __GNUC__
           #define alloca(size)   __builtin_alloca (size)
           #endif

It looks like alloca is a bad idea in modern C/C++, so we use
VLAs for C and std::vector for C++.
2019-02-25 11:11:07 +00:00
xiphon
a54e81e572 daemon: add '--no-sync' arg to optionally disable blockchain sync 2019-02-25 03:22:14 +00:00
xiphon
551104fbf1 daemon: add --public-node mode, RPC port propagation over P2P 2019-02-25 02:40:23 +03:00
moneromooo-monero
8298f42e9d
miner: it can now autodetect the optimal number of threads 2019-02-23 12:22:32 +00:00
moneromooo-monero
b674728dfa
Better error when sending a tx with a too large extra field 2019-02-22 11:45:32 +00:00
moneromooo-monero
bb2aed8e4d
rpc: quantize db size up to 5 GB in restricted mode 2019-02-21 23:49:53 +00:00
moneromooo-monero
7c09882a27
dns_utils: remove MoneroPulse/checkpoints mention in TXT record code
This code is used for more than just these
2019-02-21 17:38:43 +00:00
Joel
c17c81881b Remove code duplication 2019-02-21 15:49:32 +01:00
moneromooo-monero
85088d9f85
db_lmdb: fix missing mdb_dbi_close in migration
Fixed by hyc
2019-02-21 09:52:30 +00:00
stoffu
3d2772a0d6
wallet-rpc: get balance for all accounts and subaddresses 2019-02-20 14:23:36 +09:00
Dusan Klinec
8630a028f2
wallet: fix payment ID decryption for construction data 2019-02-20 03:55:35 +01:00
Dusan Klinec
75e5aafdcb
device/trezor: dummy payment ID fix 2019-02-20 02:00:14 +01:00
Joel
acb14c1079 Add generate_from_view_key RPC method 2019-02-19 14:30:35 +01:00
Joel
7dd7a3b791 Add generate_from_keys RPC method 2019-02-19 14:13:01 +01:00
Jethro Grassie
8a1ff079ea
wallet-rpc: get transfers for all accounts and subaddresses 2019-02-17 22:21:45 -05:00
TheCharlatan
4a9257b464
Support docker for gitian builds
Building with docker is arguably easier and more familiar to most people
than either kvm, or lxc.

This commit also relaxes the back compat requirement a bit. 32 bit linux
now uses glibc version 2.0. Also, the docker shell could not handle gcc arguments
containing spaces, so the explicit '-DFELT_TYPE' declaration was dropped.

Lastly, this removes some packages from the osx descriptor.
2019-02-14 23:14:34 +01:00
moneromooo-monero
5c81a9f1a1
wallet_rpc_server: add a validate_address RPC 2019-02-14 21:01:11 +00:00
SChernykh
f1fb06b137 Fixed path to int-util.h 2019-02-14 20:46:56 +01:00
SChernykh
9da0892b10 Adding cnv4-2 tweaks
Co-Authored-By: Lee Clagett <vtnerd@users.noreply.github.com>
2019-02-14 20:42:50 +01:00
SChernykh
f51397b306 Cryptonight variant 4 aka CryptonightR
It introduces random integer math into the main loop.
2019-02-14 11:29:54 +01:00
moneromooo-monero
1f5680c8db
simplewallet: add help for ask-password options 2019-02-14 09:21:22 +00:00
moneromooo-monero
c7c74cafec
simplewallet: mark confirm-missing-payment-id as obsolete 2019-02-14 09:21:22 +00:00
Dusan Klinec
a3973fc95f debug compilation fix: net lib missing common deps
```
Undefined symbols for architecture x86_64:
  "common_category()", referenced from:
      make_error_code(common_error) in parse.cpp.o
      make_error_code(common_error) in tor_address.cpp.o
  "boost::system::detail::system_category_ncx()", referenced from:
      boost::system::system_category() in parse.cpp.o
      boost::system::system_category() in socks.cpp.o
      boost::system::system_category() in libepee.a(net_utils_base.cpp.o)
  "boost::system::detail::generic_category_ncx()", referenced from:
      boost::system::generic_category() in parse.cpp.o
      boost::system::generic_category() in socks.cpp.o
      boost::system::generic_category() in tor_address.cpp.o
      boost::system::generic_category() in libepee.a(string_tools.cpp.o)
      boost::system::generic_category() in libepee.a(net_utils_base.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [src/net/libnet.dylib] Error 1
make[2]: *** [src/net/CMakeFiles/net.dir/all] Error 2
```
2019-02-13 23:37:46 +01:00
Doyle
d2c95ab941 Don't decrypt keys in view only wallets in wallet_keys_unlocker 2019-02-13 15:36:49 +11:00
italocoin
de32dcea1d Human readable message if maximum outputs reached 2019-02-10 09:51:20 -05:00
cslashm
2dbc487ec0 Add support for V10 protocol with BulletProofV2 and short amount. 2019-02-08 17:02:55 +01:00
cslashm
63cc02c08d Fix dummy decryption in debug mode 2019-02-08 17:02:55 +01:00
cslashm
f0e55cebf7 fix log namespace 2019-02-08 17:02:55 +01:00