-
Notifications
You must be signed in to change notification settings - Fork 626
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
feat(core, apps): 'PacketData' interface added and implemented #4200
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4200 +/- ##
==========================================
+ Coverage 79.45% 79.48% +0.03%
==========================================
Files 188 188
Lines 12990 13005 +15
==========================================
+ Hits 10321 10337 +16
+ Misses 2240 2239 -1
Partials 429 429
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK pending change from GetPacketSender
-> GetSender
// NOTES: | ||
// - The sender address is set at the source chain and not validated by | ||
// a signature check in IBC. | ||
// - sourcePortID is not used in this implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// NOTES: | |
// - The sender address is set at the source chain and not validated by | |
// a signature check in IBC. | |
// - sourcePortID is not used in this implementation. | |
// NOTE: | |
// - The sender address is set by the packet sender and may not have been validated a signature check if the packet sender isn't the transfer module. | |
// - The sender address must only be used by modules on the sending chain. | |
// - sourcePortID is not used in this implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits:
Is it necessary to say if the packet sender isn't the transfer module
. Because in pfm, the packet sender is still technically the transfer module. Pfm just submits a MsgTransfer on behalf of a user I believe.
Should we use should
instead of must
in The sender address must only be used by modules on the sending chain.
For now, I'll paste your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good questions, what if we rather state:
- The sender address is the sender embedded in the packet data. The sender authentication is handled by the module which requested the packet to be sent.
and for
Should we use should instead of must in The sender address must only be used by modules on the sending chain.
I'm not sure what the language semantics dictate here, but I'd like to communicate that it is fully unsafe to use the packet sender on the destination chain without additional logic, whichever you think conveys that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, replied to your comment, happy for my suggestions to be readjusted as your see fit
* refactor(core/exported): moved packet interfaces to packet.go * feat(core/exported): created PacketData interface * feat(transfer): implemented PacketData for transfer * feat(ica): implemented PacketData * docs(transfer.adr8): updated godocs of GetPacketSender * style(adr8): renamed parameter srcPortID -> sourcePortID * docs(core.adr8): updated godocs for PacketData interface * docs(core.adr8): improved godocs for PacketData interface * docs(core.adr8): updated godocs * docs(transfer.adr8): updated godocs * style(ica_test): removed unneeded comment * docs(ica.adr8): updated godocs * style(ica): fixed revive linter complaint * docs(transfer.adr8): updated GetPacketSender's godocs * style(transfer, ica): ran golangci-lin (cherry picked from commit ec68438) # Conflicts: # modules/apps/27-interchain-accounts/types/packet.go # modules/apps/27-interchain-accounts/types/packet_test.go # modules/apps/transfer/types/packet.go # modules/apps/transfer/types/packet_test.go # modules/core/exported/packet.go
…ort #4200) (#4219) * feat(core, apps): 'PacketData' interface added and implemented (#4200) * refactor(core/exported): moved packet interfaces to packet.go * feat(core/exported): created PacketData interface * feat(transfer): implemented PacketData for transfer * feat(ica): implemented PacketData * docs(transfer.adr8): updated godocs of GetPacketSender * style(adr8): renamed parameter srcPortID -> sourcePortID * docs(core.adr8): updated godocs for PacketData interface * docs(core.adr8): improved godocs for PacketData interface * docs(core.adr8): updated godocs * docs(transfer.adr8): updated godocs * style(ica_test): removed unneeded comment * docs(ica.adr8): updated godocs * style(ica): fixed revive linter complaint * docs(transfer.adr8): updated GetPacketSender's godocs * style(transfer, ica): ran golangci-lin (cherry picked from commit ec68438) # Conflicts: # modules/apps/27-interchain-accounts/types/packet.go # modules/apps/27-interchain-accounts/types/packet_test.go # modules/apps/transfer/types/packet.go # modules/apps/transfer/types/packet_test.go # modules/core/exported/packet.go * fix: fixed backporting conflicts * fix: used TrimPrefix because CutPrefix was added in go1.20 * style(ica_test): typo fixed --------- Co-authored-by: srdtrk <59252793+srdtrk@users.noreply.github.com> Co-authored-by: srdtrk <srdtrk@hotmail.com>
Description
This PR reduces the diff when reviewing the adr8 PR #3939.
PacketData
defines an optional interface which PacketData's may implement.closes: #XXXX
Commit Message / Changelog Entry
see the guidelines for commit messages. (view raw markdown for examples)
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Linked to Github issue with discussion and accepted design OR link to spec that describes this work.docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.