aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2024-03-07unit_tests: fix strtoul unit testjeffro2561-1/+0
2024-02-20wallet: feature: transfer amount with fee includedjeffro2561-0/+57
To transfer ~5 XMR to an address such that your balance drops by exactly 5 XMR, provide a `subtractfeefrom` flag to the `transfer` command. For example: transfer 76bDHojqFYiFCCYYtzTveJ8oFtmpNp3X1TgV2oKP7rHmZyFK1RvyE4r8vsJzf7SyNohMnbKT9wbcD3XUTgsZLX8LU5JBCfm 5 subtractfeefrom=all If my walet balance was exactly 30 XMR before this transaction, it will be exactly 25 XMR afterwards and the destination address will receive slightly less than 5 XMR. You can manually select which destinations fund the transaction fee and which ones do not by providing the destination index. For example: transfer 75sr8AAr... 3 74M7W4eg... 4 7AbWqDZ6... 5 subtractfeefrom=0,2 This will drop your balance by exactly 12 XMR including fees and will spread the fee cost proportionally (3:5 ratio) over destinations with addresses `75sr8AAr...` and `7AbWqDZ6...`, respectively. Disclaimer: This feature was paid for by @LocalMonero.
2024-02-08serialization: fix infinite loops and clean up dispatchingjeffro2561-5/+34
Resolves #8687
2024-01-30Disable/fix ports with I2PLee Clagett1-42/+37
2024-01-29Add <cstdint> to aligned testLee *!* Clagett1-0/+1
2023-11-28Fix missing checks for IsObject in ZMQ jsonrpc readingLee Clagett1-0/+7
2023-10-02add a test for the long term weight cacheBoog9001-0/+35
2023-08-23wallet2: fix `store_to()` and `change_password()`jeffro2562-0/+267
Resolves #8932 and: 2. Not storing cache when new path is different from old in `store_to()` and 3. Detecting same path when new path contains entire string of old path in `store_to()` and 4. Changing your password / decrypting your keys (in this method or others) and providing a bad original password and getting no error and 5. Changing your password and storing to a new file
2023-05-25common: do not use DNS to determine if address is localtobtoht2-0/+51
Co-authored-by: j-berman <justinberman@protonmail.com>
2023-03-17verRctNonSemanticsSimpleCached: fix fragilityJeffrey Ryan2-0/+427
2022-11-21DNSResolver: fix not handling hostnames without dot characters [release]Jeffrey Ryan1-0/+11
Unrelated, but similar code-wise to #8643. There is a check in `DNSResolver` which automatically fails to resolve hostnames which do not contain the `.` character. This PR removes that check.
2022-11-17p2p: fix exclusive node DNS resolution for certain hosts [release]Jeffrey Ryan1-0/+35
Fixes #8633. The function `append_net_address` did not parse hostname + port addresses (e.g. `bar:29080`) correctly if the hostname did not contain a `'.'` character. @vtnerd comments 1 clear up 2nd conditional statement
2022-10-25Fix dandelion++ fluff/stem bug with local txesLee Clagett1-15/+84
2022-09-22Move update_checkpoints() to a later stageSChernykh1-0/+1
update_checkpoints() makes a few DNS requests and can take up to 20-30 seconds to complete (3-6 seconds on average). It is currently called from core::handle_incoming_block() which holds m_incoming_tx_lock, so it blocks all incoming transactions and blocks processing while update_checkpoints() is running. This PR moves it to until after a new block has been processed and relayed, to avoid full monerod locking.
2022-09-21add an option to force-update multisig key exchange under some circumstanceskoe1-24/+64
2022-09-01multisig: fix #8537 seed restore (suggestions by @UkoeHB)j-berman1-1/+1
- spend secret key is no longer the sum of multisig key shares; no need to check that is the case upon restore. - restoring a multisig wallet from multisig info means that the wallet must have already completed all setup rounds. Upon restore, set the number of rounds completed accordingly.
2022-07-08address PR commentsj-berman1-5/+5
2022-07-05connection: add segfault and deadlocks demoanon1-2/+252
2022-06-30multisig: fix critical vulnerabilities in signinganon3-20/+21
2022-05-18Don't exclusively drop tor/i2p outgoing cxns in idle loopj-berman1-2/+2
2022-05-18unit_tests: add more sha256sum test casesJeffrey Ryan1-0/+22
2022-04-29multisig: add post-kex verification round to check that all participants ↵koe1-8/+7
have completed the multisig address
2022-04-29Update copyright to 2022 for Hardfork filesAkrit2-2/+2
Update Makefile and LICENSE
2022-04-18Add Include statementsJeffrey1-0/+1
2022-04-10Fee changes from ArticMinemoneromooo-monero2-0/+188
https://github.com/ArticMine/Monero-Documents/blob/master/MoneroScaling2021-02.pdf with a change to use 1.7 instead of 2.0 for the max long term increase rate
2022-04-10epee: allow copying a rolling_median_t objectmoneromooo-monero1-0/+18
2022-04-05plug bulletproofs plus into consensusmoneromooo-monero1-1/+1
2022-04-04Bulletproofs+Sarang Noether2-0/+170
2022-03-30Remove dead code from parserse_base_utils and fix unit testsJeffrey1-67/+74
* Remove `match_string()`, `match_number()`, and `match_word()` * Remove `match_word_with_extrasymb()` and `match_word_til_equal_mark()` * Adapt unit test for `match_number()` to `match_number2()` * Adapt unit test for `match_string()` to `match_string2()` Note: the unit tests were testing for the old version of the functions, and the interfaces for these functions changed slightly, so I had to also edit the tests. As of writing, this PR has no merge conflicts with #8211 Additional changes during review: * Explicitly set up is_[float/signed]_val to be changed before each call * Structify the tests and fix uninitialized variables
2022-03-04Copyright: Update to 2022mj-xmr73-73/+94
2022-02-22multisig key exchange update and refactorkoe1-32/+202
2021-11-01tx_pool: full tx revalidation on fork boundariesmoneromooo-monero1-5/+10
avoids mining txes after a fork that are invalid by this fork's rules, but were valid by the previous fork rules at the time they were verified and added to the txpool.
2021-09-20node_server: fix race conditionanon1-36/+77
2021-09-20node_server: add race condition demoanon1-0/+260
2021-09-12Mac: UT node server fix IP localhost by aliasingmj-xmr1-0/+3
2021-09-08unit_tests: fix use after free in serialization testmoneromooo-monero1-2/+4
2021-08-05p2p: remove blocked addresses/hosts from peerlistmoneromooo-monero1-0/+1
2021-08-03EasyLogging++: new anti-UB test and propagating exceptionmj-xmr1-0/+7
2021-07-28unit_tests: fix broken testsanon2-8/+8
boosted_tcp_server: check condition before sleep too cryptonote_protocol_handler: each instance of BlockchainLMDB requires separate thread due to private thread local fields
2021-07-06EasyLogging++: Add UTests, that protect against regressionsmj-xmr1-0/+13
2021-06-11unit_tests: check for ge_frombytes_vartime failuremoneromooo-monero2-4/+4
CID 1446559
2021-04-28clang: fix -Wpessimizing-move warningselsta1-1/+2
2021-04-27clang: fix -Wrange-loop-analysis warningsselsta1-1/+1
2021-04-16Split epee/string_tools.h and encapsulate boost::lexical_castmj-xmr1-0/+1
2021-04-16Revert "Merge pull request #7136"luigi11113-118/+24
This reverts commit 63c7ca07fba2f063c760f786a986fb3e02fb040e, reversing changes made to 2218e23e84a89e9a1e4c0be5d50f891ab836754f.
2021-04-08unit_tests: fix boost 1.58 compatibilityanon1-1/+1
2021-04-05Tests: Fix test node_server.bind_same_p2p_port from randomly crashingmj-xmr1-0/+12
2021-03-27Warnings: fix ut/levin.cpp missing bracesmj-xmr1-1/+4
2021-03-22cryptonote_protocol_handler: add race condition demoanon1-0/+592
2021-03-12async_protocol_handler_config: add deadlock demoanon1-0/+110
2021-02-19async_protocol_handler_config: add segfault demoanon1-2/+73
2021-02-09New add_aux_pow RPC to support merge miningmoneromooo-monero1-0/+213
2021-02-09Remove unused variables in monero codebaseKevin Barbour5-5/+1
There are quite a few variables in the code that are no longer (or perhaps never were) in use. These were discovered by enabling compiler warnings for unused variables and cleaning them up. In most cases where the unused variables were the result of a function call the call was left but the variable assignment removed, unless it was obvious that it was a simple getter with no side effects.
2021-02-06Reduce compilation time of epee/portable_storage.hmj-xmr1-0/+1
2021-01-28Remove copies from foreach loops (thanks to Clang)Lee Clagett1-8/+8
2021-01-27unit_tests: fix wipeable_string parse_hexstr test with latest gtestxiphon1-9/+9
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973196
2021-01-23Improve cryptonote (block and tx) binary read performanceLee Clagett2-7/+75
2021-01-19boosted_tcp_server: add segfault demoanon1-0/+150
2021-01-19Remove payload copy in all outgoing p2p messagesLee Clagett4-40/+124
2021-01-16Remove payload copy in all outgoing p2p messagesLee Clagett3-24/+118
2021-01-03add a max levin packet size by command typemoneromooo-monero1-0/+1
2020-12-31protocol: more sanity checks in new chain block hashesmoneromooo-monero1-1/+2
2020-12-27protocol: fix false positives dropping peersmoneromooo-monero1-0/+1
it'd trigger on reorgs
2020-12-27Revert "Reject existing claimed blocks in sync mode"luigi11111-1/+0
2020-12-22Command max_bytes moved from dynamic map to static switchLee Clagett1-3/+40
2020-12-20Restrict duplicate keys in epee binary formatLee Clagett2-0/+55
2020-12-17protocol: reject claimed block hashes that already are in the chainmoneromooo-monero1-0/+1
2020-12-17Add aggressive restrictions to pre-handshake p2p buffer limitLee Clagett2-0/+4
2020-12-14Fix byte_stream::put_nLee Clagett1-0/+17
2020-12-10protocol: drop origin IP if a block fails to verify in sync modemoneromooo-monero1-9/+11
It would otherwise be possible for a peer to send bad blocks, then disconnect and reconnect again, escaping bans
2020-11-25cryptonote_core: dandelion - use local height or median height if syncingxiphon2-2/+8
2020-11-16Better log message for unusable anon networksHoward Chu1-1/+2
2020-11-03Switch to Dandelion++ fluff mode if no out connections for stem modeLee Clagett1-0/+109
2020-10-28Add RELINK_TARGETS, monero_add_target_no_relink and use ↵mj-xmr1-2/+2
monero_add_executable/monero_add_library where possible (mj-xmr) Add monero_add_minimal_executable and use in tests This is done in order not to have to relink targets, when just an .so changed, but not its interface.
2020-10-13Change to more efficient allocation strategy in byte_streamLee Clagett1-43/+50
2020-10-13Allow byte_stream->byte_slice conversion to shrink unused buffer spaceLee Clagett1-1/+3
2020-10-12Dandelion++: skip desynced peers in stem phasexiphon1-34/+41
2020-10-10Change epee binary output from std::stringstream to byte_streamLee Clagett4-24/+23
2020-10-03Unit Tests: Remove block reward upper bound size checksTheCharlatan1-18/+0
Tests running after being compiled with `make debug-test` failed with ``` [ FAILED ] block_reward_and_current_block_weight.fails_on_huge_median_size [ FAILED ] block_reward_and_current_block_weight.fails_on_huge_block_weight ``` With the introduction of the patch in https://github.com/monero-project/monero/commit/be82c40703d267184ee07bf7be71002122c86656#diff-1a57d4e6013984c420da98d1adde0eafL113 the assertions checking the weight of the median and current block against a size limit were removed. Since the limit is now enforced by a long divisor and a uint64_t type, checking in a separate test makes little sense, so they are removed here.
2020-09-01threadpool: guard against exceptions in jobs, and armour platingmoneromooo-monero1-20/+20
Those would, if uncaught, exit run and leave the waiter to wait indefinitely for the number of active jobs to reach 0
2020-08-27CLSAG optimizationsSarang Noether1-84/+82
2020-08-27Integrate CLSAGs into moneromoneromooo-monero2-1/+185
They are allowed from v12, and MLSAGs are rejected from v13.
2020-08-27unit_tests: add ge_triple_scalarmult_base_vartime testmoneromooo-monero1-0/+62
2020-08-17Add clear method to byte_streamLee Clagett1-0/+41
2020-08-17Revert "Use domain-separated ChaCha20 for in-memory key encryption"luigi11112-74/+0
This reverts commit 921dd8dde5d381052d0aa2936304a3541a230c55.
2020-08-17replace most boost serialization with existing monero serializationmoneromooo-monero2-2/+2
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.
2020-08-14Change ZMQ-JSON txextra to hex and remove unnecessary base fieldsLee Clagett1-1/+16
2020-08-14Fix pruned tx for ZMQ's GetBlocksFastLee Clagett1-1/+1
2020-08-09Use domain-separated ChaCha20 for in-memory key encryptionSarang Noether2-0/+74
2020-08-09Updates InProofV1, OutProofV1, and ReserveProofV1 to new V2 variants that ↵Sarang Noether2-0/+131
include all public proof parameters in Schnorr challenges, along with hash function domain separators. Includes new randomized unit tests.
2020-07-23Fix overflow issue in epee:misc_utils::rolling_median_t and median(), with ↵koe1-0/+11
unit test
2020-07-20wallet2_api: implement runtime proxy configurationxiphon1-1/+1
2020-05-20ByteSlice: Fix persisting ptr to std::moved SSO bufferDoyle1-0/+23
The Bug: 1. Construct `byte_slice.portion_` with `epee::span(buffer)` which copies a pointer to the SSO buffer to `byte_slice.portion_` 2. It constructs `byte_slice.storage_` with `std::move(buffer)` (normally this swap pointers, but SSO means a memcpy and clear on the original SSO buffer) 3. `slice.data()` returns a pointer from `slice.portion_` that points to the original SSO cleared buffer, `slice.storage_` has the actual string.
2020-05-15Add randomized delay when forwarding txes from i2p/tor -> ipv4/6Lee Clagett1-8/+246
2020-05-12Fixed bugs for take_slice and byte_stream->byte_sliceLee Clagett1-0/+31
2020-05-11remove double includessumogr1-2/+0
2020-05-06Update copyright year to 2020SomaticFanatic50-50/+50
Update copyright year to 2020
2020-05-04Adding ZMQ/Pub support for txpool_add and chain_main eventsLee Clagett4-8/+776
2020-04-18unit_tests: fix gcc+ warningSumo Gr1-0/+4
2020-04-14Bulletproofs: verification speedupSarang Noether1-0/+8
2020-04-11Add byte_stream for zero-copy serialization, and add support in ZMQ-JSON.Lee Clagett2-5/+259
2020-04-03Use byte_slice for sending zmq messages - removes data copy within zmqLee Clagett1-0/+39
2020-03-30Fixed string_ref usage bug in epee::from_hex::vectorLee Clagett1-0/+3
2020-03-28Fix network unit tests after epee changesLee Clagett1-2/+2
2020-03-26Adding Dandelion++ support to public networks:Lee Clagett1-27/+1074
- 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-03-22protocol: request txpool contents when syncedmoneromooo-monero1-0/+2
A newly synced Alice sends a (typically quite small) list of txids in the local tpxool to a random peer Bob, who then uses the existing tx relay system to send Alice any tx in his txpool which is not in the list Alice sent
2020-03-20p2p: remove old debug commandsAaron Hook3-1/+2
2020-03-10Fix receive order leakage with tx fluffingLee Clagett1-8/+12
2020-03-09Move hex->bin conversion to monero copyright files and with less includesLee Clagett1-3/+43
2020-03-05Various improvements to the ZMQ JSON-RPC handling:Lee Clagett2-20/+38
- 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.
2020-02-28daemon: auto public nodes - cache and prioritize most stable nodesxiphon2-0/+173
2020-02-18unit_tests: fix missing test namesxiphon2-5/+1
2020-02-17remove empty statementsInterchained2-2/+2
Cleaning up a little around the code base.
2020-02-12wipeable_string: split - treat CR, LF and Tabs as separatorsxiphon1-0/+1
2020-01-26wallet: do not split integrated addresses in address book apimoneromooo-monero1-1/+0
2020-01-18net: fix incorrect less operator for top/i2p addressesAaron Hook1-23/+403
2019-12-01unit_tests: remove invalid bulletproofs unit testmoneromooo-monero1-9/+0
It was intended to check a case which is actually valid (0 gamma), but was actually duplicating the bad amount test. Reported by WhatDo_ on IRC.
2019-11-18Fixed bug in ZMQ JSON-RPC method fieldLee Clagett2-1/+58
2019-11-12rpc: Only show version string if it matches expected patternNathan Dorfman2-1/+51
2019-11-04Change to Tx diffusion (Dandelion++ fluff) instead of floodingLee Clagett1-14/+82
2019-11-04Improved performance for epee serialization:Lee Clagett1-3/+3
- Removed copy of field names in binary deserialization - Removed copy of array values in binary deserialization - Removed copy of string values in json deserialization - Removed unhelpful allocation in json string value parsing - Removed copy of blob data on binary and json serialization
2019-11-02Adding support for hidden (anonymity) txpoolLee Clagett1-5/+6
2019-10-31unit_tests: fix use after freemoneromooo-monero1-7/+16
2019-10-30unit_tests: fix use after freemoneromooo-monero1-7/+16
2019-10-21Support median block size > 4 GBmoneromooo-monero1-0/+116
add a 128/64 division routine so we can use a > 32 bit median block size in calculations
2019-10-15unit_tests: fix build after renamemoneromooo-monero1-4/+6
2019-10-13p2p+rpc: don't skip p2p or rpc port bind failure by defaultxiphon2-7/+42
2019-10-11cryptonote: add function to get weight from a pruned txmoneromooo-monero1-0/+37
The weight of the prunable data is deterministic from the unpruned data, so it can be determined from a pruned tx
2019-10-11unit_tests: fix build with boost 1.69moneromooo-monero1-3/+6
2019-10-04unit_tests: fix ringdb unit testsmoneromooo-monero1-5/+11
2019-09-27monerod can now sync from pruned blocksmoneromooo-monero1-4/+6
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-16p2p: fix bans taking port into accountmoneromooo-monero1-2/+20
2019-09-16Properly format multiline logsmoneromooo-monero1-0/+17
As a side effect, colouring on Windows should now work regardless of version
2019-09-16Removed Berkeley DB and db switching logicJesus Ramirez1-8/+1
2019-09-09unit tests: replace global var with lambda returning static local varstoffu2-9/+9
Fixes assertion failure (curstate == 1) in random.c in debug mode
2019-09-04unit_tests: fix levin unit test on big endianmoneromooo-monero1-23/+23
2019-09-04difficulty: fix check_hash on big endianmoneromooo-monero1-4/+10
2019-09-02Changed the use of boost:value_initialized for C++ list initializerJesus Ramirez1-1/+1
2019-08-30unit_tests: fix build with CLANG 8 and boost 1.69moneromooo-monero1-6/+12
2019-08-27MLSAG speedup and additional checksSarang Noether1-1/+14
2019-08-27unit_tests: Fix uninitialized valuesMatyas Liptak1-1/+1
- Initialize the `hash` in the `get_block_hash()` function of the `output_distribution` unit test explicitly, to silence `valgrind` warnings.
2019-08-16epee: support unicode in parsed stringsmoneromooo-monero1-0/+17
2019-08-15Replace std::random_shuffle with std::shuffleTom Smeding2-3/+3
According to [1], std::random_shuffle is deprecated in C++14 and removed in C++17. Since std::shuffle is available since C++11 as a replacement and monero already requires C++11, this is a good replacement. A cryptographically secure random number generator is used in all cases to prevent people from perhaps copying an insecure std::shuffle call over to a place where a secure one would be warranted. A form of defense-in-depth. [1]: https://en.cppreference.com/w/cpp/algorithm/random_shuffle
2019-07-29Fixed i2p/tor tx flooding bug (white noise disabled)Lee Clagett1-12/+85
2019-07-22Dropping cppzmq dependency; adding some zmq utilsLee Clagett2-1/+132
2019-07-17Added support for "noise" over I1P/Tor to mask Tx transmission.Lee Clagett4-0/+1088
2019-07-16Add ref-counted buffer byte_slice. Currently used for sending TCP data.Lee Clagett2-3/+436
2019-07-16allow blocking whole subnetsmoneromooo-monero2-3/+53
2019-07-09boost: update obsolete usage of endian APImoneromooo-monero1-1/+2
2019-07-04keccak: guard against misaligned memory accesses on ARMmoneromooo-monero1-0/+17
The code generated is exactly the same as the direct access one on x86_64
2019-07-01unit_tests: check return values on test data parsingmoneromooo-monero1-2/+2
Won't trigger in practice, but you never know when that code changes Coverity 199723, 199685
2019-06-16unit_tests: add more leeway to the "same distribution" checkmoneromooo-monero1-2/+2
This is an inherently probabilistic check, which occasionally fails for a matching distribution
2019-05-20unit_tests: make the density test a bit less stringentmoneromooo-monero1-1/+1
It's an inherently random test
2019-05-10use crypto::rand instead of libc rand in a few testsmoneromooo-monero3-8/+8
We don't need secure randomness here, but it should shut coverity up
2019-05-02blockchain: keep a rolling long term block weight medianmoneromooo-monero2-0/+203
2019-05-01fix wide difficulty conversion with some versions of boostmoneromooo-monero1-4/+4
2019-05-01wallet2: reject standalone short payment IDs in monero: URI APImoneromooo-monero1-3/+1
2019-04-29remove unused codemoneromooo-monero1-1/+0
2019-04-29add a few checks where it seems appropriatemoneromooo-monero1-0/+1
2019-04-25unit_tests: fix crash in debug in output_distribution testmoneromooo-monero1-0/+7
updating the block size limit needs recent block sizes, so we feed it dummy ones
2019-04-25rpc: improve get_output_distributionmoneromooo-monero1-11/+18
It can now handle small reorgs without having to rescan the whole blockchain. Also add a test for it.
2019-04-23unit_tests: don't delete log file on windows, it will failmoneromooo-monero1-0/+3
2019-04-19Fix socks tests in windows and handle errors betterLee Clagett1-7/+13
2019-04-18wallet2: "output lineup" fake out selectionmoneromooo-monero1-0/+117
Based on python code by sarang: https://github.com/SarangNoether/skunkworks/blob/outputs/outputs/simulate.py
2019-04-17testdb: add override keyword where missingstoffu1-6/+6
and delete obsolete BlockchainBDB::get_tx_output_indices along the way
2019-04-16unit_tests: undo is_blocked implementation factoringmoneromooo-monero1-1/+12
The is_host_blocked method is not on master yet
2019-04-14blockchain_db: fix db txn ending too earlymoneromooo-monero1-0/+4
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-11p2p: fix integer overflow in host bansmoneromooo-monero1-12/+17
2019-04-11ringct: prevent use of full ringct signatures for more than one inputmoneromooo-monero2-142/+57
2019-04-09unit_tests/long_term_block_weight: some tweaks that seem to make more sensestoffu1-8/+9
2019-04-03unit_tests: fix long term block weight test after cache changemoneromooo-monero1-0/+5
2019-03-25Added socks proxy (tor/i2pd/kovri) support to walletLee Clagett2-1/+91
2019-03-24Make difficulty 128 bit instead of 64 bitmoneromooo-monero3-0/+92
Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
2019-03-24test: hmac_keccak - fix number of chunks countingDusan Klinec1-6/+7
2019-03-20crypto: hmac_keccak addedDusan Klinec2-0/+153
2019-03-19Adding classes, functions, and utilities for common LMDB operations.Lee Clagett2-0/+406
2019-03-12tests: disable wallet SSL init for tests involving wallet2moneromooo-monero1-1/+1
2019-03-08blockchain: speed up getting N blocks weights/long term weightsmoneromooo-monero1-0/+12
2019-03-05Update 2019 copyrightbinaryFate46-46/+46
2019-03-05epee: add SSL supportMartijn Otto1-0/+19
RPC connections now have optional tranparent SSL. An optional private key and certificate file can be passed, using the --{rpc,daemon}-ssl-private-key and --{rpc,daemon}-ssl-certificate options. Those have as argument a path to a PEM format private private key and certificate, respectively. If not given, a temporary self signed certificate will be used. SSL can be enabled or disabled using --{rpc}-ssl, which accepts autodetect (default), disabled or enabled. Access can be restricted to particular certificates using the --rpc-ssl-allowed-certificates, which takes a list of paths to PEM encoded certificates. This can allow a wallet to connect to only the daemon they think they're connected to, by forcing SSL and listing the paths to the known good certificates. To generate long term certificates: openssl genrsa -out /tmp/KEY 4096 openssl req -new -key /tmp/KEY -out /tmp/REQ openssl x509 -req -days 999999 -sha256 -in /tmp/REQ -signkey /tmp/KEY -out /tmp/CERT /tmp/KEY is the private key, and /tmp/CERT is the certificate, both in PEM format. /tmp/REQ can be removed. Adjust the last command to set expiration date, etc, as needed. It doesn't make a whole lot of sense for monero anyway, since most servers will run with one time temporary self signed certificates anyway. SSL support is transparent, so all communication is done on the existing ports, with SSL autodetection. This means you can start using an SSL daemon now, but you should not enforce SSL yet or nothing will talk to you.
2019-03-05cryptonote: avoid double parsing blocks when syncingmoneromooo-monero1-2/+2
2019-03-05save some database calls when getting top block hash and heightmoneromooo-monero1-1/+3
2019-03-05Avoid repeated (de)serialization when syncingmoneromooo-monero2-29/+29
2019-03-04ArticMine's new block weight algorithmmoneromooo-monero6-175/+414
This curbs runaway growth while still allowing substantial spikes in block weight Original specification from ArticMine: here is the scaling proposal Define: LongTermBlockWeight Before fork: LongTermBlockWeight = BlockWeight At or after fork: LongTermBlockWeight = min(BlockWeight, 1.4*LongTermEffectiveMedianBlockWeight) Note: To avoid possible consensus issues over rounding the LongTermBlockWeight for a given block should be calculated to the nearest byte, and stored as a integer in the block itself. The stored LongTermBlockWeight is then used for future calculations of the LongTermEffectiveMedianBlockWeight and not recalculated each time. Define: LongTermEffectiveMedianBlockWeight LongTermEffectiveMedianBlockWeight = max(300000, MedianOverPrevious100000Blocks(LongTermBlockWeight)) Change Definition of EffectiveMedianBlockWeight From (current definition) EffectiveMedianBlockWeight = max(300000, MedianOverPrevious100Blocks(BlockWeight)) To (proposed definition) EffectiveMedianBlockWeight = min(max(300000, MedianOverPrevious100Blocks(BlockWeight)), 50*LongTermEffectiveMedianBlockWeight) Notes: 1) There are no other changes to the existing penalty formula, median calculation, fees etc. 2) There is the requirement to store the LongTermBlockWeight of a block unencrypted in the block itself. This is to avoid possible consensus issues over rounding and also to prevent the calculations from becoming unwieldy as we move away from the fork. 3) When the EffectiveMedianBlockWeight cap is reached it is still possible to mine blocks up to 2x the EffectiveMedianBlockWeight by paying the corresponding penalty. Note: the long term block weight is stored in the database, but not in the actual block itself, since it requires recalculating anyway for verification.
2019-02-01unit_tests: remove leftover debug printmoneromooo-monero1-1/+0
2019-01-28Adding initial support for broadcasting transactions over TorLee Clagett4-8/+936
- Support for ".onion" in --add-exclusive-node and --add-peer - Add --anonymizing-proxy for outbound Tor connections - Add --anonymous-inbounds for inbound Tor connections - Support for sharing ".onion" addresses over Tor connections - Support for broadcasting transactions received over RPC exclusively over Tor (else broadcast over public IP when Tor not enabled).
2019-01-28notify: handle arbitrary tagsmoneromooo-monero1-1/+1
2019-01-22ringct: remove unused senderPk from ecdhTuplemoneromooo-monero2-4/+0
This was an early ringct field, which was never used in production
2019-01-22ringct: the commitment mask is now deterministicmoneromooo-monero2-36/+0
saves space in the tx and is safe Found by knaccc
2019-01-22ringct: encode 8 byte amount, saving 24 bytes per outputmoneromooo-monero2-5/+21
Found by knaccc
2019-01-22add a bulletproof version, new bulletproof type, and rct configmoneromooo-monero4-10/+19
This makes it easier to modify the bulletproof format
2019-01-22Pruningmoneromooo-monero3-0/+243
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-16blockchain_db: allow getting output keys without commitmentmoneromooo-monero1-1/+1
Since the commitment has to be calculated for non rct outputs, it slows down a lot unnecessarily if we don't need it
2019-01-16epee: speedup word/number matchingmoneromooo-monero1-0/+84
Number matching semantics are slightly changed: since this is used as a filter to check whether a number is signed and/or floating point, we can speed this up further. strto* functions are called afterwards and will error out where necessary. We now also accept numbers like .4 which were not accepted before. The strto* calls on a boost::string_ref will not access unallocated memory since the parsers always stop at the first bad character, and the original string is zero terminated. in arbitrary time measurement units for some arbitrary test case: match_number2: 235 -> 70 match_word2: 330 -> 108
2019-01-11added two tests for partial word and case tolerance in mnemonicsPaul Shapiro1-1/+36
2019-01-07Make get_output_key method constmoneroexamples1-2/+2
get_output_key method is commonly used when working with txs and their key images. Because the method is not const, passing blockchain object though const& or pointers to const is not possible in this context. This is especially problematic in external projects (e.g., projects in moneroexamples) that use monero C++ api to operate on the blockchain and txs. Thus, having get_output_key method will simplify moving blockchain object around through const references and pointers to const objects.
2018-12-23epee: better network buffer data structuremoneromooo-monero2-4/+73
avoids pointless allocs and memcpy
2018-12-18blockchain_db: speedup tx output gatheringmoneromooo-monero1-1/+1
We know all the data we'll want for getblocks.bin is contiguous
2018-12-07p2p: use vector instead of list for peer listsmoneromooo-monero1-3/+3
2018-12-05unit_tests: strengthen notify test against OS schedulingmoneromooo-monero1-5/+16