summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* unit_tests: initialize db object in ctor, not openmoneromooo-monero2016-01-021-1/+2
| | | | open isn't actually called in those tests
* updated copyright yearRiccardo Spagni2015-12-3198-98/+98
|
* Merge pull request #580Riccardo Spagni2015-12-311-1/+1
|\ | | | | | | | | 1813736 unit_tests: remove an unused variable (moneromooo-monero) 70dd346 unit_tests: fix hardfork test build (moneromooo-monero)
| * unit_tests: remove an unused variablemoneromooo-monero2015-12-301-1/+0
| |
| * unit_tests: fix hardfork test buildmoneromooo-monero2015-12-301-0/+1
| | | | | | | | | | The dummy blockchain class needed to have the newly added is_read_only virtual function.
* | core_tests: deinit core before destroying itmoneromooo-monero2015-12-301-1/+3
|/ | | | This fixes a use after free by ioservice threads
* tests: add a unit test for canonical decomposed amountsmoneromooo-monero2015-12-262-0/+84
|
* tests: fix various tests by using parameters better suited to moneromoneromooo-monero2015-12-253-8/+8
| | | | | | Either smaller coin values (as monero has smaller block rewards), or pre-hard fork values (full reward zone), or post-Bytecoin values (emission speed).
* tests: fix some double spending testsmoneromooo-monero2015-12-251-7/+8
| | | | | | | | | | | Some tests assume the first output in a transaction goes to the recipient. However, it can be the change. When it is, the recipient's keys will not recognize this output. To fix this, we send all we have, to ensure there is no change, and the first output goes to the recipient. I'm not sure why this worked with Cryptonote. The tests sent 17 coins, which seems way smaller than the first Bytecoin block reward, so there would have been change too. Maybe outputs were not shuffled originally.
* tests: use 255 as a "too high" block versionmoneromooo-monero2015-12-251-2/+2
| | | | | While the original cryptonote accepted only the current major version, we can accept higher ones.
* blockchain: fix bitflipping test with quantized block rewardsmoneromooo-monero2015-12-251-1/+2
| | | | | | | Block reward may now be less than the full amount allowed. This was breaking the bitflipping test. We now keep track of whether a block which was accepted by the core has a lower than allowed block reward, and allow this in the test.
* unit_tests: fix hard fork testsmoneromooo-monero2015-12-241-1/+2
| | | | | A couple stopped passing when the hard fork code was made to reject incoming hard fork versions it did not know about.
* unit_tests: new test for IP blockingmoneromooo-monero2015-12-242-0/+169
|
* Tone down a bit L0 logs during daemon syncmoneromooo-monero2015-12-141-0/+1
|
* core_tests: fix ring_signature_1 testsmoneromooo-monero2015-12-131-8/+8
| | | | | | | | They were trying to send too much monero, and thus failing. The parameters were set in such a way that the (simple) output gathering code could fulfill them for 4 block rewards for the original Bytecoin emission, but that does not work with monero so we need to use smaller values.
* core_tests: bump default test fee to 0.02 moneromoneromooo-monero2015-12-131-1/+1
| | | | | | The current monero consensus uses 0.01 per kB fees, so use enough for 2 kB transactions for now. It'll probably have to be either bumped further or changed to calculate the proper fee.
* add a --fakechain argument for testsmoneromooo-monero2015-12-131-0/+4
| | | | | | | | | | | The core tests use the blockchain, and reset it to be able to add test data to it. This does not play nice with the databases, since those will save that data without an explicit save call. We add a fakechain flag that the tests will set, which tells the core and blockchain code to use a separate database, as well as skip a few things like checkpoints and fixup, which only make sense for real data.
* unit_tests: fix block reward test using post hard fork settingsmoneromooo-monero2015-12-131-15/+15
| | | | | This would fail, as the post hard fork settings would yield different data, and the test expects pre hard fork data.
* tests: fix a typo in test namemoneromooo-monero2015-12-131-1/+1
|
* tests: remove data-dir argument registrationmoneromooo-monero2015-12-091-1/+0
| | | | | It is already registered in cryptonote::core::init_options, which we now call
* blockchain_db: make the indexing base a BlockchainDB virtual functionmoneromooo-monero2015-12-051-0/+1
|
* hardfork: fix more major/minor issuesmoneromooo-monero2015-11-241-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.
* Relay transactions when they linger too long in the poolmoneromooo-monero2015-11-213-4/+4
| | | | | | | | The last relayed time of a transaction is maintained, and transactions will be relayed again if they are still in the pool after a certain amount of time, which increases with the transaction's age. All such transactions are resent, whether or not they originated on the local node.
* Merge pull request #490Riccardo Spagni2015-11-183-13/+13
|\ | | | | | | | | baf101e More changes for 2-min blocks Use the correct block time for realtime fuzz on locktime Use the correct block time to calculate next_difficulty on alt chains (will not work as-is with voting) Lock unit tests to original block time for now (Javier Smooth) 4fea1a5 Adjust difficulty target (2 min) and full reward zone (60 kbytes) for block version 2 (Javier Smooth)
| * More changes for 2-min blocksJavier Smooth2015-11-131-4/+4
| | | | | | | | | | | | Use the correct block time for realtime fuzz on locktime Use the correct block time to calculate next_difficulty on alt chains (will not work as-is with voting) Lock unit tests to original block time for now
| * Adjust difficulty target (2 min) and full reward zone (60 kbytes) for block ↵Javier Smooth2015-11-132-9/+9
| | | | | | | | version 2
* | tests: fix build error with CLANGmoneromooo-monero2015-11-171-1/+1
|/
* hardfork: add a get_ideal_version(uint64_t) functionmoneromooo-monero2015-11-101-0/+22
| | | | | It returns the ideal version for a given height, which is based on the minimum height for a fork, disregarding votes
* hardfork: allow per-fork voting thresholdsmoneromooo-monero2015-11-081-0/+28
| | | | And setup the first fork to not vote
* unit_tests: fix build without berkeleydbmoneromooo-monero2015-11-031-1/+7
|
* Remove some old/obsolete/unused codemoneromooo-monero2015-10-271-1/+0
| | | | git history's here if needed to get any of this back
* Build fixes for the old blockchain_storage versionmoneromooo-monero2015-10-261-0/+5
|
* hardfork: switch voting to block minor versionmoneromooo-monero2015-10-211-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.
* unit_tests: remove leftover debug traces in hardfork testmoneromooo-monero2015-10-211-2/+0
|
* hardfork: rescan speedupmoneromooo-monero2015-09-271-8/+8
| | | | | Add a block height before which version 1 is assumed Use DB transactions
* hardfork: change window semantics to not count the newly added blockmoneromooo-monero2015-09-271-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).
* hardfork: most state now saved to the DBmoneromooo-monero2015-09-201-142/+200
| | | | | There will be a delay on first load of an existing blockchain as it gets reparsed for this state data.
* New hardfork classmoneromooo-monero2015-09-122-1/+396
| | | | | This keeps track of voting via block version, in order to decide when to enable a particular fork's code.
* dns: make ctor privatemoneromooo-monero2015-08-271-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.
* Fix block_reward unit testsRostislav2015-07-261-10/+10
|
* ** CHANGES ARE EXPERIMENTAL (FOR TESTING ONLY)NoodleDoodleNoodleDoodleNoodleDoodleNoo2015-07-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bockchain: 1. Optim: Multi-thread long-hash computation when encountering groups of blocks. 2. Optim: Cache verified txs and return result from cache instead of re-checking whenever possible. 3. Optim: Preload output-keys when encoutering groups of blocks. Sort by amount and global-index before bulk querying database and multi-thread when possible. 4. Optim: Disable double spend check on block verification, double spend is already detected when trying to add blocks. 5. Optim: Multi-thread signature computation whenever possible. 6. Patch: Disable locking (recursive mutex) on called functions from check_tx_inputs which causes slowdowns (only seems to happen on ubuntu/VMs??? Reason: TBD) 7. Optim: Removed looped full-tx hash computation when retrieving transactions from pool (???). 8. Optim: Cache difficulty/timestamps (735 blocks) for next-difficulty calculations so that only 2 db reads per new block is needed when a new block arrives (instead of 1470 reads). Berkeley-DB: 1. Fix: 32-bit data errors causing wrong output global indices and failure to send blocks to peers (etc). 2. Fix: Unable to pop blocks on reorganize due to transaction errors. 3. Patch: Large number of transaction aborts when running multi-threaded bulk queries. 4. Patch: Insufficient locks error when running full sync. 5. Patch: Incorrect db stats when returning from an immediate exit from "pop block" operation. 6. Optim: Add bulk queries to get output global indices. 7. Optim: Modified output_keys table to store public_key+unlock_time+height for single transaction lookup (vs 3) 8. Optim: Used output_keys table retrieve public_keys instead of going through output_amounts->output_txs+output_indices->txs->output:public_key 9. Optim: Added thread-safe buffers used when multi-threading bulk queries. 10. Optim: Added support for nosync/write_nosync options for improved performance (*see --db-sync-mode option for details) 11. Mod: Added checkpoint thread and auto-remove-logs option. 12. *Now usable on 32-bit systems like RPI2. LMDB: 1. Optim: Added custom comparison for 256-bit key tables (minor speed-up, TBD: get actual effect) 2. Optim: Modified output_keys table to store public_key+unlock_time+height for single transaction lookup (vs 3) 3. Optim: Used output_keys table retrieve public_keys instead of going through output_amounts->output_txs+output_indices->txs->output:public_key 4. Optim: Added support for sync/writemap options for improved performance (*see --db-sync-mode option for details) 5. Mod: Auto resize to +1GB instead of multiplier x1.5 ETC: 1. Minor optimizations for slow-hash for ARM (RPI2). Incomplete. 2. Fix: 32-bit saturation bug when computing next difficulty on large blocks. [PENDING ISSUES] 1. Berkely db has a very slow "pop-block" operation. This is very noticeable on the RPI2 as it sometimes takes > 10 MINUTES to pop a block during reorganization. This does not happen very often however, most reorgs seem to take a few seconds but it possibly depends on the number of outputs present. TBD. 2. Berkeley db, possible bug "unable to allocate memory". TBD. [NEW OPTIONS] (*Currently all enabled for testing purposes) 1. --fast-block-sync arg=[0:1] (default: 1) a. 0 = Compute long hash per block (may take a while depending on CPU) b. 1 = Skip long-hash and verify blocks based on embedded known good block hashes (faster, minimal CPU dependence) 2. --db-sync-mode arg=[[safe|fast|fastest]:[sync|async]:[nblocks_per_sync]] (default: fastest:async:1000) a. safe = fdatasync/fsync (or equivalent) per stored block. Very slow, but safest option to protect against power-out/crash conditions. b. fast/fastest = Enables asynchronous fdatasync/fsync (or equivalent). Useful for battery operated devices or STABLE systems with UPS and/or systems with battery backed write cache/solid state cache. Fast - Write meta-data but defer data flush. Fastest - Defer meta-data and data flush. Sync - Flush data after nblocks_per_sync and wait. Async - Flush data after nblocks_per_sync but do not wait for the operation to finish. 3. --prep-blocks-threads arg=[n] (default: 4 or system max threads, whichever is lower) Max number of threads to use when computing long-hash in groups. 4. --show-time-stats arg=[0:1] (default: 1) Show benchmark related time stats. 5. --db-auto-remove-logs arg=[0:1] (default: 1) For berkeley-db only. Auto remove logs if enabled. **Note: lmdb and berkeley-db have changes to the tables and are not compatible with official git head version. At the moment, you need a full resync to use this optimized version. [PERFORMANCE COMPARISON] **Some figures are approximations only. Using a baseline machine of an i7-2600K+SSD+(with full pow computation): 1. The optimized lmdb/blockhain core can process blocks up to 585K for ~1.25 hours + download time, so it usually takes 2.5 hours to sync the full chain. 2. The current head with memory can process blocks up to 585K for ~4.2 hours + download time, so it usually takes 5.5 hours to sync the full chain. 3. The current head with lmdb can process blocks up to 585K for ~32 hours + download time and usually takes 36 hours to sync the full chain. Averate procesing times (with full pow computation): lmdb-optimized: 1. tx_ave = 2.5 ms / tx 2. block_ave = 5.87 ms / block memory-official-repo: 1. tx_ave = 8.85 ms / tx 2. block_ave = 19.68 ms / block lmdb-official-repo (0f4a036437fd41a5498ee5e74e2422ea6177aa3e) 1. tx_ave = 47.8 ms / tx 2. block_ave = 64.2 ms / block **Note: The following data denotes processing times only (does not include p2p download time) lmdb-optimized processing times (with full pow computation): 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 1.25 hours processing time (--db-sync-mode=fastest:async:1000). 2. Laptop, Dual-core / 4-threads U4200 (3Mb) - 4.90 hours processing time (--db-sync-mode=fastest:async:1000). 3. Embedded, Quad-core / 4-threads Z3735F (2x1Mb) - 12.0 hours processing time (--db-sync-mode=fastest:async:1000). lmdb-optimized processing times (with per-block-checkpoint) 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 10 minutes processing time (--db-sync-mode=fastest:async:1000). berkeley-db optimized processing times (with full pow computation) 1. Desktop, Quad-core / 8-threads 2600k (8Mb) - 1.8 hours processing time (--db-sync-mode=fastest:async:1000). 2. RPI2. Improved from estimated 3 months(???) into 2.5 days (*Need 2AMP supply + Clock:1Ghz + [usb+ssd] to achieve this speed) (--db-sync-mode=fastest:async:1000). berkeley-db optimized processing times (with per-block-checkpoint) 1. RPI2. 12-15 hours (*Need 2AMP supply + Clock:1Ghz + [usb+ssd] to achieve this speed) (--db-sync-mode=fastest:async:1000).
* Set dnssec_valid value correctly in dns_utils; fix address_from_url testRostislav2015-06-201-1/+2
|
* cleaning up, removing redundant files, renaming, fixing incorrect licensesRiccardo Spagni2015-05-312-2/+2
|
* Merge pull request #290Riccardo Spagni2015-05-202-0/+16
|\ | | | | | | | | fee8424 Allow name@domain.tld for OpenAlias lookups (warptangent) a0fe18f Revert "Allow name@domain.tld for OpenAlias lookups" (warptangent)
| * Allow name@domain.tld for OpenAlias lookupswarptangent2015-05-192-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
* | s/terget/target/moneromooo-monero2015-05-172-6/+6
|/
* [fix] log level change. compilation: dns, testsrfree2monero2015-04-104-3/+9
| | | | | old unbound #warning does not block compilation unit tests build fine. Even though the RPC/P2P network type is required again
* Merge BlockchainDB into upstreamThomas Winget2015-04-072-0/+327
|\
| * Merge upstream into blockchainThomas Winget2015-03-291-2/+34
| |\
| * \ update berkeleydb branch to blockchain branchThomas Winget2015-03-2541-1921/+4935
| |\ \