Commit Graph

898 Commits

Author SHA1 Message Date
Riccardo Spagni
fd0740e5e7
Merge pull request #2615
10013e94 Protect node privacy by proper filtering in restricted-mode RPC answers (binaryFate)
2017-11-14 14:53:10 +02:00
moneromooo-monero
43f27c7d43
core: warn when free disk space is low 2017-11-14 10:21:34 +00:00
binaryFate
10013e9434 Protect node privacy by proper filtering in restricted-mode RPC answers
This patch allows to filter out sensitive information for queries that rely on the pool state, when running in restricted mode.
This filtering is only applied to data sent back to RPC queries. Results of inline commands typed locally in the daemon are not affected.
In practice, when running with `--restricted-rpc`:
* get_transaction_pool will list relayed transactions with the fields "last relayed time" and "received time" set to zero.
* get_transaction_pool will not list transaction that have do_not_relay set to true, and will not list key images that are used only for such transactions
* get_transaction_pool_hashes.bin will not list such transaction
* get_transaction_pool_stats will not count such transactions in any of the aggregated values that are computed

The implementation does not make filtering the default, so developers should be mindful of this if they add new RPC functionality.
Fixes #2590.
2017-11-08 13:07:07 +01:00
moneromooo-monero
ccf53a566c
track double spending in the txpool
Transactions in the txpool are marked when another transaction
is seen double spending one or more of its inputs.
This is then exposed wherever appropriate.

Note that being marked with this "double spend seen" flag does
NOT mean this transaction IS a double spend and will never be
mined: it just means that the network has seen at least another
transaction spending at least one of the same inputs, so care
should be taken to wait for a few confirmations before acting
upon that transaction (ie, mostly of use for merchants wanting
to accept unconfirmed transactions).
2017-11-06 00:05:44 +00:00
Riccardo Spagni
13a84caa22
Merge pull request #2662
88ebfd64 core_tests: fix for subaddress patch (kenshi84)
e373a203 performance_tests: add master spend pubkey to subaddress hashtable (kenshi84)
2017-11-03 11:58:06 +02:00
moneromooo-monero
935f746249
blockchain: do not lock the blockchain lock for simple DB getters
It is safe in those cases, though might return slightly out of date
information if another thread is busy modifying the blockchain,
but it avoids potentially lengthy delays just to get things like
the current blockchain height.
2017-10-30 08:23:40 +00:00
moneromooo-monero
ec48e8d81d
core: do not forbid txes without destination
This was spuriously forbidden in the recent subaddress patch,
which isn't inherently incompatible with these.
2017-10-19 09:11:12 +01:00
moneromooo-monero
523084bc79
core: don't add empty additional pub keys field to extra
Saves a couple bytes per tx
2017-10-19 09:11:10 +01:00
kenshi84
00cc1fdd22
subaddress: remove unneeded scalarmultBase 2017-10-18 08:46:00 +09:00
kenshi84
88ebfd646a
core_tests: fix for subaddress patch 2017-10-17 22:29:01 +09:00
Riccardo Spagni
97c11caf07 Merge pull request #2656
3492de01 fix lightwallet and subaddresses conflict (Jaquee)
329f149e remove reference to cryptonote::null_hash (Jaquee)
2017-10-15 19:32:18 +02:00
Jaquee
329f149e95 remove reference to cryptonote::null_hash 2017-10-15 19:19:40 +02:00
Riccardo Spagni
b293ad9a1a
Merge pull request #2640
22b51e06 db_lmdb: include chain height when failing to find an output key (moneromooo-monero)
5db433b3 blockchain: avoid exceptions in output verification (moneromooo-monero)
2017-10-15 18:59:45 +02:00
Riccardo Spagni
344c01c712
Merge pull request #2638
529a6a4a core: guard against a mined block not finding all txes in the pool (moneromooo-monero)
2017-10-15 18:58:57 +02:00
Riccardo Spagni
d8bc28cc36
Merge pull request #2552
69ce33f2 core: fix failure to sync when a tx is already in the pool (moneromooo-monero)
2017-10-15 17:31:37 +02:00
Riccardo Spagni
5ea20d6944
Merge pull request #2469
7adceee6 precomputed block hashes are now in blocks of N (currently 256) (moneromooo-monero)
2017-10-15 17:23:50 +02:00
moneromooo-monero
5db433b3f7
blockchain: avoid exceptions in output verification
This can happen if we get a bad tx, so let's not spam the log.
2017-10-12 13:27:20 +01:00
moneromooo-monero
529a6a4af8
core: guard against a mined block not finding all txes in the pool
This can happen for several reasons, but mainly if another block
was received, which took that tx off the pool.
2017-10-11 13:00:49 +01:00
kenshi84
53ad5a0f42
Subaddresses 2017-10-07 13:06:21 +09:00
Riccardo Spagni
2ff832c576
Merge pull request #2540
71c7f8d0 core: fix logging the one time public key on error (moneromooo-monero)
2017-10-06 22:58:20 +04:00
Riccardo Spagni
4a20a5b5ea
Merge pull request #2537
269a2a01 blockchain: fix off by one getting blocks (moneromooo-monero)
2017-10-06 22:56:17 +04:00
Riccardo Spagni
478b14b565
Merge pull request #2534
4e115a3a core: remove out sorting from v7 rules (moneromooo-monero)
2017-10-06 22:55:00 +04:00
stoffu
cbc5508b15
construct_tx_and_get_tx_key: return sorted sources for print_ring_memebrs to work properly 2017-10-03 08:12:28 +09:00
Riccardo Spagni
87d0516f7d
Merge pull request #2513
309290d1 Source updates are in a source subdirectory (moneromooo-monero)
2017-10-02 23:29:25 +04:00
moneromooo-monero
69ce33f217
core: fix failure to sync when a tx is already in the pool 2017-09-29 21:34:10 +01:00
moneromooo-monero
4e115a3a4c
core: remove out sorting from v7 rules
and restore random shuffle of outputs

This turned out to have a flaw (sort order depends on output
index), and this doesn't really bring much anyway
2017-09-27 12:42:08 +01:00
moneromooo-monero
71c7f8d0dc
core: fix logging the one time public key on error 2017-09-27 11:40:05 +01:00
moneromooo-monero
269a2a01ef
blockchain: fix off by one getting blocks 2017-09-27 00:31:49 +01:00
Riccardo Spagni
5f7cddeb53
Merge pull request #2533
97cdd4c9 core: undo output sorting (moneromooo-monero)
2017-09-26 15:59:32 +02:00
moneromooo-monero
97cdd4c92f
core: undo output sorting
It looks like it may be buggy
2017-09-26 13:23:31 +01:00
Riccardo Spagni
21c2c08041
Merge pull request #2527
ba6907f6 core: fix creation of v1 txes (moneromooo-monero)
2017-09-25 23:29:32 +02:00
moneromooo-monero
ba6907f661
core: fix creation of v1 txes 2017-09-25 22:27:30 +01:00
moneromooo-monero
cdbbe99c82
checkpoints: add a token checkpoint on testnet (the genesis block) 2017-09-25 21:16:35 +01:00
moneromooo-monero
fa54b20584
fix typo in basic and core CMakeLists.txt 2017-09-25 21:16:29 +01:00
moneromooo-monero
5d65a75b69
move checkpoints in a separate library 2017-09-25 21:16:26 +01:00
Riccardo Spagni
13be8115e4
Merge pull request #2458
7f2f6ee1 protocol: remove hop count on block propagation (moneromooo-monero)
2017-09-25 17:00:47 +02:00
Riccardo Spagni
e5a2cdbfad
Merge pull request #2457
d2d8a41c Use actual batch size for resize estimates (Howard Chu)
2017-09-25 16:57:07 +02:00
Riccardo Spagni
0e74777071
Merge pull request #2452
0aaaca29 tx_pool: set the "invalid input" bit when check_tx_inputs fails (moneromooo-monero)
9236823b simplewallet: print tx rejection reason where it was missing (moneromooo-monero)
3dee3301 core_rpc_server: print tx rejection reason at L0 too (moneromooo-monero)
2017-09-25 16:53:07 +02:00
Riccardo Spagni
c2346c6c59
Merge pull request #2424
28b72b6e tx_pool: pre-init tvc.m_verifivation_failed before processing (moneromooo-monero)
50a629b2 core_tests: catch (impossible in practice) tx extra api failure (moneromooo-monero)
fee15ef1 wallet2: catch failure to parse address (moneromooo-monero)
1399e26d net_peerlist: remove dead code (moneromooo-monero)
50e09698 tx_pool: guard against failure getting tx hash (moneromooo-monero)
54cc209a wallet_rpc_server: catch failure to create directory (moneromooo-monero)
3e55099c wallet_rpc_server: init m_vm to NULL in ctor (moneromooo-monero)
7d0dde5e wallet_args: remove redundant default value for --log-file (moneromooo-monero)
ed4a3350 wallet2: catch failure to save keys file (moneromooo-monero)
44434c8a wallet2_api: check whether dynamic_cast returns NULL (moneromooo-monero)
92f2f687 core: check return value from parse_hexstr_to_binbuff (moneromooo-monero)
5475692e wallet2_api: remove an unused, uninitialized, field (moneromooo-monero)
a7ba3de1 libwallet_api_tests: initialize newblock_triggered on reset (moneromooo-monero)
b2763ace wallet2_api: init error code to "no error" in the ctor (moneromooo-monero)
b5faac53 get_blockchain_top now returns void (moneromooo-monero)
2e44d8f2 wallet_rpc_server: guard against exceptions (moneromooo-monero)
4230876b simplewallet: guard against I/O exceptions (moneromooo-monero)
06c1e057 daemon: initialize decode_as_json in RPC request (moneromooo-monero)
11f71af5 http_base: init size_t in http_request_info ctor (moneromooo-monero)
2017-09-25 16:52:27 +02:00
Riccardo Spagni
b911130a46
Merge pull request #2442
e29282d2 build: auto update version info without manually deleting version.h (stoffu)
2017-09-25 16:50:35 +02:00
Riccardo Spagni
08ada1fa8b
Merge pull request #2440
6137a0b9 blockchain: reject unsorted ins and outs from v7 (moneromooo-monero)
16afab90 core: sort ins and outs key key image and public key, respectively (moneromooo-monero)
0c36b9f9 common: add apply_permutation file and function (moneromooo-monero)
2017-09-25 16:49:01 +02:00
moneromooo-monero
28b72b6ecc
tx_pool: pre-init tvc.m_verifivation_failed before processing
CID 175316
2017-09-25 15:48:59 +01:00
moneromooo-monero
50e096987b
tx_pool: guard against failure getting tx hash
Should be impossible in practice, but easy change

CID 175282
2017-09-25 15:48:42 +01:00
moneromooo-monero
92f2f687b9
core: check return value from parse_hexstr_to_binbuff 2017-09-25 15:48:24 +01:00
moneromooo-monero
b5faac5304
get_blockchain_top now returns void
It was always returning true, and could not be foreseen to
usefully return errors in the future. This silences CID 162652
as well as saves some checking code in a few places.
2017-09-25 15:48:13 +01:00
moneromooo-monero
309290d1c7
Source updates are in a source subdirectory
rather than in the same directory as the prebuilt versions
2017-09-22 21:48:19 +01:00
Riccardo Spagni
1f9058187c
Merge pull request #2496
3b8b4be5 tx_pool: drop invalid txes from the pool on startup (moneromooo-monero)
2017-09-21 12:07:35 +02:00
stoffu
e29282d208
build: auto update version info without manually deleting version.h 2017-09-21 07:47:37 +09:00
moneromooo-monero
3b8b4be5cb
tx_pool: drop invalid txes from the pool on startup
instead of just failing

This is a workaround for bad tx blobs being inserted in the
pool for unknown reasons
2017-09-20 18:55:16 +01:00
moneromooo-monero
e457aa51f4
blockchain: fix crash checking pre-validated txids 2017-09-20 10:46:13 +01:00
moneromooo-monero
7adceee634
precomputed block hashes are now in blocks of N (currently 256)
This shaves a lot of space off binaries
2017-09-18 16:29:00 +01:00
Riccardo Spagni
1a73843cec
Merge pull request #2446
6d0ca7d1 Tweak concurrency limits (Howard Chu)
510d0d47 Use a threadpool (Howard Chu)
2017-09-18 13:19:26 +02:00
Riccardo Spagni
69e039aa19
Merge pull request #2023
f761dbae Remove 1.25x multiplier from tx_pool (Nano Akron)
2017-09-18 13:11:57 +02:00
Riccardo Spagni
591e53445b
Merge pull request #2044
0299cb77 Fix various oversights/bugs in ZMQ RPC server code (Thomas Winget)
77986023 json serialization for rpc-relevant monero types (Thomas Winget)
5c1e08fe Refactor some things into more composable (smaller) functions (Thomas Winget)
9ac2ad07 DRY refactoring (Thomas Winget)
2017-09-18 13:08:16 +02:00
moneromooo-monero
6137a0b94d
blockchain: reject unsorted ins and outs from v7
This ensures no information is leaked by the ordering
2017-09-18 11:23:15 +01:00
Howard Chu
d2d8a41c47
Use actual batch size for resize estimates
And optimize import startup:

Remember start_height position during initial count_blocks pass
to avoid having to reread entire file again to arrive at start_height
2017-09-17 22:08:40 +01:00
moneromooo-monero
7f2f6ee1c9
protocol: remove hop count on block propagation
It is unused, as it was apparently a future optimization,
and it leaks some information (though since pools publish
thei blocks they find, that amount seems small).
2017-09-17 10:26:12 +01:00
moneromooo-monero
0aaaca29a2
tx_pool: set the "invalid input" bit when check_tx_inputs fails 2017-09-16 11:27:52 +01:00
Howard Chu
510d0d4753
Use a threadpool
Instead of constantly creating and destroying threads
2017-09-14 21:42:48 +01:00
Nano Akron
f761dbaeaf Remove 1.25x multiplier from tx_pool 2017-09-14 21:26:19 +01:00
Riccardo Spagni
7abdba0a5c
Merge pull request #2438
9443eec1 core: guard against exceptions in tx verification worker threads (moneromooo-monero)
2017-09-14 18:31:46 +02:00
Riccardo Spagni
3399c2a257
Merge pull request #2404
e5238adf update checkpoint hashes (Riccardo Spagni)
d4f56bdf update hardcoded checkpoints (Riccardo Spagni)
ed730511 update checkpoints.dat (Riccardo Spagni)
2017-09-14 18:25:43 +02:00
Riccardo Spagni
718820cd96
Merge pull request #2396
dbfef643 tx_pool: catch exceptions in LockedTXN dtor (moneromooo-monero)
2017-09-14 18:25:28 +02:00
moneromooo-monero
16afab900d
core: sort ins and outs key key image and public key, respectively
This avoids leaking some small amount of information
2017-09-13 09:25:05 +01:00
moneromooo-monero
9443eec10f
core: guard against exceptions in tx verification worker threads 2017-09-12 12:07:10 +01:00
Riccardo Spagni
e5238adfb3
update checkpoint hashes 2017-09-06 17:32:48 +02:00
Thomas Winget
77986023c3
json serialization for rpc-relevant monero types
Structured {de-,}serialization methods for (many new) types
which are used for requests or responses in the RPC.

New types include RPC requests and responses, and structs which compose
types within those.

# Conflicts:
#	src/cryptonote_core/blockchain.cpp
2017-09-05 12:20:27 -04:00
Thomas Winget
5c1e08fe80
Refactor some things into more composable (smaller) functions
This commit refactors some of the rpc-related functions in the
Blockchain class to be more composable.  This change was made
in order to make implementing the new zmq rpc easier without
trampling on the old rpc.

New functions:
  Blockchain::get_num_mature_outputs
  Blockchain::get_random_outputs
  Blockchain::get_output_key
  Blockchain::get_output_key_mask_unlocked

  Blockchain::find_blockchain_supplement (overload)

functions which previously had this functionality inline now call these
functions as necessary.
2017-09-05 12:17:32 -04:00
moneromooo-monero
dbfef643ed
tx_pool: catch exceptions in LockedTXN dtor
This might prevent some calls to terminate when the LockedTXN
dtor is called as part of stack unwinding caused by another
exception in the first place.
2017-09-04 10:18:38 +01:00
moneromooo-monero
6ac61100a1
Add a --fluffy-blocks option to relay blocks as fluffy blocks
Defaults to off, but fluffy blocks are forced enabled on testnet
2017-09-03 11:11:11 +01:00
Riccardo Spagni
c919ca4f1d
Merge pull request #2374
e72e625e tx_pool: wrap tx meta updates in a LockedTXN (moneromooo-monero)
2017-09-02 11:31:19 +02:00
Riccardo Spagni
1e57e48342
Merge pull request #2372
c867357a cryptonote_protocol: error handling on cleanup_handle_incoming_blocks (moneromooo-monero)
ce901fcb Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocks (moneromooo-monero)
84fa015e core: guard against exceptions in handle_incoming_{block,tx} (moneromooo-monero)
2017-09-02 11:30:57 +02:00
Thomas Winget
9ac2ad0744
DRY refactoring 2017-08-31 07:48:27 -04:00
moneromooo-monero
e72e625eb1
tx_pool: wrap tx meta updates in a LockedTXN 2017-08-29 16:35:19 +01:00
moneromooo-monero
ce901fcb31
Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocks 2017-08-29 15:43:32 +01:00
moneromooo-monero
84fa015e77
core: guard against exceptions in handle_incoming_{block,tx}
When one happens, cleanup must be called or the incoming tx
lock will stay locked
2017-08-29 13:01:45 +01:00
moneromooo-monero
a95e460c71
move db specific options to BlockchainDB
Avoids common depending on blockchain_db, which can cause
link errors.
2017-08-29 11:43:34 +01:00
Riccardo Spagni
72b5f37f58
Merge pull request #2349
1914c999 txpool: update db tx metadata when it changes (moneromooo)
4dbf29bd txpool: add tx size median to the pool stats (moneromooo)
2017-08-27 18:15:13 +02:00
Riccardo Spagni
e00238a355
Merge pull request #2347
5807529e blockchain: cap memory size of retrieved blocks (moneromooo-monero)
c1b10381 rpc: decrease memory usage a bit in getblocks.bin (moneromooo-monero)
2017-08-27 18:13:50 +02:00
Riccardo Spagni
36b978f50e
Merge pull request #2314
c22d22e2 Cleanup test impact of adding safesyncmode() method (Howard Chu)
9a859844 Toggle SAFE syncmode on and off automatically (Howard Chu)
2017-08-26 23:43:22 +02:00
Riccardo Spagni
ff0afc196e
Merge pull request #2313
3dd34a49 Cleanup test impact of moving blockchain_db_types() (Howard Chu)
80344740 More DB support cleanup (Howard Chu)
4c7f8ac0 DB cleanup (Howard Chu)
2017-08-26 23:43:09 +02:00
moneromooo-monero
5807529e69
blockchain: cap memory size of retrieved blocks
It helps keep memory usage down when a wallet refreshes through
a string of large blocks
2017-08-26 20:53:58 +01:00
moneromooo-monero
55bec1f03d
rpc: add a new RPC to get current txpool backlog (sizes and fees) 2017-08-26 16:23:31 +01:00
moneromooo
1914c999c7
txpool: update db tx metadata when it changes 2017-08-25 22:21:51 +01:00
moneromooo
4dbf29bd32
txpool: add tx size median to the pool stats 2017-08-25 22:21:38 +01:00
Riccardo Spagni
944bbdb51e
Merge pull request #2330
ea15e72d tx_pool: fix crash in stats (Howard Chu)
2017-08-25 00:18:42 +02:00
Howard Chu
ea15e72d73
tx_pool: fix crash in stats
if tx receive_time == now. supersedes #2322
2017-08-23 14:22:25 +01:00
Howard Chu
c22d22e2db
Cleanup test impact of adding safesyncmode() method 2017-08-22 15:11:09 +01:00
Howard Chu
9a859844f4
Toggle SAFE syncmode on and off automatically
If monerod is started with default sync mode, set it to SAFE after
synchronization completes. Set it back to FAST if synchronization
restarts (e.g. because another peer has a longer blockchain).

If monerod is started with an explicit sync mode, none of this
automation takes effect.
2017-08-20 16:30:28 +01:00
Howard Chu
4c7f8ac04f
DB cleanup
Hide LMDB-specific stuff behind blockchain_db.h. Nobody besides blockchain_db.cpp
should ever be including DB-specific headers any more.
2017-08-19 18:11:38 +01:00
moneromooo-monero
5d989b661a
core: add mainnet v6 fork height at 1400000 2017-08-18 10:03:49 +01:00
Riccardo Spagni
4466b6d1b0
Merge pull request #2303
5a283078 cryptonote_protocol: large block sync size before v4 (moneromooo-monero)
7b747607 cryptonote_protocol: kick idle synchronizing peers (moneromooo-monero)
2017-08-17 21:39:44 +02:00
Riccardo Spagni
4b2cc123ff
Merge pull request #2287
827afcb7 protocol: pass blockchain cumulative difficulty when syncing (moneromooo-monero)
2017-08-17 21:35:02 +02:00
moneromooo-monero
5a283078ec
cryptonote_protocol: large block sync size before v4 2017-08-17 13:11:52 +01:00
moneromooo-monero
827afcb7ea
protocol: pass blockchain cumulative difficulty when syncing
Not used yet.
2017-08-15 21:03:37 +01:00
Riccardo Spagni
3ff67323b7
Merge pull request #2288
c6e200a8 core: add --db-salvage command line flag (moneromooo-monero)
2017-08-15 20:57:26 +02:00
Riccardo Spagni
53dde37ceb
Merge pull request #2276
a1891ebe tests: fix tests build (moneromooo-monero)
2017-08-15 20:53:41 +02:00
Riccardo Spagni
79479a3614
Merge pull request #2250
f4f7eeba blockchain: log more info when we reject an orphan (moneromooo-monero)
2017-08-15 20:48:08 +02:00
Riccardo Spagni
12c70fedc0
Merge pull request #2246
d732c73e blockchain: remove a few unused variables (moneromooo-monero)
2017-08-15 20:47:32 +02:00
Riccardo Spagni
1cf4665d2a
Merge pull request #2237
5d4ef719 core: speed up output index unique set calculation (moneromooo-monero)
19d7f568 perf_timer: allow profiling more granular than millisecond (moneromooo-monero)
bda8c598 epee: add nanosecond timer and pause/restart profiling macros (moneromooo-monero)
2017-08-15 20:45:47 +02:00