Alexander Block
d4cf78fe25
Add HasVotedOnId/GetVoteForId to CSigningManager
...
These just pass through to CRecoveredSigsDb
2019-03-08 17:57:53 +01:00
Alexander Block
43e1bf674e
Add key prefix to "rs_" for CRecoveredSigsDb keys
...
This avoids future conflicts with other data stored in llmqDb
2019-03-08 17:57:16 +01:00
Alexander Block
61e10f6512
Use llmqDb for CRecoveredSigsDb
...
Instead of creating its own CDBWrapper internally.
2019-03-08 17:34:09 +01:00
Alexander Block
b2cd1db406
Don't use CEvoDB in CDKGSessionManager and instead use llmqDb
...
Contributions are not part of on-chain consensus and shouldn't be stored in
CEvoDB.
2019-03-08 17:34:09 +01:00
Alexander Block
e2cad1bd69
Introduce global llmq::llmqDb instance of CDBWrapper
...
This DB is for LLMQ related data that is not part of on-chain consensus.
This for example included LLMQ secret key shares and recovered signatures.
2019-03-08 17:34:09 +01:00
Alexander Block
acb52f6ec1
Don't pass CEvoDB to CDKGSessionHandler and CDKGSession
...
Was never used.
2019-03-08 17:34:09 +01:00
Alexander Block
64ae91268a
Merge pull request #2735 from codablock/pr_llmq_instantsend
...
Implement LLMQ based InstantSend
2019-03-08 11:32:44 +01:00
PastaPastaPasta
9dd16cdbe7
Bump minChainWork and AssumeValid to block #1033120 ( #2750 )
2019-03-08 10:21:33 +03:00
Alexander Block
4d62f3c70e
Merge pull request #2746 from codablock/pr_v13_backport
...
[0.13.x] Backport multiple PRs from develop
2019-03-08 06:45:40 +01:00
Alexander Block
06fc655595
Actually remove from finalInstantSendLocks in CInstantSendManager::RemoveFinalISLock
2019-03-07 21:15:09 +01:00
Alexander Block
041a1c26d0
Move safe TX checks into TestForBlock and TestPackageTransactions
...
Otherwise we'll miss checks for ancestors.
2019-03-07 21:15:09 +01:00
Alexander Block
4d3365ddb2
Completely disable InstantSend while filling mempool in autoix-mempool.py
...
Otherwise we overload Travis and tests start to randomly fail.
2019-03-07 21:15:09 +01:00
Alexander Block
fae33e03ae
Let ProcessPendingReconstructedRecoveredSigs return void instead of bool
...
Return value is unused and the method actually never returned something.
2019-03-07 21:15:09 +01:00
Alexander Block
f8f867a6bb
Sync blocks after generating in mine_quorum()
2019-03-07 21:15:09 +01:00
Alexander Block
3e60d2d2db
Adjust LLMQ based InstantSend tests for new spork20
2019-03-07 21:15:09 +01:00
UdjinM6
41a71fe443
update autoix-mempool.py to test both "old" and "new" InstantSend (and fix CheckCanLock to respect mempool limits)
2019-03-07 21:15:09 +01:00
UdjinM6
843b6d7a95
update p2p-autoinstantsend.py to test both "old" and "new" InstantSend
2019-03-07 21:15:09 +01:00
UdjinM6
a8da11ac5d
update p2p-instantsend.py to test both "old" and "new" InstantSend
2019-03-07 21:15:09 +01:00
UdjinM6
55152cb313
Move IS block filtering into ConnectBlock
2019-03-07 21:15:09 +01:00
Alexander Block
2299ee2836
Rename IXLOCK to ISLOCK and InstantX to InstantSend
2019-03-07 21:15:09 +01:00
Alexander Block
f5dcb00acf
Introduce spork SPORK_20_INSTANTSEND_LLMQ_BASED to switch between new/old system
2019-03-07 21:15:09 +01:00
Alexander Block
280690792a
Combine loops in CChainLocksHandler::NewPoWValidBlock
2019-03-07 21:15:09 +01:00
Alexander Block
9e9081110b
Add override keywork to CDSNotificationInterface::NotifyChainLock
2019-03-07 21:15:09 +01:00
Alexander Block
e2f99f4ae1
Set llmqForInstantSend for mainnet and testnet
2019-03-07 21:15:09 +01:00
Alexander Block
5b8344e8f8
Use scheduleFromNow instead of schedule+boost::chrono
2019-03-07 21:15:09 +01:00
Alexander Block
f44f09ca04
Fix crash in BlockAssembler::addPackageTxs
2019-03-07 21:15:09 +01:00
Alexander Block
baf8b81c4a
Fix no-wallet build
2019-03-07 21:15:09 +01:00
Alexander Block
2a7a5c6338
Only sign ChainLocks when all included TXs are "safe"
...
Safe means that the TX is either ixlocked or known since at least 10
minutes.
Also change miner code to only include safe TXs in block templates.
2019-03-07 21:15:09 +01:00
Alexander Block
96291e7a0f
Cheaper/Faster bailout from TrySignChainTip when already signed before
2019-03-07 21:15:09 +01:00
Alexander Block
0a5e8eb862
Move ChainLock signing into TrySignChainTip and call it periodically
...
Later commits will introduce checks for "safe TXs" which might abort the
signing on first try, but succeed a few seconds later, so we periodically
retry to sign the tip.
2019-03-07 21:15:09 +01:00
Alexander Block
bd7edc8ae9
Track txids of new blocks and first-seen time of TXs in CChainLocksHandler
2019-03-07 21:15:09 +01:00
Alexander Block
7945192ff6
Enforce IX locks from the new system
2019-03-07 21:15:09 +01:00
Alexander Block
dc97835ec6
Disable explicit lock requests when the new IX system is active
2019-03-07 21:15:09 +01:00
Alexander Block
68cfdc9325
Also call ProcessTx from sendrawtransaction and RelayWalletTransaction
2019-03-07 21:15:09 +01:00
Alexander Block
1d2d370cd0
Whenever we check for locked TXs, also check for the new system having a lock
2019-03-07 21:15:09 +01:00
Alexander Block
3a6cc2cc17
Show "verified via LLMQ based InstantSend" in GUI TX status
2019-03-07 21:14:31 +01:00
Alexander Block
34a8b2997a
Disable old IX code when the new system is active
2019-03-07 21:14:31 +01:00
Alexander Block
5ff4db0a05
Downgrade TXLOCKREQUEST to TX when new IX system is active
...
The new system does not require explicit lock requests, so we downgrade
TXLOCKREQUEST to TX and start propagating it instead of the original.
2019-03-07 21:14:31 +01:00
Alexander Block
1959f3e4a5
Handle incoming TXs by calling CInstantXManager::ProcessTx
...
This also includes handling of TXs that were previously orphanced
2019-03-07 21:14:31 +01:00
Alexander Block
83dbcc483f
Implement CInstantSendManager and related P2P messages
2019-03-07 21:14:31 +01:00
Alexander Block
5bbc122749
Implement PushReconstructedRecoveredSig in CSigningManager
...
We can reconstruct recovered sigs from other P2P messages to avoid
re-validation of those. We will do this later in InstantSend code.
2019-03-07 21:14:31 +01:00
Alexander Block
2bbac8ff77
Introduce NotifyChainLock signal and invoke it when CLSIGs get processed
2019-03-07 21:14:31 +01:00
Alexander Block
6374dce99e
Fix error message for invalid voting addresses ( #2747 )
2019-03-07 18:49:26 +01:00
UdjinM6
e47af29d41
Fix "chainlock" in WalletTxToJSON ( #2748 )
...
* Fix "chainlock" in WalletTxToJSON
* Add `AssertLockHeld(cs_main); // for mapBlockIndex`
* move assert higher
2019-03-07 16:29:37 +03:00
Alexander Block
e21d8d6b95
Fix error message for invalid voting addresses ( #2747 )
2019-03-07 16:29:24 +03:00
Alexander Block
25222b3786
Make -masternodeblsprivkey mandatory when -masternode is given ( #2745 )
2019-03-07 07:01:53 +01:00
Alexander Block
0364e033a7
Implement 2-stage commit for CEvoDB to avoid inconsistencies after crashes ( #2744 )
...
* Let Commit() return void
The boolean return value will loose its meaning in the next commit
* Implement 2-stage commits for CDBTransaction and CScopedDBTransaction
CDBTransaction is changed to allow CDBBatch, CDBWrapper and other
CDBTransactions as parent instead of just CDBWrapper. This in turn allows
to implement multi-staged commits in CEvoDB.
We now have the "current transaction" which is started and ended (commit
or rollback) for each call to Connect-/DisconnectBlock. When the current
transaction is committed, it moves its contents into the "root transaction"
instead of directly writing to CDBWrapper.
CommitRootTransaction() then handles the final commitment to CDBWrapper. It
is called at the same time when the chainstate is flushed to disk, which
guarantees consistency between chainstate and CEvoDB.
* Allow to efficiently move values into parent transactions to avoid copies
When CDBTransaction<CDBTransaction<...>>::Commit() is called, we can avoid
copying values from this transaction to the parent transaction and instead
pass values by rvalue and let the contents be moved.
* Revert "Force FlushStateToDisk on ConnectTip/DisconnectTip while not in IBD (#2560 )"
This reverts commit 6dfceaba5a
.
2019-03-07 07:01:53 +01:00
UdjinM6
a11e2f9eba
Add collateraladdress into masternode/protx list rpc output ( #2740 )
2019-03-07 07:01:53 +01:00
Alexander Block
43612a2720
Only include selected TX types into CMerkleBlock ( #2737 )
...
It was reported on iOS that CMerkleBlock sometimes included the dummy
quorum commitments introduced with v13, which led to banning of nodes as
these were not supported/expected there.
We should in general only include TXs here that are of interest for SPV
nodes, so we should maintain the list of allowed TX types.
2019-03-07 06:56:05 +01:00
Alexander Block
f868fbc787
Stop g_connman first before deleting it ( #2734 )
2019-03-07 06:56:05 +01:00