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 malformed tracking_packet_key by ensuring base64 encoding/decoding during Genesis export/import #1668

Merged

Conversation

NagaTulasi
Copy link
Contributor

Description


Closes #1576

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

PR review checkboxes:

I have...

  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Targeted PR against the correct branch
  • included the correct type prefix in the PR title
  • Linked to the GitHub issue with discussion and accepted design
  • Targets only one GitHub issue
  • Wrote unit and integration tests
  • Wrote relevant migration scripts if necessary
  • All CI checks have passed
  • Added relevant godoc comments
  • Updated the scripts for local run, e.g genesis_config_commands.sh if the PR changes parameters
  • Add an issue in the e2e-tests repo if necessary

SDK Checklist

  • Import/Export Genesis
  • Registered Invariants
  • Registered Events
  • Updated openapi.yaml
  • No usage of go map
  • No usage of time.Now()
  • Used fixed point arithmetic and not float arithmetic
  • Avoid panicking in Begin/End block as much as possible
  • No unexpected math Overflow
  • Used sendCoin and not SendCoins
  • Out-of-block compute is bounded
  • No serialized ID at the end of store keys
  • UInt to byte conversion should use BigEndian

Full security checklist here


For Reviewer:

  • Confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • Confirmed all author checklist items have been addressed

After reviewer approval:

  • In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
  • In case the PR targets a release branch, PR must be rebased.

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
jovandeginste Jo Vandeginste
@NagaTulasi NagaTulasi requested a review from a team as a code owner December 18, 2024 19:21
Copy link

codecov bot commented Dec 22, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 22.54%. Comparing base (d0166dd) to head (26dceec).
Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
x/eibc/genesis.go 88.88% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1668      +/-   ##
==========================================
- Coverage   22.62%   22.54%   -0.08%     
==========================================
  Files         590      590              
  Lines      129309   129946     +637     
==========================================
+ Hits        29250    29292      +42     
- Misses      96174    96763     +589     
- Partials     3885     3891       +6     

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

Copy link
Contributor

@zale144 zale144 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an important change, however I think we might want to address the issue at the source. When setting the tracking packet key field value here

TrackingPacketKey: string(rollappPacketKey),
, we already might have data loss due to conversion of certain bytes, in particular whenever the order object is marshalled and stored. So, we could consider encoding it right there to preserve the bytes when saving to store, and perhaps renaming the field to TrackingPacketKeyEncoded to avoid confusion. However, changing the field might be a more sensitive change, we would need to make sure it is encoded/decoded in all necessary places.

@zale144
Copy link
Contributor

zale144 commented Dec 24, 2024

This is an important change, however I think we might want to address the issue at the source. When setting the tracking packet key field value here

TrackingPacketKey: string(rollappPacketKey),

, we already might have data loss due to conversion of certain bytes, in particular whenever the order object is marshalled and stored. So, we could consider encoding it right there to preserve the bytes when saving to store, and perhaps renaming the field to TrackingPacketKeyEncoded to avoid confusion. However, changing the field might be a more sensitive change, we would need to make sure it is encoded/decoded in all necessary places.

Ignore this comment, I realize bytes would still be preserved, I did observe loss when creating events though.

@omritoptix omritoptix merged commit 12bfcad into dymensionxyz:main Dec 24, 2024
5 of 7 checks passed
omritoptix pushed a commit that referenced this pull request Dec 25, 2024
…ing/decoding during Genesis export/import (#1668)

(cherry picked from commit 12bfcad)
omritoptix pushed a commit that referenced this pull request Dec 25, 2024
…ing/decoding during Genesis export/import (#1668)

(cherry picked from commit 12bfcad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eibc order tracking_packet_key field malformed upon export
5 participants