Skip to content

Conversation

@tbagrel1
Copy link
Contributor

@tbagrel1 tbagrel1 commented Sep 12, 2025

Fixes tweag/cardano-peras#65

Changes

  • Changes in the HFC types:
    • EraParams now keeps track of an optional Peras round length.
    • Bound now keeps track of an optional Peras round number.
    • In the Serialise instances for EraParams and Bound, the encoders generate different CBOR depending on whether of not the Peras-relate components are present. The decoders act differently depending on the length of the CBOR list.
    • The EraSummary, while not modified directly, is now Peras-aware via EraParams and Bound:
      • in a valid summary, Peras round length must divide the epoch size. See the changes in EraSummarys haddock and in invariantSummary's implementation.
  • Changes in the HFC time translation queries:
    • Two new top-level queries are exposed from Ouroboros.Consensus.HardFork.History.Qry:

      perasRoundNoToSlot :: PerasRoundNo -> Qry SlotNo
      slotToPerasRoundNo :: SlotNo -> Qry PerasRoundNo
    • add a roundtrip test that ensures that converting Peras round number to a slot and then back is an identity is added into the Test.Consensus.HardFork.Summary module.

    • add a Peras-specific test into Test.Consensus.HardFork.History module.

Suggested review order

Even though this PR affects many files, the bulk of the changes is localised. I suggest the following review order:

  • First review the datatype and codec changes in ouroboros-consensus/Ouroboros/Consensus/HardFork/History/EraParams.hs and ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/History/Summary.hs
  • Proceed to review the time translation query changes in ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/History/Qry.hs
  • Then review the newly added tests in consensus-test/Test/Consensus/HardFork/History.hs and consensus-test/Test/Consensus/HardFork/Summary.hs

@tbagrel1 tbagrel1 changed the base branch from main to main-pr/object-diffusion September 12, 2025 14:34
@tbagrel1 tbagrel1 changed the title [Peras #5] Add new NodeToNode version and adapt the HFC time translation layer for Peras [Peras #5] Adapt the HFC time translation layer for Peras Sep 12, 2025
@amesgen amesgen added the peras label Sep 12, 2025
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch 3 times, most recently from 37a9f85 to 222f4be Compare September 18, 2025 09:25
@tbagrel1 tbagrel1 force-pushed the main-pr/hfc-era-peras branch 3 times, most recently from 3237d2a to c2b6bbf Compare September 18, 2025 09:47
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from 222f4be to d47c331 Compare September 19, 2025 08:04
@tbagrel1 tbagrel1 force-pushed the main-pr/hfc-era-peras branch 2 times, most recently from c077a49 to 66e4657 Compare September 19, 2025 08:26
@tbagrel1 tbagrel1 changed the title [Peras #5] Adapt the HFC time translation layer for Peras [Peras 5] Adapt the HFC time translation layer for Peras Sep 25, 2025
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from d47c331 to 918307c Compare September 26, 2025 13:47
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch 4 times, most recently from d9c165b to bef68f5 Compare October 22, 2025 11:20
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from bef68f5 to 0c3b30f Compare November 7, 2025 13:42
@tbagrel1 tbagrel1 force-pushed the main-pr/hfc-era-peras branch from 66e4657 to 513188c Compare November 7, 2025 14:07
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from 0c3b30f to 2e7a690 Compare November 7, 2025 17:58
@tbagrel1 tbagrel1 force-pushed the main-pr/hfc-era-peras branch from 513188c to f669223 Compare November 7, 2025 18:01
@tbagrel1 tbagrel1 force-pushed the main-pr/object-diffusion branch from 2e7a690 to 09669d1 Compare November 7, 2025 18:06
geo2a and others added 2 commits November 7, 2025 19:06
- Add `PerasRoundLength`
- introduce the `PerasEnabled` datatype to track values
  are only used when Peras is enabled
- HFC: translate between Peras rounds and slots

Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
Co-authored-by: Agustin Mista <[email protected]>
Co-authored-by: Alexander Esgen <[email protected]>
Co-authored-by: Georgy Lukyanov <[email protected]>
Co-authored-by: Thomas BAGREL <[email protected]>
Co-authored-by: Nicolas BACQUEY <[email protected]>
Co-authored-by: Nicolas "Niols" Jeannerod <[email protected]>
@tbagrel1 tbagrel1 force-pushed the main-pr/hfc-era-peras branch from f669223 to b0b9e89 Compare November 7, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants