Commit Graph

15346 Commits

Author SHA1 Message Date
UdjinM6
262454791c
Add 5th denom, drop deprecated logic and bump min PS version (#2318)
* Bump PS
- add 5th denom (0.001)
- always allow OP_RETURN in PS collaterals
- collateral amount is always 1/10 of the smallest denom
- bump MIN_PRIVATESEND_PEER_PROTO_VERSION to 70211

* drop backward compatibility in dsa/dsq serialization

* Use GetSmallestDenomination() in GetCollateralAmount()

* bump MIN_PRIVATESEND_PEER_PROTO_VERSION to 70212
2018-11-07 10:39:25 +03:00
UdjinM6
e961c71343
Translations 201811 (#2249)
* update en source

* remove pt_BR

it's no longer present on Transifex

* Update existing translations

NOTE: there are some mismatches in zh_CN

dash_zh_CN.ts: Mismatch between 'Start &all' and '启动全部(%A)'
dash_zh_CN.ts: Mismatch between 'Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.' and '打开当前目录中的调试日志文件。日志文件大的话可能要等上几秒钟。'
dash_zh_CN.ts: Mismatch between 'Too many %f denominations, removing.' and '太多面额化资金,正在移除。'
dash_zh_CN.ts: Mismatch between 'Initialization sanity check failed. %s is shutting down.' and '初始化完整性检查失败。% 即将关闭。'

* Add ar, ko, th

NOTE: there are 2 mismatches in ar

dash_ar.ts: Mismatch between '(of %1 GB needed)' and '(على 1% جيغابايت محتاجة)'
dash_ar.ts: Mismatch between 'Output debugging information (default: %u, supplying <category> is optional)' and 'معلومات تصحيح الخرج  <category>ا(ختياري)'

* update bg, it, ja, ko, nl, pl, th

* fix ru

* add tr

* fix
2018-11-07 10:39:06 +03:00
PastaPastaPasta
f0df5bffa6 Clang evo folder and activemasternode.* (#2418)
* clang + manual formatting

* clang activemasternode.*

* bump copyright

* weirdness correction
2018-11-06 11:54:23 +03:00
PastaPastaPasta
98bdf35f9d bump PS copyright (#2417) 2018-11-05 12:29:33 +03:00
PastaPastaPasta
e9bb822c10 Clang format PrivateSend files (#2373) 2018-11-05 12:29:07 +03:00
UdjinM6
1d56dffdaf
Unify help display logic for various "complex" rpc commands (#2415)
* Unify help display logic for various "complex" rpc commands

* add [[ noreturn ]] attribute and drop dummy returns
2018-11-05 12:28:38 +03:00
UdjinM6
bea590958b
Fix auto-IS tests (#2414)
* no `-debug` by default (it's too heavy)

* drop useless `sync_masternodes` calls and add a couple where they could be actually usefull

* change autoix-mempool.py test logic:
1. use separate nodes to send test txes
2. sync nodes while filling the mempool
2018-11-05 12:28:04 +03:00
Alexander Block
9da9d575aa Allow collaterals for non-DIP3 MNs which were created after DIP3/BIP9 activation (#2412)
* Remove reference to now removed "protocolVersion"

* Allow to use non-DIP3 collaterals after DIP3 activation

This removes a rule which only made sense when we assumed all collaterals
would remain in DIP3 ProRegTx transactions after DIP3 activation.

As we allow to refer external collaterals now, this rule should vanish as
well.

* Sleep in case block time is ahead of real time

See comment. This was not a problem before as we had enough time passed
between the last block that caused this and the start-alias call.
Now we added another start-alias call which is directly after we generated
many blocks.
2018-11-04 14:55:50 +03:00
strophy
f03629d6d9 Explicitly specify which branch of Wine to install (#2411)
Specifying only `wine` results in this message under Ubuntu Bionic:

Package wine is a virtual package provided by:
  wine-stable 3.0-1ubuntu1
  wine-development 3.6-1
You should explicitly select one to install.

Compilation
2018-11-04 14:55:32 +03:00
UdjinM6
23f169c44a
Drop custom PS logic for guessing fees etc. from SelectCoins (#2371)
* drop most of custom PS logic from SelectCoins and inject it into regular flow (i.e. SelectCoinsMinConf)

* different priority for different denoms

* move CompareByPriority higher

* update comment

Co-Authored-By: UdjinM6 <udjinm6@gmail.com>
2018-11-04 14:55:16 +03:00
thephez
02442673d2 Trivial: Correct protx diff RPC help (#2410) 2018-11-02 11:18:05 +03:00
Alexander Block
5e829a3b1b Update Chia bls-signature to latest version (#2409)
Brings in:
1. https://github.com/Chia-Network/bls-signatures/pull/41
2. https://github.com/Chia-Network/bls-signatures/pull/46
3. A few commits from https://github.com/codablock/bls-signatures are now
   merged into upstream.

This removes the need for manual initialization of the BLS library. This is
now done internally and in a thread-safe way.

Also switch to using tags instead of raw commit hashes. Makes testing
easier and also removes the risk of Github deleting commits due to
cleanup jobs.
2018-11-02 00:59:11 +03:00
UdjinM6
51addf9a03
Fix p2p-instantsend.py test (#2408) 2018-11-02 00:58:57 +03:00
thephez
1f56600c4b Trivial: Protx operator reward clarification (#2407)
Add decimal places to clarify:
1. Non-integers are valid (e.g. 3.25)
2. Granularity - anything beyond x.xx is rounded (e.g. 3.259 -> 3.26)

This is due to DIP3 allowing values 0-10000 for operator reward (1/10000
= 0.01%)
2018-11-02 00:58:36 +03:00
UdjinM6
7e8f07bb92
A couple of fixes for shutdown sequence (#2406)
* Do not run scheduled DoMaintenance if shutdown was requested

* Don't dump cache files if the load sequence was interrupted

* Stop privatesend and release keys before wallet flush

* fix typo
2018-11-02 00:58:17 +03:00
UdjinM6
9c455caea9
A couple of fixes for init steps (#2405)
* fLiteMode should be set via GetBoolArg before first usage

Also move related stuff to be closer to each other

* Cleanup Dash-specific init steps

* Move deterministicMNManager creation slightly higher for consistensy
2018-11-02 00:58:01 +03:00
thephez
7011fec1b4 RPC: Add help details for the bls RPC (#2403)
* RPC: Add help details for the bls RPC

* RPC: Refactor to match gobject RPC behavior

* RPC: Use command instead of strCommand for consistency within file

* RPC: BLS help cleanup

* RCP: Remove leading underscore on bls_help
2018-11-02 00:57:43 +03:00
Alexander Block
30a2b283a8 Sign ProRegTx collaterals with a string message instead of payload hash, split protx register into prepare/submit (#2395) 2018-11-02 00:57:10 +03:00
Alexander Block
6560ac64b3
Properly escape $ in Jenkinsfile.gitian (#2404) 2018-11-01 07:41:16 +01:00
Alexander Block
70eb710b12
Undefine DOUBLE after include Chia BLS headers (#2400)
These cause compilation errors on some platforms.
Observed this when I tried to cross compile win32
locally on a Debian Stretch machine.
2018-10-31 10:58:02 +01:00
Alexander Block
052af81b4b
Ensure correct order of destruction for BLS secure allocator (#2401)
Uses the same trick as LockedPoolManager::Instance()
2018-10-31 10:57:14 +01:00
UdjinM6
c8804ea5a9
Do not ignore patches in depends (#2399) 2018-10-30 13:00:37 +03:00
UdjinM6
13f2eb4498
Force fvisibility=hidden when compiling on macos (#2398)
This should remove tons of warnings about mismatching visibility
2018-10-30 13:00:21 +03:00
UdjinM6
c6cf4d9a47
Relay txes through MN network faster than through regular nodes (#2397)
* Half the delay for relaying txes to Masternode outbound peers comparing to regular ones

* No delay for relaying txes if our node is a Masternode
2018-10-30 13:00:04 +03:00
UdjinM6
4a78b161ff
PrivateSend spending txes should have "outgoing" icon on overview screen (#2396) 2018-10-30 12:59:50 +03:00
Anton Suprunchuk
50f133ad0a Add merkle tree and coinbase transaction to the protx diff rpc command (#2392) 2018-10-30 12:59:32 +03:00
Alexander Block
e34701295d Fix crash when deterministic MN list is empty and keep paying superblocks in this case (#2387)
* Don't crash when spork15 is enabled but no MNs have been registered

* Don't bail out when no masternode payee is found

We should pay superblocks even if no masternode payee is found.

* Add missing newline to LogPrint call

* Handle review comments
2018-10-30 12:59:03 +03:00
Alexander Block
9eb9c99d59 Bump version to 0.13.0 (#2386) 2018-10-26 19:43:08 +03:00
Alexander Block
28a6007a40 Prepare DIP3 for testnet and reuse DIP3 deployment for autoix deployment (#2389)
* Add BIP9 parameters for DIP3 deployment on testnet

* Remove autoix BIP9 deployment and reuse DIP3 deployment

* Add BIP9CheckMasternodesUpgraded to chain params

This controls if miners should check for upgraded masternodes first before
adding BIP9 bits to the block version. This only makes sense in network
where masternodes are up and running before BIP9 activation, which is not
necessarely the case in regtest and devnet.

Also refactor ComputeBlockVersion to use fCheckMasternodesUpgraded instead
of the inverse fAssumeMasternodeIsUpgraded. It is set to false by default
and only set to true in CreateNewBlock.

* Check for upgraded masternodes for DIP3 activation (only mainnet and testnet)

* Bump PROTOCOL_VERSION and DMN_PROTO_VERSION

We probably have nodes with 70211 already running on testnet.
2018-10-26 19:42:52 +03:00
Alexander Block
e66c4e184f Don't revert to INV based block announcements when the previous block is the devnet genesis block (#2388)
Assume that the other node already has the previous block if it matches
the devnet genesis block.
2018-10-26 19:42:28 +03:00
Alexander Block
b5142ee2ce Implement RemoveAskFor to indicate that we're not interested in an item anymore (#2384)
* Implement RemoveAskFor to indicate that we're not interested in an item anymore

When an INV item is received from the first node, the item is requested
immediately. If the same item is received from another node, an entry is
added to mapAskFor which marks the item for re-requesting in case the first
node did not respond. When the item is received from the first node,
the item was previously never removed from mapAskFor. Only the later getdata
loop in SendMessages would then gradually remove items from the map. This
is quite delayed however as the entries in mapAskFor have a timeout value.

RemoveAskFor allows to remove all entries from mapAskFor and setAskFor
when we are not interested in the item anymore (e.g. because we received
it already).

* Call RemoveAskFor whenever we receive a message

* Only pass hash instead of CInv object to RemoveAskFor
2018-10-26 19:42:11 +03:00
Alexander Block
8f9b004cab Support "fast" mode when calling sync_masternodes (#2383)
This will call "mnsync next" multiple times to force finishing of mnsync.
Also reduce sleep time to 200ms.
2018-10-26 19:41:40 +03:00
Alexander Block
fcea333ba8
Rewrite handling of too long depends builds in .travis.yml (#2385)
The old solution was unnecessarily complicated and resulted in failed tests
to be shown as successful (the exit code was ignored).
2018-10-26 12:15:43 +02:00
Alexander Block
d1debfc267
Implement mt_pooled_secure_allocator and use it for BLS secure allocation (#2375)
* Add pooled_secure_allocator and mt_pooled_secure_allocator

* Use mt_pooled_secure_allocator for BLS secure allocation

The old solution relied on thread-local-storage and was thus not compatible
to libc6 2.11 (which is the minimum supported version we use).

Also, the old solution turned out to be erroneous. It would have crashed
or memory leaked when ownership of CBLSPrivateKey would be handled over
to another thread.

* Add new header files to Makefile.am

* Fix copyright headers of new files

* Bail out early from secure deallocation

* Clean up global BLS keys when shutting down
2018-10-26 07:04:22 +02:00
UdjinM6
0692de1c58 Fix prepare_masternodes/create_masternodes in DashTestFramework (#2382)
Specify masternodeblsprivkey which is required in masternode mode now.
This should fix IS test failures which occur because of `Warning: You should specify a masternodeblsprivkey in the configuration. Please see documentation for help.` init error (there are other issues, so auto-IS test are still going to fail).
2018-10-26 07:03:48 +02:00
Alexander Block
733cd95123
Remove global fDIP0003ActiveAtTip and fix wrong use of VersionBitsState in auto IX (#2380)
* Remove global fDIP0003ActiveAtTip flag and always use VersionBitsState

fDIP0003ActiveAtTip was used much more often when introduced but turned out
to be not very useful in most places. Always use VersionBitsState now.

* Fix wrong use of VersionBitsState auto IX

* Make sure isAutoLockBip9Active flag is reset in case of chain reorgs
2018-10-26 07:03:33 +02:00
Alexander Block
25b6dae9ea
Code style and RPC help string cleanups for DIP2/DIP3 (#2379)
* Fix code style in DIP2/DIP3 code (single statement ifs with curly braces)

* Fix DIP3 RPC help strings

* Handle review comments

* Handle more review comments
2018-10-26 07:03:14 +02:00
PastaPastaPasta
6433a944a0 [Trivial] typo Groupped -> Grouped (#2374) 2018-10-25 17:32:08 +03:00
PastaPastaPasta
59932401bb Change internal references of Darksend to PrivateSend (#2372)
* Change all references to darksend to privatesend

* comment references to darksend
2018-10-25 17:31:32 +03:00
Alexander Block
e3df910822 Allow referencing other TX outputs for ProRegTx collateral (#2366)
* Pass CCoinsView reference to special TX handling methods

* Allow referencing other TX outputs for ProRegTx collateral

* Remove "collateralAmount" from "protx register"

* Rename "protx register" to "protx fund_register"

* Remove UpdateSpork15Value from CDeterministicMNManager

Was not used/implemented anymore

* Lock masternode collaterals after chain/DIP3 is fully initialized

Otherwise detection of collaterals does not work.

* Implement new "protx register" RPC which uses existing collaterals

* Remove "masternode info" RPC

It is not consistent with other "masternode" RPCs anymore as it requires
the ProRegTx hash while all other RPCs work with the collateral.

* Load sporks from disk cache before initializing the chain

Otherwise spork15 is not loaded when we check it for the first time.

* Implement "protx info" RPC

* Use "protx info" instead of "masternode info" in DIP3 tests

* Test external collaterals for ProTx

* Handle review comments

* Don't pass CCoinView reference when it's not used

* Revert "Pass CCoinsView reference to special TX handling methods"

This reverts commit 28688724e1.

* Use GetUTXOCoin instead of now removed coinsView

Also remove collateral height check as GetUTXOCoin only returns confirmed
coins.

* Add conflict handling for external collaterals to mempool

* Handle review comments (squashed Github suggestions)

Co-Authored-By: codablock <ablock84@gmail.com>
2018-10-25 17:29:50 +03:00
thephez
0ad2906c54 Clarify addlocked description in getbalance RPC (#2364)
* Trivial - Typo in getbalance RPC

* Clarify addlocked description in getbalance RPC

Co-Authored-By: thephez <thephez@gmail.com>
2018-10-25 17:29:00 +03:00
Alexander Block
e3046adb3e
Clear devNetParams and mimic behavior of other param types (#2367)
* Clear devNetParams and mimic behavior of other param types

Mainnet, testnet and regtest params are global and thus zero initialized,
we should mimic the same for devnet params.

Not doing so results in all kinds of issues on devnet.

* Remove unnecessary <string.h> includein chainparamsbase.cpp
2018-10-25 09:17:37 +02:00
thephez
fdfb077428 Update ProRegTx serialization order (#2378)
Makes consistent with both DIP-3 and the order above
2018-10-25 09:17:02 +02:00
Alexander Block
1c25356ff8
Allow to use low difficulty and higher block rewards for devnet (#2369)
* Allow to use low difficulty and higher block rewards for devnet

Configurable through -minimumdifficultyblocks, -highsubsidyblocks and -highsubsidyfactor

* Fix review comments

* Handle review comments
2018-10-25 09:16:38 +02:00
Alexander Block
de426e962a
Give tail calls enough time to print errors (#2376) 2018-10-25 09:16:13 +02:00
Alexander Block
0402240a2e
Bump CMAKE_CXX_STANDARD to 14 in CMakeLists.txt (#2377)
We still don't really use this file (it won't even work), but it's good
to have CLion not brable about unknown stuff all the time.
2018-10-25 09:15:49 +02:00
Alexander Block
53e12b7b40
Don't bail out from ProcessMasternodeConnections in regtest (#2368)
We actually do masternode testing now and we will rely on this behavior
2018-10-24 13:31:45 +02:00
Alexander Block
3c9237aa40
Use VersionBitsState instead of VersionBitsTipState to avoid cs_main lock (#2370)
It wasn't even locked, which causes AssertLockHeld to fail.
2018-10-24 13:31:22 +02:00
PastaPastaPasta
c4351fd328 revert 737, DEFAULT_TRANSACTION_MAXFEE = 0.1 * COIN (#2362) 2018-10-23 14:16:17 +03:00
Alexander Block
eaa856eb78 Remove nProtocolVersion and add mode/type fields to DIP3 (#2358)
* Remove nProtocolVersion fields from deterministic masternode lists

This field was part of my initial implementation from DIP3. One of the last
changes of DIP3 was then to remove this field, which I did not bring back
into code yet. This commit removes it now.

We use PROTOCOL_VERSION now in cases were compatibility in the the pre-DIP3
list is needed.

* Add type and mode fields in DIP3 special TXs

These were added to DIP3 but not in-code yet.

* Add DMN_PROTO_VERSION
2018-10-23 14:15:38 +03:00