aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Adding support for hidden (anonymity) txpoolLee Clagett2019-11-021-1/+2
| |/ |/|
* | epee: close connection when the peer has done somoneromooo-monero2019-11-111-1/+7
|/ | | | | | This fixes rapid reconnections failing as the peer hasn't yet worked out the other side is gone, and will reject "duplicate" connections until a timeout.
* epee: allow a random component in once_a_time timeoutsmoneromooo-monero2019-11-011-4/+16
|
* Merge pull request #5357luigi11112019-10-254-7/+50
|\ | | | | | | | | | | 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)
| * daemon, wallet: new pay for RPC use systemmoneromooo-monero2019-10-254-7/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #6006luigi11112019-10-241-2/+6
|\ \ | |/ |/| | | 9f3be3b epee: use SO_REUSEADDR on non-Windows targets (xiphon)
| * epee: use SO_REUSEADDR on non-Windows targetsxiphon2019-10-221-2/+6
| |
* | Merge pull request #5996luigi11112019-10-221-0/+1
|\ \ | | | | | | | | | 23ba69e epee: fix SSL server handshake, run_one() can block, use poll_one() (xiphon)
| * | epee: fix SSL server handshake, run_one() can block, use poll_one()xiphon2019-10-181-0/+1
| |/
* | Merge pull request #5986luigi11112019-10-221-1/+1
|\ \ | | | | | | | | | 1080136 abstract_tcp_server2: move 'Trying to connect' from error to debug (moneromooo-monero)
| * | abstract_tcp_server2: move "Trying to connect" from error to debugmoneromooo-monero2019-10-141-1/+1
| | | | | | | | | | | | and fix the message grammar
* | | Merge pull request #5966luigi11112019-10-221-0/+3
|\ \ \ | |_|/ |/| | | | | be82c40 Support median block size > 4 GB (moneromooo-monero)
| * | Support median block size > 4 GBmoneromooo-monero2019-10-211-0/+3
| | | | | | | | | | | | | | | add a 128/64 division routine so we can use a > 32 bit median block size in calculations
* | | Merge pull request #5911luigi11112019-10-161-0/+5
|\ \ \ | | | | | | | | | | | | e48dcb7 levin: armour against some 'should not happen' case (moneromooo-monero)
| * | | levin: armour against some "should not happen" casemoneromooo-monero2019-10-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | If adding a response handler after the protocol is released, they could never be cancelled again, and would end up keeping a ref that never goes away
* | | | Merge pull request #5947luigi11112019-10-141-4/+2
|\ \ \ \ | | | | | | | | | | | | | | | c9cfbf7 epee: tcp server - set SO_LINGER instead of SO_REUSEADDR option (xiphon)
| * | | | epee: tcp server - set SO_LINGER instead of SO_REUSEADDR optionxiphon2019-10-021-4/+2
| | |/ / | |/| |
* | | | Merge pull request #5937luigi11112019-10-141-1/+1
|\ \ \ \ | |_|_|/ |/| | | | | | | 4b654f6 abstract_tcp_server2: log pointer, not contents, where appropriate (moneromooo-monero)
| * | | abstract_tcp_server2: log pointer, not contents, where appropriatemoneromooo-monero2019-09-271-1/+1
| | | |
* | | | Merge pull request #5918luigi11112019-10-082-2/+6
|\ \ \ \ | | | | | | | | | | | | | | | 4371791 epee: implement handshake timeout for SSL connections (xiphon)
| * | | | epee: implement handshake timeout for SSL connectionsxiphon2019-09-172-2/+6
| | |_|/ | |/| |
* | | | Merge pull request #5917luigi11112019-10-081-1/+2
|\ \ \ \ | |_|_|/ |/| | | | | | | 7d81850 epee: fix network timeouts in blocked_mode_client (xiphon)
| * | | epee: fix network timeouts in blocked_mode_clientxiphon2019-09-161-1/+2
| |/ /
* | | Merge pull request #5910luigi11112019-09-301-0/+5
|\ \ \ | | | | | | | | | | | | 1b91beb abstract_tcp_server2: fix lingering connections (moneromooo-monero)
| * | | abstract_tcp_server2: fix lingering connectionsmoneromooo-monero2019-09-121-0/+5
| |/ / | | | | | | | | | | | | | | | Resetting the timer after shutdown was initiated would keep a reference to the object inside ASIO, which would keep the connection alive until the timer timed out
* | | Merge pull request #5893luigi11112019-09-301-1/+13
|\ \ \ | |_|/ |/| | | | | Coverity fixes [3a81639, 1bd962d, 2825f07, d099658, d46f701, cd57a10] (anonimal)
| * | epee: abstract_tcp_server2: resolve CID 203919 (DC.WEAK_CRYPTO)anonimal2019-09-081-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem actually exists in two parts: 1. When sending chunks over a connection, if the queue size is greater than N, the seed is predictable across every monero node. >"If rand() is used before any calls to srand(), rand() behaves as if it was seeded with srand(1). Each time rand() is seeded with the same seed, it must produce the same sequence of values." 2. The CID speaks for itself: "'rand' should not be used for security-related applications, because linear congruential algorithms are too easy to break." *But* this is an area of contention. One could argue that a CSPRNG is warranted in order to fully mitigate any potential timing attacks based on crafting chunk responses. Others could argue that the existing LCG, or even an MTG, would suffice (if properly seeded). As a compromise, I've used an MTG with a full bit space. This should give a healthy balance of security and speed without relying on the existing crypto library (which I'm told might break on some systems since epee is not (shouldn't be) dependent upon the existing crypto library).
* | | epee: misc_log_ex.h can now be used in C codemoneromooo-monero2019-09-241-0/+26
| | | | | | | | | | | | use mfatal/merror/mwarning/minfo/mdebug/mtrace
* | | Properly format multiline logsmoneromooo-monero2019-09-161-21/+21
| | | | | | | | | | | | | | | As a side effect, colouring on Windows should now work regardless of version
* | | Merge pull request #5898luigi11112019-09-141-1/+1
|\ \ \ | |_|/ |/| | | | | 73f22c4 depends: fix MacOS build with Clang 3.7.1 (vtnerd)
| * | depends: fix MacOS build with Clang 3.7.1Lee Clagett2019-09-081-1/+1
| |/
* | Fix IP address serialization on big endianmoneromooo-monero2019-09-041-1/+15
| | | | | | | | | | IP addresses are stored in network byte order even on little endian hosts
* | storages: fix "portable" storage on big endianmoneromooo-monero2019-09-044-3/+99
| |
* | storages: fix writing varints on big endianmoneromooo-monero2019-09-041-1/+1
| |
* | epee: fix local/loopback checks on big endianmoneromooo-monero2019-09-041-0/+7
|/ | | | IPv4 addresses are kept in network byte order in memory
* Merge pull request #5824luigi11112019-09-041-1/+1
|\ | | | | | | 2a41dc0 epee: fix connections not being properly closed in some instances (moneromooo-monero)
| * epee: fix connections not being properly closed in some instancesmoneromooo-monero2019-08-191-1/+1
| | | | | | | | Fixed by Fixed by crCr62U0
* | Merge pull request #5814luigi11112019-09-041-91/+0
|\ \ | | | | | | | | | | | | bdcdb0e Remove unused code under WINDWOS_PLATFORM guard (tomsmeding) a84aa04 syncobj.h no longer defines shared_guard, so remove those define's (tomsmeding)
| * | syncobj.h no longer defines shared_guard, so remove those define'sTom Smeding2019-08-231-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The removed preprocessor macro's refer to types that are not defined in the file anymore; the only other place where shared_guard is defined is in winobj.h, which also defines the same macro's. Therefore, this change is safe. (Side note is that these macro's weren't used at all anyway, but that is orthogonal to the issue.)
| * | Remove unused code under WINDWOS_PLATFORM guardTom Smeding2019-08-151-88/+0
| | | | | | | | | | | | | | | This code has been present, unchanged, ever since the original move to github in 2014 with commit 296ae46ed.
* | | Merge pull request #5536luigi11112019-09-042-13/+78
|\ \ \ | | | | | | | | | | | | 1a367d6 simplewallet: lock console on inactivity (moneromooo-monero)
| * | | simplewallet: lock console on inactivitymoneromooo-monero2019-08-282-13/+78
| | | |
* | | | Added support for "noise" over I1P/Tor to mask Tx transmission.Lee Clagett2019-07-177-61/+158
| | | |
* | | | Add ref-counted buffer byte_slice. Currently used for sending TCP data.Lee Clagett2019-07-168-145/+232
|/ / /
* | / fix feature not introduced until boost 1.66Jethro Grassie2019-08-201-1/+1
| |/ |/|
* | epee: support unicode in parsed stringsmoneromooo-monero2019-08-162-22/+61
| |
* | Merge pull request #5674luigi11112019-08-151-0/+24
|\ \ | | | | | | | | | | | | fcbf7b3 p2p: propagate out peers limit to payload handler (moneromooo-monero) 098aadf p2p: close the right number of connections on setting max in/out peers (moneromooo-monero)
| * | p2p: close the right number of connections on setting max in/out peersmoneromooo-monero2019-06-191-0/+24
| | |
* | | Merge pull request #5649luigi11112019-08-152-2/+6
|\ \ \ | | | | | | | | | | | | a182df2 Bans for RPC connections (hyc)
| * | | Bans for RPC connectionsHoward Chu2019-06-162-2/+6
| |/ / | | | | | | | | | | | | Make bans control RPC sessions too. And auto-ban some bad requests. Drops HTTP connections whenever response code is 500.