optakt / flow-dps

Flow Data Provisioning Service
Apache License 2.0
29 stars 13 forks source link

CBOR: error on extra fields when decoding #413

Closed awfm9 closed 2 years ago

awfm9 commented 3 years ago

The bug we had with field names changing in block headers, and the encoded data no longer populating the fields with the changed names, could have been avoided by configuring the CBOR decoder properly. With ExtraDecErrorUnknownField, it would have errored explicitly on encoded fields which don't have a corresponding field in the struct we decode into.

We should enable that option for all of our decoding, meaning for ZBOR as well as for the execution record decoding.