summaryrefslogtreecommitdiff
path: root/src/serialization
Commit message (Collapse)AuthorAgeFilesLines
* Remove src/serialization/list.hJeffrey2022-05-022-65/+0
| | | | | | Unused ;) Also a comment from serialization.h
* Add view tags to outputs to reduce wallet scanning timej-berman2022-04-183-0/+36
| | | | | | | | | | | | | Implements view tags as proposed by @UkoeHB in MRL issue https://github.com/monero-project/research-lab/issues/73 At tx construction, the sender adds a 1-byte view tag to each output. The view tag is derived from the sender-receiver shared secret. When scanning for outputs, the receiver can check the view tag for a match, in order to reduce scanning time. When the view tag does not match, the wallet avoids the more expensive EC operations when deriving the output public key using the shared secret.
* CMake: Add missing headers via monero_find_all_headers macromj-xmr2022-04-061-2/+1
|
* Merge pull request #8197luigi11112022-04-0617-17/+17
|\ | | | | | | da9aa1f Copyright: Update to 2022 (mj-xmr)
| * Copyright: Update to 2022mj-xmr2022-03-0417-17/+17
| |
* | plug bulletproofs plus into consensusmoneromooo-monero2022-04-052-2/+43
|/
* RPC and ZeroMQ APIs to support p2poolSChernykh2021-09-112-0/+25
| | | | | | | | | | | | | | | | | | | | 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
* Fixed json serialization of rct::RCTTypeNullSChernykh2021-07-181-6/+12
| | | | rct::RCTTypeNull doesn't have these fields (ecdhInfo, outPk, txnFee).
* Merge pull request #7661luigi11112021-06-1011-89/+94
|\ | | | | | | 08e4497 Improve cryptonote (block and tx) binary read performance (Lee Clagett)
| * Improve cryptonote (block and tx) binary read performanceLee Clagett2021-01-2311-89/+94
| |
* | clang: fix -Wrange-loop-analysis warningsselsta2021-04-271-1/+1
|/
* fix serialization being different on macmoneromooo-monero2021-03-054-13/+40
| | | | | | | | | | | | On Mac, size_t is a distinct type from uint64_t, and some types (in wallet cache as well as cold/hot wallet transfer data) use pairs/containers with size_t as fields. Mac would save those as full size, while other platforms would save them as varints. Might apply to other platforms where the types are distinct. There's a nasty hack for backward compatibility, which can go after a couple forks.
* wallet2: adapt to deterministic unlock timeTheCharlatan2020-09-151-0/+2
|
* replace most boost serialization with existing monero serializationmoneromooo-monero2020-08-178-251/+152
| | | | | | | | | | | | | | | | | | | | | | 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.
* Merge pull request #6603Alexander Blair2020-08-162-0/+31
|\ | | | | | | 4e2377995 Change ZMQ-JSON txextra to hex and remove unnecessary base fields (Lee Clagett)
| * Change ZMQ-JSON txextra to hex and remove unnecessary base fieldsLee Clagett2020-08-142-0/+31
| |
* | Optimize ZMQ-JSON vector reading; GetBlocksFast reads 24%+ fasterLee Clagett2020-08-141-3/+19
| |
* | Fix pruned tx for ZMQ's GetBlocksFastLee Clagett2020-08-143-17/+39
| |
* | Adding ZMQ/Pub support for txpool_add and chain_main eventsLee Clagett2020-05-041-1/+1
| |
* | Merge pull request #6512Alexander Blair2020-07-1918-18/+18
|\ \ | | | | | | | | | 5ef0607da Update copyright year to 2020 (SomaticFanatic)
| * | Update copyright year to 2020SomaticFanatic2020-05-0618-18/+18
| |/ | | | | | | Update copyright year to 2020
* / serialization: fix bad rapidjson api usagemoneromooo-monero2020-05-181-1/+1
|/
* Add byte_stream for zero-copy serialization, and add support in ZMQ-JSON.Lee Clagett2020-04-112-95/+95
|
* Merge pull request #6395luigi11112020-04-041-3/+2
|\ | | | | | | ad13a4b Fixing static_asserts in ZMQ JSON (vtnerd)
| * Fixing static_asserts in ZMQ JSONLee Clagett2020-03-191-3/+2
| |
* | Reduce template bloat in hex->bin for ZMQ jsonLee Clagett2020-03-092-16/+26
|/
* workaround for GetObject windows.h macro and rapidjson conflictxiphon2020-03-141-1/+1
|
* Various improvements to the ZMQ JSON-RPC handling:Lee Clagett2020-03-053-354/+426
| | | | | | | | | - Finding handling function in ZMQ JSON-RPC now uses binary search - Temporary `std::vector`s in JSON output now use `epee::span` to prevent allocations. - Binary -> hex in JSON output no longer allocates temporary buffer - C++ structs -> JSON skips intermediate DOM creation, and instead write directly to an output stream.
* daemon, wallet: new pay for RPC use systemmoneromooo-monero2019-10-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* monerod can now sync from pruned blocksmoneromooo-monero2019-09-272-0/+22
| | | | | | | | | | | | | | 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 #5595luigi11112019-07-241-0/+2
|\ | | | | | | 2aa1134 daemon: display peer address type in print_cn (moneromooo-monero)
| * daemon: display peer address type in print_cnmoneromooo-monero2019-05-311-0/+2
| |
* | serialization: check stream good flag at the endmoneromooo-monero2019-06-141-1/+1
| | | | | | | | just in case
* | serialization: fail on read_varint errormoneromooo-monero2019-06-141-1/+2
|/
* fix wide difficulty conversion with some versions of boostmoneromooo-monero2019-05-011-2/+2
|
* Make difficulty 128 bit instead of 64 bitmoneromooo-monero2019-03-241-0/+65
| | | | | | Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
* Merge pull request #5190Riccardo Spagni2019-03-171-0/+4
|\ | | | | | | 551104fb daemon: add --public-node mode, RPC port propagation over P2P (xiphon)
| * daemon: add --public-node mode, RPC port propagation over P2Pxiphon2019-02-251-0/+4
| |
* | Update 2019 copyrightbinaryFate2019-03-0519-19/+19
| |
* | various: remove unused variablesmoneromooo-monero2019-03-041-1/+0
| |
* | serialization: Use pos_type instead of streamposTom Smeding2019-02-011-1/+1
|/ | | | | | | | According to [1], the ios_base::streampos member type is deprecated, and removed in C++17. This type was an alias for pos_type, which this commit uses instead. [1]: https://en.cppreference.com/w/cpp/io/ios_base
* Pruningmoneromooo-monero2019-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The blockchain prunes seven eighths of prunable tx data. This saves about two thirds of the blockchain size, while keeping the node useful as a sync source for an eighth of the blockchain. No other data is currently pruned. There are three ways to prune a blockchain: - run monerod with --prune-blockchain - run "prune_blockchain" in the monerod console - run the monero-blockchain-prune utility The first two will prune in place. Due to how LMDB works, this will not reduce the blockchain size on disk. Instead, it will mark parts of the file as free, so that future data will use that free space, causing the file to not grow until free space grows scarce. The third way will create a second database, a pruned copy of the original one. Since this is a new file, this one will be smaller than the original one. Once the database is pruned, it will stay pruned as it syncs. That is, there is no need to use --prune-blockchain again, etc.
* json_archive: initialize inner_array_size in ctormoneromooo-monero2018-11-151-1/+1
| | | | Coverity 136581
* Merge pull request #4753Riccardo Spagni2018-11-141-0/+4
|\ | | | | | | | | | | | | 157054b8 hardfork: initialize current_fork_index in ctor (moneromooo-monero) 2362baf7 network_throttle: initialize m_last_sample_time in ctor (moneromooo-monero) d9400f69 serializtion: add missing mainnet and stagenet fields for 0mq (moneromooo-monero) cbe0122b wallet2: initialize amount to 0 in tx_scan_info_t ctor (moneromooo-monero)
| * serializtion: add missing mainnet and stagenet fields for 0mqmoneromooo-monero2018-10-291-0/+4
| | | | | | | | Coverity 184940
* | Update ZMQ fee estimate and add ZMQ output distributionLee Clagett2018-10-232-0/+26
|/
* tx_pool: avoid parsing a whole tx if only the prefix is neededmoneromooo-monero2018-10-081-6/+17
|
* v8: per byte fee, pad bulletproofs, fixed 11 ring sizemoneromooo-monero2018-09-111-0/+8
|
* Fixed ZMQ-RPC for transactions and GET_BLOCKS_FASTLee Clagett2018-08-022-162/+172
|
* update get_info RPC and bump RPC versionvictorsintnicolaas2018-06-291-0/+2
|