Commit Graph

443 Commits

Author SHA1 Message Date
SomaticFanatic 5ef0607da6 Update copyright year to 2020
Update copyright year to 2020
2020-05-06 22:36:54 -04:00
luigi1111 9c660e159e
Merge pull request #6278
387fd66 Daemon: Print estimates for time until fully synced (rbrunner7)
2020-04-21 08:19:02 -05:00
luigi1111 6c7d928f19
Merge pull request #6336
760ecf2 console_handler: do not let exception past the dor (moneromooo-monero)
09c8111 threadpool: lock mutex in create (moneromooo-monero)
e377977 tx_pool: catch theoretical error in get_block_reward (moneromooo-monero)
2020-03-31 15:14:12 -05:00
rbrunner7 387fd668d1 Daemon: Print estimates for time until fully synced 2020-03-21 07:32:55 +01:00
Alexander Blair 8c2939a7cb
Merge pull request #6058
88b82bef simplewallet: point to "set help" in the lock screen message (moneromooo-monero)
f19c9f23 util: allow newlines in string to be split (moneromooo-monero)
2020-02-28 19:54:37 -08:00
moneromooo-monero 09c8111c53
threadpool: lock mutex in create
In some contrived case, it might theoretically be the case that
destroy is called from another thread, which would modify the
threads array from two threads.

Coverity 208372
2020-02-12 21:05:28 +00:00
Alexander Blair bd4acbf44c
Merge pull request #6183
3813a992 download: catch exceptions checking for size (moneromooo-monero)
2020-02-06 00:34:58 -08:00
Alexander Blair af27276452
Merge pull request #6178
7ac7d5d3 updates: fix source code URL on _WIN32 (selsta)
2020-02-06 00:33:49 -08:00
Alexander Blair 5558919e56
Merge pull request #6128
9fe8a76c perf_timer: fix pause/resume macros dereferencing too much (moneromooo-monero)
2020-01-24 20:06:12 -08:00
Alexander Blair c39ea485a0
Merge pull request #6141
b9b5c473 threadpool: use std::move when taking an element off the queue (moneromooo-monero)
2020-01-16 17:45:44 -08:00
moneromooo-monero 3813a992e4
download: catch exceptions checking for size
Happens on at least one windows box
2019-11-26 18:42:00 +00:00
moneromooo-monero f19c9f2307
util: allow newlines in string to be split 2019-11-25 13:17:18 +00:00
selsta 7ac7d5d32f
updates: fix source code URL on _WIN32 2019-11-25 00:37:54 +01:00
moneromooo-monero b9b5c473d1
threadpool: use std::move when taking an element off the queue
It has a std::function, which can have a capture context, and
the function runtime might be small
2019-11-15 13:24:34 +00:00
moneromooo-monero 9fe8a76c59
perf_timer: fix pause/resume macros dereferencing too much 2019-11-13 12:08:40 +00:00
moneromooo-monero 27522aaa12
core_tests: reset thread pool between tests
Avoids a DB error (leading to an assert) where a thread uses
a read txn previously created with an environment that was
since closed and reopened. While this usually works since
BlockchainLMDB renews txns if it detects the environment has
changed, this will not work if objects end up being allocated
at the same address as the previous instance, leading to stale
data usage.

Thanks hyc for the LMDB debugging.
2019-11-10 12:58:49 +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
moneromooo-monero 32f725d32f
Properly format multiline logs
As a side effect, colouring on Windows should now work
regardless of version
2019-09-16 16:58:01 +00:00
moneromooo-monero 1a367d6a22
simplewallet: lock console on inactivity 2019-08-28 19:01:48 +00:00
luigi1111 564bb1da3a
Merge pull request #5525
0605406 daemon: sort alt chains by height (moneromooo-monero)
4228ee0  daemon: add optional arguments to alt_chain_info (moneromooo-monero)
880ebfd daemon: add more chain specific info in alt_chain_info (moneromooo-monero)
2019-08-14 15:31:52 -05:00
tobtoht 037f94c54e
Remove Xiala.net from the list of dns resolvers
It is down permanently. See: https://xiala.net/
"Ende November 2018 werden alle Dienste von xiala.net abgeschaltet."
2019-06-21 09:40:10 +00:00
moneromooo-monero 880ebfdeea
daemon: add more chain specific info in alt_chain_info 2019-06-01 15:43:52 +00:00
Lee Clagett 3544596f9f Add ssl_options support to monerod's rpc mode. 2019-05-22 00:09:11 -04:00
moneromooo-monero e1016bce14
password: do not use line input on windows
This keeps its builtin command editing away

