From 76dbd34c365d213f65c1ab3e54fe1c380e1f2046 Mon Sep 17 00:00:00 2001 From: yutianwu Date: Tue, 7 Feb 2023 14:33:19 +0800 Subject: [PATCH 1/2] feat: add comments for the events of oracle and crosschain modules --- proto/cosmos/crosschain/v1/event.proto | 9 +++++++++ proto/cosmos/oracle/v1/event.proto | 10 ++++++++++ proto/cosmos/oracle/v1/oracle.proto | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/proto/cosmos/crosschain/v1/event.proto b/proto/cosmos/crosschain/v1/event.proto index a8529667b8..285e0a26ba 100644 --- a/proto/cosmos/crosschain/v1/event.proto +++ b/proto/cosmos/crosschain/v1/event.proto @@ -6,13 +6,22 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/crosschain/types"; // EventCrossChain is emitted when there is a cross chain package created message EventCrossChain { + // Source chain id of the cross chain package uint32 src_chain_id = 1; + // Destination chain id of the cross chainpackage uint32 dest_chain_id = 2; + // Channel id of the cross chain package uint32 channel_id = 3; + // Sequence of the cross chain package uint64 sequence = 4; + // Package type of the cross chain package, like SYN, ACK and FAIL_ACK uint32 package_type = 5; + // Timestamp of the cross chain package uint64 timestamp = 6; + // Payload of the cross chain package string package_load = 7; + // Relayer fee for the cross chain package string relayer_fee = 8; + // Relayer fee for the ACK or FAIL_ACK package of this cross chain package string ack_relayer_fee = 9; } diff --git a/proto/cosmos/oracle/v1/event.proto b/proto/cosmos/oracle/v1/event.proto index 974f7271da..fed8591578 100644 --- a/proto/cosmos/oracle/v1/event.proto +++ b/proto/cosmos/oracle/v1/event.proto @@ -7,14 +7,24 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/oracle/types"; // EventPackageClaim is emitted when a cross chain package is processed message EventPackageClaim { + // Source chain id of the package uint32 src_chain_id = 1; + // Destination chain id of the package uint32 dest_chain_id = 2; + // Channel id of the package uint32 channel_id = 3; + // Package type of the package, like SYN, ACK and FAIL_ACK uint32 package_type = 4; + // Receive sequence of the package uint64 receive_sequence = 5; + // Send sequence of the corresponding ACK package or FAIL_ACK package int64 send_sequence = 6; + // Crash status for the handle of this package bool crash = 7; + // Error message for the handle of this package string error_msg = 8; + // Relayer fee paid for this package string relayer_fee = 9; + // Relayer fee paid for the ACK or FAIL_ACK package string ack_relayer_fee = 10; } \ No newline at end of file diff --git a/proto/cosmos/oracle/v1/oracle.proto b/proto/cosmos/oracle/v1/oracle.proto index fd18ff17bf..0739e2e90d 100644 --- a/proto/cosmos/oracle/v1/oracle.proto +++ b/proto/cosmos/oracle/v1/oracle.proto @@ -5,7 +5,11 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/oracle/types"; // Params holds parameters for the oracle module. message Params { + // Timeout for the in turn relayer uint64 relayer_timeout = 1; // in s + // Backoff time for the other relayers uint64 relayer_backoff_time = 2; // in s + // Reward share for the relayer sends the claim message, + // the other relayers signed the bls message will share the reward evenly. uint32 relayer_reward_share = 3; // in percentage } From aba4b750b4d8490fcc14e835fbc9ce6b88ae8bf8 Mon Sep 17 00:00:00 2001 From: yutianwu Date: Tue, 7 Feb 2023 14:44:32 +0800 Subject: [PATCH 2/2] regenerate pb files --- x/crosschain/types/event.pb.go | 25 +++++++++++++++++-------- x/oracle/types/event.pb.go | 28 +++++++++++++++++++--------- x/oracle/types/oracle.pb.go | 6 +++++- 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/x/crosschain/types/event.pb.go b/x/crosschain/types/event.pb.go index 1fac3615d2..907fc5a963 100644 --- a/x/crosschain/types/event.pb.go +++ b/x/crosschain/types/event.pb.go @@ -24,14 +24,23 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // EventCrossChain is emitted when there is a cross chain package created type EventCrossChain struct { - SrcChainId uint32 `protobuf:"varint,1,opt,name=src_chain_id,json=srcChainId,proto3" json:"src_chain_id,omitempty"` - DestChainId uint32 `protobuf:"varint,2,opt,name=dest_chain_id,json=destChainId,proto3" json:"dest_chain_id,omitempty"` - ChannelId uint32 `protobuf:"varint,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` - PackageType uint32 `protobuf:"varint,5,opt,name=package_type,json=packageType,proto3" json:"package_type,omitempty"` - Timestamp uint64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - PackageLoad string `protobuf:"bytes,7,opt,name=package_load,json=packageLoad,proto3" json:"package_load,omitempty"` - RelayerFee string `protobuf:"bytes,8,opt,name=relayer_fee,json=relayerFee,proto3" json:"relayer_fee,omitempty"` + // Source chain id of the cross chain package + SrcChainId uint32 `protobuf:"varint,1,opt,name=src_chain_id,json=srcChainId,proto3" json:"src_chain_id,omitempty"` + // Destination chain id of the cross chainpackage + DestChainId uint32 `protobuf:"varint,2,opt,name=dest_chain_id,json=destChainId,proto3" json:"dest_chain_id,omitempty"` + // Channel id of the cross chain package + ChannelId uint32 `protobuf:"varint,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // Sequence of the cross chain package + Sequence uint64 `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"` + // Package type of the cross chain package, like SYN, ACK and FAIL_ACK + PackageType uint32 `protobuf:"varint,5,opt,name=package_type,json=packageType,proto3" json:"package_type,omitempty"` + // Timestamp of the cross chain package + Timestamp uint64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Payload of the cross chain package + PackageLoad string `protobuf:"bytes,7,opt,name=package_load,json=packageLoad,proto3" json:"package_load,omitempty"` + // Relayer fee for the cross chain package + RelayerFee string `protobuf:"bytes,8,opt,name=relayer_fee,json=relayerFee,proto3" json:"relayer_fee,omitempty"` + // Relayer fee for the ACK or FAIL_ACK package of this cross chain package AckRelayerFee string `protobuf:"bytes,9,opt,name=ack_relayer_fee,json=ackRelayerFee,proto3" json:"ack_relayer_fee,omitempty"` } diff --git a/x/oracle/types/event.pb.go b/x/oracle/types/event.pb.go index 9fb4ce677c..64e1c071be 100644 --- a/x/oracle/types/event.pb.go +++ b/x/oracle/types/event.pb.go @@ -24,16 +24,26 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // EventPackageClaim is emitted when a cross chain package is processed type EventPackageClaim struct { - SrcChainId uint32 `protobuf:"varint,1,opt,name=src_chain_id,json=srcChainId,proto3" json:"src_chain_id,omitempty"` - DestChainId uint32 `protobuf:"varint,2,opt,name=dest_chain_id,json=destChainId,proto3" json:"dest_chain_id,omitempty"` - ChannelId uint32 `protobuf:"varint,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - PackageType uint32 `protobuf:"varint,4,opt,name=package_type,json=packageType,proto3" json:"package_type,omitempty"` + // Source chain id of the package + SrcChainId uint32 `protobuf:"varint,1,opt,name=src_chain_id,json=srcChainId,proto3" json:"src_chain_id,omitempty"` + // Destination chain id of the package + DestChainId uint32 `protobuf:"varint,2,opt,name=dest_chain_id,json=destChainId,proto3" json:"dest_chain_id,omitempty"` + // Channel id of the package + ChannelId uint32 `protobuf:"varint,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // Package type of the package, like SYN, ACK and FAIL_ACK + PackageType uint32 `protobuf:"varint,4,opt,name=package_type,json=packageType,proto3" json:"package_type,omitempty"` + // Receive sequence of the package ReceiveSequence uint64 `protobuf:"varint,5,opt,name=receive_sequence,json=receiveSequence,proto3" json:"receive_sequence,omitempty"` - SendSequence int64 `protobuf:"varint,6,opt,name=send_sequence,json=sendSequence,proto3" json:"send_sequence,omitempty"` - Crash bool `protobuf:"varint,7,opt,name=crash,proto3" json:"crash,omitempty"` - ErrorMsg string `protobuf:"bytes,8,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` - RelayerFee string `protobuf:"bytes,9,opt,name=relayer_fee,json=relayerFee,proto3" json:"relayer_fee,omitempty"` - AckRelayerFee string `protobuf:"bytes,10,opt,name=ack_relayer_fee,json=ackRelayerFee,proto3" json:"ack_relayer_fee,omitempty"` + // Send sequence of the corresponding ACK package or FAIL_ACK package + SendSequence int64 `protobuf:"varint,6,opt,name=send_sequence,json=sendSequence,proto3" json:"send_sequence,omitempty"` + // Crash status for the handle of this package + Crash bool `protobuf:"varint,7,opt,name=crash,proto3" json:"crash,omitempty"` + // Error message for the handle of this package + ErrorMsg string `protobuf:"bytes,8,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` + // Relayer fee paid for this package + RelayerFee string `protobuf:"bytes,9,opt,name=relayer_fee,json=relayerFee,proto3" json:"relayer_fee,omitempty"` + // Relayer fee paid for the ACK or FAIL_ACK package + AckRelayerFee string `protobuf:"bytes,10,opt,name=ack_relayer_fee,json=ackRelayerFee,proto3" json:"ack_relayer_fee,omitempty"` } func (m *EventPackageClaim) Reset() { *m = EventPackageClaim{} } diff --git a/x/oracle/types/oracle.pb.go b/x/oracle/types/oracle.pb.go index 91ea45332a..3eda561d70 100644 --- a/x/oracle/types/oracle.pb.go +++ b/x/oracle/types/oracle.pb.go @@ -24,8 +24,12 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params holds parameters for the oracle module. type Params struct { - RelayerTimeout uint64 `protobuf:"varint,1,opt,name=relayer_timeout,json=relayerTimeout,proto3" json:"relayer_timeout,omitempty"` + // Timeout for the in turn relayer + RelayerTimeout uint64 `protobuf:"varint,1,opt,name=relayer_timeout,json=relayerTimeout,proto3" json:"relayer_timeout,omitempty"` + // Backoff time for the other relayers RelayerBackoffTime uint64 `protobuf:"varint,2,opt,name=relayer_backoff_time,json=relayerBackoffTime,proto3" json:"relayer_backoff_time,omitempty"` + // Reward share for the relayer sends the claim message, + // the other relayers signed the bls message will share the reward evenly. RelayerRewardShare uint32 `protobuf:"varint,3,opt,name=relayer_reward_share,json=relayerRewardShare,proto3" json:"relayer_reward_share,omitempty"` }