Commit Graph

11 Commits

Author SHA1 Message Date
Odysseas Gabrielides
494b5c744c
feat: mnlistdiff v20 CL sig quorums (#5377)
## Issue being fixed or feature implemented
Implementation of Randomness Beacon Part 3.

Starting from v20 activation fork, members for quorums are sorted using
(if available) the best CL signature found in Coinbase.
If no CL signature is present yet, then the usual way is used (By using
Blockhash instead)

The actual new way to shuffle is already implemented in
https://github.com/dashpay/dash/pull/5366.

SPV clients also need to calculate members, but they only know block
headers.
Since Coinbase is in the actual block, then they lack the required
information to correctly calculate quorum members.

## What was done?
- Message `MNLISTIDFF` is enriched with a new field `quorumsCLSigs`.
This field holds the Chainlock Signature required for each set of
indexes corresponding to quorums in field `newQuorums`.
-  Protocol version has been bumped to `70230`.
- Clients with protocol version greater or equal to `70230` will receive
the new field `quorumsCLSigs`.
- The same field is returned in `protx diff` RPC.

Note:
- Field `quorumsCLSigs` will populated only after v20 activation
- If for one or more quorums, no non-null CL sig was found in CbTx then
a null signature is returned in `quorumsCLSigs`.

## How Has This Been Tested?
- Functional test mininode's protocol version was bumped to `70230`.
- `feature_llmq_rotation.py` checks that `quorumsCLSigs` match in both
P2P and RPC messages.

## Breaking Changes
No

## 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 _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: thephez <thephez@users.noreply.github.com>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
2023-07-10 11:23:09 -05:00
Odysseas Gabrielides
9eee9ee680
feat!: calculate quorum members using v20 cbtx clsig (#5366)
## Issue being fixed or feature implemented

Implementation of Randomness Beacon Part 2.
This PR is the next step of #5262.

Starting from v20 activation fork, members for quorums are sorted using
(if available) the best CL signature found in Coinbase.
If no CL signature is present yet, then the usual way is used (By using
Blockhash instead)

## What was done?

## How Has This Been Tested?
Test `feature_llmq_rotation.py` was updated to cover both rotated and
non-rotated quorums.
2 quorums are mined first to ensure Chainlock are working earlier.
Then dip_24 activation is replaced by v20 activation.

The only direct way to test this change is to make sure that all
expected quorums after v20 activation are properly formed.

Note: A `wait_for_chainlocked_block_all_nodes` is called between every
rotation cycle to ensure that Coinbase will use a different Chainlock
signature.

## Breaking Changes
Yes, quorum members will be calculated differently.

## 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
- [ ] 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)_

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2023-05-17 20:27:15 +03:00
Odysseas Gabrielides
06dfe1bd1f
feat(rpc): Added quorum listextended RPC (#5076)
* Added quorum listextended

* Indentation fix

* Added release notes

* Added quorum listextended func test

* Refactored reply into map

* fix: change type from ARR to OBJ_DYN to properly print out the placeholder

Co-authored-by: pasta <pasta@dashboost.org>
2022-11-21 12:17:28 -06:00
Kittywhiskers Van Gogh
e8bf39f2dc merge bitcoin#19967: Replace (dis)?connect_nodes globals with TestFramework methods
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-10-17 08:03:12 +05:30
MarcoFalke
566889f5e8
Merge #19208: test: move sync_blocks and sync_mempool functions to test_framework.py
cc84460c164bcb2a874d4f08b3a2624e5ee9ff0a test: move sync_blocks and sync_mempool functions to test_framework.py (Roy Shao)

Pull request description:

  This PR moves `sync_blocks` and `sync_mempool` out from `test_framework/util.py` to `test_framework/test_framework.py` so they can take contextual information of test framework into account.

  * Change all reference callers to call functions from `test_framework.py`
  * Remove `**kwargs` which is not used
  * Take into account of `timeout_factor` when respecting timeout in function implementations.
  * Pass all tests by running `./test/functional/test_runner.py`

  fixes #18930

ACKs for top commit:
  MarcoFalke:
    ACK cc84460c164bcb2a874d4f08b3a2624e5ee9ff0a , reviewed with --color-moved=dimmed-zebra --color-moved-ws=ignore-all-space 💫

Tree-SHA512: a79b2a3fa842fc26a7aacb834bb2aea88b3049916c0b754e60002a77ce94bb5954e0ea3b436bf268e9295efb62d721dfef263a09339a55c684ac3fda388c275e
2022-09-08 03:49:30 +03:00
Odysseas Gabrielides
088d7f2ec5
fix: Faster feature_llmq_rotation.py + introduction of llmq_devnet_dip0024 (#4878)
* Added LLMQ_DEVNET_V2

* Faster feature_llmq_rotation func test

* Updated llmq_devnet_dip0024

* Adjusted parameters

* Better comments

* Re-adjusted rotated llmq params
2022-06-28 19:14:09 -05:00
Kittywhiskers Van Gogh
282b02e6b2
rpc: split spork manipulation logic to distinct "sporkupdate" call (#4885)
* rpc: split spork manipulation logic to distinct "sporkupdate" call

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

* docs: add release notes for dash#4885

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-06-18 19:52:45 +03:00
PastaPastaPasta
d64b7229cd
chore: bump copyrights (#4873)
* chore: bump copyright in configure.ac

* chore: bump copyright via copyright_header.py

ran command `python3 contrib/devtools/copyright_header.py update .`
2022-06-08 02:36:46 +03:00
Odysseas Gabrielides
73cf7ff978
fix!: incorrect CalcCbTxMerkleRootQuorums with rotation (#4833)
* Fix for CalcCbTxMerkleRootQuorums with rotation

* Added check for merkleRootQuorums in feature_llmq_rotation

* Correct logging

* Update test/functional/feature_llmq_rotation.py

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

* Update test/functional/feature_llmq_rotation.py

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

* lint: fix python linter

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
2022-05-18 12:45:15 -05:00
UdjinM6
7fc9ced96d
tests: various fixes/cleanups (#4797)
* tests: move `move_to_next_cycle` to `DashTestFramework`

* tests: set correct defaults for `mine_cycle_quorum`

* tests: use correct quorum type in `create_islock`

* tests: fix `rpc_verifyislock.py`

* tests: fix `feature_llmq_is_cl_conflicts.py`

* tests: isolate zmq subscribers in `interface_zmq_dash.py`

this lets us call `test_*_publishers()` in any order and any number of times

* tests: check zmq for both deterministic and non-deterministic islocks
2022-04-25 22:12:04 +03:00
Odysseas Gabrielides
83ef1c6c66
feat: implement quorum rotation and updated LLMQ parameters (#4752)
* Added GET_SNAPSHOT_INFO message handling

* Quorum members by rotation

* Quorum utils functions

* Handle GET_QUORUM_ROTATION_INFO with baseBlockHash from client

* Storing QuorumSnaphots in evoDB when requesting them

* Added DIP Enforcement param

* quorumIndex cache

* Quorum Rotation deployment control

* Usage of Bitsets for storing CQuorumSnapshots

* Correct handling of early quorum quarters

* More asserts

* Corrections

* Handling of quorumIndex

* Refactoring of truncate mechanism

* Various fixes

* Interface correction

* Added template type for indexed cache

* Added quorumIndex into commitmenHash

* Various changes

* Needs to update maqQuorumsCache along with indexedQuorumsCache

* Added CFinalCommitment version 2

* Renamed variables

* Fixes

* Refactoring & correct caching of quorumMembers by rotation

* Added assertions

* Refactoring

* Interface change

* Handling of previous DKG session failure

* Applied refactoring

* Build quarter members improvments

* Merge Quorum Rotation and Decreased fee into one deployment (DIP24)

* Added new LLMQ Type

* Added functional tests + refactoring

* Refactoring

* Spreaded Quorum creation and Quorum Index adaptation

* quorumIndex adaptations

* Added quorumIndex in CFinalCommitment

* Latest work

* Final refactoring

* Batch of refactoring

* Fixes for tests

* Fix for CFinalCommitment

* Fix for Quorums

* Fix

* Small changes

* Thread sync fic

* Safety changes

* Reuse mns when needed

* Refactoring

* More refactoring

* Fixes for rotationinfo handling

* Fix for rotation of members

* Correct order of MNs lists in Quorum Snapshots

* Adding extra logs

* Sync rotation quorums + qrinfo changes

* Fix + extra logs

* Removed redundant field

* Fix for null final commitment + refactoring

* Added timers in tests

* Fix for qrinfo message: quorumdiff and merkleRootQuorums

* Small changes for rotation test

* Remove reading from scanQuorumCache

* Added quorum list output

* Crash fix

* Experimental commit

* apply changes to specialtxman.cpp from specialtx.cpp

* all the changes

* substancially speed up feature_llmq_rotation.py

* reenable asserts, add check for reorgs

* Refactoring

* Added extra logs

* format

* trivial

* drop extra boost includes

* drop ContainsMN

* fix ScanQuorums

* check quorum hash and index in CFinalCommitment::Verify

* fix/tweak tests

* IsQuorumRotationEnabled should be aware of the context

* Calculating members based on earlier block.

* Fix for Quorum Members Cache

* Removed duplicate size of baseBlockHashes

* Adaptations of qrinfo to -8 mn lists

* Introduction of llmqTypeDIP24InstantSend

* Adaptation for llmqTypeDIP24InstantSend

* Adaptations for IS

* bump protocol version

* Added feature_llmq_is_migration test

* Various cleanups

* use unordered_lru_cache for quorumSnapshotCache

* trivial refactor ComputeQuorumMembersByQuarterRotation

* Reduced CFinalCommitment::quorumIndex from 32 to 16 bits

* Keep verified LLMQ relay connections

* Experimental Relay connection fix

* Fix for EnsureQuorumConnections rotation

* Using only valid Mns for checking

* Override of nPowTargetSpacing (devnet only)

* Show penalty score in masternode rpc

* fixups

* Rotation refactoring

* Update src/chainparams.cpp

* Replaced LogPrintf with LogPrint

* IS locking fix once DIP24 activation

* Various cleanup

* Updated MIN_MASTERNODE_PROTO_VERSION

* Introduce LLMQ_TEST_INSTANTSEND reg-test only quorum and actually test switching to dip0024 quorums

* Renamed field lastQuorumHashPerIndex

* Renamed to DIP0024

* chore: update nStartTime and nTimeout for mainnet / testnet for DEPLOYMENT_DIP0024

Co-authored-by: Kittywhiskers Van Gogh <63189531+kittywhiskers@users.noreply.github.com>
Co-authored-by: pasta <pasta@dashboost.org>
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2022-04-16 17:46:04 +03:00