Thanks iDunk for testing on Windows
2019-05-10 18:56:50 +00:00
iDunk5400 b414b69f5c
Windows: fix a build error in MSYS2 with boost 1.70.0 2019-04-18 17:00:13 +02:00
Riccardo Spagni 64a4aa4f60
Merge pull request #5408
c4f8a8a6 build fix: combinator.h stdexcept missing include (Dusan Klinec)
2019-04-15 09:21:00 +02:00
Riccardo Spagni 89b8ecfc7c
Merge pull request #5392
a2195b9b crypto: replace rand<T>()%N idiom with unbiased rand_idx(N) (stoffu)
2019-04-15 09:14:28 +02:00
Riccardo Spagni 19e37c05d6
Merge pull request #5367
07b716bf util: name replace_file arguments better (moneromooo-monero)
2019-04-11 12:41:55 +02:00
Dusan Klinec c4f8a8a6a9
build fix: combinator.h stdexcept missing include 2019-04-07 17:41:13 +02:00
Riccardo Spagni 6f8e0a28b2
Merge pull request #5342
849a768f perf_timer: move some debug levels to info for consistency (moneromooo-monero)
2019-04-06 15:57:50 +02:00
stoffu a2195b9b7f
crypto: replace rand<T>()%N idiom with unbiased rand_idx(N) 2019-04-04 22:38:19 +09:00
Riccardo Spagni 1ed6441925
Merge pull request #5327
c23ea796 New interactive daemon command 'print_net_stats': Global traffic stats (rbrunner7)
2019-04-01 17:32:01 +02:00
Riccardo Spagni c994dc7ec0
Merge pull request #5306
8a97563a Use threadpool instead of new threads for DNS queries (Howard Chu)
2019-04-01 17:27:09 +02:00
moneromooo-monero 07b716bfea
util: name replace_file arguments better
It was confusing unless you read code and the rename(2) man page.
2019-03-29 16:32:00 +00:00
moneromooo-monero 849a768f36
perf_timer: move some debug levels to info for consistency 2019-03-24 20:15:33 +00:00
rbrunner7 c23ea7962d New interactive daemon command 'print_net_stats': Global traffic stats 2019-03-24 16:58:57 +01:00
moneromooo-monero 223c6b0796
dns_utils: really add default DNSSEC servers on failure
Coverity 196597
2019-03-20 23:46:22 +00:00
Riccardo Spagni 2900f6a3ca
Merge pull request #5198
9c4d403a dns_utils: use fallback if the default resolver does not support DNSSEC (moneromooo-monero)
2019-03-19 10:58:25 +02:00
Riccardo Spagni c3de019f56
Merge pull request #5192
d0e07b3d performance_tests: fix NetBSD build (moneromooo-monero)
7d88d8f2 discontinue use of alloca (moneromooo-monero)
2019-03-17 17:56:52 +02:00
Riccardo Spagni 6031a1f5b4
Merge pull request #5179
7c09882a dns_utils: remove MoneroPulse/checkpoints mention in TXT record code (moneromooo-monero)
2019-03-17 17:53:53 +02:00
Riccardo Spagni 4c91eb23a0
Merge pull request #5061
1f2930ce Update 2019 copyright (binaryFate)
2019-03-17 17:49:30 +02:00
Howard Chu 8a97563a93
Use threadpool instead of new threads for DNS queries 2019-03-17 15:39:15 +00:00
moneromooo-monero 3ac40938c3
timings: fix errno.h mispelt as error.h 2019-03-07 16:03:55 +00:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
Riccardo Spagni 5260111631
Merge pull request #5146
4a9257b4 Support docker for gitian builds (TheCharlatan)
2019-03-04 21:32:30 +02:00
Riccardo Spagni a28237c9ca
Merge pull request #5102
1eef0565 performance_tests: better stats, and keep track of timing history (moneromooo-monero)
2019-03-04 21:22:51 +02:00
Riccardo Spagni 46fd181cca
Merge pull request #4054
24569454 epee: add SSL support (moneromooo-monero)
2019-03-04 21:17:21 +02:00
moneromooo-monero 28b6dbf263
notify: fix tokenizing being too strict 2019-03-04 11:48:36 +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 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