Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feature/ implement substrate event parser #923
feature/ implement substrate event parser #923
Changes from 5 commits
b577beb
d7ad32c
5d977f9
c723336
bd9696d
39d09b5
07e5e52
b51a2e7
4c655ac
89c4389
b57bdf8
12a9905
3eb74c8
2cb4091
bf74ca7
c34f00a
d7de52f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Ack
bytes come from theWriteAcknowledgement
event, while the rest of the params come from theReceivePacket
event. We usepacketAccumulator
for combining the info from both events in the cosmos event parser.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In cosmos, both the
WriteAcknowledgement
andReceivePacket
event will be included in a single IBC message. ThepacketInfo
should be constructed with theHeight
property, as you have shown, if info is nil. If info is not nil, it should be casted topacketInfo
. The attributes should be parsed into the resultingpacketInfo
. This will "accumulate" the properties from multiple events into a singlepacketInfo
. The case of theWriteAcknowledgement
/ReceivePacket
events in the same message is the only need for the accumulator, the rest of the message types do not need an accumulator.relayer/relayer/chains/cosmos/event_parser.go
Line 98 in 91182c9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this context, where is
msg
?Given that the function signature is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, Please check the implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agouin can you confirm, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
PathProcessor
depends on the eventType being in the format ofibc-go
. For example, instead ofSendPacket
, it should bechantypes.EventTypeSendPacket
(which issend_packet
). A helper might be nice to translate from the substrate ibc event type to the ibc-go event type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agouin can you point me to a place to lookup for the mappings? I've started here already 39d09b5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a consolidated place to find them in the cosmos event parser
relayer/relayer/chains/cosmos/event_parser.go
Line 86 in 91182c9