You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to construct a Summary (which is used to create the EpochInfo that is passed to the ledger) from a ledger state, we use reconstructSummary (see its call sites):
NOTE: In practice, when using the hard fork combinator, we never ever call
'summarize', and instead read off a summary from the 'HardForkState'. In
that case, this serves primarily as a reference implementation.
It is at least surprising that we are testing a function that isn't actually directly used by the actual HFC. In particular, I don't see why the implementations of reconstructSummary and summarize couldn't be unified (either in terms of each other, or as specializations of a more general function).
In order to construct a
Summary
(which is used to create theEpochInfo
that is passed to the ledger) from a ledger state, we usereconstructSummary
(see its call sites):ouroboros-consensus/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/Combinator/State/Infra.hs
Lines 160 to 253 in 68b9799
However, we also have the very similar function
summarize
:ouroboros-consensus/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/History/Summary.hs
Lines 291 to 357 in 68b9799
The latter isn't actually used in the implementation; it is only used for tests (
Test.Consensus.HardFork.History
):ouroboros-consensus/ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/HardFork/History/Summary.hs
Lines 286 to 288 in 68b9799
It is at least surprising that we are testing a function that isn't actually directly used by the actual HFC. In particular, I don't see why the implementations of
reconstructSummary
andsummarize
couldn't be unified (either in terms of each other, or as specializations of a more general function).Relevant note: AFAICT the bug in
reconstructSummary
that was fixed by IntersectMBO/ouroboros-network#3754 was never present insummarize
.The text was updated successfully, but these errors were encountered: