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

recv_packet/write_acknowledgement separation #1038

Merged
merged 6 commits into from
Nov 8, 2022

Conversation

agouin
Copy link
Member

@agouin agouin commented Nov 6, 2022

Separate recv_packet from write_acknowledgement events since they can be in separate blocks with forward middleware.

This moves the duty of combining the data from the write_acknowledgement event with the recv_packet event into the path processor, which simplifies the event parser.

… be in separate blocks with forward middleware
@agouin agouin changed the title recv_packet write_acknowledgement separation recv_packet/write_acknowledgement separation Nov 6, 2022
@agouin agouin marked this pull request as ready for review November 8, 2022 14:06
Copy link
Member

@jtieri jtieri left a comment

Choose a reason for hiding this comment

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

More great cleanup here!

Comment on lines -55 to -78
switch event.Type {
case chantypes.EventTypeRecvPacket, chantypes.EventTypeWriteAck:
pi := &packetInfo{Height: height}
pi.parseAttrs(log, evt.Attributes)
ck, err := processor.PacketInfoChannelKey(event.Type, provider.PacketInfo(*pi))
if err == nil {
pk := packetKey{
sequence: pi.Sequence,
channel: ck,
}
_, ok := recvPacketMsgs[pk]
if !ok {
recvPacketMsgs[pk] = pi
} else {
recvPacketMsgs[pk].parseAttrs(log, evt.Attributes)
}
}
default:
m := parseIBCMessageFromEvent(log, evt, chainID, height)
if m == nil || m.info == nil {
// Not an IBC message, don't need to log here
continue
}
messages = append(messages, *m)
Copy link
Member

Choose a reason for hiding this comment

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

🔥

@agouin agouin merged commit 4a833a5 into main Nov 8, 2022
@agouin agouin deleted the andrew/recv_packet_write_ack_separation branch November 8, 2022 15:40
agouin added a commit that referenced this pull request Nov 9, 2022
* Separate recv_packet from write_acknowledgement events since they can be in separate blocks with forward middleware

* update recv packet info in map

* Correlate for flushes

* Remove unnecessary change

* Fix acks query
agouin added a commit that referenced this pull request Nov 15, 2022
* Separate recv_packet from write_acknowledgement events since they can be in separate blocks with forward middleware

* update recv packet info in map

* Correlate for flushes

* Remove unnecessary change

* Fix acks query
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

Successfully merging this pull request may close these issues.

2 participants