cosmos-sdk
cosmos-sdk copied to clipboard
refactor(stf): find alternative to reflection.Set to achieve proto.Merge on STf
We cannot use proto.Merge in STF because it fails with custom types. So we're forced to use reflection.Set, which is a little hacky and might have impact in embedded environments.
Possible alternatives:
- marshal and unmarshal: performance would be bad.
- fix our gogoproto fork to have Merge work with custom types
Ref: https://github.com/cosmos/cosmos-sdk/blob/main/server/v2/stf/stf_router.go#L167