Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement quorum rotation and updated LLMQ parameters #4752

Merged
merged 109 commits into from Apr 16, 2022

Conversation

ogabrielides
Copy link
Collaborator

Only for CI

@PastaPastaPasta PastaPastaPasta force-pushed the ci_quorum_rotation_2 branch 2 times, most recently from 284a423 to 01fe88a Compare April 5, 2022 17:22
@UdjinM6
Copy link

UdjinM6 commented Apr 5, 2022

I'd abandon #4512 and proceed with this one instead (to have working CI). Also, this PR is huge and it would be nice to have it quashed into few meaningful commits if possible.

@github-actions
Copy link

github-actions bot commented Apr 5, 2022

This pull request has conflicts, please rebase.

@ogabrielides
Copy link
Collaborator Author

@UdjinM6 Commits were already squashed as much as possible

@PastaPastaPasta
Copy link
Member

In the latest set of changes, we adjusted the logic during migration. The old LLMQs will remain active and being used for creating is locks until the block where the new LLMQ type is mined and active. At this point, all the old quorums will fall off of the list and only new LLMQ type will be used

@thephez
Copy link
Collaborator

thephez commented Apr 11, 2022

... old LLMQs will remain active and being used for creating is locks until the block where the new LLMQ type is mined and active. At this point, all the old quorums will fall off of the list and only new LLMQ type will be used

Is that until the first quorum of the new LLMQ type is mined/active? Or until there's a full set of them? Given the new process that could be one and the same, but not necessarily.

@thephez
Copy link
Collaborator

thephez commented Apr 12, 2022

... old LLMQs will remain active and being used for creating is locks until the block where the new LLMQ type is mined and active. At this point, all the old quorums will fall off of the list and only new LLMQ type will be used

Is that until the first quorum of the new LLMQ type is mined/active? Or until there's a full set of them? Given the new process that could be one and the same, but not necessarily.

@PastaPastaPasta Per our discussion my understanding is that once one quorum of the new type is present, InstantSend will transition entirely to using the new quorum type. Since multiple quorums of this type can form in parallel, there should be a decent set to handle IS from the start.

@UdjinM6
Copy link

UdjinM6 commented Apr 12, 2022

Since multiple quorums of this type can form in parallel, there should be a decent set to handle IS from the start.

I would still go with smth like 5fdb60e to be 100% sure we do not degrade IS security at any point of the migration tbh.

Also, having no tests for switching from current IS quorums to dip0024 ones is a big no imo. Could do smth like eb603bb maybe?

@PastaPastaPasta
Copy link
Member

PastaPastaPasta commented Apr 12, 2022

I would still go with smth like 5fdb60e to be 100% sure we do not degrade IS security at any point of the migration tbh.

I would disagree with this change I think. Fewer quorums doesn't / shouldn't decrease security, just scalability. Also, since all 32 attempt to form at once, it is VERY likely we will have 24+, which makes it basically the same as current setup. Additionally, one of my goals is to make sure that old LLMQs and new LLMQs are never activate at the same time, and your diff would remove this (to make sure validation from old LLMQs fail ish once the new LLMQs exist, b/c the old LLMQs are no longer in the list)

I like eb603bb :)

@UdjinM6
Copy link

UdjinM6 commented Apr 12, 2022

one of my goals is to make sure that old LLMQs and new LLMQs are never activate at the same time

hmm... ok, I guess it's a valid point, pls ignore 5fdb60e then (for the most part but maybe still pick dip_24/dip24 -> dip0024 refactoring :) )

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general but we still have to adjust activation start/timeout params #4752 (comment)

@PastaPastaPasta PastaPastaPasta mentioned this pull request Apr 15, 2022
29 tasks
@PastaPastaPasta
Copy link
Member

Adjusted testnet nStartTime and nTimeout and added a line item to release process to update main net parameters.

@PastaPastaPasta PastaPastaPasta changed the title Ci quorum rotation 2 feat: implement quorum rotation and updated LLMQ parameters Apr 15, 2022
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK for merging via merge commit

LGTM (looks good to me) and LGTM (let's get this merged!) :)

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@UdjinM6
Copy link

UdjinM6 commented Apr 15, 2022

merging via merge commit

squash maybe?

@UdjinM6 UdjinM6 merged commit 83ef1c6 into dashpay:develop Apr 16, 2022
@thephez thephez added RPC Some notable changes to RPC params/behaviour/descriptions P2P Some notable changes on p2p level labels Apr 20, 2022
@ogabrielides ogabrielides deleted the ci_quorum_rotation_2 branch May 30, 2022 11:07
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Nov 15, 2023
…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>
gades pushed a commit to piratecash/pirate that referenced this pull request Dec 9, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2P Some notable changes on p2p level RPC Some notable changes to RPC params/behaviour/descriptions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants