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

test: improve mine rotation quorums for IS in functional tests #6431

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

knst
Copy link
Collaborator

@knst knst commented Nov 26, 2024

Issue being fixed or feature implemented

Mining rotation quorum currently is not trivial. All over a codebase used this template to get a rotating quorum:

        self.move_to_next_cycle()
        self.log.info("Cycle H height:" + str(self.nodes[0].getblockcount()))
        self.move_to_next_cycle()
        self.log.info("Cycle H+C height:" + str(self.nodes[0].getblockcount()))
        self.move_to_next_cycle()
        self.log.info("Cycle H+2C height:" + str(self.nodes[0].getblockcount()))

        self.mine_cycle_quorum(llmq_type_name='llmq_test_dip0024', llmq_type=103)

The performance of this code is not great also because generating 3 or 4 batches of blocks requires time to sync nodes after each batch.

What was done?

This PR move instantly to 3-4 DKG sessions forward and starts from cycling quorum.
It's only one cycling quorum (instant-send), so, extra params are also removed.
To get it just call:

self.mine_cycle_quorum() # first time, which is usually used to get IS feature working in functional tests
self.mine_cycle_quorum(is_first=False) # if you don't need preparing 3 DKG sessions in advance

How Has This Been Tested?

Run unit and functional tests
By my benchmark it gives roughly 10 seconds for each functional test that uses rotation quorum.

Breaking Changes

N/A

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
  • I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)

@knst knst added this to the 22.1 milestone Nov 26, 2024
@knst knst mentioned this pull request Nov 28, 2024
5 tasks
@knst knst force-pushed the perf-mine-cycle-quorum branch from d8e1ccd to f8cfda6 Compare December 2, 2024 16:40
@knst knst changed the title perf: mine rotation quorums for IS in functional tests test: mine rotation quorums for IS in functional tests Dec 2, 2024
@knst knst changed the title test: mine rotation quorums for IS in functional tests test: improve mine rotation quorums for IS in functional tests Dec 2, 2024
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 f8cfda6; I wish that is_first could be automatically detected instead of manually set.

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 f8cfda6

@PastaPastaPasta PastaPastaPasta merged commit 678d28d into dashpay:develop Dec 4, 2024
20 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants