`GenesisData`'s `FromJSON` instance may be insufficiently strict, resulting in unevaluated thunks in `gdStartTime`
Link to relevant source: https://github.com/IntersectMBO/cardano-ledger/blob/14f8c026da66d9bc50cb4ec1147abb368256769a/eras/byron/ledger/impl/src/Cardano/Chain/Genesis/Data.hs#L96
When deserializing a GenesisData using fromJSON, the resulting record will contain unevaluated thunks in its gdStartTime :: UTCTime field, which can be discovered using its NoThunks instance.
I'm not sure whether this should be considered a bug, though, or if it's just unexpected behaviour, especially when it's a situation like this that's ultimately unlikely to result in a space leak.
- Should the
FromJSONinstance force its result completely? - Should the
NoThunksinstance accept unevaluated thunks withingdStartTime? - Should we (i.e. consensus) just
forcethe value after wefromJSONit?
Either of these approach will work just fine, since Byron era has very little overhead and any space leaks that could have happen can't pose a problem for us. That being said, can make the nothunks tests happy.
- Should the FromJSON instance force its result completely?
- Should the NoThunks instance accept unevaluated thunks within gdStartTime?
I am leaning towards the simplest solution of just forcing the field in FromJSON instance with (id <$!!> fromJSField obj "startTime")