aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-05-04Adding ZMQ/Pub support for txpool_add and chain_main eventsLee Clagett2-0/+82
2020-05-06Update copyright year to 2020SomaticFanatic21-21/+21
Update copyright year to 2020
2020-05-06Merge pull request #6472luigi11111-0/+2
2efbd5f cryptonote: fix reuse of non default tx data when relaying (moneromooo-monero)
2020-05-01Merge pull request #6436luigi11112-0/+16
688a3e8 Add timelock verification on device (cslashm)
2020-04-22cryptonote: fix reuse of non default tx data when relayingmoneromooo-monero1-0/+2
An automatic tx variable is initialized properly on the first run through the loop, but not the second. Moving the variable inside the loop ensures the ctor is called again to init it.
2020-04-08Add timelock verification on devicecslashm2-0/+16
2020-03-26Adding Dandelion++ support to public networks:Lee Clagett1-1/+6
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode - Stem loops detected in tx_pool.cpp - Embargo timeout for a blackhole attack during stem phase
2020-04-04Merge pull request #6338luigi11112-6/+2
80d5320 Hash domain separation (SarangNoether)
2020-04-01Hash domain separationSarang Noether2-6/+2
2020-03-31cryptonote_basic: drop unused verification_context::m_not_rct fieldxiphon1-1/+0
2020-03-20p2p: remove old debug commandsAaron Hook2-55/+0
2020-02-28Merge pull request #6225Alexander Blair2-2/+18
987c3139 print_coinbase_tx_sum now supports 128 bits sums (moneromooo-monero)
2020-02-06miner: use verification mode for low diff one block nonce searchesmoneromooo-monero1-1/+1
This avoids lengthy init times when testing
2019-12-12print_coinbase_tx_sum now supports 128 bits sumsmoneromooo-monero2-2/+18
The tail emission will bring the total above 64 bits
2019-10-31cryptonote: untangle dependency from miner to blockchainmoneromooo-monero2-9/+9
It causes link errors at least on mac
2019-10-25daemon, wallet: new pay for RPC use systemmoneromooo-monero1-1/+2
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-22Merge pull request #5972luigi11112-11/+66
9447e72 cryptonote: add function to get weight from a pruned tx (moneromooo-monero)
2019-10-22Merge pull request #5966luigi11111-5/+2
be82c40 Support median block size > 4 GB (moneromooo-monero)
2019-10-21Support median block size > 4 GBmoneromooo-monero1-5/+2
add a 128/64 division routine so we can use a > 32 bit median block size in calculations
2019-10-16Merge pull request #5984luigi11111-0/+4
7fdaa82 Fix build on FreeBSD/!x86 (pkubaj) 0f4fddc Add also ifdef __x86_64__ (pkubaj)
2019-10-14Merge pull request #5933luigi11111-0/+1
3455efa ban peers sending bad pow outright (moneromooo-monero)
2019-10-13Add also ifdef __x86_64__pkubaj1-2/+2
2019-10-13Fix build on FreeBSD/!x86pkubaj1-0/+4
Checking battery status uses x86-only headers and functions. Remove this functionality to get it to build on other architectures.
2019-10-11cryptonote: add function to get weight from a pruned txmoneromooo-monero2-11/+66
The weight of the prunable data is deterministic from the unpruned data, so it can be determined from a pruned tx
2019-10-08Merge pull request #5915luigi11113-17/+92
8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
2019-09-27monerod can now sync from pruned blocksmoneromooo-monero3-17/+92
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
2019-09-25RandomX integrationHoward Chu4-30/+14
Support RandomX PoW algorithm
2019-09-25ban peers sending bad pow outrightmoneromooo-monero1-0/+1
PoW is expensive to verify, so be strict
2019-09-24Merge pull request #5877luigi11111-2/+1
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)
2019-09-19core: move hardforks into its own libmoneromooo-monero2-11/+4
So it can be used by others without encumbrance
2019-09-05Make null hash constants constexprLev Sizov1-1/+1
Simplify m_template initialization in miner
2019-09-04difficulty: fix check_hash on big endianmoneromooo-monero1-1/+0
2019-09-02Removed unused boost/value_init headerLev Sizov1-1/+0
2019-09-02Changed the use of boost:value_initialized for C++ list initializerJesus Ramirez1-1/+1
2019-07-17Added support for "noise" over I1P/Tor to mask Tx transmission.Lee Clagett1-0/+2
2019-08-19Merge pull request #5720luigi11111-1/+1
bcd2da7 miner: fix --bg-mining-enable description (moneromooo-monero)
2019-08-14Merge pull request #5487luigi11111-0/+1
df83ed7 consensus: from v12, enforce >= 2 outputs (moneromooo-monero)
2019-07-02miner: fix --bg-mining-enable descriptionmoneromooo-monero1-1/+1
2019-06-14serialization: check stream good flag at the endmoneromooo-monero1-1/+1
just in case
2019-06-14cryptonote: throw on tx hash calculation errormoneromooo-monero1-3/+3
2019-06-09miner: fix double free of thread attributesston1th2-10/+6
issue: #5568
2019-05-01fix wide difficulty conversion with some versions of boostmoneromooo-monero1-2/+2
2019-04-23consensus: from v12, enforce >= 2 outputsmoneromooo-monero1-0/+1
2019-04-20hardfork: fix off by one updating fork index after poppingmoneromooo-monero1-3/+2
2019-04-16Merge pull request #5444Riccardo Spagni1-0/+1
6643b047 Increment m_threads_active when mining thread starts (Doyle)
2019-04-16Merge pull request #5443Riccardo Spagni1-20/+2
07dd5536 hardfork: remove "no hf version db" recreation check (moneromooo-monero)
2019-04-16Merge pull request #5400Riccardo Spagni1-6/+2
5e673c03 blockchain_db: fix db txn ending too early (moneromooo-monero)
2019-04-15Merge pull request #5402Riccardo Spagni2-0/+18
cbf32241 rpc: make wide_difficulty hexadecimal (moneromooo-monero)
2019-04-15Increment m_threads_active when mining thread startsDoyle1-0/+1
2019-04-14hardfork: remove "no hf version db" recreation checkmoneromooo-monero1-20/+2
This is now obsolete, and this removes the warning on startup on a new db that confuses some people
2019-04-14blockchain_db: fix db txn ending too earlymoneromooo-monero1-6/+2
The db txn in add_block ending caused the entire overarching batch txn to stop. Also add a new guard class so a db txn can be stopped in the face of exceptions. Also use a read only db txn in init when the db itself is read only, and do not save the max tx size in that case.
2019-04-11functional_tests: add more blockchain related testsmoneromooo-monero3-2/+14
Related to emission, reorgs, getting tx data back, output distribution and histogram
2019-04-11Merge pull request #5381Riccardo Spagni2-6/+10
def40161 miner: fix race when stopping mining with start mining enabled (moneromooo-monero)
2019-04-11Merge pull request #5380Riccardo Spagni1-2/+0
113e4877 blockchain_stats: fix sign in formatting function (moneromooo-monero) adaea3ea various: remove unused variables (moneromooo-monero) 631ef00e blockchain: some debug info when adding txes-from-block fails (moneromooo-monero)
2019-04-11Merge pull request #5374Riccardo Spagni1-5/+11
a2561653 wallet: new option to start background mining (moneromooo-monero)
2019-04-11Merge pull request #5123Riccardo Spagni3-6/+2
089c7637 cryptonote: rework block blob size sanity check (moneromooo-monero)
2019-04-06Merge pull request #5346Riccardo Spagni2-8/+51
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)
2019-04-05rpc: make wide_difficulty hexadecimalmoneromooo-monero2-0/+18
This should be friendlier for clients which don't have bignum support
2019-04-05cryptonote: rework block blob size sanity checkmoneromooo-monero3-6/+2
Use the actual block weight limit, assuming that weight is always greater or equal to size
2019-04-04wallet: new option to start background miningmoneromooo-monero1-5/+11
The setup-background-mining option can be used to select background mining when a wallet loads. The user will be asked the first time the wallet is created.
2019-04-01miner: fix race when stopping mining with start mining enabledmoneromooo-monero2-6/+10
2019-04-01various: remove unused variablesmoneromooo-monero1-2/+0
2019-04-01Merge pull request #5288Riccardo Spagni1-2/+3
39f000b3 miner: fix possible exit crash due to race in stop (moneromooo-monero)
2019-03-25cryptonote_basic: some more minor speedupsmoneromooo-monero1-4/+16
2019-03-25cryptonote_basic: speedup calculate_block_hashmoneromooo-monero1-2/+7
The block 202612 fix can be left tested at the end, if we already know we're not in the general case
2019-03-25cryptonote: block parsing + hash calculation speedupmoneromooo-monero2-4/+30
This saves a duplicate serialization step
2019-03-24Make difficulty 128 bit instead of 64 bitmoneromooo-monero3-4/+115
Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
2019-03-24Merge pull request #5277Riccardo Spagni1-0/+7
adf6d773 wallet: fix offline signing calling a daemon RPC (moneromooo-monero)
2019-03-21cryptonote: fix calculating coinbase tx hashmoneromooo-monero1-10/+6
Also set error flag on exception when handling new txes to keep tests working
2019-03-21wallet: fix offline signing calling a daemon RPCmoneromooo-monero1-0/+7
2019-03-21Merge pull request #5271Riccardo Spagni1-0/+3
2790d4d3 hardfork: update last_versions on popped block (moneromooo-monero)
2019-03-21Merge pull request #5211Riccardo Spagni1-0/+5
c9b13fbb tests/trezor: HF9 and HF10 tests (Dusan Klinec) a1fd1d49 device/trezor: HF10 support added, wallet::API (Dusan Klinec) d74d26f2 crypto: hmac_keccak added (Dusan Klinec)
2019-03-20device/trezor: HF10 support added, wallet::APIDusan Klinec1-0/+5
- import only key images generated by cold signing process - wallet_api: trezor methods added - wallet: button request code added - const added to methods - wallet2::get_tx_key_device() tries to decrypt stored tx private keys using the device. - simplewallet supports get_tx_key and get_tx_proof on hw device using the get_tx_key feature - live refresh enables refresh with trezor i.e. computing key images on the fly. More convenient and efficient for users. - device: has_ki_live_refresh added - a thread is watching whether live refresh is being computed, if not for 30 seconds, it terminates the live refresh process - switches Trezor state
2019-03-17Merge pull request #5190Riccardo Spagni1-1/+3
551104fb daemon: add --public-node mode, RPC port propagation over P2P (xiphon)
2019-03-17Merge pull request #5185Riccardo Spagni2-4/+9
59478c80 daemon: new mining_status command (moneromooo-monero)
2019-03-17Merge pull request #5135Riccardo Spagni1-0/+1
de32dcea Human readable message if maximum outputs reached (italocoin)
2019-03-14miner: fix possible exit crash due to race in stopmoneromooo-monero1-2/+3
If a thread asks to stop the miner, m_stop will be set, and that thread will wait to join. If the main thread is exiting at that time, it will ask the miner to stop, but the miner will claim it's not mining and early out since m_stop is set. This will cause the database and other things to get shutdown. If the miner happens to find a block at that time, it will try to call core, and crash. Instead, lock and check whether any threads are currently in m_threads, since they'll only be cleared once the threads are joined. Moreover, since we lock, the second thread will have to wait for the first one to have finished. Calling join twice on a thread seems fine as per pthread_join(3).
2019-03-12hardfork: update last_versions on popped blockmoneromooo-monero1-0/+3
2019-03-09daemon: new mining_status commandmoneromooo-monero2-4/+9
2019-03-05Update 2019 copyrightbinaryFate22-22/+22
2019-03-05cryptonote: speed up calculating coinbase tx prunable hashmoneromooo-monero1-2/+9
It's a hash of an empty buffer, so we can avoid keccak
2019-03-05core: avoid calculating tx prefix hash when we don't need itmoneromooo-monero2-1/+9
2019-03-05db: speedup block additionmoneromooo-monero3-26/+67
by avoiding repeated (de)serialization
2019-03-04check load_t_from_json return valuesmoneromooo-monero1-1/+2
2019-03-04default initialize rpc structuresmoneromooo-monero1-1/+2
2019-03-04Merge pull request #5125Riccardo Spagni2-4/+84
8298f42e miner: it can now autodetect the optimal number of threads (moneromooo-monero)
2019-03-04hardfork: fix fork determination for historical heightsmoneromooo1-1/+1
2019-03-04Merge pull request #5126Riccardo Spagni1-1/+1
f1fb06b1 Fixed path to int-util.h (SChernykh) 9da0892b Adding cnv4-2 tweaks (SChernykh) f51397b3 Cryptonight variant 4 aka CryptonightR (SChernykh)
2019-02-25daemon: add --public-node mode, RPC port propagation over P2Pxiphon1-1/+3
2019-02-23miner: it can now autodetect the optimal number of threadsmoneromooo-monero2-4/+84
2019-02-14Cryptonight variant 4 aka CryptonightRSChernykh1-1/+1
It introduces random integer math into the main loop.
2019-02-10Human readable message if maximum outputs reacheditalocoin1-0/+1
2019-02-03ringct: fix v1 ecdhInfo serializationmoneromooo-monero1-15/+2
The change made for v2 broke v1, and we have no way to know which version we're serializing here. However, since we don't actually care about space savings in this case, we continue serialiazing both mask and amount.
2019-01-28Merge pull request #5052Riccardo Spagni1-6/+18
b6534c40 ringct: remove unused senderPk from ecdhTuple (moneromooo-monero) 7d375981 ringct: the commitment mask is now deterministic (moneromooo-monero) 99d946e6 ringct: encode 8 byte amount, saving 24 bytes per output (moneromooo-monero) cdc3ccec ringct: save 3 bytes on bulletproof size (moneromooo-monero) f931e16c add a bulletproof version, new bulletproof type, and rct config (moneromooo-monero)
2019-01-22ringct: remove unused senderPk from ecdhTuplemoneromooo-monero1-1/+0
This was an early ringct field, which was never used in production
2019-01-22ringct: the commitment mask is now deterministicmoneromooo-monero1-1/+4
saves space in the tx and is safe Found by knaccc
2019-01-22ringct: encode 8 byte amount, saving 24 bytes per outputmoneromooo-monero1-1/+11
Found by knaccc
2019-01-22add a bulletproof version, new bulletproof type, and rct configmoneromooo-monero1-3/+3
This makes it easier to modify the bulletproof format
2019-01-22Pruningmoneromooo-monero5-5/+56
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.
2019-01-01blockchain: fix wrong hf version when popping multiple blocksmoneromooo-monero2-0/+33
Since we keep track of the hf version in the db, we pick it up from there instead of doing the full reorg call, which is quite expensive
2019-01-01hardfork: remove batch transactions setupmoneromooo-monero1-1/+0
This is now default, so it spares us the warnings
2018-12-31Merge pull request #4953luigi11111-5/+13
dbbb3ce cryptonote: don't serialize for blob size if already known (moneromooo-monero)
2018-12-31Merge pull request #4946luigi11112-0/+3
6644b9b blockchain_db: remove a couple unused functions (moneromooo-monero) ce594f5 blockchain_db: allocate known size vector only once (moneromooo-monero) 8332698 db_lmdb: inline check_open, it's trivial and called everywhere (moneromooo-monero) 5511563 db_lmdb: avoid pointless division (moneromooo-monero) d1efe3d cryptonote: set tx hash on newly parsed txes when known (moneromooo-monero) 9cc68a2 tx_pool: add a few std::move where it can make a difference (moneromooo-monero)
2018-12-12Merge pull request #4924Riccardo Spagni1-7/+10
0c5dd316 cryptonote: add a set_null for transaction_prefix (moneromooo-monero)
2018-12-07cryptonote: don't serialize for blob size if already knownmoneromooo-monero1-5/+13
2018-12-05cryptonote: set tx hash on newly parsed txes when knownmoneromooo-monero2-0/+3
2018-12-04Merge pull request #4894Riccardo Spagni3-4/+4
aee7a4e3 wallet_rpc_server: do not use RPC data if the call failed (moneromooo-monero) 1a0733e5 windows_service: fix memory leak (moneromooo-monero) 0dac3c64 unit_tests: do not rethrow a copy of an exception (moneromooo-monero) 5d9915ab cryptonote: fix get_unit for non default settings (moneromooo-monero) d4f50cb1 remove some unused code (moneromooo-monero) 61163971 a few minor (but easy) performance tweaks (moneromooo-monero) 30023074 tests: slow_memmem now returns size_t (moneromooo-monero)
2018-12-04move int-util.h to epeemoneromooo-monero2-2/+2
2018-12-04Merge pull request #4869Riccardo Spagni1-1/+1
60f36386 Avoid unnecessary temp block and copy ctor (moneromooo-monero)
2018-12-04Merge pull request #4854Riccardo Spagni3-23/+18
bd98e99c Removed a lot of unnecessary includes (Martijn Otto)
2018-11-30cryptonote: add a set_null for transaction_prefixmoneromooo-monero1-7/+10
Since it's all inline, I suspect the compiler will merge the duplicate stores anyway.
2018-11-23cryptonote: fix get_unit for non default settingsmoneromooo-monero1-2/+2
Found by codacy.com
2018-11-23a few minor (but easy) performance tweaksmoneromooo-monero2-2/+2
Found by codacy.com
2018-11-19Avoid unnecessary temp block and copy ctormoneromooo-monero1-1/+1
block already has a default ctor, and the extra object churn due to its innards (vectors, etc) is pointless.
2018-11-15Removed a lot of unnecessary includesMartijn Otto3-23/+18
2018-11-14Merge pull request #4753Riccardo Spagni1-3/+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)
2018-11-06Merge pull request #4744Riccardo Spagni1-1/+1
b3e8677c cryptonote: use logging functions for errors, not std::cout (moneromooo-monero)
2018-11-02device/trezor: trezor support addedDusan Klinec2-5/+20
2018-10-29hardfork: initialize current_fork_index in ctormoneromooo-monero1-3/+4
Also order init list to match actual runtime init order Coverity 136605
2018-10-27cryptonote: use logging functions for errors, not std::coutmoneromooo-monero1-1/+1
2018-10-26Merge pull request #4700Riccardo Spagni1-1/+1
3bb4b0d4 miner: fix build with boost 1.69 (moneromooo-monero)
2018-10-26Merge pull request #4617Riccardo Spagni1-0/+1
3ffbec15 rpc: init m_rpc_version in Message ctor (moneromooo-monero) bfa2dce1 rpc: remove unused ctors (moneromooo-monero) 7cc39845 account: init creation timestamp to 0 (moneromooo-monero) 32123789 wallet2: initialize some scalar fields in ctor where appropriate (moneromooo-monero) 4eca42b2 blockchain_db: initialize m_hardfork in ctor just in case (moneromooo-monero)
2018-10-26Merge pull request #4308Riccardo Spagni3-1/+87
9907ea06 cryptonote: sort tx_extra fields (moneromooo-monero)
2018-10-22miner: fix build with boost 1.69moneromooo-monero1-1/+1
2018-10-20Merge pull request #4523Riccardo Spagni1-1/+1
6ca00b6d miner: really reset flags/precision on std::cout (moneromooo-monero)
2018-10-16account: init creation timestamp to 0moneromooo-monero1-0/+1
Never actually used uninitialized Coverity 136615
2018-10-15Merge pull request #4389Riccardo Spagni2-0/+11
6844ae1b tx_pool: avoid parsing a whole tx if only the prefix is needed (moneromooo-monero)
2018-10-08miner: really reset flags/precision on std::coutmoneromooo-monero1-1/+1
2018-10-08tx_pool: avoid parsing a whole tx if only the prefix is neededmoneromooo-monero2-0/+11
2018-10-07cryptonote: sort tx_extra fieldsmoneromooo-monero3-1/+87
This removes some small amount of fingerprinting entropy. There is no consensus rule to require this since this field is technically free form, and a transaction is free to have custom data in it.
2018-09-29Merge pull request #4459Riccardo Spagni1-2/+4
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero) 3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero) a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero) 1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero) fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero) 2e2139ff epee: do not propagate exception through dtor (moneromooo-monero) 0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero) 1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero) 418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero) ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero) 6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero) 53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero) e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero) 661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero) 5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero) 7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero) a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero) d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero) 02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero) c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
2018-09-18Merge pull request #4299Riccardo Spagni2-3/+8
f9b22a7b hw_device: support for multiple devices added [for review] (Dusan Klinec)
2018-09-18Merge pull request #3430Riccardo Spagni1-3/+7
42397359 Fixup 32bit arm build (TheCharlatan) a06d2581 Fix Windows build (TheCharlatan) ecaf5b3f Add libsodium to the packages, the arm build was complaining about it. (TheCharlatan) cbbf4d24 Adapt translations to upstream changes (TheCharlatan) db571546 Updated pcsc url (TheCharlatan) f0ba19fd Add lrelease to the depends (TheCharlatan) cfb30462 Add Miniupnp submodule (TheCharlatan) 5f7da005 Unbound is now a submodule. Adapt depends for this. (TheCharlatan) d6b9bdd3 Update readmes to reflect the usage of depends (TheCharlatan) 56b6e41e Add support for apple and arm building (TheCharlatan) 29311fd1 Disable stack unwinding for mingw32 depends build. (TheCharlatan) 8db3d573 Modify depends for monero's dependencies (TheCharlatan) 0806a23a Initial depends addition (TheCharlatan)
2018-09-14hw_device: support for multiple devices added [for review]Dusan Klinec2-3/+8
- device name is a new wallet property - full device name is now a bit more structured so we can address particular device vendor + device path. Example: 'Ledger', 'Trezor:udp', 'Trezor:udp:127.0.0.1:21324', 'Trezor:bridge:usb01'. The part before ':' identifies HW device implementation, the optional part after ':' is device path to look for. - new --hw-device parameter added to the wallet, can name the hardware device - device reconnect added
2018-09-14Merge pull request #4330Riccardo Spagni1-3/+13
93e7627d cryptonote_format_utils: do not early out on invalid tx pubkeys (moneromooo-monero)
2018-09-11bulletproofs: scale points by 8 to ensure subgroup validitymoneromooo-monero1-1/+1
2018-09-11cryptonote_basic: check output type before using itmoneromooo-monero1-0/+7
Reported by QuarksLab.
2018-09-11v8: per byte fee, pad bulletproofs, fixed 11 ring sizemoneromooo-monero4-28/+64
2018-09-11Bulletproof aggregated verification and testsmoneromooo-monero2-8/+16
Also constrains bulletproofs to simple rct, for simplicity
2018-09-10Add support for apple and arm buildingTheCharlatan1-3/+7
Add pcsc-lite to linux builds Fixup windows icu4c linking with depends, the static libraries have an 's' appended to them Compiling depends arm-linux-gnueabihf will allow you to compile armv6zk monero binaries
2018-09-02cryptonote_format_utils: do not early out on invalid tx pubkeysmoneromooo-monero1-3/+13
Another such pubkey might be valid
2018-08-16crypto: make secret_key automatically mlockmoneromooo-monero1-2/+2
2018-08-16store secret keys encrypted where possiblemoneromooo-monero2-0/+82
The secret spend key is kept encrypted in memory, and decrypted on the fly when needed. Both spend and view secret keys are kept encrypted in a JSON field in the keys file. This avoids leaving the keys in memory due to being manipulated by the JSON I/O API.
2018-07-19Merge pull request #4030luigi11111-1/+1
0c41488 miner: show id and height when a block is found (stoffu)
2018-07-19Merge pull request #3854luigi11111-7/+8
149da42 db_lmdb: enable batch transactions by default (stoffu) 34cb6b4 add --regtest and --fixed-difficulty for regression testing (vicsn) 9e1403e update get_info RPC and bump RPC version (vicsn) 207b66e first new functional tests (vicsn)
2018-06-29add --regtest and --fixed-difficulty for regression testingvictorsintnicolaas1-7/+8
on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest. Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'. Queries hard fork heights info of other network types
2018-06-27Merge pull request #3982luigi11111-14/+5
08b85a8 cryptonote_config: add get_config to refactor x = testnet ? config::testnet::X : stagenet ? config::stagenet::X : config::X (stoffu) 0cf80ba net_node: resolve host for node addresses given via command line flags (stoffu)
2018-06-26replace std::list with std::vector on some hot pathsmoneromooo-monero1-1/+1
also use reserve where appropriate
2018-06-20Merge pull request #3757luigi11111-0/+5
6f9260e handle optional miner params better (cryptochangements34)
2018-06-20miner: show id and height when a block is foundstoffu1-1/+1
2018-06-19Merge pull request #3851luigi11111-1/+1
a87980f fix build with GCC 8.1.0 (moneromooo-monero)
2018-06-16Merge pull request #3725luigi11111-5/+5
9cc0d42 connection_context: remove state_ prefix from state names (moneromooo-monero) d9d002c daemon: print peer state in sync_info (moneromooo-monero)
2018-06-11cryptonote_config: add get_config to refactor x = testnet ? ↵stoffu1-14/+5
config::testnet::X : stagenet ? config::stagenet::X : config::X
2018-05-30hardfork: fix get_next_version()stoffu1-3/+3
2018-05-30hardfork: fix get_earliest_ideal_height_for_version() to support ↵stoffu1-4/+8
non-existent versions
2018-05-26fix build with GCC 8.1.0moneromooo-monero1-1/+1
2018-05-23db_lmdb: save pruned and prunable tx data separatelymoneromooo-monero2-8/+60
This bumps DB version to 2, migration code will run for v1 DBs
2018-05-07cryptonote: make sure outPk setup always happensmoneromooo-monero1-0/+37
2018-05-06handle optional miner params bettercryptochangements341-0/+5
2018-04-28connection_context: remove "state_" prefix from state namesmoneromooo-monero1-5/+5
It's redundant and makes it easier to print them in columns
2018-03-15Fix typos in various filesDimitris Apostolou1-1/+1
2018-03-14keypair::generate: always require hw::device to avoid possible mistakestoffu1-6/+0
2018-03-14device: untangle cyclic depenencystoffu5-200/+15
When #3303 was merged, a cyclic dependency chain was generated: libdevice <- libcncrypto <- libringct <- libdevice This was because libdevice needs access to a set of basic crypto operations implemented in libringct such as scalarmultBase(), while libringct also needs access to abstracted crypto operations implemented in libdevice such as ecdhEncode(). To untangle this cyclic dependency chain, this patch splits libringct into libringct_basic and libringct, where the basic crypto ops previously in libringct are moved into libringct_basic. The cyclic dependency is now resolved thanks to this separation: libcncrypto <- libringct_basic <- libdevice <- libcryptonote_basic <- libringct This eliminates the need for crypto_device.cpp and rctOps_device.cpp. Also, many abstracted interfaces of hw::device such as encrypt_payment_id() and get_subaddress_secret_key() were previously implemented in libcryptonote_basic (cryptonote_format_utils.cpp) and were then called from hw::core::device_default, which is odd because libdevice is supposed to be independent of libcryptonote_basic. Therefore, those functions were moved to device_default.cpp.
2018-03-14device: made function prototypes consistent with pre-#3303 codebasestoffu1-7/+3
2018-03-12Ledger HW Bug fixesCédric1-2/+0
Fix the way the REAL mode is handle: Let create_transactions_2 and create_transactions_from construct the vector of transactions. Then iterate on it and resign. We just need to add 'outs' list in the TX struct for that. Fix default secret keys value when DEBUG_HWDEVICE mode is off The magic value (00...00 for view key and FF..FF for spend key) was not correctly set when DEBUG_HWDEVICE was off. Both was set to 00...00. Add sub-address info in ABP map in order to correctly display destination sub-address on device Fix DEBUG_HWDEVICE mode: - Fix compilation errors. - Fix control device init in ledger device. - Add more log. Fix sub addr control Fix debug Info
2018-03-05Monero Cryptonight variants, and add one for v7moneromooo-monero1-1/+2
This is the first variant of many, with the intent to improve Monero's resistance to ASICs and encourage mining decentralization.
2018-03-05Merge pull request #3277Riccardo Spagni6-28/+32
0e7ad2e2 Wallet API: generalize 'bool testnet' to 'NetworkType nettype' (stoffu) af773211 Stagenet (stoffu) cc9a0bee command_line: allow args to depend on more than one args (stoffu) 55f8d917 command_line::get_arg: remove 'required' for dependent args as they're always optional (stoffu) 450306a0 command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318 (stoffu) 9f9e095a Use `genesis_tx` parameter in `generate_genesis_block`. #3261 (Jean Pierre Dudey)
2018-03-05Correct spelling mistakes.Edward Betts1-1/+1
2018-03-05Stagenetstoffu6-28/+32
2018-03-04Code modifications to integrate Ledger HW device into monero-wallet-cli.cslashm6-23/+188
The basic approach it to delegate all sensitive data (master key, secret ephemeral key, key derivation, ....) and related operations to the device. As device has low memory, it does not keep itself the values (except for view/spend keys) but once computed there are encrypted (with AES are equivalent) and return back to monero-wallet-cli. When they need to be manipulated by the device, they are decrypted on receive. Moreover, using the client for storing the value in encrypted form limits the modification in the client code. Those values are transfered from one C-structure to another one as previously. The code modification has been done with the wishes to be open to any other hardware wallet. To achieve that a C++ class hw::Device has been introduced. Two initial implementations are provided: the "default", which remaps all calls to initial Monero code, and the "Ledger", which delegates all calls to Ledger device.
2018-02-20Merge pull request #3260Riccardo Spagni1-1/+0
b2d4bb9b Remove `voting_version` parameter documentation. (Jean Pierre Dudey)
2018-02-20Merge pull request #3255Riccardo Spagni1-11/+5
3962bcb2 Closes #2886: really ignore battery checking (Timothy D. Prime)
2018-02-20Merge pull request #3247Riccardo Spagni2-0/+40
89ad162a wallet2: remove unused m_subaddresses_inv (moneromooo-monero) f2c4c399 wallet2: speed up subaddress generation (by about a third) (moneromooo-monero)
2018-02-16wallet2: speed up subaddress generation (by about a third)moneromooo-monero2-0/+40
2018-02-16Merge pull request #3226Riccardo Spagni1-1/+2
e4646379 keccak: fix mdlen bounds sanity checking (moneromooo-monero) 2e3e90ac pass large parameters by const ref, not value (moneromooo-monero) 61defd89 blockchain: sanity check number of precomputed hash of hash blocks (moneromooo-monero) 9af6b2d1 ringct: fix infinite loop in unused h2b function (moneromooo-monero) 8cea8d0c simplewallet: double check a new multisig wallet is multisig (moneromooo-monero) 9b98a6ac threadpool: catch exceptions in dtor, to avoid terminate (moneromooo-monero) 24803ed9 blockchain_export: fix buffer overflow in exporter (moneromooo-monero) f3f7da62 perf_timer: rewrite to make it clear there is no division by zero (moneromooo-monero) c6ea3df0 performance_tests: remove add_arg call stray extra param (moneromooo-monero) fa6b4566 fuzz_tests: fix an uninitialized var in setup (moneromooo-monero) 03887f11 keccak: fix sanity check bounds test (moneromooo-monero) ad11db91 blockchain_db: initialize m_open in base class ctor (moneromooo-monero) bece67f9 miner: restore std::cout precision after modification (moneromooo-monero) 1aabd14c db_lmdb: check hard fork info drop succeeded (moneromooo-monero)
2018-02-16Merge pull request #3232Riccardo Spagni1-1/+1
b81e276c connection_context: initialize m_last_request_time to current time (moneromooo-monero)
2018-02-13Remove `voting_version` parameter documentation.Jean Pierre Dudey1-1/+0
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-02-12Closes #2886: really ignore battery checkingTimothy D. Prime1-11/+5
Move option test first.
2018-02-04connection_context: initialize m_last_request_time to current timemoneromooo-monero1-1/+1
This prevents spurious early peer drops
2018-02-02miner: restore std::cout precision after modificationmoneromooo-monero1-1/+2
Coverity 136462
2018-01-31ringct: pseudoOuts moved to prunable in the simple bulletproof casemoneromooo-monero1-2/+6
Saves 64 bytes non prunable data per typical tx This breaks v7 consensus, will require a testnet reorg from v6
2018-01-26Readd copyright starting datexmr-eric1-1/+1
2018-01-26Update 2018 copyrightxmr-eric22-22/+22
2018-01-10Merge pull request #2990Riccardo Spagni3-2/+2
2d17feb0 factor STL container serialization (moneromooo-monero)
2017-12-22factor STL container serializationmoneromooo-monero3-2/+2
2017-12-18check accessing an element past the end of a containermoneromooo-monero1-1/+1
2017-12-18check return value for generate_key_derivation and derive_public_keymoneromooo-monero1-4/+8
2017-12-17make multisig work with subaddressesmoneromooo-monero1-4/+49
Thanks to kenshi84 for help getting this work
2017-12-17N-1/N multisigmoneromooo-monero2-2/+14
2017-12-17Add N/N multisig tx generation and signingmoneromooo-monero1-0/+15
Scheme by luigi1111: Multisig for RingCT on Monero 2 of 2 User A (coordinator): Spendkey b,B Viewkey a,A (shared) User B: Spendkey c,C Viewkey a,A (shared) Public Address: C+B, A Both have their own watch only wallet via C+B, a A will coordinate spending process (though B could easily as well, coordinator is more needed for more participants) A and B watch for incoming outputs B creates "half" key images for discovered output D: I2_D = (Hs(aR)+c) * Hp(D) B also creates 1.5 random keypairs (one scalar and 2 pubkeys; one on base G and one on base Hp(D)) for each output, storing the scalar(k) (linked to D), and sending the pubkeys with I2_D. A also creates "half" key images: I1_D = (Hs(aR)+b) * Hp(D) Then I_D = I1_D + I2_D Having I_D allows A to check spent status of course, but more importantly allows A to actually build a transaction prefix (and thus transaction). A builds the transaction until most of the way through MLSAG_Gen, adding the 2 pubkeys (per input) provided with I2_D to his own generated ones where they are needed (secret row L, R). At this point, A has a mostly completed transaction (but with an invalid/incomplete signature). A sends over the tx and includes r, which allows B (with the recipient's address) to verify the destination and amount (by reconstructing the stealth address and decoding ecdhInfo). B then finishes the signature by computing ss[secret_index][0] = ss[secret_index][0] + k - cc[secret_index]*c (secret indices need to be passed as well). B can then broadcast the tx, or send it back to A for broadcasting. Once B has completed the signing (and verified the tx to be valid), he can add the full I_D to his cache, allowing him to verify spent status as well. NOTE: A and B *must* present key A and B to each other with a valid signature proving they know a and b respectively. Otherwise, trickery like the following becomes possible: A creates viewkey a,A, spendkey b,B, and sends a,A,B to B. B creates a fake key C = zG - B. B sends C back to A. The combined spendkey C+B then equals zG, allowing B to spend funds at any time! The signature fixes this, because B does not know a c corresponding to C (and thus can't produce a signature). 2 of 3 User A (coordinator) Shared viewkey a,A "spendkey" j,J User B "spendkey" k,K User C "spendkey" m,M A collects K and M from B and C B collects J and M from A and C C collects J and K from A and B A computes N = nG, n = Hs(jK) A computes O = oG, o = Hs(jM) B anc C compute P = pG, p = Hs(kM) || Hs(mK) B and C can also compute N and O respectively if they wish to be able to coordinate Address: N+O+P, A The rest follows as above. The coordinator possesses 2 of 3 needed keys; he can get the other needed part of the signature/key images from either of the other two. Alternatively, if secure communication exists between parties: A gives j to B B gives k to C C gives m to A Address: J+K+M, A 3 of 3 Identical to 2 of 2, except the coordinator must collect the key images from both of the others. The transaction must also be passed an additional hop: A -> B -> C (or A -> C -> B), who can then broadcast it or send it back to A. N-1 of N Generally the same as 2 of 3, except participants need to be arranged in a ring to pass their keys around (using either the secure or insecure method). For example (ignoring viewkey so letters line up): [4 of 5] User: spendkey A: a B: b C: c D: d E: e a -> B, b -> C, c -> D, d -> E, e -> A Order of signing does not matter, it just must reach n-1 users. A "remaining keys" list must be passed around with the transaction so the signers know if they should use 1 or both keys. Collecting key image parts becomes a little messy, but basically every wallet sends over both of their parts with a tag for each. Thia way the coordinating wallet can keep track of which images have been added and which wallet they come from. Reasoning: 1. The key images must be added only once (coordinator will get key images for key a from both A and B, he must add only one to get the proper key actual key image) 2. The coordinator must keep track of which helper pubkeys came from which wallet (discussed in 2 of 2 section). The coordinator must choose only one set to use, then include his choice in the "remaining keys" list so the other wallets know which of their keys to use. You can generalize it further to N-2 of N or even M of N, but I'm not sure there's legitimate demand to justify the complexity. It might also be straightforward enough to support with minimal changes from N-1 format. You basically just give each user additional keys for each additional "-1" you desire. N-2 would be 3 keys per user, N-3 4 keys, etc. The process is somewhat cumbersome: To create a N/N multisig wallet: - each participant creates a normal wallet - each participant runs "prepare_multisig", and sends the resulting string to every other participant - each participant runs "make_multisig N A B C D...", with N being the threshold and A B C D... being the strings received from other participants (the threshold must currently equal N) As txes are received, participants' wallets will need to synchronize so that those new outputs may be spent: - each participant runs "export_multisig FILENAME", and sends the FILENAME file to every other participant - each participant runs "import_multisig A B C D...", with A B C D... being the filenames received from other participants Then, a transaction may be initiated: - one of the participants runs "transfer ADDRESS AMOUNT" - this partly signed transaction will be written to the "multisig_monero_tx" file - the initiator sends this file to another participant - that other participant runs "sign_multisig multisig_monero_tx" - the resulting transaction is written to the "multisig_monero_tx" file again - if the threshold was not reached, the file must be sent to another participant, until enough have signed - the last participant to sign runs "submit_multisig multisig_monero_tx" to relay the transaction to the Monero network
2017-12-17wallet: add multisig key generationmoneromooo-monero2-0/+8
Scheme by luigi1111
2017-12-16move includes around to lessen overall loadmoneromooo-monero4-2/+43
2017-12-16Merge pull request #2860Riccardo Spagni2-4/+10
3dffe71b new wipeable_string class to replace std::string passphrases (moneromooo-monero) 7a2a5741 utils: initialize easylogging++ in on_startup (moneromooo-monero) 54950829 use memwipe in a few relevant places (moneromooo-monero) 000666ff add a memwipe function (moneromooo-monero)
2017-12-08add bulletproofs from v7 on testnetmoneromooo-monero1-4/+4
2017-12-08integrate bulletproofs into moneromoneromooo-monero1-0/+21
2017-11-27new wipeable_string class to replace std::string passphrasesmoneromooo-monero2-4/+10
2017-11-25Merge pull request #2784Riccardo Spagni2-4/+4
54a4c1cb cryptonote: do not overwrite const data (moneromooo-monero)
2017-11-25Merge pull request #2792Riccardo Spagni1-5/+107
47c0948a Implement missing miner functions on FreeBSD (Vasil Dimov) fdb5bd16 Remove unused variables and fix typos in comments (Vasil Dimov)
2017-11-22cryptonote: do not overwrite const datamoneromooo-monero2-4/+4
2017-11-14remove "using namespace std" from headersmoneromooo-monero1-0/+2
It's nasty, and actually breaks on Solaris, where if.h fails to build due to: struct map *if_memmap;