* Print hash of block which conflicts with a ChainLock
* Allow specifying custom block status in `AddToBlockIndex`
* Add blocks (headers) to block index even if they conflict with chainlocks
Applies to CInstantSendManager and CChainLocksHandler. This fixes extremely
high RAM usage on reindex and resync, which happens to many/all transactions
being kept track of non-locked TXs (nonLockedTxs) and TXs per
block (blockTxs).
* Bump nMinimumChainWork and defaultAssumeValid for mainnet
Signed-off-by: Pasta <Pasta@dash.org>
add back 0x
Signed-off-by: Pasta <Pasta@dash.org>
* Bump nMinimumChainWork and defaultAssumeValid for testnet
Signed-off-by: Pasta <Pasta@dash.org>
add back 0x 2nd time
Signed-off-by: Pasta <Pasta@dash.org>
* Add a checkpoint for 0.14
Signed-off-by: Pasta <Pasta@dash.org>
* add testnet checkpoint 0.14
Signed-off-by: Pasta <Pasta@dash.org>
* update mainnet ChainTxData
Signed-off-by: Pasta <Pasta@dash.org>
formatting fix mainnet chaintxdata
Signed-off-by: Pasta <Pasta@dash.org>
update mainnet ChainTxData to specific block
Signed-off-by: Pasta <Pasta@dash.org>
* update testnet chainTxData
Signed-off-by: Pasta <Pasta@dash.org>
update testnet ChainTxData to specific block
Signed-off-by: Pasta <Pasta@dash.org>
* Store rs_t key time in big endian
Also implement ConvertInvalidTimeKeys to convert old entries. We can remove
this later when we know that most MNs have run this code on testnet.
The way we stored the time field in the past lead to CleanupOldRecoveredSigs
iterating the keys in a strange order, causing no deletion at all and the
LLMQ DB filling up.
* Write batch in CleanupOldRecoveredSigs when it gets too large
This avoids RAM filling up and OOM getting triggered.
* Keep track of when a vote was written to the DB and clean up after week
Instead of only deleting when the corresponding recovered sig is deleted.
It sometimes happens that a masternode votes on something but a recovered
sig is never created, which leaves us with a vote that will never be
deleted.
* Apply suggestions from code review
Co-Authored-By: PastaPastaPasta <pasta@dashboost.org>
* Fall back to ReadBlockFromDisk when blockTxs is not filled yet
This handles the case where a MN is freshly started and SyncTransaction
was not been called for older transactions/blocks.
* Also update txFirstSeenTime
* Properly handle txids == nullptr
And for llmq5_60, set it to 3 instead of 24 (which was incorrect from the
beginning).
Increasing all LLMQs "keepOldConnections" by one is required because we
don't use the tip when scanning active quorums, but a block that is 8 blocks
in the past. This however means that we need to keep connections for one
additional quorum alive.
This fixes an issue with signing sessions randomly failing with timeouts.
* Print inputs on which we voted
Also print the corresponding requestId. This makes debugging InstantSend
issues easier.
* Print quorum hash when signing a share
* Remove unused nodesByAddress map in CSigSharesManager::SendMessages
Not related to this PR, but a simple cleanup that should have no
side effects.
* Allow modifying simulate DKG error rates via RPC
* Don't lie to yourself :)
* Add some missing new-lines in LogPrintf calls
* More fine grained control over which messages to expect in mine_quorum
* Implement llmq-dkgerrors.py integration tests
These test DKG errors and malicious behavior.
* Move code to write archived ISLOCKs into its own method
We'll need this from another method as well later.
* Return ISLOCK instead of conflicting txid in GetConflictingTx/GetConflictingLock
* Implement GetInstantSendLocksByParent and RemoveChainedInstantSendLocks
These allow to easily delete multiple chains (actually trees) of ISLOCKs
in one go.
* Implement RemoveConflictedTx and call it from RemoveMempoolConflictsForLock
Also add "retryChildren" parameter to RemoveNonLockedTx so that we can
skip retrying of non-locked children TXs.
* Properly handle/remove conflicted TXs (between mempool and new blocks)
* Track non-locked TXs by inputs
* Implement and call ResolveBlockConflicts
* Also call ResolveBlockConflicts from ConnectBlock
But only when a block is known to have a conflict and at the same time is
ChainLocked, which causes the ISLOCK to be pruned.
* Split out RemoveChainLockConflictingLock from ResolveBlockConflicts
* Implement "quorum getrecsig" RPC
* Include decoded TX data in result of create_raw_tx
* Implement support for CLSIG in mininode.py
* Fix condition for update of nonLockedTxs.pindexMined
* Only add entries to nonLockedTxsByInputs when AddNonLockedTx is called for the first time
* Implement support for ISLOCK in mininode.py
* Implement tests for ChainLock vs InstantSend lock conflict resolution
* Handle review comment
Bail out (continue) early
* Also test conflicts in mempool instead of only in blocks
* Ask for locked TXs after removing conflicting TXs
When we removed a conflicting TX from the mempool, the correct/locked TX
is not available locally as the first-seen rule would have filtered before.
We need to re-request this TX if any other node announced it before.
* Apply suggestions from code review
Co-Authored-By: codablock <ablock84@gmail.com>
* Remove code for QDEBUGSTATUS propagation
This turned out to be too expensive and could easily take the network
down by bringing all nodes to 100% CPU usage. Better to fully remove this
functionality.
* Apply suggestions from code review
Co-Authored-By: codablock <ablock84@gmail.com>
* Update src/rpc/rpcquorums.cpp
Co-Authored-By: codablock <ablock84@gmail.com>
* Be more accurate with denom creation/consumption
- Calculate and pass an actual balance needed to be denominated to CreateDenominated.
- Drop GetNeedsToBeAnonymizedBalance and fix corresponding conditions: do not overshoot, do not check max pool amount - these conditions are handled outside.
- Properly calculate various balance limits.
- Handle edge case for the final denom.
* Add an option to control max number of denoms created and respect it
`-privatesenddenoms`, default is 300
Note: CreateDenominated failure is not an error anymore
* Add few more stats to log in DoAutomaticDenominating
* Trivial: vout->txout
* Re-use SetHexStr in few more places
* Tweak log output
* fix v13 release notes links
* Drop no longer used stuff
* Few more trivial fixes
* Adjust few rpc help strings
* Apply review suggestions
unordered_limitedmap was meant to be used with much larger
nPruneAfterSizeIn values to maintain good performance. The way it is not
will result in pruning too often on high load.
* Harden DIP3 activation height
Also drop all related but no longer used parts.
* Pass current block index to GetCommitmentsFromBlock
* Allow to change dip3 activation height for tests
And fix them.
* Report `instantlock: true` for transactions locked via ChainLocks
Also introduce `instantlock_internal` to show the actual lock state.
* Always show instantlock_internal
* Ensure wallet is available and unlocked for specific governance rpc commands
* Ensure wallet is available and unlocked for specific protx rpc commands
Do this in actual rpc command handlers, not in the top protx rpc
* Fix few pwalletMain occurrences in rpc
This allows AlreadyHave to check if an announced (via INV) islock was
already known in the past. This avoids requesting islocks which got
obsolete due to ChainLocks.
Observed on testnet that MNs tend to re-request the same objects multiple
times when load becomes high, which results in the same objects being
received multiple times.
* Track which TXs are not locked yet and use this info in ProcessPendingRetryLockTxs
Instead of relying on ReadBlockFromDisk. This should be less disk+CPU
intensive but require more RAM.
It also fixes a bug in ProcessPendingRetryLockTxs which caused ChainLocked
parents to not be considered for retrying of its children.
* Handle review commments
* Don't disconnect peers on MNAUTH verification failure
Only give them a DoS score.
* Re-add cs_main lock
Co-Authored-By: codablock <ablock84@gmail.com>
generate() will push INV messages to all nodes, including our test_node.
The original check_last_announcement() call done here will then
sporadically return Fals when the INV message is received shortly after
clear_last_announcement()
Solution is to check for the INV announcement first and then continue with
the test.