Skip to content

ICS04: adds event emission in recvPacket to align with implementation#844

Merged
crodriguezvega merged 6 commits into
mainfrom
carlos/755-ics4-recvpacket-should-emit-an-event-for-already-received-packets-on-ordered-channels
Oct 24, 2022
Merged

ICS04: adds event emission in recvPacket to align with implementation#844
crodriguezvega merged 6 commits into
mainfrom
carlos/755-ics4-recvpacket-should-emit-an-event-for-already-received-packets-on-ordered-channels

Conversation

@crodriguezvega
Copy link
Copy Markdown
Contributor

Closes: #755

// it's the sentinel success receipt: []byte{0x01}
abortTransactionUnless(provableStore.get(packetReceiptPath(packet.destPort, packet.destChannel, packet.sequence) === null))
packetRecepit = provableStore.get(packetReceiptPath(packet.destPort, packet.destChannel, packet.sequence))
if (packetRecepit != null) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I noticed that we are also emitting an event in this case in ibc-go, so I added it here as well. I hope that's ok.

// log that a packet has been received
emitLogEntry("recvPacket", {sequence: packet.sequence, timeoutHeight: packet.timeoutHeight, port: packet.destPort, channel: packet.destChannel,
timeoutTimestamp: packet.timeoutTimestamp, data: packet.data})
emitLogEntry("recvPacket", {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought it would help readability to break the long line...

…ent-for-already-received-packets-on-ordered-channels
Copy link
Copy Markdown
Contributor

@mpoke mpoke 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 some nits. See comments below.

Comment thread spec/core/ics-004-channel-and-packet-semantics/README.md Outdated
Comment thread spec/core/ics-004-channel-and-packet-semantics/README.md
Comment thread spec/core/ics-004-channel-and-packet-semantics/README.md Outdated
Comment thread spec/core/ics-004-channel-and-packet-semantics/README.md
Comment thread spec/core/ics-004-channel-and-packet-semantics/README.md Outdated
Comment thread spec/core/ics-004-channel-and-packet-semantics/README.md Outdated
@crodriguezvega crodriguezvega merged commit 96dd5ba into main Oct 24, 2022
@crodriguezvega crodriguezvega deleted the carlos/755-ics4-recvpacket-should-emit-an-event-for-already-received-packets-on-ordered-channels branch October 24, 2022 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

ICS4: recvPacket() should emit an event for already received packets on ordered channels

3 participants