Description
Agglayer node has to be able to correctly load certificates and other pieces of data written by older versions of the software. We currently rely on code reviews to accomplish that which has proven to be rather error prone. Tooling should be introduced to automate this at least in part.
Suggested approach
Take a snapshot of the internal structure of serialized types as understood by serde. Commit it into the repo. Differences will be way more obvious during the code review, making potential incompatibilities easier to spot.
- serde_reflection to extract the structure
- insta to take the snapshot
Possible follow up
The CI could checkout the structure snapshot from the base branch and from the PR branch. Then feed them both into a script checking backwards incompatibilites.
- Enum arms can only be added at the end of the enum
- Adding fields to structs is not allowed
False positives are to some degree expected but it should help with the most common cases.