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

Why Query/NextSequenceSend is not available for UNORDERED channels? #4698

Closed
3 tasks
dzmitry-lahoda opened this issue Sep 18, 2023 · 1 comment · Fixed by #4706
Closed
3 tasks

Why Query/NextSequenceSend is not available for UNORDERED channels? #4698

dzmitry-lahoda opened this issue Sep 18, 2023 · 1 comment · Fixed by #4706
Labels
gRPC Issues for gRPC endpoints type: bug Something isn't working as expected

Comments

@dzmitry-lahoda
Copy link
Contributor

Summary

Query/NextSequenceSend to return real packet sequence for UNORDERED channels instead of zero.

Problem Definition

Handler of Query/NextSequenceSend has next code:

	var sequence uint64
	if channel.Ordering != types.UNORDERED {
		sequence, found = k.GetNextSequenceSend(ctx, req.PortId, req.ChannelId)
		if !found {
			return nil, status.Error(
				codes.NotFound,
				errorsmod.Wrapf(types.ErrSequenceSendNotFound, "port-id: %s, channel-id %s", req.PortId, req.ChannelId).Error(),
			)
		}
	}
	selfHeight := clienttypes.GetSelfHeight(ctx)
	return types.NewQueryNextSequenceSendResponse(sequence, nil, selfHeight), nil

returning zero for request.

But GetNextSequenceSend works for UNORDERED for sure. Because it is used in ICS-20 transfer application, here is transfer send method

	sequence, err := k.ics4Wrapper.SendPacket(ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, packetData.GetBytes())
	if err != nil {
		return 0, err
	}

If to allow getting next sequence query handling for UNORDERED channels it will simplify correlation of message sent with IBC timeouts/ack callbacks for various forms of handling.

Proposal

Remove check of UNORDERED


For Admin Use

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

Thanks, @dzmitry-lahoda. Yeah, this looks like an oversight from our side. I see that you opened a PR already, so thank you also for that!

@crodriguezvega crodriguezvega added type: bug Something isn't working as expected gRPC Issues for gRPC endpoints labels Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gRPC Issues for gRPC endpoints type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants