Commit graph

1196 commits

Author SHA1 Message Date
Riccardo Spagni
55305559c1
Merge pull request #5124
b8787f43 ArticMine's new block weight algorithm (moneromooo-monero)
2019-03-04 12:09:13 +02:00
moneromooo-monero
b8787f4302
ArticMine's new block weight algorithm
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-03-04 09:33:58 +00:00
cslashm
460da140ec New scheme key destination contrfol
Implies protocol version management.
2019-02-08 17:02:44 +01:00
Tom Smeding
fec359a641 cryptonote: Fix enum check in expand_transaction_2
This was noticed because GCC warned about using an enum value in a
boolean context.
2019-02-01 16:44:58 +01:00
Tom Smeding
9bf0e53751 cryptonote: Add const-qualifier on comparison functor
The original code did not compile with GCC 8.2.1 in C++17 mode, since
comparison functions for std::set's must be invocable as const.
2019-02-01 16:44:56 +01:00
moneromooo-monero
23813c7160
blockchain: add --reorg-notify
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-28 19:32:31 +00:00
moneromooo-monero
f6db59b011
notify: handle arbitrary tags 2019-01-28 19:32:28 +00:00
Riccardo Spagni
0daa00e035
Merge pull request #5052
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-28 21:24:55 +02:00
moneromooo-monero
eec792764d
blockchain: fix default genesis block timestamp 2019-01-26 21:39:00 +00:00
moneromooo-monero
f931e16c6e
add a bulletproof version, new bulletproof type, and rct config
This makes it easier to modify the bulletproof format
2019-01-22 23:17:24 +00:00
moneromooo-monero
b750fb27b0
Pruning
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-22 20:30:51 +00:00
Riccardo Spagni
4e72384318
Merge pull request #5008
c6d38718 core: include a dummy encrypted payment id when no payment is used (moneromooo-monero)
b7441c4a core, wallet: remember original text version of destination address (moneromooo-monero)
a9b1c04a crptonote_core: do not error out sending unparsable extra field (moneromooo-monero)
2019-01-18 19:12:58 +02:00
Riccardo Spagni
54eb3318e2
Merge pull request #5048
a67b77a9 blockchain: don't propagate exception past dtor (moneromooo-monero)
2019-01-18 19:00:47 +02:00
moneromooo-monero
c6d387184e
core: include a dummy encrypted payment id when no payment is used
For better transaction uniformity, even though this wastes space.
2019-01-18 16:58:50 +00:00
moneromooo-monero
b7441c4a32
core, wallet: remember original text version of destination address 2019-01-18 16:58:47 +00:00
moneromooo-monero
a9b1c04acf
crptonote_core: do not error out sending unparsable extra field
extra is arbitrary, and the user may well want to send custom data
2019-01-18 16:58:45 +00:00
Riccardo Spagni
dc726f4b3b
Merge pull request #5032
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-16 21:40:06 +02:00
Riccardo Spagni
a80978e699
Merge pull request #5015
6f2081f8 cryptonote_core: revert extra_tx_map (moneromooo-monero)
2019-01-16 21:32:14 +02:00
Riccardo Spagni
1f71bfc8d0
Merge pull request #4993
b8342dd5 blockchain: fix block rate check for empty blockchains (moneromooo-monero)
2019-01-16 19:07:55 +02:00
Riccardo Spagni
9d57ee9ff6
Merge pull request #4984
008647d7 blockchain_db: speedup tx output gathering (moneromooo-monero)
2019-01-16 19:06:07 +02:00
moneromooo-monero
a67b77a9eb
blockchain: don't propagate exception past dtor
Coverity 190660
2019-01-07 16:32:50 +00:00
moneromooo-monero
5ee6f03742
blockchain: fix wrong hf version when popping multiple blocks
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-01 18:28:01 +00:00
moneromooo-monero
634d359a84
blockchain: use the version passed as parameter, not a new one 2019-01-01 18:28:01 +00:00
luigi1111
69e8567c0e
Merge pull request #4946
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)
2018-12-31 16:06:50 -06:00
luigi1111
c7af379d29
Merge pull request #4940
9e64a71 blockchain: call deinit in dtor (moneromooo-monero)
2018-12-31 15:44:49 -06:00
luigi1111
6d3caaff70
Merge pull request #4928
affff94 blockchain: fix race between two external mining threads (moneromooo-monero)
2018-12-31 15:28:25 -06:00
moneromooo-monero
6f2081f867
cryptonote_core: revert extra_tx_map
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-25 15:19:41 +00:00
moneromooo-monero
b8342dd52c
blockchain: fix block rate check for empty blockchains 2018-12-18 18:47:54 +00:00
moneromooo-monero
008647d7eb
blockchain_db: speedup tx output gathering
We know all the data we'll want for getblocks.bin is contiguous
2018-12-18 11:55:21 +00:00
Riccardo Spagni
fe3c8c9682
Merge pull request #4923
aba9a9c2 daemon: stop miner before we bring the whole thing down (moneromooo-monero)
2018-12-12 12:00:37 +02:00
Riccardo Spagni
e19a205ff4
Merge pull request #4920
e98ae34e core: fix adding new pre-hoh block when a tx is already in the pool (moneromooo-monero)
2018-12-12 11:59:43 +02:00
Riccardo Spagni
83684ea515
Merge pull request #4909
756684bb blockchain: avoid unnecessary DB lookups when syncing (moneromooo-monero)
2018-12-12 11:59:25 +02:00
Riccardo Spagni
0fccc78e39
Merge pull request #4903
dc1c1252 add command pop_blocks (Jason Wong)
2018-12-12 11:58:37 +02:00
Riccardo Spagni
dde1e69723
Merge pull request #4787
3dba7f25 protocol: option to pad transaction relay to the next kB (moneromooo-monero)
2018-12-12 11:53:10 +02:00
moneromooo-monero
9cc68a2f74
tx_pool: add a few std::move where it can make a difference 2018-12-05 21:13:37 +00:00
moneromooo-monero
d1efe3d91c
cryptonote: set tx hash on newly parsed txes when known 2018-12-05 21:13:29 +00:00
moneromooo-monero
9e64a71e7d
blockchain: call deinit in dtor
This ensures the io service that runs in another thread cannot
access data after it's deleted
2018-12-05 00:13:28 +00:00
Riccardo Spagni
81418cb281
Merge pull request #4894
aee7a4e3 wallet_rpc_server: do not use RPC data if the call failed (moneromooo-monero)
1a0733e5 windows_service: fix memory leak (moneromooo-monero)
0dac3c64 unit_tests: do not rethrow a copy of an exception (moneromooo-monero)
5d9915ab cryptonote: fix get_unit for non default settings (moneromooo-monero)
d4f50cb1 remove some unused code (moneromooo-monero)
61163971 a few minor (but easy) performance tweaks (moneromooo-monero)
30023074 tests: slow_memmem now returns size_t (moneromooo-monero)
2018-12-04 17:33:19 +02:00
moneromooo-monero
ec1a62b50d
move int-util.h to epee 2018-12-04 15:14:29 +00:00
Riccardo Spagni
e7d30780de
Merge pull request #4869
60f36386 Avoid unnecessary temp block and copy ctor (moneromooo-monero)
2018-12-04 17:12:47 +02:00
Riccardo Spagni
c00ac446fd
Merge pull request #4854
bd98e99c Removed a lot of unnecessary includes (Martijn Otto)
2018-12-04 17:08:42 +02:00
moneromooo-monero
affff949f9
blockchain: fix race between two external mining threads 2018-12-02 13:08:41 +00:00
moneromooo-monero
aba9a9c277
daemon: stop miner before we bring the whole thing down
This avoids the miner erroring out trying to submit blocks
to a core that's already shut down (and avoids pegging
the CPU while we're busy shutting down).
2018-11-30 15:10:25 +00:00
Jason Wong
dc1c12528d add command pop_blocks
add new public method to Blockchain and update according to code review

update after review: better lock/unlock, try catch and coding style
2018-11-28 12:20:28 +01:00
moneromooo-monero
756684bb28
blockchain: avoid unnecessary DB lookups when syncing
Some of the inputs for block in a span will be from other earlier
blocks in that span. Keep track of those outputs so we don't have
to look them up again after those early blocks are added to the
blockchain.
2018-11-27 14:03:06 +00:00
moneromooo-monero
e98ae34e4b
core: fix adding new pre-hoh block when a tx is already in the pool 2018-11-26 23:45:01 +00:00
moneromooo-monero
fc98f7a0a1
rpc: speedup get_outs.bin 2018-11-26 18:56:23 +00:00
moneromooo-monero
d4f50cb109
remove some unused code
Found by codacy.com
2018-11-23 15:37:36 +00:00
moneromooo-monero
611639710d
a few minor (but easy) performance tweaks
Found by codacy.com
2018-11-23 15:36:48 +00:00
moneromooo-monero
60f36386e4
Avoid unnecessary temp block and copy ctor
block already has a default ctor, and the extra object
churn due to its innards (vectors, etc) is pointless.
2018-11-19 17:57:17 +00:00
moneromooo-monero
31d80027b5
tests: add unit tests for get_output_distribution 2018-11-16 19:21:45 +00:00
moneromooo-monero
0936dae8a4
blockchain: remove "0 is height" shortcut from get_output_distribution
This prevents asking for just 0, and the RPC layer already does this
2018-11-16 10:03:02 +00:00
moneromooo-monero
872c7eb26a
Revert "blockchain: simplify output distribution code"
This reverts commit b2bb9312a7.
2018-11-16 10:02:59 +00:00
Riccardo Spagni
c37c70f459
Merge pull request #4806
ac23b10f blockchain: fix innocuous difficulty cache inconsistency (moneromooo-monero)
3b14d972 blockchain: use uint64_t for block height, not size_t (moneromooo-monero)
2018-11-16 11:16:49 +02:00
Riccardo Spagni
9827958f5e
Merge pull request #4768
cf552c75 tx_pool: allow take_tx to work without m_txs_by_fee_and_receive_time (moneromooo-monero)
2018-11-16 10:59:25 +02:00
Riccardo Spagni
e90ee7548c
Merge pull request #4765
09dbd9cb tx_pool: fix comment about transaction_prefix (moneromooo-monero)
2018-11-16 10:58:42 +02:00
Martijn Otto
bd98e99c80
Removed a lot of unnecessary includes 2018-11-15 17:29:34 +01:00
Riccardo Spagni
0cc3fc3756
Merge pull request #4769
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)
2018-11-14 21:35:03 +02:00
Riccardo Spagni
299d75b209
Merge pull request #4735
73e504c1 rpc: adjust ring size error message now that too high is also possible (moneromooo-monero)
a5ca7f4f core: fix unmixable special case allowing ring size below 11 (moneromooo-monero)
2018-11-06 21:31:14 +02:00
moneromooo-monero
3dba7f252e
protocol: option to pad transaction relay to the next kB
To help protect one's privacy from traffic volume analysis
for people using Tor or I2P. This will really fly once we
relay txes on a timer rather than on demand, though.

Off by default for now since it's wasteful and doesn't bring
anything until I2P's in.
2018-11-06 15:47:05 +00:00
moneromooo-monero
ac23b10f15
blockchain: fix innocuous difficulty cache inconsistency
This inconsistent state would not actually be used in practice
2018-11-05 14:47:52 +00:00
moneromooo-monero
3b14d9727b
blockchain: use uint64_t for block height, not size_t
for consistency
2018-11-05 14:47:48 +00:00
xiphon
b3067962fa cryptonote_core: avoid gratuitous recalculations in check_block_rate() 2018-11-05 00:13:51 +00:00
Riccardo Spagni
adf4eb8d50
Merge pull request #4688
5a2e54a1 Fix prune using receive time as tx_weight (doy-lee)
2018-11-04 20:45:06 +02:00
Riccardo Spagni
5918ef93f8
Merge pull request #4683
3a85af40 core: fix handle_incoming_tx* comment about return value (moneromooo-monero)
2018-11-04 20:43:08 +02:00
moneromooo-monero
5808530f54
blockchain: remove unused output_scan_worker parameter 2018-11-04 13:23:05 +00:00
moneromooo-monero
1426209a10
blockchain: don't run threads if we have just one function to run 2018-11-04 13:23:02 +00:00
xiphon
233f00c601 cryptonote_core: fix build error gcc 5.4.0 'sign-compare' 2018-11-01 22:57:08 +00:00
moneromooo-monero
bf31447e9b
tx_pool: speed up take_tx for transactions from blocks
This happens for every historical tx when syncing, and the
unnecessary parsing is actually showing up on profile.
Since these are kept cached for just one block, this does
not increase memory usage after syncing.
2018-11-01 15:51:28 +00:00
moneromooo-monero
4f005a77c2
tx_pool: remove unnecessary get_transaction_hash 2018-11-01 15:51:24 +00:00
moneromooo-monero
6ecc99ad1f
core: avoid unnecessary tx/blob conversions 2018-11-01 15:51:19 +00:00
moneromooo-monero
cf552c752d
tx_pool: allow take_tx to work without m_txs_by_fee_and_receive_time
This should make it possible to have two daemons running on the
same database again.
2018-10-31 14:45:02 +00:00
moneromooo-monero
09dbd9cbbc
tx_pool: fix comment about transaction_prefix
It was leftover from a change that was undone before commit,
but the comment change was let through
2018-10-31 12:15:38 +00:00
moneromooo-monero
a5ca7f4fb5
core: fix unmixable special case allowing ring size below 11 2018-10-27 11:16:25 +00:00
Riccardo Spagni
056a58d13f
Merge pull request #4536
fd62b6e7 blocks: use auto-generated .c files instead of 'LD -r -b binary' (xiphon)
2018-10-26 22:20:39 +02:00
Riccardo Spagni
557c17e206
Merge pull request #4408
341b3931 cryptonote_core: warn when the block rate deviates from expectations (moneromooo-monero)
2018-10-26 22:18:41 +02:00
Riccardo Spagni
1c91963dcd
Merge pull request #4308
9907ea06 cryptonote: sort tx_extra fields (moneromooo-monero)
2018-10-26 22:18:28 +02:00
doy-lee
5a2e54a1cb Fix prune using receive time as tx_weight 2018-10-23 10:03:45 +11:00
xiphon
fd62b6e79f blocks: use auto-generated .c files instead of 'LD -r -b binary' 2018-10-22 01:12:00 +03:00
moneromooo-monero
3a85af403d
core: fix handle_incoming_tx* comment about return value 2018-10-21 17:09:21 +00:00
Riccardo Spagni
5c418c0522
Merge pull request #4522
a39c0358 blockchain: add check test options are given for fakechain mode (moneromooo-monero)
2018-10-20 20:40:16 +02:00
Riccardo Spagni
a38299801f
Merge pull request #4666
cf75ee72 blockchain: move two new verification errors to the verify category (moneromooo-monero)
2018-10-20 20:38:37 +02:00
Riccardo Spagni
93f2c13a39
Merge pull request #4637
c39e0a17 core: don't verify range proofs multiple times (moneromooo-monero)
2018-10-20 20:36:33 +02:00
moneromooo-monero
cf75ee722a
blockchain: move two new verification errors to the verify category
Lest we get people get scared again
2018-10-19 21:11:12 +00:00
stoffu
776aefdac1
tx_pool: revert #4592 and move bin2hex conversion to on_get_transaction_pool 2018-10-18 08:01:56 +09:00
moneromooo-monero
c39e0a1706
core: don't verify range proofs multiple times 2018-10-17 16:23:10 +00:00
Riccardo Spagni
c531df734f
Merge pull request #4389
6844ae1b tx_pool: avoid parsing a whole tx if only the prefix is needed (moneromooo-monero)
2018-10-15 13:36:15 +02:00
stoffu
a677492f1b
tx_pool: store hex string instead of raw binary to tx_blob of get_transaction_pool RPC
Inspired by https://github.com/masari-project/masari/issues/93
2018-10-15 11:57:02 +09:00
Riccardo Spagni
ac5674524a
Revert "Merge pull request #4472"
This reverts commit 79d46c4d55, reversing
changes made to c9fc61dbb5.
2018-10-08 21:39:54 +02:00
moneromooo-monero
a39c035846
blockchain: add check test options are given for fakechain mode
Coverity 188616
2018-10-08 11:37:58 +00:00
moneromooo-monero
6844ae1b8d
tx_pool: avoid parsing a whole tx if only the prefix is needed 2018-10-08 10:18:01 +00:00
moneromooo-monero
9907ea0694
cryptonote: sort tx_extra fields
This removes some small amount of fingerprinting entropy.
There is no consensus rule to require this since this field
is technically free form, and a transaction is free to have
custom data in it.
2018-10-07 11:13:22 +00:00
xiphon
02d3ef7bda blocks: use auto-generated .c files instead of 'LD -r -b binary' 2018-10-04 00:01:09 +00:00
Riccardo Spagni
d1d64327b6
Merge pull request #4476
fa9e54b6 build: fix gcc false positive 'stringop-overflow' warning (xiphon)
2018-10-02 22:38:32 +02:00
Riccardo Spagni
e2da7c7817
Merge pull request #4467
fa942ef6 daemon: silence daemon update warnings on testnet (iDunk5400)
2018-10-02 22:36:57 +02:00
xiphon
fa9e54b6ee build: fix gcc false positive 'stringop-overflow' warning 2018-09-30 10:58:00 +00:00
Riccardo Spagni
83d8f03c23
Merge pull request #4333
73403004 add --block-notify to monerod and --tx-notify to monero-wallet-{cli,rpc} (moneromooo-monero)
2018-09-29 22:20:44 +02:00
iDunk5400
fa942ef610
daemon: silence daemon update warnings on testnet 2018-09-29 14:42:10 +02:00
Riccardo Spagni
8bf5a00564
Merge pull request #4423
357441a2 add checkpoints for testnet and mainnet (Riccardo Spagni)
d9f666d7 update checkpoints.dat (Riccardo Spagni)
6b1b4e83 update version to 13.0 (Riccardo Spagni)
6f153533 update readme with v13.0 (Riccardo Spagni)
2018-09-25 13:33:52 +02:00
Riccardo Spagni
689758d691
Merge pull request #4435
c39ad0cd tx_pool: fix tx removal at startup keeping references (moneromooo-monero)
2018-09-25 13:11:05 +02:00