Skip to content

VRFVerKeyHash counters in PState#5265

Merged
lehins merged 2 commits intomasterfrom
td/vrfs-counters
Sep 2, 2025
Merged

VRFVerKeyHash counters in PState#5265
lehins merged 2 commits intomasterfrom
td/vrfs-counters

Conversation

@teodanciu
Copy link
Contributor

@teodanciu teodanciu commented Aug 29, 2025

Description

If stake pools with the same VRF key hash exist, then - in the current version - at HardFork we lose the information that it occurs several times, by collapsing all occurrences in a Set.
So, if after the HardFork, one of these pools retires, we remove the VRF key from the record, even though there might be other stake pools left with this key. This allows for the VRF key to be used again!

This PR solves this problem, by removing individual occurrences of VRF key hashes.

Fixes #5252

Checklist

  • Commits in meaningful sequence and with useful messages.
  • Tests added or updated when needed.
  • CHANGELOG.md files updated for packages with externally visible changes.
    NOTE: New section is never added with the code changes. (See RELEASING.md).
  • Versions updated in .cabal and CHANGELOG.md files when necessary, according to the
    versioning process.
  • Version bounds in .cabal files updated when necessary.
    NOTE: If bounds change in a cabal file, that package itself must have a version increase. (See RELEASING.md).
  • Code formatted (use scripts/fourmolize.sh).
  • Cabal files formatted (use scripts/cabal-format.sh).
  • CDDL files are up to date (use scripts/gen-cddl.sh)
  • hie.yaml updated (use scripts/gen-hie.sh).
  • Self-reviewed the diff.

@teodanciu teodanciu force-pushed the td/vrfs-counters branch 5 times, most recently from a04a7e6 to bb61dee Compare September 1, 2025 18:48
in order to avoid pools retiring after the HardFork from removing the
record of a known (but duplicate) VRF key hash
@teodanciu teodanciu changed the title [wip] VRFVerKeyHash counters VRFVerKeyHash counters in PState Sep 2, 2025
@teodanciu teodanciu marked this pull request as ready for review September 2, 2025 10:24
@teodanciu teodanciu requested a review from a team as a code owner September 2, 2025 10:24
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.

Very nice!!! 💪

@lehins lehins enabled auto-merge September 2, 2025 19:01
@lehins lehins merged commit e35decb into master Sep 2, 2025
234 of 236 checks passed
@lehins lehins deleted the td/vrfs-counters branch September 2, 2025 19:01
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.

Implement counters for VRFKeyHashes

2 participants