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

pfm(refactor): missing prefix for RefundPacketKey #217

Open
jtieri opened this issue Sep 4, 2024 · 0 comments
Open

pfm(refactor): missing prefix for RefundPacketKey #217

jtieri opened this issue Sep 4, 2024 · 0 comments
Labels
packet-forward-middleware Label for items related to the packet forward middleware

Comments

@jtieri
Copy link
Member

jtieri commented Sep 4, 2024

The RefundPacketKey function does not include a prefix that disambiguates it from other possible store paths.

While there are currently no other slash-separated store paths in Packet Forward Middleware's Keeper than RefundPacketKey, if one is added in the future, values stored under RefundPacketKey may collide with it.

Proposed fix:

func RefundPacketKey(channelID, portID string, sequence uint64) []byte {
  - return []byte(fmt.Sprintf("%s/%s/%d", channelID, portID, sequence))
  + return []byte(fmt.Sprintf("refund_packet/%s/%s/%d", channelID, portID,
      sequence))
}

Since this is a breaking change we do not plan to introduce these changes now but it's probably a good idea to keep this issue open so we can be aware of this issue in the case where we need to persist some additional data to the store in the future.

@jtieri jtieri added the packet-forward-middleware Label for items related to the packet forward middleware label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packet-forward-middleware Label for items related to the packet forward middleware
Projects
None yet
Development

No branches or pull requests

1 participant