aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-07-13build: prepare v0.18.0.0selsta1-1/+1
2022-04-25Merge pull request #8178luigi11111-9/+15
5d388eb Bump ring size to 16 for v15 & remove set default in wallet cli (j-berman)
2022-04-18Bump ring size to 16 for v15 & remove set default in wallet clij-berman1-9/+15
2022-04-18Add view tags to outputs to reduce wallet scanning timej-berman1-9/+23
Implements view tags as proposed by @UkoeHB in MRL issue https://github.com/monero-project/research-lab/issues/73 At tx construction, the sender adds a 1-byte view tag to each output. The view tag is derived from the sender-receiver shared secret. When scanning for outputs, the receiver can check the view tag for a match, in order to reduce scanning time. When the view tag does not match, the wallet avoids the more expensive EC operations when deriving the output public key using the shared secret.
2022-04-10Fee changes from ArticMinemoneromooo-monero1-7/+130
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
2022-04-06Merge pull request #8212luigi11111-3/+0
591c174 Remove footgun doc comment in miner TX validation (Luke Parker)
2022-04-06Merge pull request #8197luigi11111-1/+1
da9aa1f Copyright: Update to 2022 (mj-xmr)
2022-04-05plug bulletproofs plus into consensusmoneromooo-monero1-4/+31
2022-03-10Remove footgun doc comment in miner TX validationLuke Parker1-3/+0
This comment suggests this check is unnecessary, when it is completely necessary as miner TXs can have multiple outputs *which is a statement directly, and incorrectly, contradicted by this comment*. While I don't ever see someone removing this code and getting their edits merged into Monero, someone inexperienced who thinks they're cleaning old code may break their own work, and then there's really just zero benefit to keeping this around.
2022-03-04Copyright: Update to 2022mj-xmr1-1/+1
2021-11-01tx_pool: full tx revalidation on fork boundariesmoneromooo-monero1-0/+21
avoids mining txes after a fork that are invalid by this fork's rules, but were valid by the previous fork rules at the time they were verified and added to the txpool.
2021-10-11blockchain: fix pedantic assertselsta1-0/+2
2021-09-11RPC and ZeroMQ APIs to support p2poolSChernykh1-1/+68
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
2021-07-10Merge pull request #7754luigi11111-1/+1
8ff21e1 doc: update IRC references to Libera (fdov)
2021-06-24Merge pull request #7612luigi11111-4/+6
254a133 core: speed up print_coinbase_tx_sum (moneromooo-monero)
2021-06-20doc: update IRC references to Liberafdov1-1/+1
2021-06-10Merge pull request #7684luigi11111-1/+4
ed6f053 blockchain: speed up repeated pops (mostly in tests) (moneromooo-monero)
2021-05-08Warnings: unused variable in core/blockchain.cppmj-xmr1-1/+1
2021-04-26blockchain: speed up repeated pops (mostly in tests)moneromooo-monero1-1/+4
The heavy rolling median reset only has to be performed after all blocks are popped
2021-03-18core: speed up print_coinbase_tx_summoneromooo-monero1-4/+6
It only needs to parse the tx headers, not the full tx data
2021-02-18Merge pull request #7355luigi11111-1/+1
bd12984 Remove copies from foreach loops (thanks to Clang) (Lee Clagett) 1572df9 Removing unused namespace alias (Lee Clagett)
2021-02-09Remove unused variables in monero codebaseKevin Barbour1-1/+0
There are quite a few variables in the code that are no longer (or perhaps never were) in use. These were discovered by enabling compiler warnings for unused variables and cleaning them up. In most cases where the unused variables were the result of a function call the call was left but the variable assignment removed, unless it was obvious that it was a simple getter with no side effects.
2021-01-28Remove copies from foreach loops (thanks to Clang)Lee Clagett1-1/+1
2021-01-19Remove payload copy in all outgoing p2p messagesLee Clagett1-0/+1
2021-04-16Revert "Merge pull request #7136"luigi11111-1/+0
This reverts commit 63c7ca07fba2f063c760f786a986fb3e02fb040e, reversing changes made to 2218e23e84a89e9a1e4c0be5d50f891ab836754f.
2021-01-16Remove payload copy in all outgoing p2p messagesLee Clagett1-0/+1
2021-01-02blockchain: lock access to m_blocks_hash_of_hashesmoneromooo-monero1-0/+2
it is accessed both when adding and when prevalidating a set of new hashes from a peer
2020-12-31protocol: more sanity checks in new chain block hashesmoneromooo-monero1-2/+14
2020-12-29rpc: limit the number of txes for get_blocks.binmoneromooo-monero1-3/+3
2020-11-29Merge pull request #6924luigi11111-8/+0
874487f blockchain: remove some dead code (moneromooo-monero)
2020-10-20blockchain: remove some dead codemoneromooo-monero1-8/+0
This is already done
2020-10-20Make Blockchain::get_fee_quantization_mask() compile timeSChernykh1-13/+0
This also removes potential thread safety bug in that function.
2020-10-18blockchain: fix sync at v14 boundarymoneromooo-monero1-3/+15
Miners with MLSAG txes which they'd already verified included a couple in that block, but the consensus rules had changed in the meantime, so that block is technically invalid and any node which did not already have those two txes in their txpool could not sync. Grandfather them in, since it has no effect in practice.
2020-09-15blockchain: deterministic UNIX time unlock checksmoneromooo-monero1-16/+45
Based on a patch by TheCharlatan <seb.kung@gmail.com>
2020-09-14build: prepare v0.17selsta1-1/+1
2020-09-07blockchain: fix pow skipping for old blocks without precalc hashmoneromooo-monero1-1/+1
2020-09-06Merge pull request #6111Riccardo Spagni1-5/+41
d20ff4f64 functional_tests: add a large (many randomx epochs) p2p reorg test (moneromooo-monero) 6a0b3b1f8 functional_tests: add randomx tests (moneromooo-monero) 9d42649d5 core: fix mining from a block that's not the current top (moneromooo-monero)
2020-09-03Merge pull request #6757luigi11111-7/+9
6a37da8 threadpool: guard against exceptions in jobs, and armour plating (moneromooo-monero)
2020-09-01threadpool: guard against exceptions in jobs, and armour platingmoneromooo-monero1-7/+9
Those would, if uncaught, exit run and leave the waiter to wait indefinitely for the number of active jobs to reach 0
2020-08-27core: fix mining from a block that's not the current topmoneromooo-monero1-5/+41
2020-08-27Integrate CLSAGs into moneromoneromooo-monero1-3/+53
They are allowed from v12, and MLSAGs are rejected from v13.
2020-08-27Merge pull request #6760Alexander Blair1-2/+2
844fb4e94 enforce claiming maximum coinbase amount (moneromooo-monero)
2020-08-21enforce claiming maximum coinbase amountmoneromooo-monero1-2/+2
Claiming a slightly lesser amount does not yield the size gains that were seen pre rct, so this closes a fingerprinting vector
2020-08-17Avoid some temporary strings when reading off the databasemoneromooo-monero1-3/+3
2020-08-16Merge pull request #6727Alexander Blair1-0/+11
13eee1d6a rpc: reject wrong sized txid (moneromooo-monero) 92e6b7df2 easylogging++: fix crash with reentrant logging (moneromooo-monero) 6dd95d530 epee: guard against exceptions in RPC handlers (moneromooo-monero) 90016ad74 blockchain: guard against exceptions in add_new_block/children (moneromooo-monero)
2020-08-16Merge pull request #6661Alexander Blair1-1/+1
267ce5b71 avoid a couple needless copies (moneromooo-monero)
2020-07-30blockchain: guard against exceptions in add_new_block/childrenmoneromooo-monero1-0/+11
Reporter requested credit to be given to Decred
2020-07-19Merge pull request #6534Alexander Blair1-0/+115
7bd66b01b daemon: guard against rare 'difficulty drift' bug with checkpoints and recalculation (stoffu)
2020-07-19Merge pull request #6526Alexander Blair1-0/+1
5d882f4f1 blockchain: fix theoretical race getting bulk timestamps (moneromooo-monero)
2020-07-19Merge pull request #6512Alexander Blair1-1/+1
5ef0607da Update copyright year to 2020 (SomaticFanatic)
2020-07-08blockchain: fix timestamp/difficulty cache getting out of syncmoneromooo-monero1-1/+16
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.
2020-07-08Merge pull request #6629luigi11111-0/+1
795e186 blockchain: fix total_height in getblocks.bin response (moneromooo-monero)
2020-07-08Merge pull request #6544luigi11111-5/+72
5741b4d blockchain: detect and log bad difficulty calculations (moneromooo-monero)
2020-06-14avoid a couple needless copiesmoneromooo-monero1-1/+1
2020-06-09daemon: guard against rare 'difficulty drift' bug with checkpoints and ↵stoffu1-0/+115
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.
2020-06-05blockchain: fix total_height in getblocks.bin responsemoneromooo-monero1-0/+1
2020-05-17blockchain: detect and log bad difficulty calculationsmoneromooo-monero1-5/+72
2020-05-13build: prepare v0.16.0.0 releaseselsta1-1/+1
2020-05-13blockchain: fix theoretical race getting bulk timestampsmoneromooo-monero1-0/+1
2020-05-06Update copyright year to 2020SomaticFanatic1-1/+1
Update copyright year to 2020
2020-05-04Adding ZMQ/Pub support for txpool_add and chain_main eventsLee Clagett1-10/+21
2020-04-10Merge pull request #6358luigi11111-30/+2
8958b4e blockchain_db: faster fetching of consecutive txes (moneromooo-monero)
2020-04-04Merge pull request #6347luigi11111-8/+16
fcb06f7 cryptonote_core: skip block notify on blockchain switching rollback (xiphon)
2020-04-04Merge pull request #6339luigi11111-2/+2
c61abf8 remove empty statements (shopglobal)
2020-03-27Merge pull request #6284Alexander Blair1-2/+2
02224e71 Fix check_fee() discrepancy. (UkoeHB)
2020-02-28Merge pull request #6211Alexander Blair1-0/+7
5985c5af rpc: add bad-blocks to flush_cache RPC (moneromooo-monero)
2020-02-27blockchain_db: faster fetching of consecutive txesmoneromooo-monero1-30/+2
Useful for wallet refresh or node sync
2020-02-19cryptonote_core: skip block notify on blockchain switching rollbackxiphon1-8/+16
2020-02-17remove empty statementsInterchained1-2/+2
Cleaning up a little around the code base.
2020-02-04Merge pull request #6233luigi11111-1/+1
8a27645 blockchain: fix flushing txes from the txpool (moneromooo-monero)
2020-01-25Merge pull request #6140Alexander Blair1-3/+10
08635a08 blockchain: speedup fetching pruned contiguous tx blobs (moneromooo-monero)
2020-01-16Merge pull request #6124Alexander Blair1-1/+6
21d4c216 blockchain: error out if the builtin hashes data size is wrong (moneromooo-monero)
2020-01-09Fix check_fee() discrepancy.UkoeHB1-2/+2
M100 = max{300kb, min{100block_median, m_long_term_effective_median_block_weight}} not M100 = max{300kb, m_long_term_effective_median_block_weight} Fix base reward in get_dynamic_base_fee_estimate(). get_dynamic_base_fee_estimate() should match check_fee() Fee is calculated based on block reward, and the reward penalty takes into account 0.5*max_block_weight (both before and after HF_VERSION_EFFECTIVE_SHORT_TERM_MEDIAN_IN_PENALTY). Moved median calculation according to best practice of 'keep definitions close to where they are used'.
2019-12-14blockchain: fix flushing txes from the txpoolmoneromooo-monero1-1/+1
2019-12-02rpc: add bad-blocks to flush_cache RPCmoneromooo-monero1-0/+7
Flushes m_invalid_blocks in Blockchain.
2019-11-15blockchain: speedup fetching pruned contiguous tx blobsmoneromooo-monero1-3/+10
About twice as fast, very roughly
2019-11-12blockchain: error out if the builtin hashes data size is wrongmoneromooo-monero1-1/+6
2019-11-02Adding support for hidden (anonymity) txpoolLee Clagett1-13/+18
2019-11-020.15.0.0 release engineeringRiccardo Spagni1-1/+1
2019-10-27blockchain: fix unwanted error when probing the pool for a txmoneromooo-monero1-2/+11
2019-10-22Merge pull request #5974luigi11111-2/+4
7fcd0b5 blockchain: initialize pow to ff..ff (moneromooo-monero)
2019-10-22Merge pull request #5970luigi11111-3/+12
ab96181 blockchain: use effective median block weight for penalty from v12 (moneromooo-monero)
2019-10-22Merge pull request #5966luigi11111-8/+3
be82c40 Support median block size > 4 GB (moneromooo-monero)
2019-10-22Merge pull request #5919luigi11111-0/+28
01f660f blockchain: fill in cumulative block weight for alt blocks (moneromooo-monero)
2019-10-21Support median block size > 4 GBmoneromooo-monero1-8/+3
add a 128/64 division routine so we can use a > 32 bit median block size in calculations
2019-10-16blockchain: initialize pow to ff..ffmoneromooo-monero1-2/+4
as a safety to reject if it somehow does not get initialised
2019-10-14Merge pull request #5941luigi11111-1/+2
d37d30f blockchain: tweak fee as a function of median values (moneromooo-monero)
2019-10-14Merge pull request #5933luigi11111-0/+2
3455efa ban peers sending bad pow outright (moneromooo-monero)
2019-10-11blockchain: use effective median block weight for penalty from v12moneromooo-monero1-3/+12
It was using the raw block weight median, which was not what was intended in ArticMine's design
2019-10-10blockchain: fill in cumulative block weight for alt blocksmoneromooo-monero1-0/+28
2019-10-08Merge pull request #5915luigi11111-50/+194
8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
2019-09-30Merge pull request #5902luigi11111-1/+3
b9da023 blockchain: keep block template timestamp not below recent median (moneromooo-monero)
2019-09-28blockchain: tweak fee as a function of median valuesmoneromooo-monero1-1/+2
Use the lesser of the short and long terms medians, rather then the long term median alone From ArticMine: I found a bug in the new fee calculation formula with using only the long term median It actually needs to be the lesser of the long term median and the old (modified short term median) short term median with the last 10 blocks calculated as empty Yes the issue occurs if there is a large long term median and, the short term median then falls and tries to then rise again The fees are could be not high enough for example LTM and STM rise to say 2000000 bytes STM falls back to 300000 bytes Fees are now based on 2000000 bytes until LTM also falls So the STM is could prevented from rising back up STM short term median LTM long term median
2019-09-27monerod can now sync from pruned blocksmoneromooo-monero1-50/+194
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
2019-09-25RandomX integrationHoward Chu1-4/+40
Support RandomX PoW algorithm
2019-09-25ban peers sending bad pow outrightmoneromooo-monero1-0/+2
PoW is expensive to verify, so be strict
2019-09-24Merge pull request #5882luigi11111-0/+10
a444f06 blockchain: enforce 10 block age for spending outputs (moneromooo-monero)
2019-09-24Merge pull request #5877luigi11111-8/+8
2cd4fd8 Changed the use of boost:value_initialized for C++ list initializer (JesusRami) 4ad191f Removed unused boost/value_init header (whyamiroot) 928f4be Make null hash constants constexpr (whyamiroot)
2019-09-19core: move hardforks into its own libmoneromooo-monero1-125/+4
So it can be used by others without encumbrance
2019-09-17blockchain: enforce 10 block age for spending outputsmoneromooo-monero1-0/+10
Some custom wallet code apparently ignores this, which causes users of that code to be fingerprinted
2019-09-14Merge pull request #5865luigi11111-2/+3
11f13da blockchain: fix logging bad number of blocks if first one fails (moneromooo-monero) 19bfe7e simplewallet: fix warnings about useless std::move (moneromooo-monero)
2019-09-14Merge pull request #5823luigi11111-12/+37
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)
2019-09-11blockchain: keep block template timestamp not below recent medianmoneromooo-monero1-1/+3
Such a template would yield an invalid block, though would require an attacker to have mined a long blockchain with drifting times (assuming the miner's clock is roughly correct) Fixed by crCr62U0
2019-09-04Merge pull request #5819luigi11111-1/+2
07cb087 blockchain: Fix alt chain generated coins overflow (iamamyth)
2019-09-02Changed the use of boost:value_initialized for C++ list initializerJesus Ramirez1-8/+8
2019-08-28blockchain: fix logging bad number of blocks if first one failsmoneromooo-monero1-2/+3
2019-08-19Merge pull request #5721luigi11111-36/+6
c164f90 Remove unnecessary m_check_txin_table, fix const correctness (omartijn)
2019-08-19blockchain: reject rct signatures in coinbase txes from v12moneromooo-monero1-0/+7
2019-08-19core: from v12, require consistent ring size for mixable txesmoneromooo-monero1-8/+23
We're supposed to have a fixed ring size now Already checked by MLSAG verification, but here seems more intuitive
2019-08-19blockchain: forbid v1 coinbase from v12moneromooo-monero1-4/+7
2019-08-18blockchain: Fix alt chain generated coins overflowiamamyth1-1/+2
Apply the overflow logic used for computing already_generated_coins in the main chain to alternative chains.
2019-08-14Merge pull request #5525luigi11111-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)
2019-08-14Merge pull request #5487luigi11111-0/+13
df83ed7 consensus: from v12, enforce >= 2 outputs (moneromooo-monero)
2019-07-24Merge pull request #5591luigi11111-2/+0
f17dcde Remove unused txs member in NOTIFY_RESPONSE_GET_OBJECT (Doy-lee)
2019-07-24Merge pull request #5524luigi11111-66/+126
06b8f29 blockchain: keep alternative blocks in LMDB (moneromooo-monero)
2019-07-24Merge pull request #5502luigi11111-6/+2
25a7cfd add a few checks where it seems appropriate (moneromooo-monero) 1a66a86 remove unused code (moneromooo-monero)
2019-07-18update checkpoints.dat hashRiccardo Spagni1-1/+1
2019-07-15Remove unused txs member in NOTIFY_RESPONSE_GET_OBJECTDoyle1-2/+0
2019-07-03Remove unnecessary m_check_txin_table, fix const correctnessMartijn Otto1-36/+6
2019-06-16blockchain: silence an error getting blocks for pruned nodesmoneromooo-monero1-4/+8
This happens often when a pre-pruning node asks a pruned node for data it does not have
2019-06-14prep for 0.14.1 releaseRiccardo Spagni1-1/+1
2019-06-01Merge pull request #5571Riccardo Spagni1-12/+19
35da33be blockchain: do not try to pop blocks down to the genesis block (moneromooo-monero) 4b51f9a3 core: do not commit half constructed batch db txn (moneromooo-monero)
2019-05-26blockchain: do not try to pop blocks down to the genesis blockmoneromooo-monero1-0/+3
2019-05-25core: do not commit half constructed batch db txnmoneromooo-monero1-12/+16
2019-05-19Fix #5553Howard Chu1-1/+2
Make sure the tip hash still matches the cached block
2019-05-09daemon: sort alt chains by heightmoneromooo-monero1-2/+2
2019-05-08blockchain: keep alternative blocks in LMDBmoneromooo-monero1-66/+126
Alternative blocks are cleared on startup unless --keep-alt-blocks is passed on the command line
2019-05-07Merge pull request #5510Riccardo Spagni1-2/+2
e9809382 fix wide difficulty conversion with some versions of boost (moneromooo-monero)
2019-05-02blockchain: keep a rolling long term block weight medianmoneromooo-monero1-27/+29
2019-05-01fix wide difficulty conversion with some versions of boostmoneromooo-monero1-2/+2
2019-04-29remove unused codemoneromooo-monero1-6/+2
2019-04-23consensus: from v12, enforce >= 2 outputsmoneromooo-monero1-0/+13
2019-04-16Merge pull request #5448Riccardo Spagni1-5/+13
d009f6dd rpc: fix get_block_hashes.bin from wallet on pruned blockchain (moneromooo-monero) bb0ef5b1 blockchain: lock the blockchain while pruning (moneromooo-monero)
2019-04-16Merge pull request #5414Riccardo Spagni1-1/+0
e9fac29a unit_tests/long_term_block_weight: some tweaks that seem to make more sense (stoffu) 467f4c7e tests/block_weight: use integer division when computing median (stoffu) 815d08dc tests/block_weight: remove unused MULTIPLIER_SMALL (stoffu) 661f1fb8 blockchain: remove unused calc of short_term_constraint (stoffu)
2019-04-15rpc: fix get_block_hashes.bin from wallet on pruned blockchainmoneromooo-monero1-5/+9
We want to get all blocks here, even pruned ones
2019-04-15blockchain: lock the blockchain while pruningmoneromooo-monero1-0/+4
2019-04-14blockchain_db: fix db txn ending too earlymoneromooo-monero1-29/+23
The db txn in add_block ending caused the entire overarching batch txn to stop. Also add a new guard class so a db txn can be stopped in the face of exceptions. Also use a read only db txn in init when the db itself is read only, and do not save the max tx size in that case.
2019-04-11functional_tests: add more blockchain related testsmoneromooo-monero1-61/+136
Related to emission, reorgs, getting tx data back, output distribution and histogram
2019-04-11Merge pull request #5380Riccardo Spagni1-0/+2
113e4877 blockchain_stats: fix sign in formatting function (moneromooo-monero) adaea3ea various: remove unused variables (moneromooo-monero) 631ef00e blockchain: some debug info when adding txes-from-block fails (moneromooo-monero)
2019-04-11Merge pull request #5378Riccardo Spagni1-6/+0
eda2661a Allow pruning before v10 (moneromooo-monero)
2019-04-11Merge pull request #5373Riccardo Spagni1-2/+4
aff80e70 blockchain: fix returned height in create_block_template (moneromooo-monero)
2019-04-11Merge pull request #5123Riccardo Spagni1-0/+6
089c7637 cryptonote: rework block blob size sanity check (moneromooo-monero)
2019-04-09blockchain: remove unused calc of short_term_constraintstoffu1-1/+0
2019-04-06Merge pull request #5346Riccardo Spagni1-4/+7
c84ea299 cryptonote_basic: some more minor speedups (moneromooo-monero) e40eb2ad cryptonote_basic: speedup calculate_block_hash (moneromooo-monero) 547a9708 cryptonote: block parsing + hash calculation speedup (moneromooo-monero) 11604b6d blockchain: avoid unneeded block copy (moneromooo-monero) 8461df04 save some database calls when getting top block hash and height (moneromooo-monero) 3bbc3661 Avoid repeated (de)serialization when syncing (moneromooo-monero)
2019-04-05cryptonote: rework block blob size sanity checkmoneromooo-monero1-0/+6
Use the actual block weight limit, assuming that weight is always greater or equal to size
2019-04-01blockchain: some debug info when adding txes-from-block failsmoneromooo-monero1-0/+2
2019-04-01Merge pull request #5352Riccardo Spagni1-0/+44
ae6885f6 blockchain: incremental long term block weight cache (moneromooo-monero) 9b687c78 blockchain: simple cache for the long term block weights (moneromooo-monero)
2019-04-01Merge pull request #5294Riccardo Spagni1-0/+2
77e9815d blockchain: do not try to pop the genesis block (moneromooo-monero)
2019-04-01Allow pruning before v10moneromooo-monero1-6/+0
This check is now not needed anymore, and would prevent people from using --prune-blockchain when starting a new sync
2019-03-30blockchain: fix returned height in create_block_templatemoneromooo-monero1-2/+4
It's now needed for CNv4, and was not retained when cached
2019-03-28blockchain: incremental long term block weight cachemoneromooo-monero1-0/+22
2019-03-28blockchain: simple cache for the long term block weightsmoneromooo-monero1-0/+22
2019-03-25cryptonote: block parsing + hash calculation speedupmoneromooo-monero1-4/+6
This saves a duplicate serialization step
2019-03-25blockchain: avoid unneeded block copymoneromooo-monero1-1/+2
2019-03-25save some database calls when getting top block hash and heightmoneromooo-monero1-0/+1
2019-03-25Avoid repeated (de)serialization when syncingmoneromooo-monero1-2/+1
2019-03-24Make difficulty 128 bit instead of 64 bitmoneromooo-monero1-2/+6
Based on Boolberry work by: jahrsg <jahr@jahr.me> cr.zoidberg <crypto.zoidberg@gmail.com>
2019-03-21Merge pull request #5256Riccardo Spagni1-13/+11
4b21d38d blockchain: speed up getting N blocks weights/long term weights (moneromooo-monero)
2019-03-17Merge pull request #5061Riccardo Spagni1-1/+1
1f2930ce Update 2019 copyright (binaryFate)
2019-03-15blockchain: do not try to pop the genesis blockmoneromooo-monero1-0/+2
2019-03-10blockchain: fix ahead of time PoW batch calcmoneromooo-monero1-2/+2
2019-03-08blockchain: speed up getting N blocks weights/long term weightsmoneromooo-monero1-13/+11
2019-03-07Merge pull request #5232Riccardo Spagni1-1/+1
082149c5 fix merge errors, update recommended version to 0.14.0.2 (Riccardo Spagni) f3b368c6 update checkpoints hash (Riccardo Spagni) e518f2b1 update checkpoints, update README for 0.14.1 release (Riccardo Spagni) 8780d6b4 update readme via cherry-pick (Riccardo Spagni)
2019-03-05Update 2019 copyrightbinaryFate1-1/+1
2019-03-05cryptonote: avoid double parsing blocks when syncingmoneromooo-monero1-10/+3
2019-03-05core: avoid double parsing blocks after hohmoneromooo-monero1-2/+2
2019-03-05blockchain: avoid unneeded block copymoneromooo-monero1-1/+2
2019-03-05save some database calls when getting top block hash and heightmoneromooo-monero1-25/+35
2019-03-05blockchain: avoid pointless transaction copy and temporarymoneromooo-monero1-3/+4
2019-03-05blockchain: avoid duplicate block hash computationmoneromooo-monero1-2/+1
2019-03-05Avoid repeated (de)serialization when syncingmoneromooo-monero1-9/+14
2019-03-05fix merge errors, update recommended version to 0.14.0.2Riccardo Spagni1-1/+1
2019-03-05update checkpoints hashRiccardo Spagni1-2/+2
2019-03-04various: remove unused variablesmoneromooo-monero1-2/+0
2019-03-04Merge pull request #5092Riccardo Spagni1-2/+2
eec79276 blockchain: fix default genesis block timestamp (moneromooo-monero)
2019-03-04blockchain: forbid older BP rct versions from v11moneromooo-monero1-1/+18
2019-03-04Merge pull request #5174Riccardo Spagni1-0/+5
0de14396 tests: add a CNv4 JIT test (moneromooo-monero) 24d281c3 crypto: plug CNv4 JIT into cn_slow_hash (moneromooo-monero) 78ab59ea crypto: clear cache after generating random program (moneromooo-monero) b9a61884 performance_tests: add tests for new Cryptonight variants (moneromooo-monero) fff23bf7 CNv4 JIT compiler for x86-64 and tests (SChernykh) 3dde67d8 blockchain: add v10 fork heights (moneromooo-monero)
2019-03-04blockchain: add v10 fork heightsmoneromooo-monero1-0/+5
2019-03-04blockchain: include number of discarded blocks in --reorg-notifymoneromooo-monero1-1/+2
2019-03-04Merge pull request #5124Riccardo Spagni1-21/+118
b8787f43 ArticMine's new block weight algorithm (moneromooo-monero)
2019-03-04ArticMine's new block weight algorithmmoneromooo-monero1-21/+118
This curbs runaway growth while still allowing substantial spikes in block weight Original specification from ArticMine: here is the scaling proposal Define: LongTermBlockWeight Before fork: LongTermBlockWeight = BlockWeight At or after fork: LongTermBlockWeight = min(BlockWeight, 1.4*LongTermEffectiveMedianBlockWeight) Note: To avoid possible consensus issues over rounding the LongTermBlockWeight for a given block should be calculated to the nearest byte, and stored as a integer in the block itself. The stored LongTermBlockWeight is then used for future calculations of the LongTermEffectiveMedianBlockWeight and not recalculated each time. Define: LongTermEffectiveMedianBlockWeight LongTermEffectiveMedianBlockWeight = max(300000, MedianOverPrevious100000Blocks(LongTermBlockWeight)) Change Definition of EffectiveMedianBlockWeight From (current definition) EffectiveMedianBlockWeight = max(300000, MedianOverPrevious100Blocks(BlockWeight)) To (proposed definition) EffectiveMedianBlockWeight = min(max(300000, MedianOverPrevious100Blocks(BlockWeight)), 50*LongTermEffectiveMedianBlockWeight) Notes: 1) There are no other changes to the existing penalty formula, median calculation, fees etc. 2) There is the requirement to store the LongTermBlockWeight of a block unencrypted in the block itself. This is to avoid possible consensus issues over rounding and also to prevent the calculations from becoming unwieldy as we move away from the fork. 3) When the EffectiveMedianBlockWeight cap is reached it is still possible to mine blocks up to 2x the EffectiveMedianBlockWeight by paying the corresponding penalty. Note: the long term block weight is stored in the database, but not in the actual block itself, since it requires recalculating anyway for verification.
2019-02-01cryptonote: Fix enum check in expand_transaction_2Tom Smeding1-1/+1
This was noticed because GCC warned about using an enum value in a boolean context.
2019-01-28blockchain: add --reorg-notifymoneromooo-monero1-0/+5
This will trigger if a reorg is seen. This may be used to do things like stop automated withdrawals on large reorgs. %s is replaced by the height at the split point %h is replaced by the height of the new chain %n is replaced by the number of new blocks after the reorg
2019-01-28notify: handle arbitrary tagsmoneromooo-monero1-1/+1
2019-01-28Merge pull request #5052Riccardo Spagni1-2/+15
b6534c40 ringct: remove unused senderPk from ecdhTuple (moneromooo-monero) 7d375981 ringct: the commitment mask is now deterministic (moneromooo-monero) 99d946e6 ringct: encode 8 byte amount, saving 24 bytes per output (moneromooo-monero) cdc3ccec ringct: save 3 bytes on bulletproof size (moneromooo-monero) f931e16c add a bulletproof version, new bulletproof type, and rct config (moneromooo-monero)
2019-01-26blockchain: fix default genesis block timestampmoneromooo-monero1-2/+2
2019-01-22add a bulletproof version, new bulletproof type, and rct configmoneromooo-monero1-2/+15
This makes it easier to modify the bulletproof format
2019-01-22Pruningmoneromooo-monero1-3/+93
The blockchain prunes seven eighths of prunable tx data. This saves about two thirds of the blockchain size, while keeping the node useful as a sync source for an eighth of the blockchain. No other data is currently pruned. There are three ways to prune a blockchain: - run monerod with --prune-blockchain - run "prune_blockchain" in the monerod console - run the monero-blockchain-prune utility The first two will prune in place. Due to how LMDB works, this will not reduce the blockchain size on disk. Instead, it will mark parts of the file as free, so that future data will use that free space, causing the file to not grow until free space grows scarce. The third way will create a second database, a pruned copy of the original one. Since this is a new file, this one will be smaller than the original one. Once the database is pruned, it will stay pruned as it syncs. That is, there is no need to use --prune-blockchain again, etc.
2019-01-18Merge pull request #5048Riccardo Spagni1-1/+2
a67b77a9 blockchain: don't propagate exception past dtor (moneromooo-monero)
2019-01-16Merge pull request #5032Riccardo Spagni1-7/+5
5ee6f037 blockchain: fix wrong hf version when popping multiple blocks (moneromooo-monero) 634d359a blockchain: use the version passed as parameter, not a new one (moneromooo-monero) 94a375d5 hardfork: remove batch transactions setup (moneromooo-monero)
2019-01-16Merge pull request #5015Riccardo Spagni1-58/+4
6f2081f8 cryptonote_core: revert extra_tx_map (moneromooo-monero)
2019-01-16Merge pull request #4993Riccardo Spagni1-1/+3
b8342dd5 blockchain: fix block rate check for empty blockchains (moneromooo-monero)
2019-01-16Merge pull request #4984Riccardo Spagni1-8/+17
008647d7 blockchain_db: speedup tx output gathering (moneromooo-monero)
2019-01-07blockchain: don't propagate exception past dtormoneromooo-monero1-1/+2
Coverity 190660
2019-01-01blockchain: fix wrong hf version when popping multiple blocksmoneromooo-monero1-6/+4
Since we keep track of the hf version in the db, we pick it up from there instead of doing the full reorg call, which is quite expensive
2019-01-01blockchain: use the version passed as parameter, not a new onemoneromooo-monero1-1/+1
2018-12-31Merge pull request #4940luigi11111-7/+10
9e64a71 blockchain: call deinit in dtor (moneromooo-monero)
2018-12-31Merge pull request #4928luigi11111-5/+3
affff94 blockchain: fix race between two external mining threads (moneromooo-monero)
2018-12-25cryptonote_core: revert extra_tx_mapmoneromooo-monero1-58/+4
While the lookups are faster, the zeroCommit calls have to be done again when storing the new outputs in the db, which ends up making the whole thing slower after all, and the ways this can be cached aren't very nice code wise, so let's forget it since the gains aren't very large anyway.
2018-12-18blockchain: fix block rate check for empty blockchainsmoneromooo-monero1-1/+3