For T185709: Cache CheckResult serializations per-entity in ObjectCache, we need to be able to serialize and deserialize Constraint objects. Shouldn’t be difficult, they’re pure value objects (constraint ID, property ID, constraint type ID, parameters).
The only question is whether to serialize the parameters or not. They’re large and we won’t use them at all, so I definitely don’t want them in the cache. Should it be configurable whether they’re serialized or not, or do we just never serialize them?