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

modules/apps/27-interchain-accounts/controller/keeper: Keeper.SendTx doesn't seem to respect the zero value for types.MsgSendTx.TimeoutTimestamp which signifies being disabled #2267

Closed
1 of 3 tasks
odeke-em opened this issue Sep 10, 2022 · 2 comments · Fixed by #2280
Assignees
Labels
27-interchain-accounts type: bug Something isn't working as expected
Milestone

Comments

@odeke-em
Copy link
Contributor

Summary of Bug

The code in here

seq, err := s.Keeper.SendTx(ctx, chanCap, msg.ConnectionId, portID, msg.PacketData, msg.TimeoutTimestamp)
then invokes

if uint64(ctx.BlockTime().UnixNano()) >= timeoutTimestamp {
return 0, icatypes.ErrInvalidTimeoutTimestamp
}

but if we look at the definition of the types.MsgSendTx, it clearly says that a 0 value disables timeouts

// Timeout timestamp in absolute nanoseconds since unix epoch.
// The timeout is disabled when set to 0.
TimeoutTimestamp uint64 `protobuf:"varint,4,opt,name=timeout_timestamp,json=timeoutTimestamp,proto3" json:"timeout_timestamp,omitempty" yaml:"timeout_timestamp"`

Expected Behaviour

I expected that value to be honored and that ctx.BlockTime().UnixNano() wouldn't be blindly compared with what could be a zero value. If that's not the expected behavior, please update the proto definitions.

Version

a4be561


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@crodriguezvega
Copy link
Contributor

Good catch, @odeke-em!

I think we should probably do if timeoutTimestamp != 0 && uint64(ctx.BlockTime().UnixNano()) >= timeoutTimestamp, right @damiannolan?

Actually, I am wondering now... why do we need this check here at all? For ICS20 we don't have this check in SendTransfer...

@crodriguezvega crodriguezvega added type: bug Something isn't working as expected 27-interchain-accounts labels Sep 11, 2022
@crodriguezvega crodriguezvega moved this to Todo in ibc-go Sep 11, 2022
@crodriguezvega crodriguezvega added this to the v6.0.0 milestone Sep 11, 2022
@colin-axner
Copy link
Contributor

Hi @odeke-em, the documentation is incorrect. ICS 27 packets set the timeout height to be zero, thus the timeout timestamp must be non-zero

@colin-axner colin-axner self-assigned this Sep 28, 2022
Repository owner moved this from Todo to Done in ibc-go Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
27-interchain-accounts type: bug Something isn't working as expected
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants