Commit Graph

734 Commits

Author SHA1 Message Date
luigi1111 105e2304a2
Merge pull request #8083
e8e507f rpc: fix DoS vector in get_output_distribution (moneromooo-monero)
2021-11-26 23:05:31 -06:00
Howard Chu 0221b01519
Add calcpow RPC
Calculate PoW hash for a block candidate
2021-11-20 18:52:05 +00:00
moneromooo-monero e8e507f36f
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:12 +00:00
luigi1111 a6367693c7
Merge pull request #7960
2e8936f rpc: Fix get_transactions failing when not found (Nathan Dorfman)
2021-10-11 12:59:32 -05:00
luigi1111 298c9a357f
Merge pull request #7891
dfee15e RPC and ZeroMQ APIs to support p2pool (SChernykh)
2021-09-23 22:10:03 -05:00
Nathan Dorfman 2e8936f614 rpc: Fix get_transactions failing when not found 2021-09-20 17:32:01 -06:00
selsta 3a90be4bd6
rpc: don't set error code as status string 2021-09-15 08:57:41 +02:00
SChernykh dfee15eee1 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-11 15:15:07 +02:00
luigi1111 7848a467c5
Merge pull request #7616
4ced092 daemon: allow proxy configuration (anon, selsta, tobtoht)
2021-09-09 15:09:51 -04:00
anon 4ced092aae daemon: allow proxy configuration
Co-authored-by: selsta <selsta@sent.at>
Co-authored-by: tobtoht <thotbot@protonmail.com>
2021-08-20 21:24:29 +02:00
selsta 87a092811d
rpc: source file extensions must be explicit (cmake warning) 2021-07-15 09:42:57 +02:00
luigi1111 7499837a6f
Merge pull request #7661
08e4497 Improve cryptonote (block and tx) binary read performance (Lee Clagett)
2021-06-10 12:00:54 -05:00
luigi1111 a1a3e970f7
Merge pull request #7662
4da1112 rpc: send confirmations in get_transactions result (moneromooo-monero)
2021-06-10 11:34:20 -05:00
luigi1111 288e5ec350
Merge pull request #7384
494f2e1 rpc: fix some error return codes/status (moneromooo-monero)
2021-04-16 12:48:05 -05:00
luigi1111 2218e23e84
Merge pull request #7002
673c6d2 Reduce compilation time of epee/portable_storage_template_helper.h (mj-xmr)
2021-04-16 12:43:42 -05:00
moneromooo-monero 4da1112967
rpc: send confirmations in get_transactions result
if the wallet does it, it would get a wrong result (possibly even
negative) if its local chain is not synced up to the daemon's yet
2021-04-15 15:31:52 +00:00
luigi1111 c2bc829cca
Merge pull request #7326
cf266d6 bootstrap_daemon: proxy configuration support (xiphon)
2021-03-29 21:08:36 -04:00
mj-xmr 673c6d2d11 Reduce compilation time of epee/portable_storage_template_helper.h 2021-03-28 15:41:48 +02:00
moneromooo-monero 494f2e1c21
rpc: fix some error return codes/status
Some RPC return an error string in status, and the code must return
true on error (with a status string).
2021-02-15 12:27:19 +00:00
Lee Clagett 2a20434705 Fix monerod --rpc-ssl disabled 2021-01-28 17:53:47 +00:00
luigi1111 602926fe9d
Merge pull request #7366
9867a91 Store RPC SSL key/cert for consistent authentication between runs (Lee Clagett)
2021-03-20 01:38:03 -04:00
luigi1111 8d7c1135b8
Merge pull request #6810
19b2283 New add_aux_pow RPC to support merge mining (moneromooo-monero)
2021-03-20 01:33:10 -04:00
Lee Clagett 9867a913dc Store RPC SSL key/cert for consistent authentication between runs 2021-02-13 20:26:26 +00:00
moneromooo-monero 19b228393f
New add_aux_pow RPC to support merge mining 2021-02-09 11:58:21 +00:00
Kevin Barbour 85db1734e7
Remove unused variables in monero codebase
There are quite a few variables in the code that are no longer
(or perhaps never were) in use. These were discovered by enabling
compiler warnings for unused variables and cleaning them up.

In most cases where the unused variables were the result
of a function call the call was left but the variable
assignment removed, unless it was obvious that it was
a simple getter with no side effects.
2021-02-09 08:05:05 +01:00
Lee Clagett 08e4497c6e Improve cryptonote (block and tx) binary read performance 2021-01-23 06:23:39 +00:00
xiphon cf266d66dd bootstrap_daemon: proxy configuration support 2021-01-21 13:45:44 +00:00
luigi1111 5c497ed22f
Merge pull request #7112
47590fc rpc: report target height as 0 when synced (moneromooo-monero)
2021-01-15 23:43:46 -05:00
moneromooo-monero 1eb14af1a3
rpc: limit the number of txes for get_blocks.bin 2020-12-29 04:31:58 +00:00
moneromooo-monero d2fda6c25f
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:07 +00:00
moneromooo-monero 5a1ac9c0ef
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:03:11 +00:00
moneromooo-monero d660f22ed1
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 21:59:18 +00:00
moneromooo-monero 47590fc80b
rpc: report target height as 0 when synced
since it only makes sense when syncing, and it confuses people
2020-12-10 17:05:34 +00:00
Alexander Blair ce564e7ebf
Merge pull request #7030
0363476ee rpc: get_info - add 'synchronized' field (xiphon)
2020-12-04 13:21:36 -08:00
Alexander Blair 976fcb5985
Merge pull request #7024
aaf837cf5 rpc: skip non-synced bootstrap daemons in --no-sync mode too (xiphon)
2020-12-01 14:23:21 -08:00
Alexander Blair 7cd0c64210
Merge pull request #6948
65903d2cf Add rpc-restricted-bind-ip option (Howard Chu)
2020-12-01 14:21:19 -08:00
luigi1111 ad843541d5
Merge pull request #7008
3247f11 Silence stupid warnings (Howard Chu)
2020-11-29 01:57:24 -06:00
luigi1111 9945ca7a62
Merge pull request #6960
5569a8e rpc: on_send_raw_tx (bootstrap) - send to bootstrap daemon and P2P (xiphon)
2020-11-29 01:53:12 -06:00
luigi1111 bb56248acd
Merge pull request #6949
aad780b Fix CLI and unrestricted RPC relay_tx with stempool (Lee Clagett)
2020-11-29 01:52:23 -06:00
luigi1111 7539d4ac74
Merge pull request #6895
b49f489 fix next_seed_height regression in getblocktemplate rpc (xnbya)
2020-11-29 00:41:42 -06:00
luigi1111 678237835f
Merge pull request #6892
ad7ea2c core_rpc_server: on_send_raw_tx - fix bootstrap daemon mode check (xiphon)
2020-11-29 00:40:03 -06:00
luigi1111 d45a4ba106
Merge pull request #6849
f4b2382 rpc_private_headers declaration fix (malbit)
2020-11-28 22:31:25 -06:00
xiphon 0363476ee3 rpc: get_info - add 'synchronized' field 2020-11-19 12:51:31 +00:00
xiphon aaf837cf5f rpc: skip non-synced bootstrap daemons in --no-sync mode too 2020-11-17 23:15:36 +00:00
xiphon 5569a8e426 rpc: on_send_raw_tx (bootstrap) - send to bootstrap daemon and P2P 2020-11-15 03:13:07 +00:00
Howard Chu 3247f11638
Silence stupid warnings 2020-11-11 02:34:14 +00:00
Lee Clagett aad780bcfa Fix CLI and unrestricted RPC relay_tx with stempool 2020-10-29 00:17:55 -04:00
Howard Chu 65903d2cfc
Add rpc-restricted-bind-ip option
Fixes #6369
2020-10-29 00:22:18 +00:00
Alexis Enston b49f48962b fix next_seed_height regression in getblocktemplate rpc 2020-10-13 11:07:59 +01:00
xiphon 4cf3545a31 core_rpc_server: on_get_blocks - forward bootstrap daemon error 2020-10-13 00:44:59 +00:00
xiphon ad7ea2c60c core_rpc_server: on_send_raw_tx - fix bootstrap daemon mode check 2020-10-12 23:49:37 +00:00
Michal m@lbit Malicki f4b2382713
rpc_private_headers declaration fix 2020-09-27 13:41:44 +01:00
TheCharlatan 80e535c95a
wallet2: adapt to deterministic unlock time 2020-09-15 11:40:31 +00:00
moneromooo-monero 5498142e8f
rpc: assume randomx from v13 onwards 2020-09-07 01:13:06 +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
luigi1111 a51ccc036f
Merge pull request #6770
bdc6b10 Fix ZMQ pruned bulletproof transactions (vtnerd)
2020-08-31 16:50:18 -05:00
moneromooo-monero 9d42649d58
core: fix mining from a block that's not the current top 2020-08-27 15:13:00 +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
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
Lee Clagett bdc6b10d62 Fix ZMQ pruned bulletproof transactions 2020-08-19 00:36:06 -04: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
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 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
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
Lee Clagett 4e2377995d Change ZMQ-JSON txextra to hex and remove unnecessary base fields 2020-08-14 23:01:00 +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 13eee1d6ab
rpc: reject wrong sized txid
Reporter requested credit to be given to Decred
2020-07-30 22:52:14 +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
Alexander Blair a0d179e528
Merge pull request #6512
5ef0607da Update copyright year to 2020 (SomaticFanatic)
2020-07-19 03:32:59 -07: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 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 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
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
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 6e4a55ba7e
rpc: fix relay_tx error return mixup 2020-05-28 11:33:27 +00: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
moneromooo-monero 4d3c2d0b7b
rpc: add a sanity limit to a few RPC in restricted mode 2020-05-20 19:17:49 +00:00
moneromooo-monero 7ebb351c2d
rpc: lock access to the rpc payment object 2020-05-19 18:26:28 +00:00
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
luigi1111 f2c78f6a5b
Merge pull request #6486
feee455 Fixes for ZMQ JSON-RPC endpoint names for raw tx (vtnerd)
2020-05-06 00:34:30 -05:00
luigi1111 de025281dc
Merge pull request #6481
119f706 rpc: fix 'use_bootstrap_daemon_if_necessary' return value (xiphon)
2020-05-06 00:29:49 -05:00
Lee Clagett e5214a2ca2 Adding ZMQ/Pub support for txpool_add and chain_main events 2020-05-04 02:06:35 +00:00
Lee Clagett feee455c9f Fixes for ZMQ JSON-RPC endpoint names for raw tx 2020-04-29 01:07:27 -04:00
xiphon 119f706921 rpc: fix 'use_bootstrap_daemon_if_necessary' return value 2020-04-27 10:32:33 +00:00
Lee Clagett c26c93019a Add byte_stream for zero-copy serialization, and add support in ZMQ-JSON. 2020-04-11 04:12:11 +00:00
luigi1111 ec90f9a54b
Merge pull request #6453
d2d3a81 bootstrap_daemon: fix missing virtual destructor and lambda capture (clang warning) (xiphon)
2020-05-01 15:47:47 -05:00
xiphon d2d3a81d0e bootstrap_daemon: fix missing virtual destructor and lambda capture (clang warning) 2020-04-15 21:22:55 +00:00
luigi1111 5757d99208
Merge pull request #6361
68a6507 Fixed bug in ZMQ JSON-RPC method field (vtnerd)
2020-04-04 13:01:15 -05:00
luigi1111 0150a480fd
Merge pull request #6357
42a7a4d daemon: auto public nodes - cache and prioritize most stable nodes (xiphon)
2020-04-04 12:59:23 -05:00
luigi1111 cfc0f4a7fa
Merge pull request #6351
81c5943 Remove temporary std::string creation in some hex->bin calls (vtnerd)
5fcc23a Move hex->bin conversion to monero copyright files and with less includes (vtnerd)
3387f0e Reduce template bloat in hex->bin for ZMQ json (vtnerd)
2020-04-04 12:55:02 -05:00
luigi1111 ad5200e440
Merge pull request #6342
82da832 rpc: Add check for too old timestamps in payment signatures. (glv2)
2020-04-04 12:49:02 -05:00
luigi1111 081d49c59f
Merge pull request #6338
80d5320 Hash domain separation (SarangNoether)
2020-04-04 12:44:45 -05:00
Lee Clagett da99157462 Use byte_slice for sending zmq messages - removes data copy within zmq 2020-04-03 01:56:17 +00:00
Sarang Noether 80d5320fff Hash domain separation 2020-04-01 08:31:00 -04:00