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

Modify MsgSendTx fields based on audit #2280

Merged
merged 21 commits into from
Sep 28, 2022

Conversation

chatton
Copy link
Contributor

@chatton chatton commented Sep 13, 2022

Description

closes: #2232
closes: #2200
closes: #2267


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@@ -50,7 +50,7 @@ func (s msgServer) SendTx(goCtx context.Context, msg *types.MsgSendTx) (*types.M
}

// explicitly passing nil as the argument is discarded as the channel capability is retrieved in SendTx.
seq, err := s.Keeper.SendTx(ctx, nil, msg.ConnectionId, portID, msg.PacketData, msg.TimeoutTimestamp)
seq, err := s.Keeper.SendTx(ctx, nil, msg.ConnectionId, portID, msg.PacketData, msg.RelativeTimeout)
Copy link
Contributor Author

@chatton chatton Sep 13, 2022

Choose a reason for hiding this comment

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

this value will be passed correctly in #2257

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2022

Codecov Report

Merging #2280 (5cf2181) into main (b97729d) will increase coverage by 0.03%.
The diff coverage is 80.39%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2280      +/-   ##
==========================================
+ Coverage   79.54%   79.57%   +0.03%     
==========================================
  Files         175      175              
  Lines       12069    12118      +49     
==========================================
+ Hits         9600     9643      +43     
- Misses       2045     2049       +4     
- Partials      424      426       +2     
Impacted Files Coverage Δ
...7-interchain-accounts/controller/ibc_middleware.go 70.96% <42.85%> (-9.56%) ⬇️
...27-interchain-accounts/controller/keeper/keeper.go 91.04% <75.00%> (-1.70%) ⬇️
...nterchain-accounts/controller/keeper/migrations.go 81.25% <75.00%> (+1.25%) ⬆️
...7-interchain-accounts/controller/keeper/account.go 85.00% <100.00%> (ø)
...7-interchain-accounts/controller/keeper/genesis.go 91.30% <100.00%> (ø)
...nterchain-accounts/controller/keeper/msg_server.go 100.00% <100.00%> (ø)
...ps/27-interchain-accounts/controller/types/msgs.go 91.66% <100.00%> (-0.65%) ⬇️
...apps/27-interchain-accounts/host/keeper/account.go 100.00% <100.00%> (+23.07%) ⬆️
...ps/27-interchain-accounts/host/keeper/handshake.go 92.18% <100.00%> (+7.57%) ⬆️
modules/apps/27-interchain-accounts/module.go 54.00% <100.00%> (+1.42%) ⬆️
... and 7 more

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

LGTM!

Just need to update the error return in ValidateBasic I think! 🚀

flagPacketTimeoutHeight = "packet-timeout-height"
flagPacketTimeoutTimestamp = "packet-timeout-timestamp"
flagVersion = "version"
flagRelativePacketTimeoutTimestamp = "relative-packet-timeout"
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: why not drop the Timestamp word? In the proto file is called just relative_timeout and timestamp has the connotation of a fixed date/time...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it must have been accidentally included! I've removed it now

Comment on lines 40 to 41
// Timeout timestamp in absolute nanoseconds since unix epoch.
// The timeout is disabled when set to 0.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the documentation needs to be moved and updated.

I'd suggest:

Suggested change
// Timeout timestamp in absolute nanoseconds since unix epoch.
// The timeout is disabled when set to 0.
// Relative timeout timestamp provided will be added to the current block time during transaction execution.
// The timeout timestamp must be non-zero.

This will close #2267

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Ay! Nice work! One last suggestion, might be nice to return the error from failed packet data validation

@chatton chatton merged commit 3c21b5e into main Sep 28, 2022
@chatton chatton deleted the cian/issue#2232-modify-msgsendtx-fields branch September 28, 2022 19:02
mergify bot pushed a commit that referenced this pull request Sep 28, 2022
colin-axner pushed a commit that referenced this pull request Sep 29, 2022
(cherry picked from commit 3c21b5e)

Co-authored-by: Cian Hatton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants