aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.h
Commit message (Collapse)AuthorAgeFilesLines
* p2p: fix race causing dropped connections during syncj-berman2025-12-111-1/+2
| | | | | | | | | | | | | Without this commit: 1) read height from DB 2) add block to chain in separate thread 3) read chain for block id's and request them from peer 4) ERR in handle_response_chain_entry, peer's first block is the one that was added to the chain, which has block idx=height from step 1. This commit reads the chain for height and highest block id's in one go while holding the m_blockchain_lock to avoid the race.
* Merge pull request #9740tobtoht2025-03-101-15/+41
|\ | | | | | | 008ba966d blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
| * blockchain sync: reduce disk writes from 2 to 1 per txjeffro2562025-03-101-15/+41
| |
* | Fix build with boost ASIO 0.87. Support boost 1.66+Lee *!* Clagett2025-02-141-3/+4
|/
* verRctNonSemanticsSimpleCached: fix fragilityJeffrey Ryan2023-03-171-9/+13
|
* Refactored rx-slow-hash.cSChernykh2022-12-141-1/+3
| | | | | | | | | - Straight-forward call interface: `void rx_slow_hash(const char *seedhash, const void *data, size_t length, char *result_hash)` - Consensus chain seed hash is now updated by calling `rx_set_main_seedhash` whenever a block is added/removed or a reorg happens - `rx_slow_hash` will compute correct hash no matter if `rx_set_main_seedhash` was called or not (the only difference is performance) - New environment variable `MONERO_RANDOMX_FULL_MEM` to force use the full dataset for PoW verification (faster block verification) - When dataset is used for PoW verification, dataset updates don't stall other threads (verification is done in light mode then) - When mining is running, PoW checks now also use dataset for faster verification
* wallet2: check wallet compatibility with daemon's hard fork versionj-berman2022-09-121-0/+7
|
* rpc: skip bootstrap nodes that are lower than last checkpointselsta2022-09-061-0/+7
|
* Fee changes from ArticMinemoneromooo-monero2022-04-101-0/+16
| | | | | | https://github.com/ArticMine/Monero-Documents/blob/master/MoneroScaling2021-02.pdf with a change to use 1.7 instead of 2.0 for the max long term increase rate
* Copyright: Update to 2022mj-xmr2022-03-041-1/+1
|
* RPC and ZeroMQ APIs to support p2poolSChernykh2021-09-111-2/+37
| | | | | | | | | | | | | | | | | | | | Adds the following: - "get_miner_data" to RPC API - "json-miner-data" to ZeroMQ subscriber contexts Both provide the necessary data to create a custom block template. They are used by p2pool. Data provided: - major fork version - current height - previous block id - RandomX seed hash - network difficulty - median block weight - coins mined by the network so far - mineable mempool transactions
* core: speed up print_coinbase_tx_summoneromooo-monero2021-03-181-1/+1
| | | | It only needs to parse the tx headers, not the full tx data
* protocol: more sanity checks in new chain block hashesmoneromooo-monero2020-12-311-1/+3
|
* rpc: limit the number of txes for get_blocks.binmoneromooo-monero2020-12-291-2/+3
|
* Make Blockchain::get_fee_quantization_mask() compile timeSChernykh2020-10-201-1/+5
| | | | This also removes potential thread safety bug in that function.
* blockchain: deterministic UNIX time unlock checksmoneromooo-monero2020-09-151-12/+19
| | | | Based on a patch by TheCharlatan <seb.kung@gmail.com>
* core: fix mining from a block that's not the current topmoneromooo-monero2020-08-271-3/+5
|
* Merge pull request #6767Alexander Blair2020-08-271-0/+3
|\ | | | | | | 07442a605 Fix build with Boost 1.74 (moneromooo-monero)
| * Fix build with Boost 1.74moneromooo-monero2020-08-161-0/+3
| | | | | | | | Thanks iDunk for testing
* | Avoid some temporary strings when reading off the databasemoneromooo-monero2020-08-171-1/+1
|/
* Adding ZMQ/Pub support for txpool_add and chain_main eventsLee Clagett2020-05-041-2/+7
|
* Merge pull request #6534Alexander Blair2020-07-191-0/+16
|\ | | | | | | 7bd66b01b daemon: guard against rare 'difficulty drift' bug with checkpoints and recalculation (stoffu)
| * daemon: guard against rare 'difficulty drift' bug with checkpoints and ↵stoffu2020-06-091-0/+16
| | | | | | | | | | | | recalculation On startup, it checks against the difficulty checkpoints, and if any mismatch is found, recalculates all the blocks with wrong difficulties. Additionally, once a week it recalculates difficulties of blocks after the last difficulty checkpoint.
* | Merge pull request #6512Alexander Blair2020-07-191-1/+1
|\ \ | | | | | | | | | 5ef0607da Update copyright year to 2020 (SomaticFanatic)
| * | Update copyright year to 2020SomaticFanatic2020-05-061-1/+1
| |/ | | | | | | Update copyright year to 2020
* / blockchain: fix timestamp/difficulty cache getting out of syncmoneromooo-monero2020-07-081-0/+1
|/ | | | | | | | | | | | | | | | | | The cache is discarded when a block is popped, but then gets rebuilt when the difficulty for next block is requested. While this is all properly locked, it does not take into account the delay caused by a database transaction being only committed (and thus its effects made visible to other threads) later on, which means another thread could request difficulty between the pop and the commit, which would end up using stale database view to build the cache, but that cache would not be invalidated again when the transaction gets committed, which would cause the cache to not match the new database data. To fix this, we now keep track of when the cache is invalidated so we can invalidate it again upon database transaction commit to ensure it gets calculated again with fresh data next time it is nedeed.
* Merge pull request #6347luigi11112020-04-041-2/+4
|\ | | | | | | fcb06f7 cryptonote_core: skip block notify on blockchain switching rollback (xiphon)
| * cryptonote_core: skip block notify on blockchain switching rollbackxiphon2020-02-191-2/+4
| |
* | Merge pull request #6211Alexander Blair2020-02-281-0/+5
|\ \ | |/ |/| | | 5985c5af rpc: add bad-blocks to flush_cache RPC (moneromooo-monero)
| * rpc: add bad-blocks to flush_cache RPCmoneromooo-monero2019-12-021-0/+5
| | | | | | | | Flushes m_invalid_blocks in Blockchain.
* | Merge pull request #6055luigi11112019-12-121-1/+1
|\ \ | | | | | | | | | 886ed25 blockchain: fix comment wrongly refering to SHA-3 rather than Keccak (moneromooo-monero)
| * | blockchain: fix comment wrongly refering to SHA-3 rather than Keccakmoneromooo-monero2019-10-291-1/+1
| |/
* / Adding support for hidden (anonymity) txpoolLee Clagett2019-11-021-4/+5
|/
* Merge pull request #5915luigi11112019-10-081-8/+24
|\ | | | | | | 8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
| * monerod can now sync from pruned blocksmoneromooo-monero2019-09-271-8/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the peer (whether pruned or not itself) supports sending pruned blocks to syncing nodes, the pruned version will be sent along with the hash of the pruned data and the block weight. The original tx hashes can be reconstructed from the pruned txes and theur prunable data hash. Those hashes and the block weights are hashes and checked against the set of precompiled hashes, ensuring the data we received is the original data. It is currently not possible to use this system when not using the set of precompiled hashes, since block weights can not otherwise be checked for validity. This is off by default for now, and is enabled by --sync-pruned-blocks
* | RandomX integrationHoward Chu2019-09-251-0/+17
| | | | | | | | Support RandomX PoW algorithm
* | core: move hardforks into its own libmoneromooo-monero2019-09-191-7/+0
| | | | | | | | So it can be used by others without encumbrance
* | Merge pull request #5823luigi11112019-09-141-1/+2
|\ \ | |/ |/| | | | | | | 26072f1 blockchain: forbid v1 coinbase from v12 (moneromooo-monero) 555dc7c core: from v12, require consistent ring size for mixable txes (moneromooo-monero) d22dfb7 blockchain: reject rct signatures in coinbase txes from v12 (moneromooo-monero)
| * blockchain: forbid v1 coinbase from v12moneromooo-monero2019-08-191-1/+2
| |
* | Merge pull request #5721luigi11112019-08-191-7/+6
|\ \ | |/ |/| | | c164f90 Remove unnecessary m_check_txin_table, fix const correctness (omartijn)
| * Remove unnecessary m_check_txin_table, fix const correctnessMartijn Otto2019-07-031-7/+6
| |
* | Merge pull request #5525luigi11112019-08-141-2/+2
|\ \ | | | | | | | | | | | | | | | 0605406 daemon: sort alt chains by height (moneromooo-monero) 4228ee0 daemon: add optional arguments to alt_chain_info (moneromooo-monero) 880ebfd daemon: add more chain specific info in alt_chain_info (moneromooo-monero)
| * | daemon: sort alt chains by heightmoneromooo-monero2019-05-091-2/+2
| | |
* | | Merge pull request #5524luigi11112019-07-241-27/+4
|\ \ \ | |_|/ |/| | | | | 06b8f29 blockchain: keep alternative blocks in LMDB (moneromooo-monero)
| * | blockchain: keep alternative blocks in LMDBmoneromooo-monero2019-05-081-27/+4
| | | | | | | | | | | | | | | Alternative blocks are cleared on startup unless --keep-alt-blocks is passed on the command line
* | | core: do not commit half constructed batch db txnmoneromooo-monero2019-05-251-0/+3
| |/ |/|
* | blockchain: keep a rolling long term block weight medianmoneromooo-monero2019-05-021-6/+7
|/
* rpc: fix get_block_hashes.bin from wallet on pruned blockchainmoneromooo-monero2019-04-151-1/+2
| | | | We want to get all blocks here, even pruned ones
* functional_tests: add more blockchain related testsmoneromooo-monero2019-04-111-3/+17
| | | | | Related to emission, reorgs, getting tx data back, output distribution and histogram
* Merge pull request #5373Riccardo Spagni2019-04-111-1/+2
|\ | | | | | | aff80e70 blockchain: fix returned height in create_block_template (moneromooo-monero)