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

fix(ics-23): Auto-derive serde::Serialize for CommitmentPrefix #1230

Merged
merged 2 commits into from
May 21, 2024

Conversation

seanchen1991
Copy link
Contributor

Closes: #1229

Description


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@seanchen1991 seanchen1991 changed the title fix/auto-derive serde::Serialize for CommitmentPrefix fix(ics-23): Auto-derive serde::Serialize for CommitmentPrefix May 16, 2024
@seanchen1991 seanchen1991 changed the title fix(ics-23): Auto-derive serde::Serialize for CommitmentPrefix fix(ics-23): Auto-derive serde::Serialize for CommitmentPrefix May 16, 2024
Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 67.33%. Comparing base (86a0ee0) to head (c3cbca4).

Files Patch % Lines
ibc-core/ics23-commitment/types/src/commitment.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1230      +/-   ##
==========================================
+ Coverage   67.31%   67.33%   +0.01%     
==========================================
  Files         234      234              
  Lines       23553    23547       -6     
==========================================
  Hits        15855    15855              
+ Misses       7698     7692       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soareschen
Copy link
Collaborator

I think this is a reasonable fix. However, we may want to consider whether it is fine for breaking compatibility in this case. Let's wait for @rnbguy and @romac to review and discuss the changes.

@soareschen soareschen requested review from romac and rnbguy May 17, 2024 08:22
@romac
Copy link
Member

romac commented May 17, 2024

I think that's fine, better to break compatibility now and have consistent serialization than the reverse.

@soareschen
Copy link
Collaborator

Sounds good. @seanchen1991 let's add a changelog to indicate the breaking change?

@seanchen1991
Copy link
Contributor Author

@soareschen, you mentioned that you opened a fork that manually implements deserialization from String. Would that route be preferable than opting to auto-derive Serialize?

@seanchen1991
Copy link
Contributor Author

Oh, I just saw this comment, which makes me think we should just opt to auto-derive Serialize instead of manually implement Deserialize.

@soareschen
Copy link
Collaborator

Yes, the custom fix is at https://github.com/cosmos/ibc-rs/tree/soares/fix-commitment-prefix-deserialize. But we should serialize and deserialize it as bytes, as the current behavior for serializing non-UTF8 commitment prefix is incorrect.

@seanchen1991 seanchen1991 added this pull request to the merge queue May 21, 2024
Merged via the queue into main with commit 5873500 May 21, 2024
19 checks passed
@seanchen1991 seanchen1991 deleted the auto-derive-ser-commitment-prefix branch May 21, 2024 15:55
Farhad-Shabani pushed a commit that referenced this pull request Sep 9, 2024
…1230)

* Auto-derive serde::Serialize for CommitmentPrefix

* Add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Fix inconsistencies when de/serializing CommitmentPrefix
3 participants