Commit graph

8984 commits

Author SHA1 Message Date
moneromooo-monero
e108330248
wallet: reuse cached height when set after refresh
Refreshing sets cached height, which is otherwise got by calling
get_info. Since get_info is called upon needing to display a prompt
after a command has finished, it can be used to determine how much
time a given command took to run if the cache timeout lapses while
the command runs. Refreshing caches the height as a side effect, so
get_info will never be called as a result of displaying a prompt
after refreshing (and potentially leaking how much time it took to
process a set of transactions, therefore leaking whether we got
some monero in them).
2019-11-01 18:59:41 +00:00
moneromooo-monero
5956beaa15
wallet2: fix is_synced checking target height, not height
Target height would be appropriate for the daemon, which syncs
off other daemons, but the wallet syncs off the daemon it's
connected to, and its target is the daemon's current height.
2019-11-01 18:59:39 +00:00
moneromooo-monero
fd35e2304a
wallet: fix another facet of "did I get some monero" information leak
We get new pool txes before processing any tx, pool or not.
This ensures that if we're asked for a password, this does not
cause a measurable delay in the txpool query after the last
block query.
2019-11-01 18:59:38 +00:00
moneromooo-monero
d5472bd87b
wallet2: do not send an unnecessary last getblocks.bin call on refresh
The "everything refreshed" state was detected when a refresh call did
not return any new blocks. This can be detected without that extra
"empty" call by comparing the claimed node height to the height of
the last block retrieved. Doing this avoids that last call, saves
some bandwidth, and makes the common refresh case use only one call
rather than two.

As a side effect, it prevents an information leak reported by
Tramèr et al: if the wallet retrieves a set of blocks which includes
an output sent to the refreshing wallet, the wallet will prompt the
user for the password to decode the amount and calculate the key
image for the new output, and this will delay subsequent calls to
getblocks.bin, allowing a passive adversary to note the delay and
deduce when the wallet receives at least one output.

This can still happen if the wallet downloads more than 1000 blocks,
since this will be split in several calls, but then the most the
adversary can tell is which 1000 block section the user received
some monero (the adversary can estimate the heights of the blocks
by calculating how many "large" transfers are done, which will be
sections of blocks, the last of which will usually be below 1000,
but the size of the data should allow the actual number of blocks
sent to be determined fairly accurately).

This timing trick still be used via the subsequent scan for incoming
txes in the txpool, which will be fixed later.
2019-11-01 18:59:37 +00:00
moneromooo-monero
97ae7bb5cb
wallet2: do not repeatedly ask for pool txes sent to us
This lets a passive attacker with access to the network link
between node and wallet perform traffic analysis to deduce
when an idle wallet receives a transaction.

Reported by Tramèr et al.
2019-11-01 10:42:01 +00:00
luigi1111
4c9fd8d86d
Merge pull request #6044
eb16755 blockchain: fix unwanted error when probing the pool for a tx (moneromooo-monero)
2019-10-27 16:28:33 -05:00
luigi1111
f9ddda75a2
Merge pull request #6038
e8964c2 wallet: do not warn if the rpc cost was free (moneromooo-monero)
2019-10-27 16:27:31 -05:00
moneromooo-monero
eb16755083
blockchain: fix unwanted error when probing the pool for a tx 2019-10-27 19:23:25 +00:00
moneromooo-monero
e8964c26cc
wallet: do not warn if the rpc cost was free 2019-10-27 10:59:31 +00:00
luigi1111
b928ead30e
Merge pull request #6036
7bca3e0 CMake build out of source (trasherdk)
2019-10-26 12:23:28 -05:00
TrasherDK
7bca3e069f CMake build out of source 2019-10-26 15:10:23 +02:00
luigi1111
3b0a43a8d4
Merge pull request #6033
da2ffd6 python-rpc: add missing daemon RPC (moneromooo-monero)
2019-10-25 20:51:04 -05:00
luigi1111
ef8b3a15b4
Merge pull request #6017
5734686 rpc: Include tag in get_info version string (ndorf)
2019-10-25 20:48:04 -05:00
luigi1111
bae2d00ec4
Merge pull request #6025
aceb1dc Translations from weblate + resync (Monero-Weblate)
2019-10-25 20:46:38 -05:00
luigi1111
b408416e7e
Merge pull request #6034
f7f7513 rpc: fix PRIx64 build error on some systems (moneromooo-monero)
2019-10-25 20:45:27 -05:00
luigi1111
0aec2613f2
Merge pull request #6032
978a61f functional_tests: fix rpc_payment tests with python 3 (moneromooo-monero)
2019-10-25 20:43:27 -05:00
moneromooo-monero
f7f7513ec3
rpc: fix PRIx64 build error on some systems 2019-10-26 00:05:21 +00:00
moneromooo-monero
978a61f34f
functional_tests: fix rpc_payment tests with python 3 2019-10-25 23:20:33 +00:00
moneromooo-monero
da2ffd6abe
python-rpc: add missing daemon RPC 2019-10-25 23:10:35 +00:00
luigi1111
7caa2b0d3e
Merge pull request #6024
296ec7c device: bounds checking in Ledger send_secret/receive_secret (xiphon)
2019-10-25 16:06:37 -05:00
luigi1111
07c6789148
Merge pull request #5958
d25acd7 Add hmac over encrypted value during transaction (clashm)
34f28a7 Add display address (clashm)
235b94e Revert PR #5835 (export view key) (clashm)
32febd2 Fix debug feature (clashm)
2019-10-25 16:03:24 -05:00
luigi1111
0a4920414f
Merge pull request #6031
27cb8bc revert changes to translations (moneromooo-monero)
2019-10-25 14:40:28 -05:00
moneromooo-monero
27cb8bc509
revert changes to translations
Those should be updated from the Weblate tool only
2019-10-25 19:32:07 +00:00
luigi1111
86d085e988
Merge pull request #6028
174a6ac tx_pool: fix divide by 0 in log (moneromooo-monero)
2019-10-25 14:29:15 -05:00
luigi1111
f253bf3846
Merge pull request #6007
a4dc575 rpc: add a flush_cache RPC (moneromooo-monero)
2019-10-25 14:20:20 -05:00
luigi1111
9a995f338a
Merge pull request #6023
643dcb9 net: link with libzmq (moneromooo-monero)
2019-10-25 13:56:06 -05:00
luigi1111
bae49e9fbd
Merge pull request #6022
dd28383 depends: bump cppzmq version to 4.4.1 (anonimal)
157b3fc depends: bump zeromq version to 4.1.7 (anonimal)
2019-10-25 13:54:15 -05:00
luigi1111
68b03abdc5
Merge pull request #6021
65e8a89 Change monerod --proxy to --tx-proxy (vtnerd)
2019-10-25 13:52:19 -05:00
luigi1111
4e2b139e72
Merge pull request #6020
3816ac2 build: fix building on Windows due to _FORTIFY_SOURCE changes in MSYS2 (iDunk5400)
78b076c Windows: enable high-entropy ASLR where available (iDunk5400)
2019-10-25 13:48:25 -05:00
luigi1111
4a67bdbde4
Merge pull request #6019
d60c1b6 changed 'batttery' to 'battery' (jakehemmerle)
2019-10-25 13:45:59 -05:00
luigi1111
711625c467
Merge pull request #6014
93e7426 wallet2: error out when we need a daemon password but have no prompt function (moneromooo-monero)
2019-10-25 13:44:31 -05:00
luigi1111
59439f8113
Merge pull request #6013
635401b wallet2: fix the logged number of detached transfers (moneromooo-monero)
2019-10-25 13:43:00 -05:00
moneromooo-monero
a4dc575ccb
rpc: add a flush_cache RPC
This allows flushing internal caches (for now, the bad tx cache,
which will allow debugging a stuck monerod after it has failed to
verify a transaction in a block, since it would otherwise not try
again, making subsequent log changes pointless)
2019-10-25 18:41:54 +00:00
luigi1111
960c215801
Merge pull request #5357
b3a9a4d add a quick early out to get_blocks.bin when up to date (moneromooo-monero)
2899379 daemon, wallet: new pay for RPC use system (moneromooo-monero)
ffa4602 simplewallet: add public_nodes command (moneromooo-monero)
2019-10-25 13:38:21 -05:00
moneromooo-monero
174a6ac9c5
tx_pool: fix divide by 0 in log
Coverity 205394
2019-10-25 16:56:55 +00:00
Weblate
aceb1dce85 Translations from weblate + resync
Translators:

* Ukrainian

    * Agent LvM
    * TheFuzzStone

* Italian

    * erciccione
    * Luca Ciavatta
    * Alessandro Lotta
    * stefanomarty

* Chinese (Traditional)

    * Lafudoci

* Catalan

    * Assumpta Anglada
    * BennyBeat
    * Ecron
    * Joan Montané

* Russian

    * Agent LvM
    * TheFuzzStone
    * Russian Bear

* Japanese

    * Andrew Onishi
    * Scott Anecito

* French

    * el00ruobuob
    * glv2
    * Viktor

* Czech

    * dskch83

* Chinese (Simplified)

    * jindouyunz
    * TE Scott
    * razorshaman909

* Dutch

    * Jonathan Heirbaut
    * siesero

* German

    * fullmetalScience
    * Christian
    * M5M400
    * Sneaky Squid
    * Paul Rant
    * Tim Hartmann
2019-10-25 15:08:59 +00:00
xiphon
296ec7c9bb device: bounds checking in Ledger send_secret/receive_secret 2019-10-25 13:13:23 +00:00
moneromooo-monero
643dcb9700
net: link with libzmq 2019-10-25 12:06:16 +00:00
moneromooo-monero
ffa46026b5
simplewallet: add public_nodes command
Lists nodes exposing their RPC port for public use
2019-10-25 09:34:41 +00:00
moneromooo-monero
2899379791
daemon, wallet: new pay for RPC use system
Daemons intended for public use can be set up to require payment
in the form of hashes in exchange for RPC service. This enables
public daemons to receive payment for their work over a large
number of calls. This system behaves similarly to a pool, so
payment takes the form of valid blocks every so often, yielding
a large one off payment, rather than constant micropayments.

This system can also be used by third parties as a "paywall"
layer, where users of a service can pay for use by mining Monero
to the service provider's address. An example of this for web
site access is Primo, a Monero mining based website "paywall":
https://github.com/selene-kovri/primo

This has some advantages:
 - incentive to run a node providing RPC services, thereby promoting the availability of third party nodes for those who can't run their own
 - incentive to run your own node instead of using a third party's, thereby promoting decentralization
 - decentralized: payment is done between a client and server, with no third party needed
 - private: since the system is "pay as you go", you don't need to identify yourself to claim a long lived balance
 - no payment occurs on the blockchain, so there is no extra transactional load
 - one may mine with a beefy server, and use those credits from a phone, by reusing the client ID (at the cost of some privacy)
 - no barrier to entry: anyone may run a RPC node, and your expected revenue depends on how much work you do
 - Sybil resistant: if you run 1000 idle RPC nodes, you don't magically get more revenue
 - no large credit balance maintained on servers, so they have no incentive to exit scam
 - you can use any/many node(s), since there's little cost in switching servers
 - market based prices: competition between servers to lower costs
 - incentive for a distributed third party node system: if some public nodes are overused/slow, traffic can move to others
 - increases network security
 - helps counteract mining pools' share of the network hash rate
 - zero incentive for a payer to "double spend" since a reorg does not give any money back to the miner

And some disadvantages:
 - low power clients will have difficulty mining (but one can optionally mine in advance and/or with a faster machine)
 - payment is "random", so a server might go a long time without a block before getting one
 - a public node's overall expected payment may be small

Public nodes are expected to compete to find a suitable level for
cost of service.

The daemon can be set up this way to require payment for RPC services:

  monerod --rpc-payment-address 4xxxxxx \
    --rpc-payment-credits 250 --rpc-payment-difficulty 1000

These values are an example only.

The --rpc-payment-difficulty switch selects how hard each "share" should
be, similar to a mining pool. The higher the difficulty, the fewer
shares a client will find.
The --rpc-payment-credits switch selects how many credits are awarded
for each share a client finds.
Considering both options, clients will be awarded credits/difficulty
credits for every hash they calculate. For example, in the command line
above, 0.25 credits per hash. A client mining at 100 H/s will therefore
get an average of 25 credits per second.
For reference, in the current implementation, a credit is enough to
sync 20 blocks, so a 100 H/s client that's just starting to use Monero
and uses this daemon will be able to sync 500 blocks per second.

The wallet can be set to automatically mine if connected to a daemon
which requires payment for RPC usage. It will try to keep a balance
of 50000 credits, stopping mining when it's at this level, and starting
again as credits are spent. With the example above, a new client will
mine this much credits in about half an hour, and this target is enough
to sync 500000 blocks (currently about a third of the monero blockchain).

There are three new settings in the wallet:

 - credits-target: this is the amount of credits a wallet will try to
reach before stopping mining. The default of 0 means 50000 credits.

 - auto-mine-for-rpc-payment-threshold: this controls the minimum
credit rate which the wallet considers worth mining for. If the
daemon credits less than this ratio, the wallet will consider mining
to be not worth it. In the example above, the rate is 0.25

 - persistent-rpc-client-id: if set, this allows the wallet to reuse
a client id across runs. This means a public node can tell a wallet
that's connecting is the same as one that connected previously, but
allows a wallet to keep their credit balance from one run to the
other. Since the wallet only mines to keep a small credit balance,
this is not normally worth doing. However, someone may want to mine
on a fast server, and use that credit balance on a low power device
such as a phone. If left unset, a new client ID is generated at
each wallet start, for privacy reasons.

To mine and use a credit balance on two different devices, you can
use the --rpc-client-secret-key switch. A wallet's client secret key
can be found using the new rpc_payments command in the wallet.
Note: anyone knowing your RPC client secret key is able to use your
credit balance.

The wallet has a few new commands too:

 - start_mining_for_rpc: start mining to acquire more credits,
regardless of the auto mining settings
 - stop_mining_for_rpc: stop mining to acquire more credits
 - rpc_payments: display information about current credits with
the currently selected daemon

The node has an extra command:

 - rpc_payments: display information about clients and their
balances

The node will forget about any balance for clients which have
been inactive for 6 months. Balances carry over on node restart.
2019-10-25 09:34:38 +00:00
anonimal
157b3fcff4
depends: bump zeromq version to 4.1.7
Resolves https://hackerone.com/reports/652911
2019-10-25 01:22:17 +00:00
Lee Clagett
65e8a89e1c Change monerod --proxy to --tx-proxy 2019-10-24 21:06:31 -04:00
anonimal
dd28383a4b
depends: bump cppzmq version to 4.4.1 2019-10-25 00:47:33 +00:00
luigi1111
cc46f05f1f
Merge pull request #6002
0136bf7 v12 fork heights (tevador)
2019-10-24 18:57:05 -05:00
Jake Hemmerle
d60c1b6312 changed 'batttery' to 'battery' 2019-10-24 19:55:28 -04:00
luigi1111
be6c5afabb
Merge pull request #6016
afcfb3b easylogging++: windows does not need terminal colour support (moneromooo-monero)
2019-10-24 18:41:38 -05:00
luigi1111
2319b9dd9f
Merge pull request #6015
56895ee cmake: Fix generation of version.cpp (ndorf)
2019-10-24 18:39:03 -05:00
iDunk5400
78b076c7f2
Windows: enable high-entropy ASLR where available 2019-10-25 01:22:56 +02:00
iDunk5400
3816ac24f0
build: fix building on Windows due to _FORTIFY_SOURCE changes in MSYS2
Also, enable other hardening options that work on Windows with GCC 9.x
2019-10-25 01:19:26 +02:00
Nathan Dorfman
57346864a3 rpc: Include tag in get_info version string 2019-10-24 13:48:35 -06:00