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

Fix too many discards. #3989

Merged
merged 1 commit into from
Jan 12, 2024
Merged

Fix too many discards. #3989

merged 1 commit into from
Jan 12, 2024

Conversation

TimSheard
Copy link
Contributor

@TimSheard TimSheard commented Jan 11, 2024

Figure out how to get non-empty poolDistr from "random" SnapShots.

The test "Bruteforce = Pulsed, in every epoch, on traces of length 150"
Some times fails because at the epoch boundary because "There are no stakepools to choose an issuer from"
We set this up to discard, but occasionally we reach 150 discards and the test fails.
A lot of analysis discovers that in the random initial NewEpochState, the mark snapshot is not well formed, in that when ones computes the PoolDistr from such a snap shot, PoolDistr is empty.

The fix is to arrange random snapshots such that they never result in an empty PoolDistr. So we had to change the constraints for 'regPools' , 'incrementalStake', and 'delegations' so this never happens. In order to do that
we had to change the order we solve constraints, so that 'utxo' and 'incementalStake' are solved before 'delegations' . To do that we created a new Stage utxoStage, in the module Preds/UTxO.hs,
so we can see the UTxO when specifying the DState and PState.

Description

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@TimSheard TimSheard force-pushed the ts-toomanyDiscardsVersion2 branch 2 times, most recently from 26ad163 to 804553c Compare January 12, 2024 00:11
@TimSheard TimSheard requested a review from lehins January 12, 2024 02:45
Copy link
Collaborator

@lehins lehins left a comment

Choose a reason for hiding this comment

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

Thank you for fixing it!

Added module Preds/UTxO.hs, so we can see the UTxO when specifying
the DState and PState.
@lehins lehins force-pushed the ts-toomanyDiscardsVersion2 branch from 804553c to 61e547a Compare January 12, 2024 10:17
@lehins lehins enabled auto-merge January 12, 2024 10:17
@lehins lehins merged commit 92fd668 into master Jan 12, 2024
10 of 12 checks passed
@neilmayhew neilmayhew deleted the ts-toomanyDiscardsVersion2 branch March 8, 2024 21:07
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.

2 participants