Age | Commit message (Collapse) | Author | Files | Lines |
|
The check interferes with raw device/partition support.
|
|
This reverts commit bd96536637724413173271e8d5df1777f7879c29.
The check interferes with raw device/partition support.
|
|
|
|
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.
|
|
|
|
da9aa1f Copyright: Update to 2022 (mj-xmr)
|
|
It avoids dividing by 8 when deserializing a tx, which is a slow
operation, and multiplies by 8 when verifying and extracing the
amount, which is much faster as well as less frequent
|
|
|
|
514f8fa LMDB: protection against UB, by not calling virtual methods from destructor (mj-xmr)
|
|
|
|
|
|
5a2edea db_lmdb: catch exceptions testing for mmap support (moneromooo-monero)
|
|
Turns out at least one arch (armel based) does not have unique_path
implemented and throws
|
|
If an invalid input type were to get to this, the code could
remove key images that might be present already in the chain,
which could allow a double spend, even if this is impossible
with the current code.
Reported by KeyboardWarrior.
|
|
bd12984 Remove copies from foreach loops (thanks to Clang) (Lee Clagett)
1572df9 Removing unused namespace alias (Lee Clagett)
|
|
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.
|
|
|
|
|
|
These are functions that check whether a tx is in the db, so whether
it is there or not is really not interesting, and it seems to scare
people from time to time
|
|
|
|
67ade8005 Add randomized delay when forwarding txes from i2p/tor -> ipv4/6 (Lee Clagett)
|
|
72cdfa4a2 fix a few typos in error messages (moneromooo-monero)
|
|
bd69e3b37 testdb: add override in a couple places where it's missing (moneromooo-monero)
|
|
bd9653663 db_lmdb: test for mmap support at init time (moneromooo-monero)
|
|
7bd66b01b daemon: guard against rare 'difficulty drift' bug with checkpoints and recalculation (stoffu)
|
|
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.
|
|
Reported by adrelanos
|
|
|
|
It'll make it clearer when a DB init failure is due to being
on a filesystem which does not support mmap
|
|
|
|
Update copyright year to 2020
|
|
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode
- Stem loops detected in tx_pool.cpp
- Embargo timeout for a blackhole attack during stem phase
|
|
8958b4e blockchain_db: faster fetching of consecutive txes (moneromooo-monero)
|
|
ec01077 db_lmdb: fix race crash using a stale cursor (moneromooo-monero)
|
|
c61abf8 remove empty statements (shopglobal)
|
|
for example, in the RPC server
|
|
If a db resize happened, the txpool meta cursor might be stale,
and was not being renewed when necessary.
It would cause this SEGSEGV:
in mdb_cursor_set ()
in mdb_cursor_get ()
in cryptonote::BlockchainLMDB::get_txpool_tx_blob(crypto::hash const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, cryptonote::relay_category) const ()
in cryptonote::tx_memory_pool::get_transaction(crypto::hash const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, cryptonote::relay_category) const ()
in cryptonote::t_cryptonote_protocol_handler<cryptonote::core>::handle_notify_new_fluffy_block(int, epee::misc_utils::struct_init<cryptonote::NOTIFY_NEW_FLUFFY_BLOCK::request_t>&, cryptonote::cryptonote_connection_context&) ()
|
|
Useful for wallet refresh or node sync
|
|
Cleaning up a little around the code base.
|
|
08635a08 blockchain: speedup fetching pruned contiguous tx blobs (moneromooo-monero)
|
|
402dd207 db_lmdb: guard against non NUL terminated keys (moneromooo-monero)
|
|
|
|
About twice as fast, very roughly
|
|
|
|
|
|
as opposed to an absent record
|
|
8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
|
|
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
|
|
f9b3f6e Removed Berkeley DB and db switching logic (JesusRami)
|
|
|
|
|
|
We've added a lot of new indices recently, and 20 isn't enough for them plus
new DBs opened during format migrations.
|
|
06b8f29 blockchain: keep alternative blocks in LMDB (moneromooo-monero)
|
|
25a7cfd add a few checks where it seems appropriate (moneromooo-monero)
1a66a86 remove unused code (moneromooo-monero)
|
|
to avoid errors when the txn is too large
|
|
NULL is valid when size is 0, but memcpy uses nonnull attributes,
so let's not poke the bear
|
|
|
|
Alternative blocks are cleared on startup unless --keep-alt-blocks
is passed on the command line
|
|
|
|
|
|
and delete obsolete BlockchainBDB::get_tx_output_indices along the way
|
|
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.
|
|
Use the actual block weight limit, assuming that weight is always
greater or equal to size
|
|
Based on Boolberry work by:
jahrsg <jahr@jahr.me>
cr.zoidberg <crypto.zoidberg@gmail.com>
|
|
4b21d38d blockchain: speed up getting N blocks weights/long term weights (moneromooo-monero)
|
|
|
|
|
|
f024a10b db_lmdb: make mdb_block_info format conversion more future proof (moneromooo-monero)
|
|
If mdb_block_info changes again, the v2 to v3 conversion would
convert to an incorrect format.
|
|
|
|
|
|
by avoiding repeated (de)serialization
|
|
d78addcb db_lmdb: don't unnecessarily cast to double on the way to uint64_t (moneromooo-monero)
|
|
85088d9f db_lmdb: fix missing mdb_dbi_close in migration (moneromooo-monero)
|
|
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.
|
|
Fixed by hyc
|
|
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.
|
|
|
|
Since the commitment has to be calculated for non rct outputs,
it slows down a lot unnecessarily if we don't need it
|
|
008647d7 blockchain_db: speedup tx output gathering (moneromooo-monero)
|
|
get_output_key method is commonly used when working with txs and their key images. Because the method is not const, passing blockchain object though const& or pointers to const is not possible in this context. This is especially problematic in external projects (e.g., projects in moneroexamples) that use monero C++ api to operate on the blockchain and txs.
Thus, having get_output_key method will simplify moving blockchain object around through const references and pointers to const objects.
|
|
6644b9b blockchain_db: remove a couple unused functions (moneromooo-monero)
ce594f5 blockchain_db: allocate known size vector only once (moneromooo-monero)
8332698 db_lmdb: inline check_open, it's trivial and called everywhere (moneromooo-monero)
5511563 db_lmdb: avoid pointless division (moneromooo-monero)
d1efe3d cryptonote: set tx hash on newly parsed txes when known (moneromooo-monero)
9cc68a2 tx_pool: add a few std::move where it can make a difference (moneromooo-monero)
|
|
We know all the data we'll want for getblocks.bin is contiguous
|
|
a48f2dab blockchain_prune_known_spent_data: blackball file is now optional (moneromooo-monero)
17b45725 Outputs where all amounts are known spent can now be pruned (moneromooo-monero)
|
|
|
|
|
|
|
|
|
|
fc99f177 lmdb: fix gcc 7.3.0 'implicit-fallthrough' warning (xiphon)
|
|
bd98e99c Removed a lot of unnecessary includes (Martijn Otto)
|
|
Only for pre rct for obvious reasons.
Note: DO NOT use a known spent list which includes outputs
which are not known spent. If the list includes any output
that's just strongly thought to be spent, but not provably
so, you risk finding yourself unable to sync past the point
where that output is spent.
I estimate only 200 MB saved on current mainnet though,
unless the new blackballing rule unearths a good amount of
large-amount-set extra spent outs.
|
|
fc98f7a0 rpc: speedup get_outs.bin (moneromooo-monero)
|
|
|
|
dffec258 db_lmdb: error out if the db needs migration in read only mode (moneromooo-monero)
|
|
|
|
|
|
5808530f blockchain: remove unused output_scan_worker parameter (moneromooo-monero)
1426209a blockchain: don't run threads if we have just one function to run (moneromooo-monero)
6f7a5fd4 db_lmdb: slight speedup getting array data from the blockchain (moneromooo-monero)
99fbe100 db_lmdb: save some string copies for readonly db keys/values (moneromooo-monero)
bf31447e tx_pool: speed up take_tx for transactions from blocks (moneromooo-monero)
4f005a77 tx_pool: remove unnecessary get_transaction_hash (moneromooo-monero)
593ef598 perf_timer: call reserve on new timer array (moneromooo-monero)
6ecc99ad core: avoid unnecessary tx/blob conversions (moneromooo-monero)
00cc1a16 unit_tests: notify test special case for the usual weirdo (moneromooo-monero)
|
|
|
|
|
|
|
|
61304151 db_lmdb: use MDB_MULTIPLE_NEXT where possible for some speedup (moneromooo-monero)
|
|
ec301390 Update db_lmdb.cpp (Cactii1)
|
|
|
|
|
|
|
|
|
|
Coverity 136568
|
|
Should only stop the rtxn if we actually started it
Fixes Coverity 184960
|
|
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero)
3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero)
a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero)
1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero)
fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero)
2e2139ff epee: do not propagate exception through dtor (moneromooo-monero)
0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero)
1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero)
418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero)
ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero)
6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero)
53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero)
e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero)
661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero)
5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero)
7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero)
a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero)
d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero)
02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero)
c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
|
|
fe125647 Fixup RENAME_DB() macro (Howard Chu)
|
|
it's confusing and needlessly complicated
|
|
|
|
9d65399 is_hdd update (p8p)
|
|
d6fc870 db_lmdb: resize blockchain database when 90% filled (moneromooo-monero)
|
|
29dea03 epee: resize vectors where possible in serialization (moneromooo-monero)
76affd9 epee: some speedup in parsing (moneromooo-monero)
dc6c069 db_lmdb: speedup the get_output_distribution common case (moneromooo-monero)
76ac5a8 wallet2: ask for a binary output distribution, for speed (moneromooo-monero)
|
|
|
|
b278b83 core: sync database based on bytes added, not blocks added (moneromooo-monero)
|
|
43f7110 blockchain_db: remove unused get_output_key variant (moneromooo-monero)
|
|
|
|
be02eb9 db_lmdb: demote the 'batch already enabled' log, it's harmless (moneromooo-monero)
|
|
instead of a random ratio from 60% to 90%.
|
|
Blocks have a very wide range, whereas actual size is the relevant
quantity to consider when syncing
|
|
It was actually incorrect, as it would not return commitment
|
|
ee31383 db_lmdb: don't sync a read only DB (moneromooo-monero)
|
|
|
|
e5592c4 rpc: add blockchain disk size to getinfo (moneromooo-monero)
|
|
45e419b db: store cumulative rct output distribution in the db for speed (moneromooo-monero)
|
|
149da42 db_lmdb: enable batch transactions by default (stoffu)
34cb6b4 add --regtest and --fixed-difficulty for regression testing (vicsn)
9e1403e update get_info RPC and bump RPC version (vicsn)
207b66e first new functional tests (vicsn)
|
|
This gets rid of the temporary precalc cache.
Also make the RPC able to send data back in binary or JSON,
since there can be a lot of data
This bumps the LMDB database format to v3, with migration.
|
|
This would only throw
|
|
on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest.
Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain
Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'.
Queries hard fork heights info of other network types
|
|
2d10830 db_ldmb: print db version when complaining about incompatibility (moneromooo-monero)
|
|
d81e042 tx_pool: initialize bitflags padding since it gets written to storage (moneromooo-monero)
|
|
This should help new nodes predict how much disk space will be
needed for a full sync
|
|
|
|
|
|
|
|
Avoids valgrind reporting uninitialized data usage
|
|
740da1b core: fix automatic safe db sync mode switching (moneromooo-monero)
e942d34 protocol: do not switch to unsafe sync mode for just a few blocks (moneromooo-monero)
|
|
|
|
This bumps DB version to 2, migration code will run for v1 DBs
|
|
|
|
This skips the vast majority of "dust" output amounts with just
one instance on the chain. Clocks in at 0.15% of the original
time on testnet.
|
|
|
|
223d7d0c db_lmdb: fix free space reporting (moneromooo-monero)
|
|
|
|
reported by Brad Richards
|
|
|
|
e4646379 keccak: fix mdlen bounds sanity checking (moneromooo-monero)
2e3e90ac pass large parameters by const ref, not value (moneromooo-monero)
61defd89 blockchain: sanity check number of precomputed hash of hash blocks (moneromooo-monero)
9af6b2d1 ringct: fix infinite loop in unused h2b function (moneromooo-monero)
8cea8d0c simplewallet: double check a new multisig wallet is multisig (moneromooo-monero)
9b98a6ac threadpool: catch exceptions in dtor, to avoid terminate (moneromooo-monero)
24803ed9 blockchain_export: fix buffer overflow in exporter (moneromooo-monero)
f3f7da62 perf_timer: rewrite to make it clear there is no division by zero (moneromooo-monero)
c6ea3df0 performance_tests: remove add_arg call stray extra param (moneromooo-monero)
fa6b4566 fuzz_tests: fix an uninitialized var in setup (moneromooo-monero)
03887f11 keccak: fix sanity check bounds test (moneromooo-monero)
ad11db91 blockchain_db: initialize m_open in base class ctor (moneromooo-monero)
bece67f9 miner: restore std::cout precision after modification (moneromooo-monero)
1aabd14c db_lmdb: check hard fork info drop succeeded (moneromooo-monero)
|
|
84a8b2da Don't create readtxn until after txn_safe gate check (Howard Chu)
|
|
It's cleaner this way, since it's a base class field
Coverity 136568
|
|
Coverity 136364
|
|
|
|
|
|
ae860230 Fix exceptions not finding txpool txes when relaying (moneromooo-monero)
|
|
Reset thread-local info if it doesn't match the current env.
Only happens when a process opens/closes env multiple times in the
same process, doesn't affect monerod.
|
|
Reset thread-specific flags when a write txn is started.
Also remove some redundant start-readtxn code.
|
|
|
|
|
|
|
|
|
|
It could trip on a corrupt/crafted file if the user has disabled
input verification.
|
|
383ff4f6 remove "using namespace std" from headers (moneromooo-monero)
|
|
It's nasty, and actually breaks on Solaris, where if.h fails to
build due to:
struct map *if_memmap;
|
|
7c7d3672 Increase LMDB maxreaders if large number of threads in use (Howard Chu)
6738753b Use max_concurrency as-is (Howard Chu)
|
|
10013e94 Protect node privacy by proper filtering in restricted-mode RPC answers (binaryFate)
|
|
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.
|
|
Transactions in the txpool are marked when another transaction
is seen double spending one or more of its inputs.
This is then exposed wherever appropriate.
Note that being marked with this "double spend seen" flag does
NOT mean this transaction IS a double spend and will never be
mined: it just means that the network has seen at least another
transaction spending at least one of the same inputs, so care
should be taken to wait for a few confirmations before acting
upon that transaction (ie, mostly of use for merchants wanting
to accept unconfirmed transactions).
|
|
|
|
|
|
22b51e06 db_lmdb: include chain height when failing to find an output key (moneromooo-monero)
5db433b3 blockchain: avoid exceptions in output verification (moneromooo-monero)
|
|
To help debugging logs.
|
|
Level 1 logs map to INFO, so setting log level to 1 should
show these. Demote some stuff to DEBUG to avoid spam, though.
|
|
d2d8a41c Use actual batch size for resize estimates (Howard Chu)
|
|
|
|
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
|
|
c867357a cryptonote_protocol: error handling on cleanup_handle_incoming_blocks (moneromooo-monero)
ce901fcb Fix blockchain_import wedge on exception in cleanup_handle_incoming_blocks (moneromooo-monero)
84fa015e core: guard against exceptions in handle_incoming_{block,tx} (moneromooo-monero)
|
|
|
|
Avoids common depending on blockchain_db, which can cause
link errors.
|
|
c22d22e2 Cleanup test impact of adding safesyncmode() method (Howard Chu)
9a859844 Toggle SAFE syncmode on and off automatically (Howard Chu)
|
|
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.
|
|
Hide DB types from db_types.h - no reason to recompile dependencies
when DB types change.
Also remove lingering in-memory DB references, they've been
obsolete since 9e82b694da120708652871b55f639d1ef306a7ec
|
|
Hide LMDB-specific stuff behind blockchain_db.h. Nobody besides blockchain_db.cpp
should ever be including DB-specific headers any more.
|
|
Use to load the database when the primary meta page is corrupted
|
|
|
|
Avoids exception spam for the "nope, not found" case
|
|
Changed Blockchain::for_all_blocks() to for_blocks_range()
Operate on blockchain in-place instead of building a copy first.
|
|
4b932ff3 changed crypto to cncrypto so it generated libcncrypto (Gentian)
|
|
Integration could go further (ie, return_tx_to_pool calls should
not be needed anymore, possibly other things).
poolstate.bin is now obsolete.
|
|
fix a cmakelist
|
|
Don't allow use of existing batch txn if it's from the wrong thread
|
|
BlockchainDB functions virtual again to avoid missing symbols error
|
|
Cleanup of bf1348b7e2b2c72a6d40b23567afaa46b53e6cb7
|
|
should fix a cross dependency betewen cryptonote_basic and
blockchain_db
|
|
|
|
0288310e blockchain_db: add "raw" blobdata getters for block and transaction (moneromooo-monero)
|
|
cca95c1c blockchain_db: do not throw on expected partial results getting keys (moneromooo-monero)
|
|
|
|
Same reason as 3ff54bdd7a8b5e08e4e8ac17b7fff23ad3a82312
|
|
Slight perf gain, but mainly to reduce spam at loglevel 3
|