Commit Graph
100 Commits
Author SHA1 Message Date
moneromooo-monero 7c8f95d3e2 ringct: make conversion functions return const refs
This might avoid unnecessary copies.

Reported by stoffu
2018-09-04 18:28:20 +00:00
moneromooo-monero 67666b14ba unit_tests: disable mlocker tests on windows (no implementation) 2018-08-23 21:59:33 +00:00
moneromooo-monero c955257c4a electrum-words: fix bytes_to_words on big endian
Reported by cslashm
2018-08-23 07:58:23 +00:00
moneromooo-monero d2e26c23f3 add and use constant time 32 byte equality function 2018-08-23 07:56:51 +00:00
moneromooo-monero 2a100fd81f unit_tests: add tests for incremental keccak 2018-08-20 08:47:31 +00:00
moneromooo-monero 48a7bc4280 tx_pool: fix infinite loop when failing to find a meta record 2018-08-19 17:47:05 +00:00
moneromooo-monero 76ac5a8fbe wallet2: ask for a binary output distribution, for speed 2018-08-19 15:58:25 +00:00
moneromooo-monero dc6c0696fd db_lmdb: speedup the get_output_distribution common case 2018-08-19 15:58:21 +00:00
moneromooo-monero 76affd941b epee: some speedup in parsing 2018-08-19 15:29:01 +00:00
moneromooo-monero 11c6718865 util: remove unused <ustat.h>
It's obsolete and removed from at least Arch Linux 8.2

Reported by moneroexamples
2018-08-17 13:06:38 +00:00
moneromooo-monero 29dea03091 epee: resize vectors where possible in serialization
to avoid unnecessary repeated reallocation
2018-08-17 01:08:52 +00:00
moneromooo-monero 82d1b74500 core: cache block template where possible
This avoids constant rechecking of the same things each time
a miner asks for the block template. The tx pool maintains
a cookie to allow users to detect when the pool state changed,
which means the block template needs rebuilding.
2018-08-16 12:44:33 +00:00
moneromooo-monero ab74dc277a crypto: make secret_key automatically mlock 2018-08-16 11:57:49 +00:00
moneromooo-monero 70271fa788 common: add a class to safely wrap mlock/munlock
This class will allow mlocking small objects, of which there
may be several per page. It adds refcounting so pages are only
munlocked when the last object on that page munlocks.
2018-08-16 11:57:46 +00:00
moneromooo-monero e9ffa91257 store secret keys encrypted where possible
The secret spend key is kept encrypted in memory, and
decrypted on the fly when needed.

Both spend and view secret keys are kept encrypted in a JSON
field in the keys file. This avoids leaving the keys in
memory due to being manipulated by the JSON I/O API.
2018-08-16 11:57:43 +00:00
moneromooo-monero ea37614efe wallet: wipe seed from memory where appropriate 2018-08-16 09:17:52 +00:00
moneromooo-monero 0c8d8f6b2e unit_tests: remove std::move in return statement
This actually prevents copy elision
2018-08-15 13:38:47 +00:00
moneromooo-monero 5ed6669130 wallet_rpc_server: remove unused amount_keys field in transfer RPC 2018-08-15 12:47:33 +00:00
moneromooo-monero c3c14f3083 simplewallet: allow named priority levels for default-priority
to match those used by the various transfer functions
2018-08-15 12:16:17 +00:00
moneromooo-monero ac09cfa6be wallet2: remove obsolete pruned/unpruned case
All daemons will not support pruned blocks
2018-08-13 13:17:27 +00:00
moneromooo-monero 4307489147 wallet: disable core dumps on startup in release mode 2018-08-12 16:28:10 +00:00
moneromooo-monero bc8cbdb25d stack_trace: print stack traces on stdout if the logger isn't live 2018-08-12 16:18:07 +00:00
moneromooo-monero b278b83860 core: sync database based on bytes added, not blocks added
Blocks have a very wide range, whereas actual size is the relevant
quantity to consider when syncing
2018-08-12 16:13:46 +00:00
moneromooo-monero 83f5587167 blockchain: use uint64_t for height, not size_t 2018-08-09 17:09:26 +00:00
moneromooo-monero 361513ac81 blockchain_blackball: use a bit less memory 2018-08-09 14:50:20 +00:00
moneromooo-monero ce9457a379 cryptonote_protocol: don't serialize an unneeded new block message
Non fluffy block nodes should now be very rare
2018-08-09 14:45:31 +00:00
moneromooo-monero 3e914ad831 simplewallet: add a warning and prompt on rescan_blockchain
Many people are using this as a "let's see what this does" command
when something doesn't work as they thought it should, and thus
destroying info that they might still need.
2018-08-07 12:49:23 +00:00
moneromooo-monero c5e2aee961 updates: fix hash sanity checking 2018-08-05 00:19:45 +00:00
moneromooo-monero 37f0799284 wallet: distinguish coinbase from other txes in show_transfers 2018-08-03 12:48:16 +00:00
moneromooo-monero 8439306212 wallet2: do not divide by 0 on invalid daemon response 2018-07-31 14:26:00 +00:00
moneromooo-monero 43f71100bc blockchain_db: remove unused get_output_key variant
It was actually incorrect, as it would not return commitment
2018-07-30 21:57:47 +00:00
moneromooo-monero 0f757177fe wallet2: avoid using arbitrary random values when unknown 2018-07-30 13:34:15 +01:00
moneromooo-monero 4520cfd978 wallet2: guard against bad outputs in import_outputs
also some minor speedup
2018-07-30 13:21:58 +01:00
moneromooo-monero 5860611afa blockchain_blackball: allow resumable interrupt with ^C 2018-07-30 11:14:45 +01:00
moneromooo-monero c8226ad1f7 unit_tests: use valid key images, pub keys, etc 2018-07-28 19:39:59 +01:00
moneromooo-monero 262e391fb1 mlog: handle filenames without parent directories
eg, --log-file=foo.log

This would otherwise throw and crash with a stack overflow
2018-07-26 22:49:54 +01:00
moneromooo-monero e7c0fcd8f3 epee: set jsonrpc to "2.0" in parse error return data 2018-07-25 23:00:19 +01:00
moneromooo-monero ff37bd00bc wallet2: fix O(n^2) behaviour in import_key_images
That takes a lot of time for even not so large wallets
2018-07-24 14:34:19 +01:00
moneromooo-monero 5e675de7c2 simplewallet: fix language detection when using --use-english-language-names 2018-07-22 14:26:38 +01:00
moneromooo-monero 8e24533a7f blockchain: some batch tx scanning speedup 2018-07-21 12:05:12 +01:00
moneromooo-monero be02eb9389 db_lmdb: demote the "batch already enabled" log, it's harmless 2018-07-20 23:41:40 +01:00
moneromooo-monero 0496c7c91a crypto: do not use boost::value_initialized to init null skey/pkey 2018-07-20 23:06:22 +01:00
moneromooo-monero 704b60caf0 block_queue: faster check whether a block was requested 2018-07-20 16:05:56 +01:00
moneromooo-monero d6440ab319 wallet2: recover from index out of hashchain bounds error
This can happen when there's a very large reorg on the daemon
(ie, on testnet)
2018-07-16 23:13:56 +01:00
moneromooo-monero 7f8bdeb35c easylogging++: make the logger handle early/late logging 2018-07-15 19:10:44 +01:00
moneromooo-monero 63e342be84 crypto: move null_pkey/null_skey to the cpp file 2018-07-15 19:09:36 +01:00
moneromooo-monero 979105b298 abstract_tcp_server2: fix race on shutdown 2018-07-15 19:08:49 +01:00
moneromooo-monero 45e419bd5c db: store cumulative rct output distribution in the db for speed
This gets rid of the temporary precalc cache.

Also make the RPC able to send data back in binary or JSON,
since there can be a lot of data

