aboutsummaryrefslogtreecommitdiff
path: root/tests/unit_tests (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2017-12-25Add a chacha20 variant to go with chacha8moneromooo-monero3-6/+6
2017-12-18tests: fix a buffer overread in a unit testmoneromooo-monero1-3/+1
and remove a leftover debugging sanity check
2017-12-17wallet2: fix slow multisig unit tests with subaddress patchmoneromooo-monero1-0/+1
While there, move the wallet2 ctor to the cpp file as it's a huge amount of init list now, and remove an unused one.
2017-12-17wallet: guard against partly initialized multisig walletmoneromooo-monero1-5/+12
2017-12-17N-1/N multisigmoneromooo-monero1-7/+19
2017-12-17gen_multisig: generates multisig wallets if participants trust each othermoneromooo-monero1-8/+8
2017-12-17wallet2: allow empty wallet filename to avoid saving datamoneromooo-monero1-11/+1
Useful to speed tests up and avoid unnecessary leftover files
2017-12-17tests: add multisig unit testsmoneromooo-monero2-0/+179
2017-12-17Add N/N multisig tx generation and signingmoneromooo-monero2-10/+10
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-17unit_tests: fix memwipe test comparisonmoneromooo-monero1-1/+1
free might overwrite the memory, so we can't expect to see the NULs we overwrote with, but at least we shouldn't see the original data.
2017-12-16cryptonote_core does not depend on p2p anymoremoneromooo-monero2-0/+12
As a followon side effect, this makes a lot of inline code included only in particular cpp files (and instanciated when necessary.
2017-12-16move includes around to lessen overall loadmoneromooo-monero3-1/+5
2017-12-08integrate bulletproofs into moneromoneromooo-monero1-0/+1
2017-12-08add bulletproofs to the build, with basic unit testsmoneromooo-monero2-0/+71
Based on Java code from Sarang Noether
2017-12-07util: allow non numeric version partsmoneromooo-monero1-0/+2
2017-11-27new wipeable_string class to replace std::string passphrasesmoneromooo-monero1-1/+1
2017-11-27add a memwipe functionmoneromooo-monero2-0/+67
It's meant to avoid being optimized out memory_cleanse lifted from bitcoin
2017-11-15unit_tests: fix running without --data-dirmoneromooo-monero1-2/+2
While there, also use the new is_arg_defaulted API instead of going to poke the internal API directly.
2017-11-14unit_tests: fix build after wallet2 list/vector changemoneromooo-monero1-2/+2
2017-11-14move cryptonote command line options to cryptonote_coremoneromooo-monero1-1/+1
Those have no reason to be in a generic module
2017-11-14remove "using namespace std" from headersmoneromooo-monero2-0/+2
It's nasty, and actually breaks on Solaris, where if.h fails to build due to: struct map *if_memmap;
2017-11-11kaccak: remove unused return valuemoneromooo-monero1-5/+1
2017-11-08Protect node privacy by proper filtering in restricted-mode RPC answersbinaryFate1-2/+2
This patch allows to filter out sensitive information for queries that rely on the pool state, when running in restricted mode. This filtering is only applied to data sent back to RPC queries. Results of inline commands typed locally in the daemon are not affected. In practice, when running with `--restricted-rpc`: * get_transaction_pool will list relayed transactions with the fields "last relayed time" and "received time" set to zero. * get_transaction_pool will not list transaction that have do_not_relay set to true, and will not list key images that are used only for such transactions * get_transaction_pool_hashes.bin will not list such transaction * get_transaction_pool_stats will not count such transactions in any of the aggregated values that are computed The implementation does not make filtering the default, so developers should be mindful of this if they add new RPC functionality. Fixes #2590.
2017-10-24unit_tests: fix data dir determinationmoneromooo-monero1-1/+1
2017-10-21Initialize openssl on startupmoneromooo-monero1-0/+2
2017-10-19unit tests: OOB indexes & adding subaddressCole Lightfighter1-15/+41
Tests for checking proper error throwing for out-of-bounds subaddress indexes, and proper addition of subaddresses. Signed-off-by: Cole Lightfighter <cole@onicsla.bz>
2017-10-17Subaddress unit testsCole Lightfighter2-0/+93
Basic unit test fixture, and initialization of a subaddress account. Signed-off-by: Cole Lightfighter <cole@onicsla.bz>
2017-10-16unit_tests: fix build on windowsmoneromooo-monero1-1/+1
Reported by iDunk on IRC
2017-10-10dns_utils: allow an optional DNS server IP in DNS_PUBLICmoneromooo-monero1-0/+14
tcp://a.b.c.d
2017-10-09Fix an object lifetime bug in net load testsmoneromooo-monero1-3/+5
The commands handler must not be destroyed before the config object, or we'll be accessing freed memory. An earlier attempt at using boost::shared_ptr to control object lifetime turned out to be very invasive, though would be a better solution in theory.
2017-10-08unit_tests: fix compiling on WindowsiDunk54002-7/+5
2017-10-08unit_tests: data dir is now overridden with --data-dirmoneromooo-monero2-10/+23
rather than a raw string without option
2017-10-07Subaddresseskenshi842-26/+26
2017-10-05tests: add sha256sum unit testmoneromooo-monero2-0/+46
2017-10-05Upgrades to epee::net_utils::network_addressLee Clagett3-2/+233
- internal nullptr checks - prevent modifications to network_address (shallow copy issues) - automagically works with any type containing interface functions - removed fnv1a hashing - ipv4_network_address now flattened with no base class
2017-10-03tests: fix hashchain unit testsmoneromooo-monero1-1/+1
and relax the not-empty safety check to stay more intuitiuve
2017-09-28tests: pass data dir as argredfish4-10/+32
This fixes test failure on builds that happen to be built in 'build/' instead of 'build/release'. Use boost filesystem path type.
2017-09-26mnemonics: new Lojban word listWei Tang1-1/+3
Word list authored by: sorpaas Sources: lo gimste jo'u lo ma'oste (http://guskant.github.io/lojbo/gismu-cmavo.html) N-grams of Lojban corpus (https://mw.lojban.org/papri/N-grams_of_Lojban_corpus)
2017-09-25wallet2: do not keep block hashes below last checkpointmoneromooo-monero2-0/+130
This saves a lot of space and load/save time for wallet caches
2017-09-25move checkpoints in a separate librarymoneromooo-monero4-4/+4
2017-09-25get_blockchain_top now returns voidmoneromooo-monero1-1/+1
It was always returning true, and could not be foreseen to usefully return errors in the future. This silences CID 162652 as well as saves some checking code in a few places.
2017-09-21build: auto update version info without manually deleting version.hstoffu1-0/+1
2017-09-19Added test documentation & Keccak unit testCole Lightfighter1-0/+28
2017-09-18precomputed block hashes are now in blocks of N (currently 256)moneromooo-monero1-0/+1
This shaves a lot of space off binaries
2017-09-18blockchain: reject unsorted ins and outs from v7moneromooo-monero1-0/+29
This ensures no information is leaked by the ordering
2017-09-17Use actual batch size for resize estimatesHoward Chu1-1/+1
And optimize import startup: Remember start_height position during initial count_blocks pass to avoid having to reread entire file again to arrive at start_height
2017-09-14Use a threadpoolHoward Chu2-178/+0
Instead of constantly creating and destroying threads
2017-09-13common: add apply_permutation file and functionmoneromooo-monero2-0/+46
This algorithm is adapted from Raymond Chen's code: https://blogs.msdn.microsoft.com/oldnewthing/20170109-00/?p=95145
2017-09-03Add a --fluffy-blocks option to relay blocks as fluffy blocksmoneromooo-monero1-0/+1
Defaults to off, but fluffy blocks are forced enabled on testnet
2017-08-22Cleanup test impact of adding safesyncmode() methodHoward Chu1-0/+1
2017-08-20Toggle SAFE syncmode on and off automaticallyHoward Chu1-0/+1
If monerod is started with default sync mode, set it to SAFE after synchronization completes. Set it back to FAST if synchronization restarts (e.g. because another peer has a longer blockchain). If monerod is started with an explicit sync mode, none of this automation takes effect.
2017-08-19DB cleanupHoward Chu1-1/+1
Hide LMDB-specific stuff behind blockchain_db.h. Nobody besides blockchain_db.cpp should ever be including DB-specific headers any more.
2017-08-17cryptonote_protocol: large block sync size before v4moneromooo-monero1-1/+1
2017-08-15protocol: pass blockchain cumulative difficulty when syncingmoneromooo-monero1-0/+1
Not used yet.
2017-08-14mnemonics: new Esperanto word listmoneromooo-monero1-1/+3
Word list authored by: Engelberg, ProkhorZ Sources: Baza Radikaro Oficiala Reta Vortaro (http://www.reta-vortaro.de/revo/) Esperanto Panorama - Esperanto-English Dictionary (http://www.esperanto-panorama.net/vortaro/eoen.htm) ESPDIC - Paul Denisowski (http://www.denisowski.org/Esperanto/ESPDIC/espdic.txt)
2017-08-12protocol: fix reorgs while syncingmoneromooo-monero1-188/+0
2017-08-10tests: fix tests buildmoneromooo-monero1-0/+2
Add get_fork_version and add_ideal_fork_version to core so cryptonote_protocol does not have to need the Blockchain class directly, as it's not in its dependencies, and add those to the fake core classes in tests too.
2017-08-07core: thread most of handle_incoming_txmoneromooo-monero1-0/+1
2017-08-07cryptonote_protocol_handler: sync speedupmoneromooo-monero2-0/+277
A block queue is now placed between block download and block processing. Blocks are now requested only from one peer (unless starved). Includes a new sync_info coommand.
2017-06-19unit_tests: fix build failures after network_address changesmoneromooo-monero2-64/+68
2017-06-11blockchain_db: add a txpool tx getter which returns existencemoneromooo-monero1-0/+1
Avoids exception spam for the "nope, not found" case
2017-06-01Don't copy blockchain for coinbase_tx_sumHoward Chu1-1/+1
Changed Blockchain::for_all_blocks() to for_blocks_range() Operate on blockchain in-place instead of building a copy first.
2017-05-25Move txpool to the databasemoneromooo-monero2-1/+11
Integration could go further (ie, return_tx_to_pool calls should not be needed anymore, possibly other things). poolstate.bin is now obsolete.
2017-05-07Fix overlooked renaming of Português in the unit testsNano Akron1-2/+2
2017-04-24Change Old_English to English_Old - 'Old English' is actually a languageNano Akron1-1/+1
2017-04-16Added Simplified Chinese electrum word listNano Akron1-1/+3
2017-04-11Simplified the implementation and features of spanLee Clagett1-1/+1
2017-04-11Improvements for epee binary to hex functions:Lee Clagett5-8/+415
- Performance improvements - Added `span` for zero-copy pointer+length arguments - Added `std::ostream` overload for direct writing to output buffers - Removal of unused `string_tools::buff_to_hex`
2017-03-29Replace deprecated tmpnam function.Randi Joseph1-10/+16
2017-03-25mnemonics: sanity checks for word listsmoneromooo-monero1-1/+30
and a test to go with it Remember to run the test when changing word lists, or simplewallet will throw uncaught if that word list is used.
2017-03-23core: cache tx and block hashes in the respective classesmoneromooo-monero1-0/+14
An idea from smooth
2017-03-18Removed boost/asio.hpp include from epee/string_tools.hLee Clagett2-0/+98
2017-03-15Add intervening v5 fork for increased min block sizemoneromooo-monero1-25/+25
Minimum mixin 4 and enforced ringct is moved from v5 to v6. v5 is now used for an increased minimum block size (from 60000 to 300000) to cater for larger typical/minimum transaction size. The fee algorithm is also changed to decrease the base per kB fee, and add a cheap tier for those transactions which we do not care if they get delayed (or even included in a block).
2017-03-10fix dependency: put HardFork back to cryptonote_basic, made some ↵kenshi841-1/+1
BlockchainDB functions virtual again to avoid missing symbols error
2017-03-04unit_tests: fix fee tests after quantization changemoneromooo-monero1-22/+35
2017-02-25core: move hardfork back to cryptonote_coremoneromooo-monero1-1/+1
should fix a cross dependency betewen cryptonote_basic and blockchain_db
2017-02-21update copyright year, fix occasional lack of newline at line endRiccardo Spagni32-32/+32
2017-02-21unit_tests: hardfork unit test now needs get_block_blob_from_heightmoneromooo-monero1-1/+2
2017-02-21More for PR #1724Howard Chu1-1/+1
Fix unit_tests build (get_output_key API change)
2017-02-20util: add a vercmp function to compare version numbersmoneromooo-monero2-1/+45
It is simple, supports simple x.y.z type numeric versions, and does not attempt any kind of validation
2017-02-16switch to boost::thread for mingw buildLee Clagett3-24/+25
2017-02-14unit_tests: fix minor blockchain_db regressionmoneromooo-monero1-1/+1
Due to the change in ordering for adding block and tx data to the database in f2986ccfc1f41023cd667dbb488a10df492eb8e7, adding a block twice now throws TX_EXISTS, not BLOCK_EXISTS.
2017-02-13blockchain_db: add "raw" blobdata getters for block and transactionmoneromooo-monero2-2/+4
This speeds up operations such as serving blocks to syncing peers
2017-02-12cryptonote_protocol: misc fluffy block fixesmoneromooo-monero1-0/+2
- fix wrong block being used when a new block is received between a node elaying a fluffy block and sending a new fluffy block with txes a peer did not have - misc a neverending ping pong requesting the same missing txids when a new block is received in the meantime, causing the top block to not be the one we need - send the original fluffy block message block height when sending a new fluffy block, not the current top height, which might have been updated since - avoid sending back the whole block blob when asking for txes, send only the hash instead - plus misc cleanup and additional debugging logs
2017-02-08extract some basic code from libcryptonote_core into libcryptonote_basickenshi8412-14/+14
2017-02-06Add server auth to monerod, and client auth to wallet-cli and wallet-rpcLee Clagett2-11/+25
2017-01-21unit_tests: fix missing return after batch_start prototype changemoneromooo-monero1-1/+1
2017-01-16fixups in logging init calls, and add missing net context in a logmoneromooo-monero1-0/+1
2017-01-15mnemonics: fix language detection with checksum wordmoneromooo-monero1-0/+19
If a checksum word is present, language detection would use just the word prefixes. However, a set of word prefixes may be found in more than one language, and so the wrong language may be found first, which could then fail the checksum, since the check may be done with a different unique prefix length from the one it was created from. We now make a checksum test when we we detect a language from prefixes only, to make sure we have the correct one.
2017-01-14Use batch transactions when syncingHoward Chu1-1/+1
Faster throughput while avoiding corruption. I.e., makes running with --db-sync-mode safe more tolerable.
2017-01-14unit_tests: fix portable serialization tests hardcoded data pathmoneromooo-monero2-4/+5
2017-01-14fix do_not_relay not preventing relaying on a timermoneromooo-monero1-1/+1
Also print its value when printing pool
2017-01-11Added (not yet enabled) HTTP client authenticationLee Clagett1-49/+302
2017-01-07blockchain: allow marking "tx not found" without an exceptionmoneromooo-monero1-0/+1
This is a normal occurence in many cases, and there is no need to spam the log with those when it is.
2017-01-03portable serializer: tests addedkenshi841-0/+513
2016-12-21Fixed HTTP auth tests for gcc 4.9Lee Clagett1-4/+4
2016-12-21make openalias also available for solo miner; introduce namespace ↵kenshi841-8/+9
tools::dns_utils; support integrated address with dns lookup
2016-12-20Fixed uninitialized valgrind errors in serialization testsLee Clagett1-2/+4
2016-12-19Fixes for google test < 1.8Lee Clagett1-18/+18
2016-12-15Preliminary support for DragonFly BSDAntonio Huete Jimenez1-1/+2
- It builds but no further testing has been done.
2016-12-13Adding HTTP Digest Auth (but not yet enabled)Lee Clagett2-0/+473
2016-12-04ringct: luigi1111's changes to fix and speedup Borromean sigsluigi11111-8/+4
2016-12-04ringct: switch to Borromean signaturesShen Noether2-35/+18
2016-11-28tests: add unit tests for uri parsingmoneromooo-monero2-0/+218
2016-11-25Added command_line::is_yesLee Clagett2-0/+51
2016-11-23Fixed undefined behavior in TestDBLee Clagett1-2/+2
2016-11-23Added task_region - a fork/join task implementationLee Clagett2-0/+178
2016-11-20tests: fix uninitialized data valgrind reports in levin testsmoneromooo-monero1-0/+1
2016-11-20tests: fix uninitialized data valgrind reports in serialization testsmoneromooo-monero1-1/+4
2016-11-13tests: fix another fee test on 32 bitmoneromooo-monero1-1/+1
2016-11-11tests: fix tests builds after fluffy blocks mergemoneromooo-monero1-0/+3
2016-11-10tests: fix fee unit tests on 32 bitmoneromooo-monero1-3/+5
2016-10-31core: dynamic fee algorithm from ArticMinemoneromooo-monero2-0/+122
The fee will vary based on the base reward and the current block size limit: fee = (R/R0) * (M0/M) * F0 R: base reward R0: reference base reward (10 monero) M: block size limit M0: minimum block size limit (60000) F0: 0.002 monero Starts applying at v4
2016-10-29ringct: check the size of amount_keys is the same as destinationsmoneromooo-monero2-2/+4
2016-10-23core: notify the txpool when transactions are relayedmoneromooo-monero1-0/+1
2016-10-19unit_tests: fix build after get_output_histogram signature changemoneromooo-monero1-1/+1
2016-10-01tests: fix build after addition of cryptonote_core::get_block_sync_sizemoneromooo-monero1-0/+1
2016-09-27wallet: cold wallet transaction signingmoneromooo-monero1-4/+4
This change adds the ability to create a new unsigned transaction from a watch only wallet, and save it to a file. This file can then be moved to another computer/VM where a cold wallet may load it, sign it, and save it. That cold wallet does not need to have a blockchain nor daemon. The signed transaction file can then be moved back to the watch only wallet, which can load it and send it to the daemon. Two new simplewallet commands to use it: sign_transfer (on the cold wallet) submit_transfer (on the watch only wallet) The transfer command used on a watch only wallet now writes an unsigned transaction set in a file called 'unsigned_monero_tx' instead of submitting the tx to the daemon as a normal wallet does. The signed tx file is called 'signed_monero_tx'.
2016-09-18cmake: transitive deps and remove deprecated LINK_*redfish1-6/+2
Keep the immediate direct deps at the library that depends on them, declare deps as PUBLIC so that targets that link against that library get the library's deps as transitive deps. Break dep cycle between blockchain_db <-> crytonote_core. No code refactoring, just hide cycle from cmake so that it doesn't complain (cycles are allowed only between static libs, not shared libs). This is in preparation for supproting BUILD_SHARED_LIBS cmake built-in option for building internal libs as shared.
2016-09-14rct: rework serialization to avoid storing vector sizesmoneromooo-monero1-2/+5
2016-09-04tests: block reward: disable 64-bit-only tests on 32-bit systemsredfish1-0/+2
Issue #1008
2016-08-31core: faster find_blockchain_supplementmoneromooo-monero1-1/+1
Since this queries block heights for blocks that may or may not exist, queries for non existing blocks would throw an exception, and that would slow down the loop a lot. 7 seconds to go through a 30 hash list. Fix this by adding an optional return block height to block_exists and using this instead. Actual errors will still throw an exception. This also cuts down on log exception spam.
2016-08-30tests: cmake: fix building with system gtestredfish1-1/+1
Issues #980 #983
2016-08-28rct amount key modified as per luigi1111's recommendationsmoneromooo-monero1-8/+8
This allows the key to be not the same for two outputs sent to the same address (eg, if you pay yourself, and also get change back). Also remove the key amounts lists and return parameters since we don't actually generate random ones, so we don't need to save them as we can recalculate them when needed if we have the correct keys.
2016-08-28rct: rework v2 txes into prunable and non prunable datamoneromooo-monero2-39/+41
Nothing is pruned, but this allows easier changes later.
2016-08-28rct: rework the verification preparation processmoneromooo-monero1-4/+4
The whole rct data apart from the MLSAGs is now included in the signed message, to avoid malleability issues. Instead of passing the data that's not serialized as extra parameters to the verification API, the transaction is modified to fill all that information. This means the transaction can not be const anymore, but it cleaner in other ways.
2016-08-28rct: change the simple flag to a typemoneromooo-monero1-1/+1
for future expansion
2016-08-28rct: avoid the need for the last II elementShen Noether1-4/+2
This element is used in the generation of the MLSAG, but isn't needed in verification. Also misc changes in the cryptonote code to match, by mooo.
2016-08-28wallet: do not store signatures in the wallet cachemoneromooo-monero1-0/+5
Saves some substantial space. Also avoid calculating tx hashes we don't need.
2016-08-28rct: do not serialize senderPk - it is not used anymoremoneromooo-monero1-1/+3
2016-08-28rct: make the amount key derivable by a third party with the tx keymoneromooo-monero2-15/+32
Scheme design from luigi1114.
2016-08-28rct: do not serialize public keys in outPkmoneromooo-monero1-1/+2
They can be reconstructed from vout
2016-08-28tests: add tests for wallet output selectionmoneromooo-monero2-1/+100
2016-08-28tests: add basic tests for simple rct apimoneromooo-monero1-44/+378
2016-08-28integrate simple rct apimoneromooo-monero2-6/+61
2016-08-28move the rct commitments to the output_amounts databasemoneromooo-monero1-5/+1
Since these are needed at the same time as the output pubkeys, this is a whole lot faster, and takes less space. Only outputs of 0 amount store the commitment. When reading other outputs, a fake commitment is regenerated on the fly. This avoids having to rewrite the database to add space for fake commitments for existing outputs. This code relies on two things: - LMDB must support fixed size records per key, rather than per database (ie, all records on key 0 are the same size, all records for non 0 keys are same size, but records from key 0 and non 0 keys do have different sizes). - the commitment must be directly after the rest of the data in outkey and output_data_t.
2016-08-28rct: add the tx prefix hash into the MLSAGmoneromooo-monero2-6/+6
to protect the non-signatures parts of the tx from tampering.
2016-08-28ringct: do not serialize what can be reconstructedmoneromooo-monero2-21/+13
The mixRing (output keys and commitments) and II fields (key images) can be reconstructed from vin data. This saves some modest amount of space in the tx.
2016-08-28tests: test for ringct rctSig data sizesmoneromooo-monero1-3/+44
ie, more data or less data than expected in various fields
2016-08-28make rct tx serialization workmoneromooo-monero1-0/+201
It may be suboptimal, but it's a pain to have to rebuild everything when some of this changes. Also, no clue why there seems to be two different code paths for serializing a tx...
2016-08-28ringct: allow no outputs, and add tests for this and feesmoneromooo-monero1-31/+75
2016-08-28ringct: txn fee stuffShen Noether1-0/+61
2016-08-28blockchain_db: add functions for adding/removing/getting rct commitmentsmoneromooo-monero1-0/+4
2016-08-28tests: new ringct test for checking H2 valuesShen Noether1-0/+11
Ported from Shen's RingCT repo
2016-08-28tests: zero inputs/outputs are in fact supposed to be acceptedmoneromooo-monero1-14/+14
2016-08-28ringct: add a test for prooveRange being non deterministicmoneromooo-monero1-0/+9
2016-08-28tests: more ringct range proof testsmoneromooo-monero1-0/+245
2016-08-28tests: add some more ringct building block testsmoneromooo-monero1-1/+50
2016-08-28tests: add Shen Noether's basic ringct testsmoneromooo-monero2-1/+209
2016-08-11Fake outs set is now decided by the walletmoneromooo-monero1-3/+3
This plugs a privacy leak from the wallet to the daemon, as the daemon could previously see what input is included as a transaction input, which the daemon hadn't previously supplied. Now, the wallet requests a particular set of outputs, including the real one. This can result in transactions that can't be accepted if the wallet happens to select too many outputs with non standard unlock times. The daemon could know this and select another output, but the wallet is blind to it. It's currently very unlikely since I don't think anything uses non default unlock times. The wallet requests more outputs than necessary so it can use spares if any of the returns outputs are still locked. If there are not enough spares to reach the desired mixin, the transaction will fail.
2016-07-26tests: fix a bitflag test typomoneromooo-monero1-1/+1
2016-07-26unit_tests: check adding checkpoints succeededmoneromooo-monero1-3/+3
2016-07-13remove hf_starting_height dbmoneromooo-monero1-31/+1
It's not really needed, it used to be an optimization for when that code was not using the db and needed to recalculate things fast on startup.
2016-05-18fix: error: -Werror=misleading-indentationmoneroexample1-1/+3
Compilation of bitmonero on Arch with gcc 6.1 results in the following error: /home/mwo/bitmonero/tests/unit_tests/hardfork.cpp: In member function ‘virtual void TestDB::set_hard_fork_version(uint64_t, uint8_t)’: /home/mwo/bitmonero/tests/unit_tests/hardfork.cpp:132:5: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] if (versions.size() <= height) versions.resize(height+1); versions[height] = version; This can be fixed by simply unfolding this line into three lines.
2016-05-01unit_tests: add a write_varint/read_varint testmoneromooo-monero2-1/+68
2016-05-01unit_tests: fix UNBOUND_LIBRARIES/UNBOUND_LIBRARY typomoneromooo-monero1-1/+1
2016-04-05CleanupHoward Chu1-4/+5
drop obsolete remove_output() fix get_output_key(global), fix crash in blockchain_dump
2016-04-02tests: unbound API is only accessible in static buildsmoneromooo-monero1-0/+4
2016-03-29tests: add test for needed OpenSSL algorithms in unboundmoneromooo-monero2-1/+52
These can be compiled out of libunbound, leading to failure to check DNSSEC validity.
2016-03-26tests: obligatory hardfork unit build fix after interface changemoneromooo-monero1-1/+1
2016-03-26New RPC and daemon command to get output histogrammoneromooo-monero1-0/+1
This is a list of existing output amounts along with the number of outputs of that amount in the blockchain. The daemon command takes: - no parameters: all outputs with at least 3 instances - one parameter: all outputs with at least that many instances - two parameters: all outputs within that many instances The default starts at 3 to avoid massive spamming of all dust outputs in the blockchain, and is the current minimum mixin requirement. An optional vector of amounts may be passed, to request histogram only for those outputs.
2016-03-21Revert "Print stack trace upon exceptions"moneromooo-monero4-4/+2
Ain't nobody got time for link/cmake skullduggery. This reverts commit fff238ec94ac6d45fc18c315d7bc590ddfaad63d.
2016-03-19Print stack trace upon exceptionsmoneromooo-monero4-2/+4
Useful for debugging users' logs
2016-03-05unit_tests: fix hard fork unit test compilationwarptangent1-1/+1
Match changed BlockchainDB function declaration.
2016-02-23unit_tests: update test openalias addressmoneromooo-monero1-1/+1
It was recently changed
2016-02-22move g_test_dbg_lock_sleep from a global to a function level staticmoneromooo-monero1-2/+0
This avoids the need to define that variable in every program which uses epee.
2016-02-08unit_tests: fix blockchain unit test after hard fork import fixmoneromooo-monero1-1/+10
2016-02-08unit_tests: fix hard fork unit test compilationmoneromooo-monero1-0/+4
2016-02-01unit_tests: fix mnemonics unit test testing invalid seedsmoneromooo-monero1-13/+9
Some word triplets, such as "mugged names nail", are not valid results from any 32 bit value. If used to decode a 32 bit value, the result will therefore encode to a different word triplet. Fix this by using random words converted from an actual random bitstring, ensuring we always get valid triplets.
2016-02-01unit_tests: fix hard fork unit tests and add a test for major toomoneromooo-monero1-30/+68
2016-01-21OpenBSD support for Monero.me0wmix1-2/+2
2016-01-16Fix 30f92f5630bbc7507708275a29a9ae7acf633a5bHoward Chu1-0/+1
Needed to add the corresponding (dummy) method to unit test hardfork
2016-01-02unit_tests: initialize db object in ctor, not openmoneromooo-monero1-1/+2
open isn't actually called in those tests
2015-12-31updated copyright yearRiccardo Spagni25-25/+25
2015-12-30unit_tests: remove an unused variablemoneromooo-monero1-1/+0
2015-12-30unit_tests: fix hardfork test buildmoneromooo-monero1-0/+1
The dummy blockchain class needed to have the newly added is_read_only virtual function.
2015-12-26tests: add a unit test for canonical decomposed amountsmoneromooo-monero2-0/+84
2015-12-24unit_tests: fix hard fork testsmoneromooo-monero1-1/+2
A couple stopped passing when the hard fork code was made to reject incoming hard fork versions it did not know about.
2015-12-24unit_tests: new test for IP blockingmoneromooo-monero2-0/+169
2015-12-13unit_tests: fix block reward test using post hard fork settingsmoneromooo-monero1-15/+15
This would fail, as the post hard fork settings would yield different data, and the test expects pre hard fork data.
2015-12-13tests: fix a typo in test namemoneromooo-monero1-1/+1
2015-12-05blockchain_db: make the indexing base a BlockchainDB virtual functionmoneromooo-monero1-0/+1
2015-11-24hardfork: fix more major/minor issuesmoneromooo-monero1-44/+57
Also add some more tests, and rename some instances of "version" and "add" for clarity. NOTE: the starting height values are sometimes wrong. I suspect this is due to the hard fork reorg code being buggy, since they're good when syncing after the fact. However, they're not actually used by the consensus code, so I'm ignoring this for now, but this needs debugging.
2015-11-13Adjust difficulty target (2 min) and full reward zone (60 kbytes) for block ↵Javier Smooth1-7/+7
version 2
2015-11-10hardfork: add a get_ideal_version(uint64_t) functionmoneromooo-monero1-0/+22
It returns the ideal version for a given height, which is based on the minimum height for a fork, disregarding votes
2015-11-08hardfork: allow per-fork voting thresholdsmoneromooo-monero1-0/+28
And setup the first fork to not vote
2015-11-03unit_tests: fix build without berkeleydbmoneromooo-monero1-1/+7
2015-10-27Remove some old/obsolete/unused codemoneromooo-monero1-1/+0
git history's here if needed to get any of this back
2015-10-26Build fixes for the old blockchain_storage versionmoneromooo-monero1-0/+5
2015-10-21hardfork: switch voting to block minor versionmoneromooo-monero1-4/+1
Using major version would cause older daemons to reject those blocks as they fail to deserialize blocks with a major version which is not 1. There is no such restriction on the minor version, so switching allows older daemons to coexist with newer ones till the actual fork date, when most will hopefully have updated already. Also, for the same reason, we consider a vote for 0 to be a vote for 1, since older daemons set minor version to 0.
2015-10-21unit_tests: remove leftover debug traces in hardfork testmoneromooo-monero1-2/+0
2015-09-27hardfork: rescan speedupmoneromooo-monero1-8/+8
Add a block height before which version 1 is assumed Use DB transactions
2015-09-27hardfork: change window semantics to not count the newly added blockmoneromooo-monero1-10/+13
This allows knowing the hard fork a block must obey in order to be added to the blockchain. The previous semantics would use that new block's version vote to determine this hard fork, which made it impossible to use the rules to validate transactions entering the tx pool (and made it impossible to validate a block before adding it to the blockchain).
2015-09-20hardfork: most state now saved to the DBmoneromooo-monero1-142/+200
There will be a delay on first load of an existing blockchain as it gets reparsed for this state data.
2015-09-12New hardfork classmoneromooo-monero2-1/+396
This keeps track of voting via block version, in order to decide when to enable a particular fork's code.
2015-08-27dns: make ctor privatemoneromooo-monero1-6/+6
This ensures one can't instanciate a DNSResolver object by mistake, but uses the singleton. A separate create static function is added for cases where a new object is explicitely needed.
2015-07-26Fix block_reward unit testsRostislav1-10/+10
2015-06-20Set dnssec_valid value correctly in dns_utils; fix address_from_url testRostislav1-1/+2
2015-05-31cleaning up, removing redundant files, renaming, fixing incorrect licensesRiccardo Spagni2-2/+2
2015-05-19Allow name@domain.tld for OpenAlias lookupswarptangent2-0/+16
Based on tewinget's update. Make OpenAlias address format independent of existing DNS functions. Add tests. Test: make debug-test cd build/debug/tests/unit_tests # test that regular DNS functions work, including IPv4 lookups. # also test function that converts OpenAlias address format make && ./unit_tests --gtest_filter=DNSResolver* # test that OpenAlias addresses like donate@getmonero.org work from # wallet tools make && ./unit_tests --gtest_filter=AddressFromURL.Success