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

ICS04: Unordered channels for Packet receiving #5080

Closed
mossid opened this issue Sep 20, 2019 · 2 comments
Closed

ICS04: Unordered channels for Packet receiving #5080

mossid opened this issue Sep 20, 2019 · 2 comments

Comments

@mossid
Copy link
Contributor

mossid commented Sep 20, 2019

Channel types are defined as ChannelOrder under Definitions in ICS04:

enum ChannelOrder {
  ORDERED,
  UNORDERED,
}

and the packet submission works differently on the different channel ordering types:

function recvPacket(
  packet: OpaquePacket,
  proof: CommitmentProof,
  proofHeight: uint64,
  acknowledgement: bytes): Packet {
    ...
  
    if (acknowledgement.length > 0 || channel.order === UNORDERED)
      provableStore.set(
        packetAcknowledgementPath(packet.destPort, packet.destChannel, packet.sequence),
        hash(acknowledgement)
      )

    if (channel.order === ORDERED) {
      nextSequenceRecv = provableStore.get(nextSequenceRecvPath(packet.destPort, packet.destChannel))
      abortTransactionUnless(packet.sequence === nextSequenceRecv)
      nextSequenceRecv = nextSequenceRecv + 1
      provableStore.set(nextSequenceRecvPath(packet.destPort, packet.destChannel), nextSequenceRecv)
    }

    // return transparent packet
    return packet
}

The current implementation defines only ordered channels. We need to add ordering logic in the channel implementation and modify Object.Receive() function to match with recvPacket.

@mossid mossid added the x/ibc label Sep 20, 2019
@mossid mossid changed the title ICS04: Unordered channels ICS04: Unordered channels for Packet receiving Sep 20, 2019
@mossid mossid mentioned this issue Oct 1, 2019
5 tasks
@alexanderbez alexanderbez added this to the IBC Implementation & Integration milestone Oct 1, 2019
@jackzampolin
Copy link
Member

Sounds like @fedekunze has this in the current PRs

@fedekunze fedekunze modified the milestones: IBC Implementation & Integration, IBC Implementation Dec 10, 2019
@fedekunze
Copy link
Collaborator

Closed via #4548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants