aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol
Commit message (Collapse)AuthorAgeFilesLines
...
| * daemon, wallet: new pay for RPC use systemmoneromooo-monero2019-10-252-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #5998luigi11112019-10-241-3/+3
|\ \ | |/ |/| | | 0da09ed protocol: fix syncing from peers being too choosy about peers (moneromooo-monero)
| * protocol: fix syncing from peers being too choosy about peersmoneromooo-monero2019-10-171-3/+3
| |
* | Merge pull request #5981luigi11112019-10-221-1/+1
|\ \ | |/ |/| | | | | | | 88c9d90 protocol: initialize block_weight in block_complete_entry ctor (moneromooo-monero) fe443bb cryptonote: don't leave block_weight uninitialized (moneromooo-monero) 1ba9baf tx_pool: do not divide by 0 (moneromooo-monero)
| * protocol: initialize block_weight in block_complete_entry ctormoneromooo-monero2019-10-111-1/+1
| | | | | | | | CID 204479
* | Merge pull request #5933luigi11112019-10-142-7/+14
|\ \ | |/ |/| | | 3455efa ban peers sending bad pow outright (moneromooo-monero)
| * ban peers sending bad pow outrightmoneromooo-monero2019-09-252-7/+14
| | | | | | | | PoW is expensive to verify, so be strict
* | Merge pull request #5915luigi11112019-10-085-49/+229
|\ \ | | | | | | | | | 8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
| * | monerod can now sync from pruned blocksmoneromooo-monero2019-09-275-49/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the peer (whether pruned or not itself) supports sending pruned blocks to syncing nodes, the pruned version will be sent along with the hash of the pruned data and the block weight. The original tx hashes can be reconstructed from the pruned txes and theur prunable data hash. Those hashes and the block weights are hashes and checked against the set of precompiled hashes, ensuring the data we received is the original data. It is currently not possible to use this system when not using the set of precompiled hashes, since block weights can not otherwise be checked for validity. This is off by default for now, and is enabled by --sync-pruned-blocks
* | | Merge pull request #5926luigi11112019-10-081-1/+1
|\ \ \ | | | | | | | | | | | | 74a23e9 protocol: only print sync complete message when out of precompiled hashes (moneromooo-monero)
| * | | protocol: only print sync complete message when out of precompiled hashesmoneromooo-monero2019-09-241-1/+1
| |/ / | | | | | | | | | This avoids most premature triggers
* | | Merge pull request #5921luigi11112019-10-082-7/+12
|\ \ \ | |_|/ |/| | | | | 2a7d915 Fixed i2p/tor tx flooding bug (white noise disabled) (vtnerd)
| * | Fixed i2p/tor tx flooding bug (white noise disabled)Lee Clagett2019-07-292-7/+12
| |/
* | Merge pull request #5905luigi11112019-09-241-5/+0
|\ \ | | | | | | | | | Revert a96c1a4 and adc16d2 (moneromooo-monero)
| * | Revert "cryptonote_protocol: drop peers we can't download from when syncing"moneromooo-monero2019-09-111-5/+0
| | | | | | | | | | | | This reverts commit a96c1a46d4b3854252de75cbe09458ad5d1aecb0.
| * | Revert "Fix check for disconnecting peers when syncing"moneromooo-monero2019-09-111-1/+1
| |/ | | | | | | This reverts commit adc16d2504d3e76b0115791caf10446684d45433.
* | Merge pull request #5877luigi11112019-09-241-8/+8
|\ \ | | | | | | | | | | | | | | | 2cd4fd8 Changed the use of boost:value_initialized for C++ list initializer (JesusRami) 4ad191f Removed unused boost/value_init header (whyamiroot) 928f4be Make null hash constants constexpr (whyamiroot)
| * | Changed the use of boost:value_initialized for C++ list initializerJesus Ramirez2019-09-021-8/+8
| | |
* | | Properly format multiline logsmoneromooo-monero2019-09-161-2/+2
| |/ |/| | | | | | | As a side effect, colouring on Windows should now work regardless of version
* | Merge pull request #5806luigi11112019-09-041-3/+3
|\ \ | |/ |/| | | 69465e3 cryptonote_protocol: fix '--no-sync', ignore new blocks and txes (xiphon)
| * cryptonote_protocol: fix '--no-sync', ignore new blocks and txesxiphon2019-08-111-3/+3
| |
* | Added support for "noise" over I1P/Tor to mask Tx transmission.Lee Clagett2019-07-173-61/+709
| |
* | Fix check for disconnecting peers when syncingJason Rhinelander2019-08-161-1/+1
|/ | | | | | | | | | The check added here (in #5732/#5733) is supposed to disconnect behind peers when the current node is syncing, but actually disconnects behind peers always. We are syncing when `target > our_height`, but the check here triggers when `target > remote_height`, which is basically always true when the preceding `m_core.have_block(hshd.top_id)` check is true.
* Merge pull request #5595luigi11112019-07-242-0/+4
|\ | | | | | | 2aa1134 daemon: display peer address type in print_cn (moneromooo-monero)
| * daemon: display peer address type in print_cnmoneromooo-monero2019-05-312-0/+4
| |
* | Merge pull request #5591luigi11112019-07-242-16/+9
|\ \ | | | | | | | | | f17dcde Remove unused txs member in NOTIFY_RESPONSE_GET_OBJECT (Doy-lee)
| * | Remove unused txs member in NOTIFY_RESPONSE_GET_OBJECTDoyle2019-07-152-16/+9
| | |
* | | cryptonote_protocol: drop peers we can't download from when syncingmoneromooo-monero2019-07-041-0/+5
|/ / | | | | | | | | | | | | Any peer that's behind us while syncing is useless to us (though not to them). This ensures that we don't get our peer slots filled with peers that we can't use. Once we've synced, we can connect to them and they can then sync off us if they want.
* | cryptonote_protocol: fix another potential P2P DoSmoneromooo-monero2019-06-141-0/+15
| | | | | | | | | | When asking for txes in a fluffy transaction, one might ask for the same (large) tx many times
* | cryptonote_protocol: expand basic DoS protectionmoneromooo-monero2019-06-142-4/+4
| | | | | | | | Count transactions as well
* | cryptonote_protocol_handler: prevent potential DoSanonimal2019-06-142-0/+12
|/ | | | | | | | | | Essentially, one can send such a large amount of IDs that core exhausts all free memory. This issue can theoretically be exploited using very large CN blockchains, such as Monero. This is a partial fix. Thanks and credit given to CryptoNote author 'cryptozoidberg' for collaboration and the fix. Also thanks to 'moneromooo'. Referencing HackerOne report #506595.
* fix wide difficulty conversion with some versions of boostmoneromooo-monero2019-05-011-2/+2
|
* cryptonote_protocol: warn when the last connection goesmoneromooo-monero2019-04-141-0/+2
|
* Merge pull request #5360Riccardo Spagni2019-04-061-2/+16
|\ | | | | | | b0c552f5 cryptonote_protocol_handler: add block/tx hashes in notify logs (moneromooo-monero)
| * cryptonote_protocol_handler: add block/tx hashes in notify logsmoneromooo-monero2019-03-281-2/+16
| |
* | Merge pull request #5346Riccardo Spagni2019-04-061-4/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | c84ea299 cryptonote_basic: some more minor speedups (moneromooo-monero) e40eb2ad cryptonote_basic: speedup calculate_block_hash (moneromooo-monero) 547a9708 cryptonote: block parsing + hash calculation speedup (moneromooo-monero) 11604b6d blockchain: avoid unneeded block copy (moneromooo-monero) 8461df04 save some database calls when getting top block hash and height (moneromooo-monero) 3bbc3661 Avoid repeated (de)serialization when syncing (moneromooo-monero)
| * | cryptonote: block parsing + hash calculation speedupmoneromooo-monero2019-03-251-4/+4
| |/ | | | | | | This saves a duplicate serialization step
* / Make difficulty 128 bit instead of 64 bitmoneromooo-monero2019-03-242-1/+8
|/ | | | | | Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
* Merge pull request #5199Riccardo Spagni2019-03-192-0/+44
|\ | | | | | | eef164f7 cryptonote_protocol_handler: search for syncing peers in "cruise mode" (moneromooo-monero)
| * cryptonote_protocol_handler: search for syncing peers in "cruise mode"moneromooo-monero2019-02-262-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | When all our outgoing peer slots are filled, we cycle one peer at a time looking for syncing peers until we have at least two such peers. This brings two advantages: - Peers without incoming connections will find more syncing peers that before, thereby strengthening network decentralization - Peers will have more resistance to isolation attacks, as they are more likely to find a "good" peer than they were before
* | Merge pull request #5195Riccardo Spagni2019-03-192-1/+11
|\ \ | | | | | | | | | a54e81e5 daemon: add '--no-sync' arg to optionally disable blockchain sync (xiphon)
| * | daemon: add '--no-sync' arg to optionally disable blockchain syncxiphon2019-02-252-1/+11
| |/
* | Merge pull request #5190Riccardo Spagni2019-03-172-0/+3
|\ \ | | | | | | | | | 551104fb daemon: add --public-node mode, RPC port propagation over P2P (xiphon)
| * | daemon: add --public-node mode, RPC port propagation over P2Pxiphon2019-02-252-0/+3
| |/
* | Update 2019 copyrightbinaryFate2019-03-058-8/+8
| |
* | cryptonote: avoid double parsing blocks when syncingmoneromooo-monero2019-03-051-3/+18
| |
* | core: avoid double parsing blocks after hohmoneromooo-monero2019-03-051-7/+17
| |
* | default initialize rpc structuresmoneromooo-monero2019-03-041-8/+16
| |
* | Merge pull request #5111Riccardo Spagni2019-03-041-1/+1
|\ \ | | | | | | | | | 6a3608d3 cryptonote_protocol_handler: pad tx messages when using tor/i2p (moneromooo-monero)
| * | cryptonote_protocol_handler: pad tx messages when using tor/i2pmoneromooo-monero2019-01-301-1/+1
| |/