Commit Graph

15489 Commits

Author SHA1 Message Date
Kittywhiskers Van Gogh
24a58c3934 merge bitcoin#18775: Add fuzzing harnesses for various classes/functions in policy/ (CBlockPolicyEstimator, IsRBFOptIn(…), etc.) 2022-08-23 21:31:20 +05:30
Kittywhiskers Van Gogh
5b0b206853 merge bitcoin#19296: Add fuzzing harness for AES{CBC,}256{Encrypt,Decrypt}, poly1305_auth, CHKDF_HMAC_SHA256_L32, ChaCha20 and ChaCha20Poly1305AEAD 2022-08-21 18:09:28 +05:30
Kittywhiskers Van Gogh
50b6c2af4c merge bitcoin#19379: Add fuzzing harness for SigHasLowR(...) and ecdsa_signature_parse_der_lax(...) 2022-08-21 18:09:28 +05:30
Kittywhiskers Van Gogh
208ca5bd7e merge bitcoin#18736: Add fuzzing harnesses for various classes/functions in util/ 2022-08-21 18:09:25 +05:30
UdjinM6
af085cd528
fix: Allow triggers with p2sh after DIP0024 (#4973) 2022-08-17 16:45:04 +03:00
PastaPastaPasta
8773a21b30
chore: enable DIP0024 hard fork on mainnet (#4968) 2022-08-13 23:25:53 +03:00
UdjinM6
3ac0b4884a
fix(llmq): Drop quorum members cache on undo (#4964)
This should help with v18 migration for nodes that failed to update in time. Still have to invalidate/reconsider the pre-fork quorum cycle start block to recalculate quorum members but it's better than having to reindex the whole chain.
2022-08-13 11:10:32 -05:00
PastaPastaPasta
f83d857e36
Merge pull request #4478 from kittywhiskers/undashify
revert #3036, #2911, #1879, #1432: revert dashification of filenames
2022-08-11 12:34:55 -04:00
UdjinM6
7072ab491d
fix: make linter happy (4926+4952 follow-up) (#4965) 2022-08-11 11:18:49 +03:00
PastaPastaPasta
afbc817220
refactor/chore: update cppcheck to 2.8 with needed refactoring (#4926)
* refactor/chore: update cppcheck to 2.8 with needed refactoring

* use probably invalid index for default

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* trivial: rename skContributions -> m_sk_contributions and skContributions2 -> skContributions

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-11 02:05:44 +03:00
Konstantin Akimov
137c4fc84c
Update hard coded seeds for v18.0.0-rc12 (#4953)
Mainnet: 1716101
    Testnet: 774784
2022-08-11 01:57:13 +03:00
UdjinM6
b30d50d835
translations: Add final v18 updates for ar, de and zh_CN (#4962)
NOTE: these files were made by running `./contrib/devtools/update-translations.py` on v18.x branch
2022-08-11 01:56:17 +03:00
PastaPastaPasta
91047566a8
chore: bump ChainTxData for mainnet and testnet (#4961)
mainnet
```
getchaintxstats
{
  "time": 1660074878,
  "txcount": 43702293,
  "window_final_block_hash": "0000000000000002ee5a0d2caa3f78cd630ece1a12ce74f7a8146eb6689b1b66",
  "window_final_block_height": 1718597,
  "window_block_count": 17280,
  "window_tx_count": 476084,
  "window_interval": 2724994,
  "txrate": 0.174710109453452
}
```

testnet
```
> dash-cli getblockhash 771537
0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f
> dash-cli getchaintxstats 17280 0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f
{
  "time": 1659215338,
  "txcount": 5579961,
  "window_final_block_hash": "0000028ce7bc90ddaa75703bbe576b8821e470b4b98bbe13be81eb79546e111f",
  "window_final_block_height": 771537,
  "window_block_count": 17280,
  "window_tx_count": 43514,
  "window_interval": 2428572,
  "txrate": 0.01791752519587642
}
```
2022-08-11 01:55:59 +03:00
PastaPastaPasta
8a4b9c66a9
chore: bump nMinimumChainWork, defaultAssumeValid and m_assumed_blockchain_size for mainnet and testnet (#4960)
* chore: bump nMinimumChainWork and defaultAssumeValid for mainnet and testnet

* chore: bump m_assumed_blockchain_size for mainnet and testnet
2022-08-11 01:55:33 +03:00
Kittywhiskers Van Gogh
fc18536053 trivial: revert dashification of header guards 2022-08-09 14:16:29 +05:30
Kittywhiskers Van Gogh
887b4324d3 trivial: revert dashification of source and header filenames 2022-08-09 14:16:29 +05:30
Kittywhiskers Van Gogh
f02085e988 revert dash#1432: Rename consensus source library and API
It's a shared library, so we should keep its name and API 
distinguishable from Bitcoin's and avoid pkgconfig confusion

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-09 14:16:28 +05:30
Kittywhiskers Van Gogh
c587212f8c partial revert dash#2911: s/dash-config/bitcoin-config/g 2022-08-09 14:16:28 +05:30
Kittywhiskers Van Gogh
ece4e1ee87 partial revert dash#3036: s/libbitcoin/libdash/g 2022-08-09 14:16:28 +05:30
UdjinM6
d47af2c4bf
feat/fix: ScanQuorums improvements (#4945)
* feat: Revive quorum scan caching

* refactor: split quorumsCacheCs mutex into two

* fix: Avoid extra work in quorum scanning

Non-rotation quorums do not become rotation ones (anymore), use `useRotation` to pick the right method only. This brings CPU load for `d-isman` thread (while being idle) from ~5% down to ~1% on testnet for me.

* apply suggestions
2022-08-08 19:09:21 +03:00
UdjinM6
63d9c6abf7
fix: 4946 follow-up (#4957) 2022-08-08 19:06:10 +03:00
Konstantin Akimov
ae051bb6e0
Merge #17260: Split some CWallet functions into new LegacyScriptPubKeyMan (#4938)
* Move wallet enums to walletutil.h

* MOVEONLY: Move key handling code out of wallet to keyman file

Start moving wallet and ismine code to scriptpubkeyman.h, scriptpubkeyman.cpp

The easiest way to review this commit is to run:

   git log -p -n1 --color-moved=dimmed_zebra

And check that everything is a move (other than includes and copyrights comments).

This commit is move-only and doesn't change code or affect behavior.

* Refactor: Split up CWallet and LegacyScriptPubKeyMan and classes

This moves CWallet members and methods dealing with keys to a new
LegacyScriptPubKeyMan class, and updates calling code to reference the new
class instead of CWallet.

Most of the changes are simple text replacements and variable substitutions
easily verified with:

    git log -p -n1 -U0 --word-diff-regex=.

The only nontrivial chunk of code added is the new LegacyScriptPubKeyMan class
declaration, but this code isn't new and is just selectively copied and moved
from the previous CWallet class declaration. This can be verified with:

    git log -p -n1 --color-moved=dimmed_zebra src/wallet/scriptpubkeyman.h src/wallet/wallet.h

or

    git diff HEAD~1:src/wallet/wallet.h HEAD:src/wallet/scriptpubkeyman.h

This commit does not change behavior.

* Renamed classes in scriptpubkeyman

* Fixes for conflicts, compilation and linkage errors due to previous commits

* Reordered methods in scriptpubkeyman to make further backports easier

* Reordered methods in scriptpubkeyman to make further backports easier (part II)

* Remove HDChain copy from SigningProvider class

* fixes/suggestions

Co-authored-by: Andrew Chow <achow101-github@achow101.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-08 11:05:21 -05:00
UdjinM6
8882a7377e
feat: Avoid starting useless DKG threads on regular non-watching nodes (#4946)
* refactor: Initialize masternode mode related variables and objects earlier

* feat: Avoid starting useless DKG threads on regular nodes
2022-08-06 11:50:11 +03:00
UdjinM6
bdfa322f1f
fix: Restore caching in CalcCbTxMerkleRootMNList (#4951) 2022-08-06 11:45:02 +03:00
UdjinM6
abcc14b51e
feat: Implement caching in CalcCbTxMerkleRootQuorums (#4952) 2022-08-06 11:44:21 +03:00
Konstantin Akimov
7b9f0acbdd
fix: resolve some memory leaks (#4939)
- In wallet/rpcdump memory the leak would happen, if wallet is not correct JSON
 - In BLS the leak would happen, if object hasn't been pushed in queue by some reason. Need to remove temporary object also
2022-08-05 12:13:42 -05:00
UdjinM6
0835e4c307
fix(rpc): Fix off-by-1 in protx diff (#4950) 2022-08-05 11:35:46 +03:00
Kittywhiskers Van Gogh
bb7d6aed99
refactor(llmq): substitute memberless class llmq::CLLMQUtils with namespace llmq::utils (#4931)
* refactor(llmq): substitute memberless class llmq::CLLMQUtils with namespace llmq::utils

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* chore: mark functions internal to `llmq::utils` as `static`

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-08-02 12:14:25 -05:00
UdjinM6
39bf079f54
fix(llmq): Calculate quorum members while not debugging llmq
¯\_(ツ)_/¯
2022-07-27 23:34:29 +03:00
Odysseas Gabrielides
6041e25722
fix!: Fix on QuorumDataRequests and refactoring (#4937)
* qdata typo fixes and refactoring

* code style fix

* Add LOCK2 back

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-07-26 15:31:03 -05:00
UdjinM6
e9500f597a
fix(llmq): use keepOldConnections (#4932)
We must scan/cache keepOldConnections quorums or we won't be able to process sig shares signed in the 8 blocks window (signig offset) once new quorum(s) are mined.
2022-07-26 00:39:04 +03:00
UdjinM6
5a5278d398
fix/test: Count MN connections properly, add more tests for getnetworkinfo (#4928)
* fix: Count MN connections properly

* tests: check extended connections info returned via getnetworkinfo
2022-07-26 00:38:07 +03:00
UdjinM6
17b15efd61
fix(dkg/net): Drop outdated connections to nodes that became masternodes recently (#4934)
* feat: switch nTimeFirstMessageReceived from microseconds to seconds

Was acting more like a bool until now, so nothing should change really. Align it with nTimeConnected.

* fix(dkg/net): Drop outdated connections to nodes that became masternodes recently

Such nodes won't be seen as masternodes by RelayInvToParticipants otherwise so no contributions will be sent to them when they are picked as relay members which in its turn may result in other nodes PoSe-punishing us.
2022-07-26 00:36:17 +03:00
UdjinM6
1f161e520d
fix: Handle quorum watch connections correctly (#4933)
We add them via EnsureQuorumConnections+ThreadOpenMasternodeConnections so they are clearly masternode connections and they are dropped regularly which is annoying. But also, we don't want every masternode connection to be a qwatch one, we want only the ones we added via that algo.
2022-07-26 00:35:45 +03:00
Odysseas Gabrielides
5dbf375d31
Store QuorumDataRequests per {ProTx, quorumHash, llmqType} (#4935) 2022-07-26 00:34:33 +03:00
PastaPastaPasta
4bdb9ac95d
refactor(llmq): misc refactors (#4922)
* refactor: remove c-style casts

* refactor: avoid logging initialization when not needed

* refactor: require ';' after LogPrintfFinalCommitment

* refactor: prefer lambda to std::bind

* refactor: explicit nullptr comparison

* refactor: compress a lock and set

* refactor: don't use else after return

* refactor: more const

* refactor: avoid implicit bool conversions

* refactor: add more const

* refactor: use structured binding

* refactor: compact lambda into inline

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>

* move scheduler_thread to initialization list

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-07-18 23:55:47 +03:00
UdjinM6
666859b47f
feat(llmq): Ensure connections between IS quorums (#4917)
* fix(llmq): Ensure connections between quorums

Every masternode will now "watch" a single node from _every other_ quorum in addition to intra-quorum connections. This should make propagation of recsigs produced by one quorum to other quorums much more reliable.

* fix: Do this only for masternodes which participate in IS quorums

* refactor: rename `CQuorumManager::EnsureQuorumConnections` to better match the actual behaviour

(and avoid confusion with `CLLMQUtils::EnsureQuorumConnections`)

* refactor: move IS quorums watch logic into `CQuorumManager::CheckQuorumConnections`

avoid calling slow `ScanQuorums` (no caching atm) inside the loop

* tests: check that inter-quorum connections are added

* use `ranges::any_of`
2022-07-18 22:26:51 +03:00
UdjinM6
0d67aa1915
fix: Pass KeyOriginInfo instead of CKeyMetadata to DeriveChildExtKey (#4918)
Resolves "hdchain -> wallet/walletdb -> ... -> hdchain" circular dependencies
2022-07-18 16:56:33 +03:00
Kittywhiskers Van Gogh
38781fc114 merge bitcoin#17989: Add one specialized ProcessMessage(...) fuzzing binary per message type for optimal results when using coverage-guided fuzzing 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
141c6e2920 merge bitcoin#19934: Add fuzzing harness for Keccak and SHA3_256 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
e17767ccf1 merge bitcoin#19286: Add fuzzing harness for CHash{160,256}, C{HMAC_,}SHA{1,256,512}, CRIPEMD160, CSipHasher, etc. 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
bf04694e73 merge bitcoin#18393: Don't assume presence of __builtin_mul_overflow in MultiplicationOverflow(...) fuzzing harness 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
b50f00a2d5 merge bitcoin#18190: Add fuzzing harness for Golomb-Rice coding (GolombRiceEncode/GolombRiceDecode) 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
93d3c26063 merge bitcoin#18363: Add fuzzing harness for HTTPRequest, libevent's evhttp and related functions 2022-07-15 21:24:21 +05:30
Kittywhiskers Van Gogh
01367c944e fix(fuzz): statically cast to consistent type to account for type similarity
AdditionOverflow is a template function that expects both inputs to explicitly be of the same type
2022-07-15 21:24:20 +05:30
Kittywhiskers Van Gogh
eb2fa81288 partial bitcoin#19143: Add fuzzing harnesses for CAutoFile, CBufferedFile, LoadExternalBlockFile and other FILE* consumers 2022-07-15 21:23:01 +05:30
Kittywhiskers Van Gogh
da690542f4 merge bitcoin#19222: Add fuzzing harness for BanMan 2022-07-15 21:09:53 +05:30
Kittywhiskers Van Gogh
cd9b83c15e merge bitcoin#19247: Add fuzzing harness for {Read,Write}{LE,BE}{16,32,64} 2022-07-15 21:09:53 +05:30
Kittywhiskers Van Gogh
a7109d8724 partial bitcoin#18314: Add deserialization fuzzing of SnapshotMetadata (utxo_snapshot). Increase fuzzing coverage 2022-07-15 21:09:53 +05:30
Kittywhiskers Van Gogh
0d5a7929ac partial bitcoin#18047: Add basic fuzzing harness for CNetAddr/CService/CSubNet related functions (netaddress.h) 2022-07-15 21:09:53 +05:30