Commit Graph

447 Commits

Author SHA1 Message Date
moneromooo-monero
cc618f2fe4 blockchain: fix off by one brought by the regtest mode fix 2019-03-04 09:31:06 +00:00
moneromooo-monero
49896e5c63 blockchain: fix long term block weight for regtest mode 2019-02-27 19:49:11 +00:00
Riccardo Spagni
392f0858c6 update quick sync checkpoints and hash 2019-02-20 18:17:07 +02:00
moneromooo-monero
395eb9217a blockchain: remove buggy long term block weight cache
It seems to be buggy on reorgs, and prevents the use of
a blockchain with two nodes.
We'll speed this up again if/when the need arises.
2019-02-19 15:21:57 +00:00
moneromooo-monero
0c0f6034c0 blockchain: fix block template creation race
If two create_block_template are called at nearly the same time,
and a block is added at nearly the same time, this could happen:

- the blockchain top block is B0
- thread 1 enters create_block_template, takes blockchain lock
- thread 1 creates a fresh block referencing prev block B0
- thread 1 releases blockchain lock
- thread 0 adds a new block
- thread 0 enters create_block_template
- thread 0 updates block template
- thread 1 takes txpool lock and continues creating block template
- thread 1 overwrites block template with previous data
2019-02-18 15:43:08 +00:00
moneromooo-monero
1d62855044 blockchain: fix long term weight addition on pop/init 2019-02-18 12:46:32 +00:00
moneromooo-monero
7aa0cc58e2 blockchain: fix m_long_term_block_weight_height initialization
Also check return of that function, it can now return error
2019-02-15 13:01:56 +00:00
moneromooo-monero
bd7f82515b blockchain: forbid older BP rct versions from v11 2019-02-15 10:20:23 +00:00
moneromooo-monero
f9d820ada1 Fix v3/v4 db conversion 2019-02-15 01:21:37 +00:00
moneromooo-monero
0b0fb709c3 Build fixes for some platforms 2019-02-14 19:25:58 +00:00
moneromooo-monero
3ac3366a6e blockchain: add v10 fork heights 2019-02-14 14:56:19 +00:00
Tom Smeding
041af9545f 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-14 14:44:03 +00:00
moneromooo-monero
f7f6760052 add a bulletproof version, new bulletproof type, and rct config
This makes it easier to modify the bulletproof format
2019-02-12 12:16:40 +00:00
moneromooo-monero
b84b350fd4 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-02-12 12:16:30 +00:00
moneromooo-monero
4a7917ef6b blockchain: fix block rate check for empty blockchains 2019-02-12 12:16:25 +00:00
moneromooo-monero
db1e0a5323 core: fix unmixable special case allowing ring size below 11 2019-02-12 12:16:17 +00:00
moneromooo-monero
66772f1235 blockchain: include number of discarded blocks in --reorg-notify 2019-02-12 12:16:13 +00:00
moneromooo-monero
7d2f817f5e 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-02-12 12:16:04 +00:00
moneromooo-monero
1168e8d5d5 cryptonote_core: warn when the block rate deviates from expectations
The warning threshold is set to allow a false positive every
ten days on average.
2019-02-12 12:16:02 +00:00
moneromooo-monero
842a5d8bbe notify: handle arbitrary tags 2019-02-12 12:15:59 +00:00
moneromooo-monero
ebc60a098d 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.
2019-02-12 12:15:54 +00:00
moneromooo-monero
14515ef230 blockchain: move two new verification errors to the verify category
Lest we get people get scared again
2018-10-19 21:11:31 +00:00
Riccardo Spagni
f5df0e272e Revert "Merge pull request #4472"
This reverts commit b26ab0b580.
2018-10-08 21:42:38 +02:00
Riccardo Spagni
b26ab0b580 Merge pull request #4472
02d3ef7b blocks: use auto-generated .c files instead of 'LD -r -b binary' (xiphon)
2018-10-06 11:15:43 +02:00
Riccardo Spagni
4701a78ad1 Merge pull request #4467
fa942ef6 daemon: silence daemon update warnings on testnet (iDunk5400)
2018-10-02 22:45:45 +02:00
moneromooo-monero
7340300460 add --block-notify to monerod and --tx-notify to monero-wallet-{cli,rpc}
Those take a command line of the form "A [B]", with A being the
name (and optional path, if not in the caller's CWD, but fully
qualified path is recommended, avoids possible security issues)
to a program, and optional arguments. Any occurence of the two
character string "%s" will be replaced by the hash of the block
or transaction which triggered the notification.

Tokenization is barebones. If you want things like pipes, calls
to paths with spaces, etc, then use a script (though exec time
will suffer).

block-notify is called when a new block is added onto the chain.

tx-notify is called when a new transaction happens with the
wallet as source and/or destination.

It is the notification program's responsibility to determine what
to do in those cases.

Note that this is asynchronous, so it is very possible that:
- the notification programs will be run out of order
- several events happen before the notification for the first one

A Windows port would be nice if someone wants to make one.
2018-09-29 08:44:18 +00: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
moneromooo-monero
50981c40ce blockchain: add stagenet v8 and v9, two weeks before mainnet 2018-09-24 20:43:39 +00:00
Riccardo Spagni
d9f666d78c update checkpoints.dat 2018-09-23 09:51:15 +02:00
Riccardo Spagni
d6893aedf6 Merge pull request #4369
b2bb9312 blockchain: simplify output distribution code (moneromooo-monero)
befdcbf4 db_lmdb: do not use base for cumulative distribution (moneromooo-monero)
2018-09-21 20:31:21 +02:00
Riccardo Spagni
22a6591a70 Merge pull request #4325
4e1e9a60 blockchain: add mainnet v8 height targetting 18 october (moneromooo-monero)
2018-09-18 17:39:16 +02:00
moneromooo-monero
be001326d1 remove obsolete daemon selection of fake outs and old tx construction 2018-09-14 10:51:45 +00:00
moneromooo-monero
b2bb9312a7 blockchain: simplify output distribution code 2018-09-12 19:20:16 +00:00
moneromooo-monero
9137ad2c63 blockchain: add a testnet v9 a day after v8
So that bulletproofs become mandatory
2018-09-11 13:38:36 +00:00
moneromooo-monero
5ffb2ff9b7 v8: per byte fee, pad bulletproofs, fixed 11 ring size 2018-09-11 13:38:07 +00:00
moneromooo-monero
2a8fcb421b Bulletproof aggregated verification and tests
Also constrains bulletproofs to simple rct, for simplicity
2018-09-11 13:37:37 +00:00
moneromooo-monero
bacf0a1e2f bulletproofs: add aggregated verification
Ported from sarang's java code
2018-09-11 13:37:32 +00:00
moneromooo-monero
9ce9f8caf6 bulletproofs: add multi output bulletproofs to rct 2018-09-11 13:37:28 +00:00
moneromooo-monero
4e1e9a607e blockchain: add mainnet v8 height targetting 18 october
and v9 a day later
2018-09-02 16:02:17 +00:00
luigi1111
ec6982f8eb Merge pull request #4240
83f5587 blockchain: use uint64_t for height, not size_t (moneromooo-monero)
2018-08-22 20:58:55 -05:00
luigi1111
4a4ea78ecd Merge pull request #4204
b278b83 core: sync database based on bytes added, not blocks added (moneromooo-monero)
2018-08-22 20:43:51 -05:00
moneromooo-monero
82d1b74500 core: cache block template where possible
This avoids constant rechecking of the same things each time
a miner asks for the block template. The tx pool maintains
a cookie to allow users to detect when the pool state changed,
which means the block template needs rebuilding.
2018-08-16 12:44:33 +00:00
luigi1111
fd3b71129b Merge pull request #4164
8e24533 blockchain: some batch tx scanning speedup (moneromooo-monero)
2018-08-15 17:31:24 -05:00
moneromooo-monero
b278b83860 core: sync database based on bytes added, not blocks added
Blocks have a very wide range, whereas actual size is the relevant
quantity to consider when syncing
2018-08-12 16:13:46 +00:00
moneromooo-monero
83f5587167 blockchain: use uint64_t for height, not size_t 2018-08-09 17:09:26 +00:00
luigi1111
dda05f357a Merge pull request #4108
8c05237 blockchain: cache next block difficulty after adding a block (moneromooo-monero)
2018-07-27 14:26:01 -05:00
moneromooo-monero
8e24533a7f blockchain: some batch tx scanning speedup 2018-07-21 12:05:12 +01:00
luigi1111
61eea83978 Merge pull request #4081
d95bc44 blockchain: fix getting invalid block data on failure (moneromooo-monero)
2018-07-19 14:12:30 -05:00
luigi1111
9474567d76 Merge pull request #4076
aa0ea0a blockchain: set the m_verifivation_failed flag in a couple more places (moneromooo-monero)
2018-07-19 14:11:24 -05:00
luigi1111
21afa71ba6 Merge pull request #3981
45e419b db: store cumulative rct output distribution in the db for speed (moneromooo-monero)
2018-07-19 13:39:24 -05:00