-
Notifications
You must be signed in to change notification settings - Fork 523
Closed
Labels
Description
Summary
Recently the field Logs []string was added to EvalDelta. This field is meant to hold arbitrary binary data, but because it was declared with []string, when encoding into JSON the data is interpreted as UTF-8. If instead it were declared as [][]byte, our encoder would base64 encode the contents when encoding into JSON. For this reason, it's necessary to use []byte over string for binary data in all cases.
Scope
- Add a unit test which uses reflection and recursion to examine all fields referenced from
bookkeeping.Block. If the field is a string and we don't have a specific exception for it, error. This will prevent us from accidentally adding string fields going forward. - For existing string fields, create exceptions so the test passes with the current structs.
However, investigate whether converting these fields to byte slices has any effect on their msgpack encoding -- if not, then convert them to byte slices to eliminate all strings from the structs.- Msgpack uses different byte prefixes to distinguish between strings and binary data, so we cannot migrate the existing
stringinstances to[]bytewithout changing the canonical encoding of these structures.
- Msgpack uses different byte prefixes to distinguish between strings and binary data, so we cannot migrate the existing