-
Notifications
You must be signed in to change notification settings - Fork 780
Description
As part of the PR #1677, some beta proto files (v1betaN) ended up importing a v1 proto. The reason was to avoid protobuf code duplication (i.e., having analogous proto data structures both in v1 and v1betaN. The drawback of this approach is that, when modifying a v1 proto, we need to be careful, we need to:
- Search for any
v1betaNproto file that imports thev1proto being modified - If there exists at least one
v1betaNproto file importing thev1proto being modified then- In Promote latest versions of Protobuf definitions to v1 packages #1677, find the
v1betaNproto file that corresponds to thev1proto being modified - If that
v1betaNproto has been converted tov1(so thev1betaNproto appears in red) then- Recreate it again in a new PR
- Adapt every
v1betaNproto that imports thev1proto under modification to import the newly recreatedv1betaNproto
- In Promote latest versions of Protobuf definitions to v1 packages #1677, find the
This would prevent issues when making changes to the current level proto level that can inadvertently cause breaking changes.
Some examples of the current imports are:
v1beta1(lower level) importsv1(higher level)- File
proto/cometbft/abci/v1beta1/types.protohasimport "cometbft/crypto/v1/keys.proto" - File
proto/cometbft/types/v1beta1/validator.protohasimport "cometbft/crypto/v1/keys.proto";
- File
Definition of Done (DoD):
Go through all the current proto files and find all the use cases where a lower proto level references a higher proto level (as the examples above)
- v1beta1
- v1beta2
- v1beta3
For each level (v1betaN)
- Ensure the proto on a higher level proto with the level of the proto that was there before (e.g.
v1beta1was deleted andv1was referenced instead, so ensure thev1beta1andv1have the same structure). - Recreate the higher level proto in the lower level (e.g. if in a
v1beta1level referencesv1, then re-create av1beta1with the same content and replace the import. - Generate the
.pb.gofiles for the newly re-created protos.
Backport changes
In the release that uses a particular proto level as specified in this table, ensure that the code references are updated accordingly to use the refactored protos above (if applicable)
- v0.34
- v0.37
- v0.38
Final check
- Ensure that all the dependencies between proto levels are right.