Commit Graph
100 Commits
Author SHA1 Message Date
moneromooo-monero ef92620c1d socks: fix build with boost 1.70 2019-03-27 13:22:41 +00:00
moneromooo-monero e9519e9876 cryptonote: fix calculating coinbase tx hash
Also set error flag on exception when handling new txes
to keep tests working
2019-03-21 17:13:01 +00:00
moneromooo-monero adf6d7730f wallet: fix offline signing calling a daemon RPC 2019-03-21 14:46:29 +00:00
moneromooo-monero b05f10f82e wallet2: sanity check new tx before sending
We generate and check tx proofs and verify the amounts in those
match what the original amounts were.
2019-03-21 13:03:45 +00:00
moneromooo-monero efb2bdd309 slow-hash: default to JIT on x86_64 2019-03-21 11:29:08 +00:00
moneromooo-monero 17769db946 epee: fix build with boost 1.70.0
get_io_service was deprecated, and got removed
2019-03-21 11:02:02 +00:00
moneromooo-monero d6d6c46c4d cmake: handle detecting boost using boost's own cmake files
Its version looks like 1.70.1 rather than 107000, so detect range
to know which type we're seeing
2019-03-21 11:02:02 +00:00
moneromooo-monero 223c6b0796 dns_utils: really add default DNSSEC servers on failure
Coverity 196597
2019-03-20 23:46:22 +00:00
moneromooo-monero 1659029469 abstract_tcp_server2: fix crashy race on socket shutdown 2019-03-19 16:50:00 +00:00
moneromooo-monero cce948a5ae simplewallet: add some missing spacing before uses data 2019-03-14 10:07:49 +00:00
moneromooo-monero 6ef816de2b console_handler: print newline on EOF
This avoids the annoying case where the shell prints its prompt
after the last line from Monero output, causing line editing to
sometimes go wonky, for lack of a better term
2019-03-13 16:52:22 +00:00
moneromooo-monero f962449d46 wallet_rpc_server: include out subaddress indices in get_transfers 2019-03-13 14:14:15 +00:00
moneromooo-monero aac4e2f585 wallet_rpc_server: add missing --rpc-ssl-allowed-fingerprints 2019-03-13 12:59:44 +00:00
moneromooo-monero dc0c0c91c5 tests: disable wallet SSL init for tests involving wallet2 2019-03-12 20:43:02 +00:00
moneromooo-monero bc61b5ca95 wallet2: don't store 0 amount outputs, they'll fail to be spent
It's better to just ignore them, the user does not really need
to know they're here. If the mask is wrong, they'll fail to be
used, and sweeping will fail as it tries to use it.

Reported by Josh Davis.
2019-03-12 18:42:30 +00:00
moneromooo-monero 2790d4d30a hardfork: update last_versions on popped block 2019-03-12 13:43:12 +00:00
moneromooo-monero 576116d415 wallet: fix load failure if the mms isn't usable 2019-03-11 16:11:48 +00:00
moneromooo-monero 4ef3c895a4 blockchain: fix ahead of time PoW batch calc 2019-03-10 10:16:13 +00:00
moneromooo-monero 59478c80dd daemon: new mining_status command 2019-03-09 20:51:53 +00:00
moneromooo-monero 9141a0a1ef connection_basic: remove debug exception ^_^ 2019-03-08 20:13:51 +00:00
moneromooo-monero 4b21d38dfd blockchain: speed up getting N blocks weights/long term weights 2019-03-08 12:04:14 +00:00
moneromooo-monero 7ac3334217 slow-hash: cache TLS references locally once at function start 2019-03-07 18:11:19 +00:00
moneromooo-monero 7632dede7b crypto: fix PaX issue on NetBSD with CNv4 JIT 2019-03-07 16:46:02 +00:00
moneromooo-monero 89b1630e35 gtest: build fix for NetBSD 2019-03-07 16:46:02 +00:00
moneromooo-monero fa43b54780 tests: handle any cmake detected python interpreter 2019-03-07 16:46:02 +00:00
moneromooo-monero a48e49aa36 aesb: avoid stomping on an existing define on NetBSD 2019-03-07 16:08:00 +00:00
moneromooo-monero 3ac40938c3 timings: fix errno.h mispelt as error.h 2019-03-07 16:03:55 +00:00
moneromooo-monero 3f6f90bb31 wallet2: do not use invalid keys as fake outs in rings 2019-03-07 15:49:13 +00:00
moneromooo-monero c8c154a2c9 tests: fix cnv4-jit-test link on mac 2019-03-06 15:29:55 +00:00
moneromooo-monero 3907588bf6 rpc: make fill_pow restricted
It's slow work, so let's not expose it
2019-03-06 00:05:41 +00:00
moneromooo-monero c6a70af86a wallet2: key image import fixes
- return the right output data when offset is not zero
- do not consider import failed if result height is zero
  (it can be 0 if unknown)
- select the right tx pubkey when using subaddresses (it's faster,
  and we might select the wrong one if we got an output using one
  of the additional tx keys)
- account for skipped outputs for spent/unspent balance info

"spent" is arguably wrong, since it will count spent change
multiple times as it goes through receive/spend cycles.
2019-03-05 22:41:44 +00: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
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
moneromooo-monero 5f67e7f547 blockchain: forbid older BP rct versions from v11 2019-03-04 15:08:12 +00: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
moneromooo-monero b9a618848f performance_tests: add tests for new Cryptonight variants 2019-03-04 11:56:38 +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-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
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 d0e07b3d86 performance_tests: fix NetBSD build 2019-02-25 11:11:09 +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
moneromooo-monero 1677fb06ad unbound: update to get the redefinition fix 2019-02-24 13:20:03 +00: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
moneromooo-monero 85088d9f85 db_lmdb: fix missing mdb_dbi_close in migration
Fixed by hyc
2019-02-21 09:52:30 +00:00
moneromooo-monero 5c81a9f1a1 wallet_rpc_server: add a validate_address RPC 2019-02-14 21:01:11 +00: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
moneromooo-monero 49b2a48a46 simplewallet: tell the user to complain to the recipient
for long payment ids
2019-02-03 10:34:07 +00:00
moneromooo-monero 529645014c ringct: fix v1 ecdhInfo serialization
The change made for v2 broke v1, and we have no way to know which
version we're serializing here. However, since we don't actually
care about space savings in this case, we continue serialiazing
both mask and amount.
2019-02-03 10:33:10 +00:00
moneromooo-monero 2456945408 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-02-02 20:05:33 +00:00
moneromooo-monero 45b7df703b wallet_rpc_server: remove detached short payment ids support 2019-02-02 18:53:14 +00:00
moneromooo-monero 7c3ade4410 network_throttle: use circular_buffer where appropriate 2019-02-01 21:33:13 +00:00
moneromooo-monero fcd0007952 unit_tests: remove leftover debug print 2019-02-01 19:14:55 +00:00
moneromooo-monero 6a3608d3d2 cryptonote_protocol_handler: pad tx messages when using tor/i2p 2019-01-30 23:17:45 +00:00
moneromooo-monero 1c9d5285d1 blockchain_prune: don't prune before v10
This uses system time since it doesn't see the p2p network,
so is not 100% accurate
2019-01-30 16:32:14 +00:00
moneromooo-monero dc0b86ab4b block_queue: fix late sanity check off by one 2019-01-28 22:17:43 +00:00
moneromooo-monero acfff8d0ce rpc: fix internal daemon calls in restricted rpc getting partial data 2019-01-28 19:35:20 +00:00
moneromooo-monero 23813c7160 blockchain: add --reorg-notify
This will trigger if a reorg is seen. This may be used to do things
like stop automated withdrawals on large reorgs.

%s is replaced by the height at the split point
%h is replaced by the height of the new chain
%n is replaced by the number of new blocks after the reorg
2019-01-28 19:32:31 +00:00
moneromooo-monero f6db59b011 notify: handle arbitrary tags 2019-01-28 19:32:28 +00:00
moneromooo-monero ff95921668 notify: warn if the spec contains one of '"\
These aren't processed as a shell does, so this may surprise users
2019-01-28 19:32:25 +00:00
moneromooo-monero 13852678e1 common: set MONERO_DEFAULT_LOG_CATEGORY for notify and spawn 2019-01-28 19:32:22 +00:00
moneromooo-monero 1eef056588 performance_tests: better stats, and keep track of timing history 2019-01-28 15:45:37 +00:00
moneromooo-monero eec792764d blockchain: fix default genesis block timestamp 2019-01-26 21:39:00 +00:00
moneromooo-monero b6534c40e6 ringct: remove unused senderPk from ecdhTuple
This was an early ringct field, which was never used in production
2019-01-22 23:17:42 +00:00
moneromooo-monero 7d37598158 ringct: the commitment mask is now deterministic
saves space in the tx and is safe

Found by knaccc
2019-01-22 23:17:39 +00:00
moneromooo-monero 99d946e619 ringct: encode 8 byte amount, saving 24 bytes per output
Found by knaccc
2019-01-22 23:17:31 +00:00
moneromooo-monero cdc3ccec5f ringct: save 3 bytes on bulletproof size
Found by luigi1111
2019-01-22 23:17:27 +00:00
moneromooo-monero f931e16c6e add a bulletproof version, new bulletproof type, and rct config
This makes it easier to modify the bulletproof format
2019-01-22 23:17:24 +00:00
moneromooo-monero b750fb27b0 Pruning
The blockchain prunes seven eighths of prunable tx data.
This saves about two thirds of the blockchain size, while
keeping the node useful as a sync source for an eighth
of the blockchain.

No other data is currently pruned.

There are three ways to prune a blockchain:

- run monerod with --prune-blockchain
- run "prune_blockchain" in the monerod console
- run the monero-blockchain-prune utility

The first two will prune in place. Due to how LMDB works, this
will not reduce the blockchain size on disk. Instead, it will
mark parts of the file as free, so that future data will use
that free space, causing the file to not grow until free space
grows scarce.

The third way will create a second database, a pruned copy of
the original one. Since this is a new file, this one will be
smaller than the original one.

Once the database is pruned, it will stay pruned as it syncs.
That is, there is no need to use --prune-blockchain again, etc.
2019-01-22 20:30:51 +00:00
moneromooo-monero 9d58749b85 wallet2: fix hashchain going out of sync on refresh error 2019-01-19 16:47:13 +00:00