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

Save the DRep Pulser State after computing it #1687

Merged
merged 3 commits into from May 17, 2024

Conversation

sgillespie
Copy link
Contributor

@sgillespie sgillespie commented Apr 29, 2024

Description

Fixes #1599. The bulk of this work is done in the HasNewEpochState typeclass, which allows us to update the ledger state in ExtLedgerState.

Checklist

  • Commit sequence broadly makes sense
  • Commits have useful messages
  • New tests are added if needed and existing tests are updated
  • Any changes are noted in the changelog
  • Code is formatted with fourmolu on version 0.10.1.0 (which can be run with scripts/fourmolize.sh)
  • Self-reviewed the diff

Migrations

  • The pr causes a breaking change of type a,b or c
  • If there is a breaking change, the pr includes a database migration and/or a fix process for old values, so that upgrade is possible
  • Resyncing and running the migrations provided will result in the same database semantically

If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.

@sgillespie sgillespie marked this pull request as ready for review April 30, 2024 23:12
-- of the cardano-ledger/ouroboros-consensus public APIs, because ledger state is not
-- designed to be updated this way. We are only replaying the chain, so this should be
-- safe.
class HasNewEpochState era where
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a very useful class to have, which can be reused for https://github.com/orgs/IntersectMBO/projects/8/views/3?pane=issue&itemId=60533809

kderme
kderme previously approved these changes May 1, 2024
Copy link
Contributor

@kderme kderme left a comment

Choose a reason for hiding this comment

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

Great work!
Good to merge when it's tested on preprod or preview.

@sgillespie
Copy link
Contributor Author

Great work! Good to merge when it's tested on preprod or preview.

It can't be tested in preprod or preview right?

Also, I forgot to update the comment, I have done some basic manual testing in sanchonet

@kderme
Copy link
Contributor

kderme commented May 1, 2024

It can't be tested in preprod or preview right?

Right, it would only work on sanchonet after rebasing to master

@sgillespie
Copy link
Contributor Author

Right, it would only work on sanchonet after rebasing to master

Yes, this is how I was able to test it on sanchonet. I applied my changes on top of sancho-4-2-1

@sgillespie sgillespie force-pushed the feature/save-drep-pulser branch 2 times, most recently from 772c054 to ecdbe06 Compare May 3, 2024 14:07
This class can be used to get/update the underlying extended
ledger state
Before retrieving the DRep pulsing state, force its evaluation, then
save it to the ledger state. This will prevent us from unnecessarily
recalculating it.
@sgillespie sgillespie merged commit a1e0378 into IntersectMBO:master May 17, 2024
10 checks passed
@sgillespie sgillespie deleted the feature/save-drep-pulser branch May 17, 2024 20:17
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.

Replace the evaluated drep pulser in ledger state
3 participants