summaryrefslogtreecommitdiff
path: root/src/blockchain_db
Commit message (Collapse)AuthorAgeFilesLines
* update copyright year, fix occasional lack of newline at line endRiccardo Spagni2017-02-218-8/+8
|
* Merge pull request #1727Riccardo Spagni2017-02-214-36/+90
|\ | | | | | | 0288310e blockchain_db: add "raw" blobdata getters for block and transaction (moneromooo-monero)
| * blockchain_db: add "raw" blobdata getters for block and transactionmoneromooo-monero2017-02-134-36/+90
| | | | | | | | This speeds up operations such as serving blocks to syncing peers
* | Merge pull request #1724Riccardo Spagni2017-02-213-3/+10
|\ \ | | | | | | | | | cca95c1c blockchain_db: do not throw on expected partial results getting keys (moneromooo-monero)
| * | blockchain_db: do not throw on expected partial results getting keysmoneromooo-monero2017-02-133-3/+10
| |/ | | | | | | | | | | | | | | | | When scanning for outputs used in a set of incoming blocks, we expect that some of the inputs in their transactions will not be found in the blockchain, as they could be in previous blocks in that set. Those outputs will be scanned there at a later point. In this case, we add a flag to control wehther an output not being found is expected or not.
* | Handle map resizes from other processesHoward Chu2017-02-181-9/+52
| |
* | Can't cache num_txs or num_outputs eitherHoward Chu2017-02-182-34/+34
| | | | | | | | Same reason as 3ff54bdd7a8b5e08e4e8ac17b7fff23ad3a82312
* | Add a few read txns to streamlineHoward Chu2017-02-182-3/+7
|/ | | | Slight perf gain, but mainly to reduce spam at loglevel 3
* db_lmdb: fix bad height saved in tx datamoneromooo-monero2017-02-112-6/+7
| | | | | | | | | | | | | The recent change to not keep separate track of the blockchain height caused the reported height to jump early in the lmdb transaction (when the block data is added to the blocks table), rather than at the end, after everything succeeded. Since the block data is added before the transaction data, this caused the transaction data to be saved with a height one more than its expected value. Fix this by saving the block data last. This should have no side effects.
* extract some basic code from libcryptonote_core into libcryptonote_basickenshi842017-02-085-6/+7
|
* Update and use blockchain data files definesMiguel Herranz2017-01-281-4/+5
|
* Tweak some msg loglevelsHoward Chu2017-01-161-11/+13
|
* Fix PR#1506, off by one in chain heightHoward Chu2017-01-161-3/+2
|
* Change logging to easylogging++moneromooo-monero2017-01-162-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the epee and data_loggers logging systems with a single one, and also adds filename:line and explicit severity levels. Categories may be defined, and logging severity set by category (or set of categories). epee style 0-4 log level maps to a sensible severity configuration. Log files now also rotate when reaching 100 MB. To select which logs to output, use the MONERO_LOGS environment variable, with a comma separated list of categories (globs are supported), with their requested severity level after a colon. If a log matches more than one such setting, the last one in the configuration string applies. A few examples: This one is (mostly) silent, only outputting fatal errors: MONERO_LOGS=*:FATAL This one is very verbose: MONERO_LOGS=*:TRACE This one is totally silent (logwise): MONERO_LOGS="" This one outputs all errors and warnings, except for the "verify" category, which prints just fatal errors (the verify category is used for logs about incoming transactions and blocks, and it is expected that some/many will fail to verify, hence we don't want the spam): MONERO_LOGS=*:WARNING,verify:FATAL Log levels are, in decreasing order of priority: FATAL, ERROR, WARNING, INFO, DEBUG, TRACE Subcategories may be added using prefixes and globs. This example will output net.p2p logs at the TRACE level, but all other net* logs only at INFO: MONERO_LOGS=*:ERROR,net*:INFO,net.p2p:TRACE Logs which are intended for the user (which Monero was using a lot through epee, but really isn't a nice way to go things) should use the "global" category. There are a few helper macros for using this category, eg: MGINFO("this shows up by default") or MGINFO_RED("this is red"), to try to keep a similar look and feel for now. Existing epee log macros still exist, and map to the new log levels, but since they're used as a "user facing" UI element as much as a logging system, they often don't map well to log severities (ie, a log level 0 log may be an error, or may be something we want the user to see, such as an important info). In those cases, I tried to use the new macros. In other cases, I left the existing macros in. When modifying logs, it is probably best to switch to the new macros with explicit levels. The --log-level options and set_log commands now also accept category settings, in addition to the epee style log levels.
* Merge pull request #1506Riccardo Spagni2017-01-155-24/+49
|\ | | | | | | | | | | | | | | 3ff54bdd Check for correct thread before ending batch transaction (Howard Chu) eaf8470b Must wait for previous batch to finish before starting new one (Howard Chu) c903c554 Don't cache block height, always get from DB (Howard Chu) eb1fb601 Tweak default db-sync-mode to fast:async:1 (Howard Chu) 0693cff9 Use batch transactions when syncing (Howard Chu)
| * Check for correct thread before ending batch transactionHoward Chu2017-01-151-0/+7
| |
| * Don't cache block height, always get from DBHoward Chu2017-01-142-14/+29
| |
| * Use batch transactions when syncingHoward Chu2017-01-145-10/+13
| | | | | | | | | | Faster throughput while avoiding corruption. I.e., makes running with --db-sync-mode safe more tolerable.
* | Merge pull request #1538Riccardo Spagni2017-01-131-1/+0
|\ \ | | | | | | | | | | | | | | | | | | aff28178 Remove db-auto-remove-logs (Miguel Herranz) 1229c685 Remove berkeley from db_type initialization (Miguel Herranz) e3090558 Show available types for db-type command (Miguel Herranz) 046ab33d Remove berkeley from blockchain_db_types (Miguel Herranz)
| * | Remove berkeley from blockchain_db_typesMiguel Herranz2017-01-101-1/+0
| |/
* / blockchain: allow marking "tx not found" without an exceptionmoneromooo-monero2017-01-073-3/+27
|/ | | | | This is a normal occurence in many cases, and there is no need to spam the log with those when it is.
* 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