-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
x/ibc: implement ADR 032 typed events #7762
Closed
Closed
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
5b539e7
Add EmitTypedEvent in events
akhilkumarpilli ed85dd7
Add parseTypedEvent method
akhilkumarpilli 7d9919b
Use jsonpb
anilcse deb1e3c
Modify unmarshal proto in events
akhilkumarpilli 5e11d14
Merge branch 'events-adr' of github.com:akhilkumarpilli/cosmos-sdk in…
akhilkumarpilli 171f362
Add a test for typed events
anilcse f158344
Fix reflect issue in parseTypedEvent
akhilkumarpilli faeab07
Modify event tests and add comments
akhilkumarpilli fe5f8ca
Merge remote-tracking branch 'upstream/master' into events-adr
akhilkumarpilli 50f3f1f
Add EmitTypedEvents and refactor other methods
akhilkumarpilli 45f32f8
Merge remote-tracking branch 'upstream/master' into events-adr
akhilkumarpilli fa6a618
Fix golangci-lint issues
akhilkumarpilli 625501d
Merge remote-tracking branch 'upstream/master' into events-adr
akhilkumarpilli 526d942
Update ProtoMarshalJSON params
akhilkumarpilli 6719759
Merge remote-tracking branch 'upstream/master' into events-adr
akhilkumarpilli d8b6883
Merge branch 'master' into events-adr
jackzampolin 5f472bf
Address PR comments
akhilkumarpilli a79c878
Merge remote-tracking branch 'upstream/master' into events-adr
akhilkumarpilli ebb07e3
Add typed events in ibc transfer
akhilkumarpilli b16fcd0
Merge branch 'master' into events-adr
jackzampolin 700f504
x/ibc: migrate EmitEvent to EmitTypedEvents
akhilkumarpilli 62be11a
Merge branch 'events-adr' into ibc-typed-events
akhilkumarpilli 7f98f3f
Merge remote-tracking branch 'upstream/master' into ibc-typed-events
akhilkumarpilli 3324f28
Merge branch 'master' into ibc-typed-events
jackzampolin 2a7b622
Merge branch 'master' into ibc-typed-events
akhilkumarpilli 8d7747e
Add TestPackHeight
akhilkumarpilli 123f0c2
Merge branch 'master' into ibc-typed-events
jackzampolin d998bd9
Use *Height instead of Height
akhilkumarpilli 5efe687
Merge branch 'master' into akhil/7563-ibc-typed-events
akhilkumarpilli d8c41cf
Merge branch 'master' into akhil/7563-ibc-typed-events
akhilkumarpilli f0212b1
Merge branch 'master' into akhil/7563-ibc-typed-events
jackzampolin a4d9034
Fix tendermint abci query txs issue
akhilkumarpilli 5a4d5dc
Merge branch 'master' into akhil/7563-ibc-typed-events
akhilkumarpilli f609c7e
Add ResultEventToABCIEvent
akhilkumarpilli 6d92028
Fix golangci lint issues
akhilkumarpilli 344614b
Update attribute value encoding
akhilkumarpilli dfe947b
Merge branch 'master' into akhil/7563-ibc-typed-events
akhilkumarpilli 3e9169c
Revert EventTypeMessage events
akhilkumarpilli f9eb795
Revert Height changes
akhilkumarpilli f3fa0c7
Address PR comments
akhilkumarpilli d0192c8
Merge branch 'master' into akhil/7563-ibc-typed-events
akhilkumarpilli c00f98d
Fix error
akhilkumarpilli 7e85d4e
Address few PR comments
akhilkumarpilli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
syntax = "proto3"; | ||
package ibc.applications.transfer.v1; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/applications/transfer/types"; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
// EventTransfer is a typed event emitted on ibc transfer | ||
message EventTransfer { | ||
string sender = 1; | ||
|
||
string receiver = 2; | ||
} | ||
|
||
// EventAcknowledgementSuccess is a typed event emitted on packet acknowledgement success | ||
message EventAcknowledgementSuccess { | ||
bytes success = 1; | ||
} | ||
|
||
// EventAcknowledgementError is a typed event emitted on packet acknowledgement error | ||
message EventAcknowledgementError { | ||
string error = 1; | ||
} | ||
|
||
// EventDenominationTrace is a typed event for denomination trace | ||
message EventDenominationTrace { | ||
string trace_hash = 1 [(gogoproto.moretags) = "yaml:\"trace_hash\""]; | ||
|
||
string denom = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
syntax = "proto3"; | ||
package ibc.core.channel.v1; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"; | ||
|
||
import "ibc/core/channel/v1/channel.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "ibc/core/client/v1/client.proto"; | ||
|
||
// EventChannelOpenInit is a typed event emitted on channel open init | ||
message EventChannelOpenInit { | ||
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; | ||
|
||
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
|
||
string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; | ||
|
||
string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
} | ||
|
||
// EventChannelOpenTry is a typed event emitted on channel open try | ||
message EventChannelOpenTry { | ||
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; | ||
|
||
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
|
||
string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; | ||
|
||
string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; | ||
|
||
string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
} | ||
|
||
// EventChannelOpenAck is a typed event emitted on channel open acknowledgement | ||
message EventChannelOpenAck { | ||
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; | ||
|
||
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
|
||
string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; | ||
|
||
string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; | ||
|
||
string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
} | ||
|
||
// EventChannelOpenConfirm is a typed event emitted on channel open confirm | ||
message EventChannelOpenConfirm { | ||
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; | ||
|
||
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
|
||
string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; | ||
|
||
string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; | ||
|
||
string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
} | ||
|
||
// EventChannelCloseInit is a typed event emitted on channel close init | ||
message EventChannelCloseInit { | ||
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; | ||
|
||
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
|
||
string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; | ||
|
||
string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; | ||
|
||
string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
} | ||
|
||
// EventChannelCloseConfirm is a typed event emitted on channel close confirm | ||
message EventChannelCloseConfirm { | ||
string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; | ||
|
||
string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; | ||
|
||
string counterparty_port_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_port_id\""]; | ||
|
||
string counterparty_channel_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; | ||
|
||
string connection_id = 5 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
} | ||
|
||
// EventChannelSendPacket is a typed event emitted when packet is sent | ||
message EventChannelSendPacket { | ||
bytes data = 1; | ||
|
||
ibc.core.client.v1.Height timeout_height = 2 | ||
[(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; | ||
|
||
uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; | ||
|
||
uint64 sequence = 4; | ||
|
||
string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; | ||
|
||
string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; | ||
|
||
string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; | ||
|
||
string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; | ||
|
||
Order channel_ordering = 9 [(gogoproto.moretags) = "yaml:\"channel_ordering\""]; | ||
} | ||
|
||
// EventChannelRecvPacket is a typed event emitted when packet is received in channel | ||
message EventChannelRecvPacket { | ||
bytes data = 1; | ||
|
||
ibc.core.client.v1.Height timeout_height = 2 | ||
[(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; | ||
|
||
uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; | ||
|
||
uint64 sequence = 4; | ||
|
||
string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; | ||
|
||
string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; | ||
|
||
string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; | ||
|
||
string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; | ||
|
||
Order channel_ordering = 9 [(gogoproto.moretags) = "yaml:\"channel_ordering\""]; | ||
} | ||
|
||
// EventChannelWriteAck is a typed event emitted on write acknowledgement | ||
message EventChannelWriteAck { | ||
bytes data = 1; | ||
|
||
ibc.core.client.v1.Height timeout_height = 2 | ||
[(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; | ||
|
||
uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; | ||
|
||
uint64 sequence = 4; | ||
|
||
string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; | ||
|
||
string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; | ||
|
||
string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; | ||
|
||
string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; | ||
|
||
bytes acknowledgement = 9; | ||
} | ||
|
||
// EventChannelAckPacket is a typed event emitted when packet acknowledgement is executed | ||
message EventChannelAckPacket { | ||
bytes data = 1; | ||
|
||
ibc.core.client.v1.Height timeout_height = 2 | ||
[(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; | ||
|
||
uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; | ||
|
||
uint64 sequence = 4; | ||
|
||
string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; | ||
|
||
string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; | ||
|
||
string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; | ||
|
||
string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; | ||
|
||
Order channel_ordering = 9 [(gogoproto.moretags) = "yaml:\"channel_ordering\""]; | ||
|
||
bytes acknowledgement = 10; | ||
} | ||
|
||
// EventChannelTimeoutPacket is a typed event emitted when packet is timeout | ||
message EventChannelTimeoutPacket { | ||
bytes data = 1; | ||
|
||
ibc.core.client.v1.Height timeout_height = 2 | ||
[(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; | ||
|
||
uint64 timeout_timestamp = 3 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; | ||
|
||
uint64 sequence = 4; | ||
|
||
string src_port = 5 [(gogoproto.moretags) = "yaml:\"src_port\""]; | ||
|
||
string src_channel = 6 [(gogoproto.moretags) = "yaml:\"src_channel\""]; | ||
|
||
string dst_port = 7 [(gogoproto.moretags) = "yaml:\"dst_port\""]; | ||
|
||
string dst_channel = 8 [(gogoproto.moretags) = "yaml:\"dst_channel\""]; | ||
|
||
Order channel_ordering = 9 [(gogoproto.moretags) = "yaml:\"channel_ordering\""]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
syntax = "proto3"; | ||
package ibc.core.client.v1; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/02-client/types"; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "ibc/core/client/v1/client.proto"; | ||
|
||
// EventCreateClient is a typed event emitted on creating client | ||
message EventCreateClient { | ||
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; | ||
|
||
ibc.core.client.v1.Height consensus_height = 3 | ||
[(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; | ||
} | ||
|
||
// EventUpdateClient is a typed event emitted on updating client | ||
message EventUpdateClient { | ||
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; | ||
|
||
ibc.core.client.v1.Height consensus_height = 3 | ||
[(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; | ||
} | ||
|
||
// EventUpgradeClient is a typed event emitted on upgrading client | ||
message EventUpgradeClient { | ||
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; | ||
|
||
ibc.core.client.v1.Height consensus_height = 3 | ||
[(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; | ||
} | ||
|
||
// EventUpdateClientProposal is a typed event emitted on updating client proposal | ||
message EventUpdateClientProposal { | ||
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; | ||
|
||
ibc.core.client.v1.Height consensus_height = 3 | ||
[(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; | ||
} | ||
|
||
// EventClientMisbehaviour is a typed event emitted when misbehaviour is submitted | ||
message EventClientMisbehaviour { | ||
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string client_type = 2 [(gogoproto.moretags) = "yaml:\"client_type\""]; | ||
|
||
ibc.core.client.v1.Height consensus_height = 3 | ||
[(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
syntax = "proto3"; | ||
package ibc.core.connection.v1; | ||
|
||
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/core/03-connection/types"; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
// EventConnectionOpenInit is a typed event emitted on connection open init | ||
message EventConnectionOpenInit { | ||
string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
|
||
string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string counterparty_client_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_client_id\""]; | ||
} | ||
|
||
// EventConnectionOpenTry is a typed event emitted on connection open try | ||
message EventConnectionOpenTry { | ||
string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
|
||
string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string counterparty_connection_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; | ||
|
||
string counterparty_client_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_client_id\""]; | ||
} | ||
|
||
// EventConnectionOpenAck is a typed event emitted on connection open acknowledgement | ||
message EventConnectionOpenAck { | ||
string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
|
||
string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string counterparty_connection_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; | ||
|
||
string counterparty_client_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_client_id\""]; | ||
} | ||
|
||
// EventConnectionOpenConfirm is a typed event emitted on connection open init | ||
message EventConnectionOpenConfirm { | ||
string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; | ||
|
||
string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; | ||
|
||
string counterparty_connection_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; | ||
|
||
string counterparty_client_id = 4 [(gogoproto.moretags) = "yaml:\"counterparty_client_id\""]; | ||
} |
Oops, something went wrong.
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.
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.
these can go in
channel
. We have a acknowledgement success/error type defined in channel so other applications may want to use this event. It's usage would make it easier on relayers as well