Commit Graph

234 Commits

Author SHA1 Message Date
Kittywhiskers Van Gogh
a014cf3703
refactor: trim and document assumptions for Get*MN* and friends 2024-11-14 10:08:05 +00:00
UdjinM6
c32fac079f
refactor: more CGovernanceVote cleanups 2024-11-04 17:27:00 +03:00
UdjinM6
6370c7a9e5
refactor: Tidy up CGovernanceVote a bit 2024-11-01 23:22:06 +03:00
UdjinM6
ae675d5314
refactor: Drop redundant SplitBy 2024-11-01 22:50:37 +03:00
Kittywhiskers Van Gogh
5fb2cc8bb6
merge bitcoin#23137: move-only bloom to src/common
excludes:
- fac303c5 (`MakeUCharSpan` is reintroduced by bitcoin#23438, a part of
  dash#5574)
2024-10-25 21:36:52 +00:00
Kittywhiskers Van Gogh
20d15056f1
merge bitcoin#22951: move amount.h into consensus 2024-10-25 16:00:12 +00:00
Konstantin Akimov
502d6ae8ef
fix: add multiple missing annotation about locks for dash specific code 2024-10-12 20:06:23 +07:00
pasta
f93c763ac6
Merge #6318: refactor: remove circular dependency governance/object over governance/classes
2e36832982 refactor: drop circular dependency governance/classes over governance/governance (Konstantin Akimov)
39f18ab154 refactor: move CGoveranceManager code from classes.cpp to governace.cpp (Konstantin Akimov)
350a5ca47c refactor: drop CSuperblock::GetGovernanceObject to simplify thread safety analysis over FindGovernanceObject (Konstantin Akimov)
5031f29441 refactor: add couple missing `const` for CGovernanceManager (Konstantin Akimov)
b240d08e09 refactor: move GetBestSuperblock to CGovernanceManager (Konstantin Akimov)
3641653174 refactor: move CSuperblockManager::IsValid to CGoveranceManager::IsValidSuperblock (Konstantin Akimov)
de8969f463 refactor: move ExecuteBestSuperblock to CGovernanceManager (Konstantin Akimov)
107d5b4941 refactor: move GetSuperblockPayments to CGovernanceManager (Konstantin Akimov)
7a470c441e refactor: move IsSuperblockTriggered to CGovernanceManager (Konstantin Akimov)
9638fdce6d refactor: pass mn_sync to CGovernanceManager ctor as a reference (UdjinM6)
7eb1634686 refactor: drop alias that is used only once (Konstantin Akimov)
1570a02c89 refactor: move ScopedLockBool from header to cpp file (Konstantin Akimov)
7aafb5a393 fix: add one more file to list of non-backported (flat-database.h) (Konstantin Akimov)
41f1a43236 fix: add missing const for member functions of CRateCheckBuffer (Konstantin Akimov)
982fc9a069 fix: avoid lock annotation for govman.cs in voteraw (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  This PR is preparation for bitcoin#19668, otherwise impossible to make lock annotations for CGovernanceManager properly.

  ## What was done?
  1. object mn_sync and peerman is pass to many methods of CGovernanceManager instead passing it to constructor.
  2. methods of class CSuperblockManager moved to CGovernanceManager where they belongs to.
  3. removed `CSuperblock::GetGovernanceObject` which makes a lot of mess with annotations of `govman.cs`

  And minor relevant improvements: moved ScopedLockBool from header to implementation, added multiple `const` for methods, added one more file `flat-database.h` to non-backported list

  ## How Has This Been Tested?
  Run unit and functional tests.

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    utACK 2e36832982
  PastaPastaPasta:
    utACK 2e36832982

Tree-SHA512: 59842c208f7ece46c9381fc3f9fc838d9ed1cf0fd2404eebf7fbd656c5df1fa5fd339410da83088089e2d954a017efb518cba290f6c5d45b5bcb91818041f931
2024-10-08 17:12:24 -05:00
Konstantin Akimov
2e36832982
refactor: drop circular dependency governance/classes over governance/governance 2024-10-09 00:13:15 +07:00
Konstantin Akimov
39f18ab154
refactor: move CGoveranceManager code from classes.cpp to governace.cpp
There's only code move, no changes. For review use `git show --color-moved=dimmed-zebra`
2024-10-09 00:13:15 +07:00
Konstantin Akimov
350a5ca47c
refactor: drop CSuperblock::GetGovernanceObject to simplify thread safety analysis over FindGovernanceObject 2024-10-09 00:13:15 +07:00
Konstantin Akimov
5031f29441
refactor: add couple missing const for CGovernanceManager 2024-10-09 00:13:14 +07:00
Konstantin Akimov
b240d08e09
refactor: move GetBestSuperblock to CGovernanceManager 2024-10-09 00:13:14 +07:00
Konstantin Akimov
3641653174
refactor: move CSuperblockManager::IsValid to CGoveranceManager::IsValidSuperblock 2024-10-09 00:13:13 +07:00
Konstantin Akimov
de8969f463
refactor: move ExecuteBestSuperblock to CGovernanceManager 2024-10-09 00:13:13 +07:00
Konstantin Akimov
107d5b4941
refactor: move GetSuperblockPayments to CGovernanceManager 2024-10-09 00:13:13 +07:00
Konstantin Akimov
7a470c441e
refactor: move IsSuperblockTriggered to CGovernanceManager 2024-10-09 00:13:12 +07:00
UdjinM6
9638fdce6d
refactor: pass mn_sync to CGovernanceManager ctor as a reference 2024-10-09 00:13:12 +07:00
pasta
8598a3fbb8
Merge #6312: chore: Update copyrights and copyright_header.py script
7d1fc66d91 chore: run `contrib/devtools/copyright_header.py update .` (UdjinM6)
c2acde0f9b chore: update copyright_header.py and BitPay copyright strings (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  A little bit of housekeeping

  ## What was done?

  ## How Has This Been Tested?

  ## Breaking Changes

  ## Checklist:
  - [ ] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK 7d1fc66d91

Tree-SHA512: f62a15139d10d10c155deef70c218d8dd14bfe3648703c4af39c299fa56537c806e84bccb7e99159633dea02d6d145b64990874d6114cfecf2a4467c7ab2cd6d
2024-10-07 15:29:29 -05:00
Konstantin Akimov
7eb1634686
refactor: drop alias that is used only once 2024-10-07 13:48:15 +07:00
Konstantin Akimov
1570a02c89
refactor: move ScopedLockBool from header to cpp file 2024-10-07 13:48:12 +07:00
Konstantin Akimov
41f1a43236
fix: add missing const for member functions of CRateCheckBuffer 2024-10-07 13:46:30 +07:00
UdjinM6
7d1fc66d91
chore: run contrib/devtools/copyright_header.py update . 2024-10-05 23:17:41 +03:00
Kittywhiskers Van Gogh
145d94d700
merge bitcoin#23636: Remove GetAdjustedTime from init.cpp 2024-10-05 17:10:03 +00:00
Konstantin Akimov
09565fe6cc
refactor: new type of message processing result for resolving circular dependency over PeerManager 2024-10-03 16:30:45 +07:00
pasta
6d426515a5
Merge #6225: feat: bury v20 fork - fire up test chains by first block - 4/n
23812555b1 fix: possible deadlock during calculation of signals for historical blocks during re-index (Konstantin Akimov)
1087489fd4 feat: bury v20 deployment (Konstantin Akimov)
64cedb30bd feat: actually test something EHF unit tests (Konstantin Akimov)
762a808b8c chore: drop irrelevant bip9 code from feature_llmq_rotation.py (Konstantin Akimov)
7735631aad fix: remove v20 from test feature_llmq_evo as far as mn_rr used (Konstantin Akimov)
ca83b26815 fix: crash in CreditPool: it meant to check that DIP0003 is activated (Konstantin Akimov)

Pull request description:

  ## Issue being fixed or feature implemented
  V20 is activated on mainnet: time to bury it!

  https://github.com/dashpay/dash/issues/6186

  ## What was done?
  Hard-fork v20 is buried and it requires to implement multiple fixes, simplifications, refactoring:
   - some tests for EHF moved from functional tests to unit tests
   - fixed crash in Credit Pool if DIP3 is not activated yet
   - added a requirement for v20 activation for `CMNHFManager::GetSignalsStage`
   - removed useless code from functional test feature_llmq_rotation
   - renamed variables "v20" to "mn_rr" in feature_llmq_evo.py so far as actually used fork is mn_rr

  ## How Has This Been Tested?
  Some unit and functional tests to succeed.

  Done reindex  (just in case):

      src/qt/dash-qt -reindex  -assumevalid=0
      src/qt/dash-qt -reindex  -assumevalid=0 -testnet

  ## Breaking Changes
  N/A

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [x] I have added or updated relevant unit/integration/functional/e2e tests
  - [x] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone

ACKs for top commit:
  UdjinM6:
    ACK 23812555b1
  PastaPastaPasta:
    utACK 23812555b1

Tree-SHA512: eec35745baa695f3f286d39b6a61fa0a9f34820b13d1dd4cfbd1efe707850283892c39bf7fe49c49c812e0c02465d64df11480b3f12aa7f21b59a71eeae7260e
2024-09-10 08:50:23 -05:00
pasta
f222f798ab
Merge #6155: fix: avoid voting for the same trigger multiple times
e92aad7cff test: make sure MNs don't vote twice even when they are allowed to (UdjinM6)
3d75390e4e fix: correct conditions for YES voting (UdjinM6)
ec1392c6de chore: make clang-format and linter happy (UdjinM6)
a6320865c4 fix: avoid voting for the same trigger multiple times (UdjinM6)

Pull request description:

  ## Issue being fixed or feature implemented
  We just had a sb voting period and I noticed that the network is way too spammy and produces too many votes (10x+ the expected numbers). It turns out that relying on `ProcessVoteAndRelay` on mainnet is not enough because rate-check expires too soon and MNs are able to vote again and again. On testnet it was never an issue because the voting period there is really short.

  ## What was done?
  Check known votes to make sure we never voted earlier.

  ## How Has This Been Tested?
  Run tests, run a MN on mainnet and check logs.

  ## Breaking Changes
  n/a

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [ ] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  PastaPastaPasta:
    utACK e92aad7cff

Tree-SHA512: 142e23d3a19fa9527fa5257eb790e558d3507a7a857f17c6e02fd58eeb5643fcfb48d824d227e0ea7cd3dae6a6d7d871b3af88b13077f5af074ed1911e42bb28
2024-09-05 12:49:44 -05:00
Kittywhiskers Van Gogh
76a458e5f9
fmt: apply formatting suggestions from clang-format-diff.py 2024-09-04 16:29:30 +00:00
Kittywhiskers Van Gogh
dbe41ea141
refactor: move object request logic to PeerManagerImpl
Preparation for backporting bitcoin#24543, which makes `State()` internal
to `PeerManagerImpl`.
2024-09-04 16:29:29 +00:00
UdjinM6
3d75390e4e
fix: correct conditions for YES voting 2024-08-30 18:02:02 +03:00
UdjinM6
ec1392c6de
chore: make clang-format and linter happy 2024-08-30 18:02:02 +03:00
UdjinM6
a6320865c4
fix: avoid voting for the same trigger multiple times 2024-08-30 18:01:59 +03:00
Konstantin Akimov
1087489fd4
feat: bury v20 deployment 2024-08-26 14:20:40 +07:00
UdjinM6
c7c930ece6
fix: use correct condition in logs 2024-08-22 21:30:26 +03:00
UdjinM6
d41d87a5be
fix: use std::chrono::seconds 2024-08-22 15:03:13 +03:00
UdjinM6
d6fe7146ff
chore: make clang-format and linter happy 2024-08-22 15:03:13 +03:00
UdjinM6
b57a9220c1
refactor: sqash 2 hash maps into one, use proper naming 2024-08-22 15:03:13 +03:00
UdjinM6
4116ba3253
fix: let internal govobj/vote inv request trackers expire after 60 sec 2024-08-22 15:03:10 +03:00
pasta
3e788edae2
fmt: run clang-format 2024-08-12 13:54:05 +07:00
pasta
cc3b63d69e
refactor: initialize variables in the header instead 2024-08-11 15:31:16 +07:00
Konstantin Akimov
c72ec70fdf
feat: implement governance RPCs votealias and votemany for descriptor wallets 2024-07-05 15:37:29 +07:00
Konstantin Akimov
490832959d
refactor: new method to generate a signing message in CGovernanceVote 2024-07-05 01:35:34 +07:00
Kittywhiskers Van Gogh
21cc12c62a
refactor: drop usage of chainstate globals in governance logic 2024-06-26 11:57:21 +00:00
Kittywhiskers Van Gogh
362e3101ad
merge bitcoin#21943: Dedup and RAII-fy the creation of a copy of CConnman::vNodes 2024-05-08 16:21:51 +00:00
Kittywhiskers Van Gogh
33098aefff
merge bitcoin#21160: Move tx inventory into net_processing 2024-04-26 20:25:55 +00:00
Kittywhiskers Van Gogh
a42370df93
refactor: remove fDisableGovernance global, define default in variable 2024-04-25 10:09:42 +00:00
Kittywhiskers Van Gogh
9402ce7171
refactor: limit usage of fDisableGovernance, use IsValid() instead
CGovernanceManager::IsValid() returns true only if its db is successfully
initialized. If we attempt to initialize it and fail, init logic will
report to us that it failed. If we don't attempt to initialize it at all,
it will remain false.

Since fDisableGovernance is the same as not initializing it at all and
the other case where IsValid() is false is dealt with in init, we can
use IsValid() to infer if governance is enabled.
2024-04-25 10:04:44 +00:00
Kittywhiskers Van Gogh
106f6bdd4e
refactor: reduce fMasternodeMode usage in governance and mnauth
Co-authored-by: Konstantin Akimov <knstqq@gmail.com>
2024-04-25 10:04:31 +00:00
Kittywhiskers Van Gogh
bfd33cd2b4
net: move CConnman::RelayInv{Filtered} into PeerManager 2024-04-23 16:08:10 +00:00
Kittywhiskers Van Gogh
0323c6ca17
net: move Relay{Inv, InvFiltered, Transaction} out of CConnman 2024-04-23 16:06:41 +00:00