Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unknown fields when parsing typed events #14983

Closed
ryanchristo opened this issue Feb 9, 2023 · 1 comment · Fixed by #14995
Closed

Allow unknown fields when parsing typed events #14983

ryanchristo opened this issue Feb 9, 2023 · 1 comment · Fixed by #14995
Assignees
Labels
T: Dev UX UX for SDK developers (i.e. how to call our code)

Comments

@ryanchristo
Copy link
Contributor

ryanchristo commented Feb 9, 2023

Summary of Bug

Adding fields in protobuf are intended to be non-breaking API changes / backwards compatible. The current implementation of ParseTypedEvent throws an error when parsing protobuf messages with new fields.

We've encountered this issue with a new field added to a custom module event and with the authz_msg_index field that was added in #12668. The following addition would make ParseTypedEvent backwards compatible:

	unmarshaler := jsonpb.Unmarshaler{AllowUnknownFields: true}

	err = unmarshaler.Unmarshal(strings.NewReader(string(attrBytes)), protoMsg)
	if err != nil {
		return nil, err
	}

Version

main, v0.47, v0.46

Steps to Reproduce

Use ParseTypedEvent with a message executed via MsgExec.

@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Feb 9, 2023
@tac0turtle tac0turtle added T: Dev UX UX for SDK developers (i.e. how to call our code) T:Sprint and removed needs-triage Issue that needs to be triaged labels Feb 9, 2023
@alexanderbez
Copy link
Contributor

@aaronc this seems reasonable to you right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: Dev UX UX for SDK developers (i.e. how to call our code)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants