summaryrefslogtreecommitdiff
path: root/src/blockchain_db
Commit message (Collapse)AuthorAgeFilesLines
* db_lmdb: add info in an error message when we can't get an outputmoneromooo-monero2016-12-011-1/+1
| | | | Will be useful to debug
* db_lmdb: guard against going out of sync on unexpected db resultsmoneromooo-monero2016-12-011-1/+1
| | | | | | | m_num_outputs keeps track of the number of outputs, which should be the same as the size of both the output_txs and output_amounts databases. If one goes out of sync, we need to throw to abort whatever it is we were doing.
* db_lmdb: minor pedantic tweaksmoneromooo-monero2016-12-011-8/+8
| | | | | | Add consts in a few places where it makes sense, avoid unnecessary memory reallocation where we know the full size needed at the outset, simplify and avoid memory copy.
* db_lmdb: set same packing format for output_data_t and pre_rct_output_data_tmoneromooo-monero2016-12-011-0/+3
| | | | | | For safety, though it seems to have been the case already. Also add a comment about the necessary layout identity.
* wallet: select part of the fake outs from recent outputsmoneromooo-monero2016-10-153-12/+30
| | | | | | | 25% of the outputs are selected from the last 5 days (if possible), in order to avoid the common case of sending recently received outputs again. 25% and 5 days are subject to review later, since it's just a wallet level change.
* Merge pull request #1139Riccardo Spagni2016-10-041-2/+2
|\ | | | | | | | | | | | | | | | | | | | | 01ec195 Update CMakeLists.txt (codehalo) 446ebbc Update CMakeLists.txt (codehalo) bd773e7 Update CMakeLists.txt (codehalo) 3627cea Cleanup. Dropped "bit" from bitmonero. (Randi Joseph) 2a51396 Dropped "bit" from bitmonero. (Randi Joseph) 78b13d6 Cleanup. Dropped "bit" from bitmonero. (Randi Joseph) 1e6aedb Cleanup. Dropped "bit" from bitmonero. (Randi Joseph) 9e54616 Dropped "bit" from bitmonero. (Randi Joseph)
| * Dropped "bit" from bitmonero.Randi Joseph2016-09-261-2/+2
| |
* | Merge pull request #1128Riccardo Spagni2016-09-291-1/+1
|\ \ | |/ |/| | | d2e11f3 db_lmdb: do not error if dropping a non existent hard fork table (moneromooo-monero)
| * db_lmdb: do not error if dropping a non existent hard fork tablemoneromooo-monero2016-09-241-1/+1
| |
* | Fix minor typo in "need resize" message.Myagui2016-09-211-2/+2
|/ | | | | | Message observed while synchronizing a node from scratch. "LMDB memory map needs resized" Proposing a change to: "LMDB memory map needs to be resized"
* cmake: transitive deps and remove deprecated LINK_*redfish2016-09-181-8/+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.
* core: faster find_blockchain_supplementmoneromooo-monero2016-08-315-5/+16
| | | | | | | | | | | | | 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.
* db_lmdb: fix reorg with "halfway rct" coinbase outputsmoneromooo-monero2016-08-291-1/+3
|
* New "Halfway RingCT" outputs for coinbase transactionsmoneromooo-monero2016-08-281-2/+17
| | | | | | | | | | | | | | | When RingCT is enabled, outputs from coinbase transactions are created as a single output, and stored as RingCT output, with a fake mask. Their amount is not hidden on the blockchain itself, but they are then able to be used as fake inputs in a RingCT ring. Since the output amounts are hidden, their "dustiness" is not an obstacle anymore to mixing, and this makes the coinbase transactions a lot smaller, as well as helping the TXO set to grow more slowly. Also add a new "Null" type of rct signature, which decreases the size required when no signatures are to be stored, as in a coinbase tx.
* move the rct commitments to the output_amounts databasemoneromooo-monero2016-08-286-167/+60
| | | | | | | | | | | | | | | | | | | 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.
* add rct to the protocolmoneromooo-monero2016-08-282-0/+4
| | | | | It is not yet constrained to a fork, so don't use on the real network or you'll be orphaned or rejected.
* db_lmdb: update reset for recent db changesmoneromooo-monero2016-08-281-0/+10
| | | | | | | - we need to drop the new m_tx_indices database - we reset the version to current version This fixes the core tests failing to initialize.
* blockchain_db: add functions for adding/removing/getting rct commitmentsmoneromooo-monero2016-08-283-0/+153
|
* db_lmdb: do not try to modify the database in read only modemoneromooo-monero2016-08-261-4/+12
|
* Merge pull request #948Riccardo Spagni2016-08-113-9/+28
|\ | | | | | | | | 11dc091 Fake outs set is now decided by the wallet (moneromooo-monero) 1593553 new unlocked parameter to output_histogram (moneromooo-monero)
| * new unlocked parameter to output_histogrammoneromooo-monero2016-08-013-9/+28
| | | | | | | | | | | | | | | | This constrains the number of instances of any amount to the unlocked ones (as defined by the default unlock time setting: outputs with non default unlock time are not considered, so may be counted as unlocked even if they are not actually unlocked).
* | db_lmdb: errors dropping hf starting height db on reset are not fatalmoneromooo-monero2016-08-101-2/+1
|/ | | | | This db is now dropped unconditionally, so may or may not be there in the first place.
* db_lmdb: add some missing api call checksmoneromooo-monero2016-07-261-14/+31
|
* remove hf_starting_height dbmoneromooo-monero2016-07-135-127/+2
| | | | | | 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.
* Merge branch 'performance' of https://github.com/LMDB/bitmoneroRiccardo Spagni2016-04-294-760/+1209
|\
| * Another take on migrationHoward Chu2016-04-242-580/+104
| | | | | | | | | | Delete old indices and recreate them, rather than updating them Maybe not quite as slow as before.
| * MigrationHoward Chu2016-04-082-5/+1049
| | | | | | | | Migrate from DB version 0 to version 1 on startup
| * Merge branch 'performance' into masterHoward Chu2016-04-054-746/+627
| |\
| | * CleanupHoward Chu2016-04-053-24/+65
| | | | | | | | | | | | | | | drop obsolete remove_output() fix get_output_key(global), fix crash in blockchain_dump
| | * Cleanup and clarifyHoward Chu2016-04-054-146/+129
| | | | | | | | | | | | Try to rationalize the variable names, document usage.
| | * Use cursors in some remove functionsHoward Chu2016-04-051-7/+33
| | | | | | | | | | | | Helps when they're called repeatedly in one txn
| | * Use DUPFIXED for block_info and output_txsHoward Chu2016-04-052-56/+46
| | | | | | | | | | | | Saves another ~150MB or so on the full blockchain
| | * More outputs consolidationHoward Chu2016-04-052-489/+261
| | | | | | | | | | | | | | | | | | | | | | | | Also bumped DB VERSION to 1 Another significant speedup and space savings: Get rid of global_output_indices, remove indirection from output to keys This is the change warptangent described on irc but never got to finish.
| | * Use DUPFIXED for output_keysHoward Chu2016-04-051-23/+37
| | | | | | | | | | | | | | | | | | Saves another 90MB on 200000 block import. Had to bring back compare_uint64 for this, but it's safe since this table is always 64-bit aligned.
| | * Use DUPFIXED for tx_indicesHoward Chu2016-04-051-50/+60
| | | | | | | | | | | | Small space savings, no measurable speedup
| | * Use DUPFIXED for block_heightsHoward Chu2016-04-051-22/+29
| | | | | | | | | | | | Only a small savings...
| | * Use DUPFIXED for spent_keysHoward Chu2016-04-051-23/+18
| | |
| | * Add back changes from revert.warptangent2016-04-051-19/+2
| | | | | | | | | | | | m_tx_outputs doesn't need to be changed, as it's no longer dup list.
| | * Use MDB_APPEND mode with two tx subdbswarptangent2016-04-051-2/+2
| | | | | | | | | | | | This is possible on those using a tx index as a key.
| | * Schema update: tx_indices - consolidate the tx subdbs from 5 to 3warptangent2016-04-053-75/+56
| | |
| | * Schema update: tx_indices - yet less indirectionwarptangent2016-04-054-20/+15
| | |
| | * Schema update: tx_indices - improve further with less indirectionwarptangent2016-04-053-19/+53
| | |
| | * Add batch warning for further reviewwarptangent2016-04-051-0/+4
| | |
| | * Schema update: tx_indiceswarptangent2016-04-052-32/+109
| | |
| | * Consolidated block infoHoward Chu2016-04-052-94/+62
| | |
| | * Update schema for "tx_outputs" to use array containing amount output indiceswarptangent2016-04-054-119/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This speeds up wallet refresh by directly retrieving a tx's amount output indices. It removes the indirection and walking the amount output duplicate list for every amount in each requested tx. "tx_outputs" is used by: Amount output indices are needed for wallet refresh. Global output indices are needed for removing a tx. Both amount output indices and global output indices are now stored in an array of 64-bit unsigned ints: tx_outputs[<tx_hash>] -> [ <a1_oi, a1_gi, a2_oi, a2_gi, ...> ] Previously it was: tx_outputs[<tx_hash>] -> duplicate list of <a1_gi, a2_gi, a3_gi, ...> The amount output list had to be walked for every amount in order to find each amount's output index, by comparing the amount's global output index with each one in the duplicate list until a match was found. See also d045dfa7ce0bf131681193c97560da26f9f37900
* | | add a --max-concurrency flagmoneromooo-monero2016-04-281-1/+1
|/ / | | | | | | | | | | It sets the max number of threads to use for a parallel job. This is different that the number of total threads, since monero binaries typically start a lot of them.
* | Detect map resize failuresHoward Chu2016-03-301-1/+3
| |
* | New RPC and daemon command to get output histogrammoneromooo-monero2016-03-265-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #749Riccardo Spagni2016-03-251-155/+937
| | | | | | | | | | | | | | | | | | | | | | | | | | bfd4a28 Update BlockchainDB documentation (Thomas Winget) 797357e Change Doxyfile, Blockchain not blockchain_storage (Thomas Winget) c835215 remove defunct code from cryptonote::core (Thomas Winget) 50dba6d cryptonote::core doxygen documentation (Thomas Winget) 8ac329d doxygen documentation for difficulty functions (Thomas Winget) 540a76c Move checkpoint functions into checkpoints class (Thomas Winget) 1b0c98e doxygen documentation for checkpoints.{h,cpp} (Thomas Winget) 89c24ac Remove unnecessary or defunct code (Thomas Winget) ab0ed14 doxygen include private and static members (Thomas Winget) 3a48449 Updated documentation for blockchain.* (Thomas Winget)