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

Automated drep (Scenario 1) #5815

Merged
merged 29 commits into from
May 17, 2024
Merged

Automated drep (Scenario 1) #5815

merged 29 commits into from
May 17, 2024

Conversation

palas
Copy link
Contributor

@palas palas commented Apr 29, 2024

Description

This PR aims to address this issue: #5600
With that aim, it adds two scenarios for automated DReps. This PR contains the first scenario:

Scenario 1

  • Create default testnet with 3 DReps and 3 stake holders delegated, one to each DRep.
  • Do some proposal and vote yes with the first DRep only.
  • Check that proposal does NOT pass.
  • Take the last two stake delegators and delegate them to "Abstain".
  • Do some other proposal and vote yes with first DRep only.
  • Check the new proposal passes now.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Runnings tests for more details
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-8.10.7 and ghc-9.2.7
  • Self-reviewed the diff

@palas palas self-assigned this Apr 29, 2024
@palas palas requested a review from a team as a code owner April 29, 2024 16:15
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

Nice job on separating the PRs. We are lacking in comments however.

@palas palas requested a review from Jimbo4350 April 30, 2024 19:53
@palas palas force-pushed the automated-drep-scenario1 branch 3 times, most recently from 172d84e to e4f6e9d Compare May 2, 2024 22:39
Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

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

Looking good, I just have a comment about waitAndCheckNewEpochState the rest are minor. Will approve after the comment about waitAndCheckNewEpochState.

@palas palas force-pushed the automated-drep-scenario1 branch 3 times, most recently from 2d3c9e6 to 5b72c6c Compare May 3, 2024 18:45
@palas palas requested a review from Jimbo4350 May 3, 2024 19:03
cardano-testnet/src/Testnet/Components/Query.hs Outdated Show resolved Hide resolved
@palas palas requested a review from Jimbo4350 May 7, 2024 15:11
@palas palas force-pushed the automated-drep-scenario1 branch 7 times, most recently from ef4d1db to a2537b8 Compare May 15, 2024 20:10
@palas palas force-pushed the automated-drep-scenario1 branch from a2537b8 to 5b62ae6 Compare May 16, 2024 21:44
@palas palas requested review from a team as code owners May 16, 2024 23:42
@palas palas force-pushed the automated-drep-scenario1 branch from 5de639b to 5b16cd1 Compare May 17, 2024 00:18
@palas palas dismissed Jimbo4350’s stale review May 17, 2024 01:08

Already addressed

@palas palas added this pull request to the merge queue May 17, 2024
github-merge-queue bot pushed a commit that referenced this pull request May 17, 2024
Merged via the queue into master with commit 662abc7 May 17, 2024
39 of 40 checks passed
@palas palas deleted the automated-drep-scenario1 branch May 17, 2024 03:07
@@ -187,4 +184,11 @@ hprop_plutus_v3 = integrationWorkspace "all-plutus-script-purposes" $ \tempAbsBa
]
H.success

waitForJustM :: (H.MonadTest m, MonadIO m) => m (Maybe a) -> m a
Copy link
Contributor

Choose a reason for hiding this comment

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

findLargestUtxoWithAddress should be modified to recurse if no UTxOs are found and terminate at a specified termination epoch.

"failingProposal" wallet2 [(1, "yes")] secondTargetDRepActivity
minEpochsToWaitIfNotChanging (Just firstTargetDRepActivity)
maxEpochsToWaitAfterProposal

kickWatchdog watchdog
Copy link
Contributor

Choose a reason for hiding this comment

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

An indication that we are testing too much and this test needs to be further decomposed.

"failingProposal" wallet2 [(1, "yes")] secondTargetDRepActivity
minEpochsToWaitIfNotChanging (Just firstTargetDRepActivity)
maxEpochsToWaitAfterProposal

kickWatchdog watchdog

-- We now send a bunch of proposals to make sure that the 2 new DReps expire.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be a separate property. Drep Expiry.

@@ -122,17 +124,19 @@ hprop_check_drep_activity = integrationWorkspace "test-activity" $ \tempAbsBaseP
-- This proposal should fail because there is 2 DReps that don't vote (out of 3)
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be a separate property. Voting threshold not reached.

@@ -145,7 +149,7 @@ hprop_check_drep_activity = integrationWorkspace "test-activity" $ \tempAbsBaseP
-- Last proposal (set activity to something else again and it should pass, because of inactivity)
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be a separate property. Update DRep activity.

nfrisby pushed a commit that referenced this pull request May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants