Update src/Ledger/Dijkstra/Specification/Account.lagda.md
Co-authored-by: Carlos Tomé Cortiñas <[email protected]>
Co-authored-by: Carlos Tomé Cortiñas <[email protected]>
The Forecast API from the eras are more type-safe and replace these partial implementations, clearly separating TPraos forecasts from Praos forecasts, and also distinguising current and future forecasts in their respective types. Add babbageForecastToLedgerView keeping bottoms the same.
Add the Forecast module. Update ConwayTICKF to have Void as its PredicateFailure. This makes the implementation clearer while also allowing futureForecast to be pure.
Add the Forecast module for babbage.
- Add EraForecast and ShelleyEraForecast typeclasses. - Add Timeline to distinguish between current and future forecasts. Disallow coercion between them in ShelleyForecast. - Add currentForecast and futureForecast, type-restricted to the corresponding Timeline. - Migrate test-suite to use these inplace of GetLedgerView.
The internal flat library contained Generic-based Flat class derivation via GHC.Generics that had a bug: deserializing large enum types (512+ constructors) consumed infinite memory. While not a security risk (UPLC on-chain code uses only manual Flat instances), the buggy dead code was distracting. This commit removes the entire Generic derivation machinery. Changes: 1. Add manual Flat instances to all types that previously relied on Generic defaults: Maybe, Either, Complex, [], NonEmpty, tuples (2-7), Tree, Filler, PostAligned, PreAligned, SrcSpan, SrcSpans, and all PIR types (Recursivity, Strictness, Datatype, Binding, Program, Term). Manual encoding is bit-identical to the Generic encoding. 2. Add missing `size` methods to partial Flat instances in FlatInstances.hs (Name, Version, VarDecl, TyVarDecl, Program, NamedDeBruijn) and Value.hs (K, Quantity, Value) that previously relied on the Generic default for `size`. 3. Gut Class.hs: remove ~440 lines of GFlat*/GEncode*/GSize* classes, NumConstructors type family, all Generic default method implementations, and associated imports/pragmas/re-exports. 4. Remove ENUM_LARGE test infrastructure (E256/E258 types, Flat/Arbitrary instances, ~530 lines) and delete Core.hs inspection tests. 5. Fix transitive import breakage: files that got Generic from the PlutusCore.Flat re-export now import GHC.Generics directly. Remove `hiding (to)` from imports that no longer re-export Generics. 6. Strip Generic-specific doctests from Tutorial.hs. All existing tests pass (5281 across 4 suites). Manual instances produce bit-identical encoding verified by round-trip tests and golden files.
Signed-off-by: Chris Gianelloni <[email protected]>