com.r3corda.core.serialization / THREAD_LOCAL_KRYO

THREAD_LOCAL_KRYO

val THREAD_LOCAL_KRYO: <ERROR CLASS>

Serialization utilities, using the Kryo framework with a custom serialiser for immutable data classes and a dead simple, totally non-extensible binary (sub)format.

This is NOT what should be used in any final platform product, rather, the final state should be a precisely specified and standardised binary format with attention paid to anti-malleability, versioning and performance. FIX SBE is a potential candidate: it prioritises performance over convenience and was designed for HFT. Google Protocol Buffers with a minor tightening to make field reordering illegal is another possibility.

FIX SBE: https://real-logic.github.io/simple-binary-encoding/ http://mechanical-sympathy.blogspot.co.at/2014/05/simple-binary-encoding.html Protocol buffers: https://developers.google.com/protocol-buffers/

But for now we use Kryo to maximise prototyping speed.

Note that this code ignores ALL concerns beyond convenience, in particular it ignores:

This code will happily deserialise literally anything, including malicious streams that would reconstruct classes in invalid states, thus violating system invariants. It isnt designed to handle malicious streams and therefore, isnt usable beyond the prototyping stage. But thats fine: we can revisit serialisation technologies later after a formal evaluation process.