This bumps the LMDB database format to v3, with migration.
2018-07-13 11:37:04 +01:00
moneromooo-monero 2951436704 wallet: warn when payment IDs are used
Subaddresses are better for privacy
2018-07-12 19:37:29 +01:00
moneromooo-monero ee31383a52 db_lmdb: don't sync a read only DB
This would only throw
2018-07-11 18:14:22 +01:00
moneromooo-monero 8d578f1f2d memwipe: don't call the workhorse for 0 bytes
Some of them don't like it
2018-07-10 15:37:22 +01:00
moneromooo-monero fc39d3b23c wallet2: ensure outputs are processed only once
This should be proof against any way one might get to multiple
processing, such as generating the same derivation from the
same pubkey, etc
2018-07-08 12:56:51 +01:00
moneromooo-monero 8c0523771f blockchain: cache next block difficulty after adding a block
It's not 100% certain it'll be needed, but it avoids getinfo
needing the blockchain lock and potentially blocking
2018-07-07 19:34:21 +01:00
moneromooo-monero 639ca3b1fa core_tests: add --filter to select which tests to run 2018-07-07 19:33:35 +01:00
moneromooo-monero 20eb192162 simplewallet: reword "seed encryption" to "seed offset"
avoids people thinking it's somehow a generic AE system
2018-07-07 11:35:41 +01:00
moneromooo-monero 61caab8a8c crypto: remove slight bias in key generation due to modulo 2018-07-05 09:18:01 +01:00
moneromooo-monero 96f8c62dc4 README: remove mentions of external miniupnpc dependency 2018-07-04 23:59:06 +01:00
moneromooo-monero 0a4a7da35c http_protocol_handler: fix HTTP/x.y parsing
It was accepting any character for the dot (yeah, massive big I know)
2018-07-03 23:16:48 +01:00
moneromooo-monero 42f3b7cbca http_protocol_handler: catch invalid numbers when parsing 2018-07-03 23:16:44 +01:00
moneromooo-monero 34d4b798d4 wallet2: use a gamma distribution to pick fake outs
as per "An Empirical Analysis of Linkability in the Monero
Blockchain", by Miller et al.
2018-07-03 18:10:48 +01:00
moneromooo-monero 58cceaad71 wallet2: fix double counting outs if the tx pubkey is duplicated 2018-07-03 14:16:30 +01:00
moneromooo-monero 909398efc7 p2p: connect via the bound ip, if any 2018-07-02 18:06:04 +01:00
moneromooo-monero 8c4db68ff7 node_rpc_proxy: factor a few RPC calls using get_info
Takes advantage of caching
2018-07-02 17:59:44 +01:00
moneromooo-monero d95bc44c6b blockchain: fix getting invalid block data on failure 2018-06-29 15:50:34 +01:00
moneromooo-monero dead780f8a abstract_tcp_server2: fix use after free 2018-06-29 15:40:48 +01:00
moneromooo-monero aa0ea0aafc blockchain: set the m_verifivation_failed flag in a couple more places
when a block being added to the main chain is invalid.

