Provide ccf.EventsEncModeV0
and ccf.EventsEncModeV1
for encoding events in CCF format
#3448
Labels
Go API Breaking Change
Breaks programs which use the Cadence repo as a Go dependency
Improvement
Performance
Updates epic:
Problem
Currently,
ccf.EventsEncMode
matches default unsorted CCF codec settings. This can cause future issues because:ccf.EventsEncMode
(currently same as default but not guaranteed).Suggested Solution
I think a dedicated CCF mode (immutable settings) should be provided for each CCF-based format and version. For simplicity, maybe each exported CCF mode can use its name to identify the CCF-based format and version.
One benefit of providing such helper functions in here is to help prevent apps individually specifying CCF codec settings for CCF events, so we reduce risk of decoding apps and encoding apps using wrong/different serialization settings.
For example, we can export and use these dedicated modes for encoding events (v0 and v1):
ccf.EventsEncModeV0
: unsorted fields, etc. for compatibility with JSON-CDC, etc.ccf.EventsEncModeV1
: sorted fields, etc. for deterministic encodingWe can also provide dedicated modes for CCF decoding. However, decoding modes can be addressed in a separate issue after encoding modes are resolved.
About CCF
The text was updated successfully, but these errors were encountered: