summaryrefslogtreecommitdiff
path: root/tests/unit_tests/hardfork.cpp
Commit message (Collapse)AuthorAgeFilesLines
* speed up get_output_distribution (and precalc common case)moneromooo-monero2018-05-191-0/+1
|
* unit_tests: fix build after get_output_didstribution signature changemoneromooo-monero2018-04-281-1/+1
|
* add RPC to get a histogram of outputs of a given amountmoneromooo-monero2018-03-161-1/+2
|
* Update 2018 copyrightxmr-eric2018-01-261-1/+1
|
* Fix exceptions not finding txpool txes when relayingmoneromooo-monero2017-12-201-1/+1
|
* Protect node privacy by proper filtering in restricted-mode RPC answersbinaryFate2017-11-081-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.
* Use actual batch size for resize estimatesHoward Chu2017-09-171-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
* Toggle SAFE syncmode on and off automaticallyHoward Chu2017-08-201-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.
* DB cleanupHoward Chu2017-08-191-1/+1
| | | | | Hide LMDB-specific stuff behind blockchain_db.h. Nobody besides blockchain_db.cpp should ever be including DB-specific headers any more.
* blockchain_db: add a txpool tx getter which returns existencemoneromooo-monero2017-06-111-0/+1
| | | | Avoids exception spam for the "nope, not found" case
* Don't copy blockchain for coinbase_tx_sumHoward Chu2017-06-011-1/+1
| | | | | Changed Blockchain::for_all_blocks() to for_blocks_range() Operate on blockchain in-place instead of building a copy first.
* Move txpool to the databasemoneromooo-monero2017-05-251-0/+9
| | | | | | | Integration could go further (ie, return_tx_to_pool calls should not be needed anymore, possibly other things). poolstate.bin is now obsolete.
* fix dependency: put HardFork back to cryptonote_basic, made some ↵kenshi842017-03-101-1/+1
| | | | BlockchainDB functions virtual again to avoid missing symbols error
* core: move hardfork back to cryptonote_coremoneromooo-monero2017-02-251-1/+1
| | | | | should fix a cross dependency betewen cryptonote_basic and blockchain_db
* update copyright year, fix occasional lack of newline at line endRiccardo Spagni2017-02-211-1/+1
|
* Merge pull request #1758Riccardo Spagni2017-02-211-1/+2
|\ | | | | | | 5664826a unit_tests: hardfork unit test now needs get_block_blob_from_height (moneromooo-monero)
| * unit_tests: hardfork unit test now needs get_block_blob_from_heightmoneromooo-monero2017-02-211-1/+2
| |
* | More for PR #1724Howard Chu2017-02-211-1/+1
|/ | | | Fix unit_tests build (get_output_key API change)
* blockchain_db: add "raw" blobdata getters for block and transactionmoneromooo-monero2017-02-131-1/+3
| | | | This speeds up operations such as serving blocks to syncing peers
* extract some basic code from libcryptonote_core into libcryptonote_basickenshi842017-02-081-1/+1
|
* unit_tests: fix missing return after batch_start prototype changemoneromooo-monero2017-01-211-1/+1
|
* Merge pull request #1506Riccardo Spagni2017-01-151-1/+1
|\ | | | | | | | | | | | | | | 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)
| * Use batch transactions when syncingHoward Chu2017-01-141-1/+1
| | | | | | | | | | Faster throughput while avoiding corruption. I.e., makes running with --db-sync-mode safe more tolerable.
* | blockchain: allow marking "tx not found" without an exceptionmoneromooo-monero2017-01-071-0/+1
|/ | | | | This is a normal occurence in many cases, and there is no need to spam the log with those when it is.
* Fixed undefined behavior in TestDBLee Clagett2016-11-231-2/+2
|
* unit_tests: fix build after get_output_histogram signature changemoneromooo-monero2016-10-191-1/+1
|
* core: faster find_blockchain_supplementmoneromooo-monero2016-08-311-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.
* move the rct commitments to the output_amounts databasemoneromooo-monero2016-08-281-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.
* blockchain_db: add functions for adding/removing/getting rct commitmentsmoneromooo-monero2016-08-281-0/+4
|
* Fake outs set is now decided by the walletmoneromooo-monero2016-08-111-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.
* remove hf_starting_height dbmoneromooo-monero2016-07-131-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.
* fix: error: -Werror=misleading-indentationmoneroexample2016-05-181-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.
* Merge branch 'performance' into masterHoward Chu2016-04-051-4/+5
|\
| * CleanupHoward Chu2016-04-051-4/+5
| | | | | | | | | | drop obsolete remove_output() fix get_output_key(global), fix crash in blockchain_dump
* | tests: obligatory hardfork unit build fix after interface changemoneromooo-monero2016-03-261-1/+1
| |
* | New RPC and daemon command to get output histogrammoneromooo-monero2016-03-261-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.
* unit_tests: fix hard fork unit test compilationwarptangent2016-03-051-1/+1
| | | | Match changed BlockchainDB function declaration.
* unit_tests: fix hard fork unit test compilationmoneromooo-monero2016-02-081-0/+4
|
* unit_tests: fix hard fork unit tests and add a test for major toomoneromooo-monero2016-02-011-30/+68
|
* Fix 30f92f5630bbc7507708275a29a9ae7acf633a5bHoward Chu2016-01-161-0/+1
| | | | Needed to add the corresponding (dummy) method to unit test hardfork
* 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-311-1/+1
|
* 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.
* 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.
* 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.
* 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
* Remove some old/obsolete/unused codemoneromooo-monero2015-10-271-1/+0
| | | | git history's here if needed to get any of this back