This ensures the peer is banned after a number of these.
2018-06-28 16:57:22 +01:00
moneromooo-monero 438d52deaf remove epee from link lines where it's redundant
For some reason, this confuses and kills ASAN on startup
as it thinks const uint8_t ipv4_network_address::ID is
defined multiple times.
2018-06-28 16:45:22 +01:00
moneromooo-monero ef649f998d crypto: remove unused unsafe random scalar generator 2018-06-28 16:44:13 +01:00
moneromooo-monero 3474154b75 gtest: use -fPIC with CLANG too 2018-06-28 16:42:52 +01:00
moneromooo-monero 9a39b7dd7f wallet2: fix build for windows (std::max again) 2018-06-28 00:47:48 +01:00
moneromooo-monero 84d9e7faec blockchain: fix build after waiter::wait prototype change 2018-06-28 00:24:39 +01:00
moneromooo-monero 9b38551c3c wallet_rpc_server: fix build - forgot to build rpc version 2018-06-27 23:34:02 +01:00
moneromooo-monero dcbc17e97e wallet: include a suggested number of confirmations based on amount
This is based on how much an attacking miner stands to lose in block
rewardy by mining a private chain which double spends a payment.
This is not foolproof, since mining is based on luck, and breaks
down as the attacking miner nears 50% of the network hash rate,
and the estimation is based on a constant block reward.
2018-06-27 21:38:21 +01:00
moneromooo-monero 80d7c6c730 blockchain_utilities: report file offset where a read error occurs 2018-06-27 14:11:35 +01:00
moneromooo-monero e6f4d4acf0 unit_tests: do not recreate the same base rct sig all the time
Helps a bit when running with valgrind
2018-06-27 11:11:14 +01:00
moneromooo-monero 0e4c7d0fae wallet2: cache ringdb key while refreshing
Speeds up syncing with a lot of outgoing outputs as key generation
runs Cryptonight.
2018-06-26 22:15:38 +01:00
moneromooo-monero 2771a18e85 threadpool: allow leaf functions to run concurrently
Decrease the number of worker threads by one to account
for the fact the calling thread acts as a worker thread now
2018-06-26 22:15:22 +01:00
moneromooo-monero 2704624eae wallet2: remove unneeded divisions 2018-06-26 22:15:20 +01:00
moneromooo-monero 5d3e70229e wallet2: remove old blockchain size cache hack 2018-06-26 22:15:18 +01:00
moneromooo-monero dcfd299239 wallet2: speedup refresh
key derivation and checking for incoming outputs are threaded
in batch before adding blocks to the local blockchain. Other
minor bits and bobs are also cached.
2018-06-26 22:15:16 +01:00
moneromooo-monero ef2cb63287 blockchain: simplify/speedup handle_get_objects 2018-06-26 22:15:14 +01:00
moneromooo-monero f025ae9760 wallet2: avoid re-parsing blocks when refreshing in a loop 2018-06-26 22:15:12 +01:00
moneromooo-monero 41be339655 wallet2: avoid duplicate parsing of tx extra 2018-06-26 22:15:10 +01:00
moneromooo-monero f7f1917ed4 wallet2: remove useless device locking 2018-06-26 22:14:35 +01:00
moneromooo-monero ba8331ce41 wallet2: parse blocks in the RPC thread, not the processing thread
Processing typically is the bottleneck
2018-06-26 22:14:33 +01:00
moneromooo-monero 31a895e876 wallet2: simplify/speedup process_blocks 2018-06-26 22:14:31 +01:00
moneromooo-monero 57ea90285c wallet: don't process miner tx if we're refreshing with no-coinbase 2018-06-26 22:14:26 +01:00
moneromooo-monero a830db2577 rpc: rework to avoid repeated calculations in get_blocks.bin 2018-06-26 22:14:23 +01:00
moneromooo-monero ed2c81ed95 replace std::list with std::vector on some hot paths
also use reserve where appropriate
2018-06-26 22:14:21 +01:00
moneromooo-monero 209ec963b5 rpc: sanity check on number of txes in a block 2018-06-26 22:14:18 +01:00
moneromooo-monero 6795bd0d4e rpc: add option to skip coinbase info in get_blocks.bin 2018-06-26 22:14:16 +01:00
moneromooo-monero a2b557fe5c wallet2: use std::move on containers where appropriate 2018-06-26 22:14:14 +01:00
moneromooo-monero 50af3579ee alt_chain_info can now give more info about a particular alt chain 2018-06-26 08:19:51 +01:00
moneromooo-monero 87e158b5b9 device_ledger: factor the prologue code 2018-06-25 12:35:10 +01:00
moneromooo-monero 41b4bf9d6d tx_pool: cache check_tx_inputs results
This is called a lot when creating a block template, and
does not change until the blockchain changes.
This also avoids tx parsing when cached.
2018-06-24 11:22:26 +01:00
moneromooo-monero 34de7bc267 device_ledger: fix buffer underflow on bad data from device 2018-06-23 15:43:31 +01:00
moneromooo-monero 41e9cab4e1 device: misc cleanup
use snprintf "just in case" where appropriate
consistently use unsigned for temp values
pass std::string by const ref rather than by value
add length check (which can't happen in practice) for memcpy
2018-06-23 15:28:48 +01:00
moneromooo-monero 3b4dec2d12 device_ledger: fix potential buffer overflow from bad size calc 2018-06-23 15:28:45 +01:00
moneromooo-monero 9d7f6e6089 simplewallet: init trusted daemon flag to false when autodetecting 2018-06-23 09:53:50 +01:00
moneromooo-monero df9d50a8a4 wallet2: fix read buffer overflow in import_key_images 2018-06-23 09:22:20 +01:00