@agoric/cosmos 0.34.2-dev-4ea2a82.0.4ea2a82 → 0.34.2-dev-2858da6.0.2858da6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/Makefile +0 -1
  2. package/ante/ante.go +2 -2
  3. package/app/app.go +96 -73
  4. package/app/sim_test.go +2 -0
  5. package/app/upgrade.go +6 -6
  6. package/daemon/cmd/root_test.go +0 -1
  7. package/git-revision.txt +1 -1
  8. package/go.mod +116 -83
  9. package/go.sum +130 -162
  10. package/package.json +2 -2
  11. package/proto/agoric/swingset/msgs.proto +0 -1
  12. package/proto/agoric/vbank/msgs.proto +1 -5
  13. package/proto/agoric/vibc/msgs.proto +2 -45
  14. package/scripts/protocgen.sh +1 -10
  15. package/tests/integrations/types/aminojson_test.go +2 -18
  16. package/third_party/proto/cosmos/base/query/v1beta1/pagination.proto +3 -2
  17. package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +3 -2
  18. package/third_party/proto/ibc/core/channel/v1/channel.proto +22 -6
  19. package/third_party/proto/ibc/core/client/v1/client.proto +53 -6
  20. package/types/address_hooks.go +2 -2
  21. package/types/address_hooks_test.go +3 -3
  22. package/types/ibc_packet.go +3 -3
  23. package/types/ibc_packet_test.go +3 -3
  24. package/x/swingset/types/msgs.pb.go +89 -90
  25. package/x/vbank/types/msgs.pb.go +8 -10
  26. package/x/vibc/alias.go +1 -0
  27. package/x/vibc/keeper/keeper.go +81 -40
  28. package/x/vibc/keeper/migrations.go +1 -1
  29. package/x/vibc/keeper/triggers.go +4 -8
  30. package/x/vibc/types/expected_keepers.go +20 -7
  31. package/x/vibc/types/ibc_module.go +20 -13
  32. package/x/vibc/types/msgs.go +3 -60
  33. package/x/vibc/types/msgs.pb.go +31 -683
  34. package/x/vibc/types/receiver.go +2 -2
  35. package/x/vlocalchain/vlocalchain_test.go +1 -1
  36. package/x/vtransfer/ibc_middleware.go +17 -15
  37. package/x/vtransfer/ibc_middleware_test.go +53 -30
  38. package/x/vtransfer/keeper/keeper.go +28 -19
  39. package/x/vtransfer/types/expected_keepers.go +8 -15
  40. package/x/vtransfer/utils_test.go +9 -4
  41. package/go.work +0 -39
  42. package/go.work.sum +0 -2636
  43. package/proto/Dockerfile +0 -14
  44. package/x/vibc/keeper/dynamic_router.go +0 -176
  45. package/x/vibc/keeper/dynamic_router_test.go +0 -240
  46. package/x/vibc/keeper/scope.go +0 -114
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/cosmos",
3
- "version": "0.34.2-dev-4ea2a82.0.4ea2a82",
3
+ "version": "0.34.2-dev-2858da6.0.2858da6",
4
4
  "description": "Connect JS to the Cosmos blockchain SDK",
5
5
  "parsers": {
6
6
  "js": "mjs"
@@ -41,5 +41,5 @@
41
41
  "typeCoverage": {
42
42
  "atLeast": 0
43
43
  },
44
- "gitHead": "4ea2a829ab7a251c14fa872a0c7ac3e85b178eeb"
44
+ "gitHead": "2858da6fc8a98390073a521783cafbc159c36170"
45
45
  }
@@ -11,7 +11,6 @@ option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types
11
11
 
12
12
  // Transactions.
13
13
  service Msg {
14
- option (cosmos.msg.v1.service) = true;
15
14
  // Install a JavaScript sources bundle on the chain's SwingSet controller.
16
15
  rpc InstallBundle(MsgInstallBundle) returns (MsgInstallBundleResponse);
17
16
  // Send a chunk of a bundle (or other artifact) to tolerate RPC message size limits.
@@ -1,11 +1,7 @@
1
1
  syntax = "proto3";
2
2
  package agoric.vbank;
3
3
 
4
- import "cosmos/msg/v1/msg.proto";
5
-
6
4
  option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/vbank/types";
7
5
 
8
6
  // No transactions.
9
- service Msg {
10
- option (cosmos.msg.v1.service) = true;
11
- }
7
+ service Msg {}
@@ -3,14 +3,12 @@ package agoric.vibc;
3
3
 
4
4
  import "amino/amino.proto";
5
5
  import "gogoproto/gogo.proto";
6
- import "cosmos/msg/v1/msg.proto";
6
+ import "ibc/core/channel/v1/channel.proto";
7
7
 
8
8
  option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/types";
9
9
 
10
10
  // The module transactions.
11
11
  service Msg {
12
- option (cosmos.msg.v1.service) = true;
13
-
14
12
  // Force sending an arbitrary packet on a channel.
15
13
  rpc SendPacket(MsgSendPacket) returns (MsgSendPacketResponse);
16
14
  }
@@ -20,7 +18,7 @@ message MsgSendPacket {
20
18
  option (gogoproto.equal) = false;
21
19
  option (amino.name) = "vibc/SendPacket";
22
20
 
23
- Packet packet = 1
21
+ ibc.core.channel.v1.Packet packet = 1
24
22
  [(gogoproto.nullable) = false, (gogoproto.jsontag) = "packet", (gogoproto.moretags) = "yaml:\"packet\""];
25
23
  bytes sender = 2 [
26
24
  (amino.encoding) = "legacy_address",
@@ -33,44 +31,3 @@ message MsgSendPacket {
33
31
 
34
32
  // Empty response for SendPacket.
35
33
  message MsgSendPacketResponse {}
36
-
37
- // Packet defines a type that carries data across different chains through IBC.
38
- // The fields in the Packet correspond to the fields in the IBC packet
39
- // definition in ibc/core/channel/v1/channel.proto, but with amino and gogoproto
40
- // options to ensure compatibility with the Cosmos SDK's Protobuf code
41
- // generation and JSON encoding. See ibc/core/channel/v1/channel.proto for more
42
- // details on the semantics of each field in the Packet.
43
- message Packet {
44
- option (gogoproto.goproto_getters) = false;
45
-
46
- // number corresponds to the order of sends and receives, where a Packet
47
- // with an earlier sequence number must be sent and received before a Packet
48
- // with a later sequence number.
49
- uint64 sequence = 1;
50
- // identifies the port on the sending chain.
51
- string source_port = 2;
52
- // identifies the channel end on the sending chain.
53
- string source_channel = 3;
54
- // identifies the port on the receiving chain.
55
- string destination_port = 4;
56
- // identifies the channel end on the receiving chain.
57
- string destination_channel = 5;
58
- // actual opaque bytes transferred directly to the application module
59
- bytes data = 6;
60
- // block height after which the packet times out
61
- Height timeout_height = 7 [(gogoproto.nullable) = false];
62
- // block timestamp (in nanoseconds) after which the packet times out
63
- uint64 timeout_timestamp = 8;
64
- }
65
-
66
- // Height is a local type that enforces amino and gogoproto compatibility for
67
- // the Height type used in IBC. See ibc/core/client/v1/client.proto for more
68
- // details on the Height type.
69
- message Height {
70
- option (gogoproto.goproto_getters) = false;
71
-
72
- // the revision that the client is currently on
73
- uint64 revision_number = 1 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "revision_number"];
74
- // the height within the given revision
75
- uint64 revision_height = 2 [(amino.dont_omitempty) = true, (gogoproto.jsontag) = "revision_height"];
76
- }
@@ -5,20 +5,11 @@
5
5
  # docker run --rm -v $(pwd):/workspace --workdir /workspace cosmossdk-proto sh ./scripts/protocgen.sh
6
6
 
7
7
  set -eo pipefail
8
- cd proto
9
-
10
- if touch .permtest; then
11
- rm -f .permtest
12
- else
13
- echo "ERROR: Cannot write to the current directory. Please check the permissions for this user."
14
- id || true
15
- ls -ald . || true
16
- exit 1
17
- fi
18
8
 
19
9
  buf_cmd="go tool buf"
20
10
 
21
11
  echo "Generating gogo proto code"
12
+ cd proto
22
13
  proto_dirs=$(find . -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
23
14
  for dir in $proto_dirs; do
24
15
  for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
@@ -33,8 +33,8 @@ import (
33
33
  "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
34
34
  "github.com/cosmos/cosmos-sdk/x/slashing"
35
35
  "github.com/cosmos/cosmos-sdk/x/staking"
36
- clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
37
- channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types"
36
+ clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
37
+ channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
38
38
 
39
39
  "github.com/Agoric/agoric-sdk/golang/cosmos/app/txconfig"
40
40
  "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset"
@@ -98,27 +98,11 @@ func TestAminoJSON_LegacyParity(t *testing.T) {
98
98
  paramsChangeGovMsg, err := govv1beta1.NewMsgSubmitProposal(paramsChangeProposal, coins, addr1)
99
99
  require.NoError(t, err)
100
100
 
101
-
102
101
  ibcPacket := channeltypes.NewPacket(
103
102
  []byte("data"),
104
103
  987654321098765432,
105
104
  "port-src", "channel-13",
106
105
  "port-dst", "channel-42",
107
- // clienttypes.Height{} does not always produce {"revision_number":0,"revision_height":0} when marshaled to JSON.
108
- //
109
- // Clue in cosmos/third_party/proto/ibc/core/client/v1/client.proto:
110
- // // Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag.
111
- // // This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height.
112
- // message Height {
113
- // option (gogoproto.goproto_getters) = false;
114
- // option (gogoproto.goproto_stringer) = false;
115
- //
116
- // // the revision that the client is currently on
117
- // uint64 revision_number = 1 [(gogoproto.jsontag) = "revision_number"];
118
- // // the height within the given revision
119
- // uint64 revision_height = 2 [(gogoproto.jsontag) = "revision_height"];
120
- // }
121
- // clienttypes.Height{RevisionNumber: 1, RevisionHeight: 2}, // workaround to get tests to pass
122
106
  clienttypes.Height{},
123
107
  123456789012345678,
124
108
  )
@@ -2,7 +2,6 @@ syntax = "proto3";
2
2
  package cosmos.base.query.v1beta1;
3
3
 
4
4
  option go_package = "github.com/cosmos/cosmos-sdk/types/query";
5
- import "cosmos_proto/cosmos.proto";
6
5
 
7
6
  // PageRequest is to be embedded in gRPC request messages for efficient
8
7
  // pagination. Ex:
@@ -33,7 +32,9 @@ message PageRequest {
33
32
  bool count_total = 4;
34
33
 
35
34
  // reverse is set to true if results are to be returned in the descending order.
36
- bool reverse = 5 [(cosmos_proto.field_added_in) = "cosmos-sdk 0.43"];
35
+ //
36
+ // Since: cosmos-sdk 0.43
37
+ bool reverse = 5;
37
38
  }
38
39
 
39
40
  // PageResponse is to be embedded in gRPC response messages where the
@@ -81,9 +81,10 @@ message CancelSoftwareUpgradeProposal {
81
81
  }
82
82
 
83
83
  // ModuleVersion specifies a module and its consensus version.
84
+ //
85
+ // Since: cosmos-sdk 0.43
84
86
  message ModuleVersion {
85
- option (cosmos_proto.message_added_in) = "cosmos-sdk 0.43";
86
- option (gogoproto.equal) = true;
87
+ option (gogoproto.equal) = true;
87
88
 
88
89
  // name of the app module
89
90
  string name = 1;
@@ -2,7 +2,7 @@ syntax = "proto3";
2
2
 
3
3
  package ibc.core.channel.v1;
4
4
 
5
- option go_package = "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types";
5
+ option go_package = "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types";
6
6
 
7
7
  import "gogoproto/gogo.proto";
8
8
  import "ibc/core/client/v1/client.proto";
@@ -24,6 +24,9 @@ message Channel {
24
24
  repeated string connection_hops = 4;
25
25
  // opaque channel version, which is agreed upon during the handshake
26
26
  string version = 5;
27
+ // upgrade sequence indicates the latest upgrade attempt performed by this channel
28
+ // the value of 0 indicates the channel has never been upgraded
29
+ uint64 upgrade_sequence = 6;
27
30
  }
28
31
 
29
32
  // IdentifiedChannel defines a channel with additional port and channel
@@ -46,10 +49,13 @@ message IdentifiedChannel {
46
49
  string port_id = 6;
47
50
  // channel identifier
48
51
  string channel_id = 7;
52
+ // upgrade sequence indicates the latest upgrade attempt performed by this channel
53
+ // the value of 0 indicates the channel has never been upgraded
54
+ uint64 upgrade_sequence = 8;
49
55
  }
50
56
 
51
57
  // State defines if a channel is in one of the following states:
52
- // CLOSED, INIT, TRYOPEN, OPEN, or UNINITIALIZED.
58
+ // CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED.
53
59
  enum State {
54
60
  option (gogoproto.goproto_enum_prefix) = false;
55
61
 
@@ -65,6 +71,10 @@ enum State {
65
71
  // A channel has been closed and can no longer be used to send or receive
66
72
  // packets.
67
73
  STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"];
74
+ // A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets.
75
+ STATE_FLUSHING = 5 [(gogoproto.enumvalue_customname) = "FLUSHING"];
76
+ // A channel has just completed flushing any in-flight packets.
77
+ STATE_FLUSHCOMPLETE = 6 [(gogoproto.enumvalue_customname) = "FLUSHCOMPLETE"];
68
78
  }
69
79
 
70
80
  // Order defines if a channel is ORDERED or UNORDERED
@@ -131,7 +141,7 @@ message PacketState {
131
141
  bytes data = 4;
132
142
  }
133
143
 
134
- // PacketId is an identifier for a unique Packet
144
+ // PacketId is an identifer for a unique Packet
135
145
  // Source chains refer to packets by source port/channel
136
146
  // Destination chains refer to packets by destination port/channel
137
147
  message PacketId {
@@ -161,11 +171,17 @@ message Acknowledgement {
161
171
  }
162
172
 
163
173
  // Timeout defines an execution deadline structure for 04-channel handlers.
164
- // This includes packet lifecycle handlers.
174
+ // This includes packet lifecycle handlers as well as the upgrade handshake handlers.
165
175
  // A valid Timeout contains either one or both of a timestamp and block height (sequence).
166
176
  message Timeout {
167
- // block height after which the packet times out
177
+ // block height after which the packet or upgrade times out
168
178
  ibc.core.client.v1.Height height = 1 [(gogoproto.nullable) = false];
169
- // block timestamp (in nanoseconds) after which the packet times out
179
+ // block timestamp (in nanoseconds) after which the packet or upgrade times out
170
180
  uint64 timestamp = 2;
171
181
  }
182
+
183
+ // Params defines the set of IBC channel parameters.
184
+ message Params {
185
+ // the relative timeout after which channel upgrades will time out.
186
+ Timeout upgrade_timeout = 1 [(gogoproto.nullable) = false];
187
+ }
@@ -2,8 +2,10 @@ syntax = "proto3";
2
2
 
3
3
  package ibc.core.client.v1;
4
4
 
5
- option go_package = "github.com/cosmos/ibc-go/v10/modules/core/02-client/types";
5
+ option go_package = "github.com/cosmos/ibc-go/v8/modules/core/02-client/types";
6
6
 
7
+ import "cosmos/upgrade/v1beta1/upgrade.proto";
8
+ import "cosmos_proto/cosmos.proto";
7
9
  import "gogoproto/gogo.proto";
8
10
  import "google/protobuf/any.proto";
9
11
 
@@ -44,17 +46,14 @@ message ClientConsensusStates {
44
46
  // breaking changes In these cases, the RevisionNumber is incremented so that
45
47
  // height continues to be monitonically increasing even as the RevisionHeight
46
48
  // gets reset
47
- //
48
- // Please note that json tags for generated Go code are overridden to explicitly exclude the omitempty jsontag.
49
- // This enforces the Go json marshaller to always emit zero values for both revision_number and revision_height.
50
49
  message Height {
51
50
  option (gogoproto.goproto_getters) = false;
52
51
  option (gogoproto.goproto_stringer) = false;
53
52
 
54
53
  // the revision that the client is currently on
55
- uint64 revision_number = 1 [(gogoproto.jsontag) = "revision_number"];
54
+ uint64 revision_number = 1;
56
55
  // the height within the given revision
57
- uint64 revision_height = 2 [(gogoproto.jsontag) = "revision_height"];
56
+ uint64 revision_height = 2;
58
57
  }
59
58
 
60
59
  // Params defines the set of IBC light client parameters.
@@ -64,3 +63,51 @@ message Params {
64
63
  // of this client will be disabled until it is added again to the list.
65
64
  repeated string allowed_clients = 1;
66
65
  }
66
+
67
+ // ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute
68
+ // client's latest consensus state is copied over to the subject client. The proposal
69
+ // handler may fail if the subject and the substitute do not match in client and
70
+ // chain parameters (with exception to latest height, frozen height, and chain-id).
71
+ //
72
+ // Deprecated: Please use MsgRecoverClient in favour of this message type.
73
+ message ClientUpdateProposal {
74
+ option deprecated = true;
75
+
76
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
77
+ option (gogoproto.goproto_getters) = false;
78
+
79
+ // the title of the update proposal
80
+ string title = 1;
81
+ // the description of the proposal
82
+ string description = 2;
83
+ // the client identifier for the client to be updated if the proposal passes
84
+ string subject_client_id = 3 [(gogoproto.moretags) = "yaml:\"subject_client_id\""];
85
+ // the substitute client identifier for the client standing in for the subject
86
+ // client
87
+ string substitute_client_id = 4 [(gogoproto.moretags) = "yaml:\"substitute_client_id\""];
88
+ }
89
+
90
+ // UpgradeProposal is a gov Content type for initiating an IBC breaking
91
+ // upgrade.
92
+ //
93
+ // Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type.
94
+ message UpgradeProposal {
95
+ option deprecated = true;
96
+
97
+ option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
98
+ option (gogoproto.goproto_getters) = false;
99
+ option (gogoproto.goproto_stringer) = false;
100
+ option (gogoproto.equal) = true;
101
+
102
+ string title = 1;
103
+ string description = 2;
104
+ cosmos.upgrade.v1beta1.Plan plan = 3 [(gogoproto.nullable) = false];
105
+
106
+ // An UpgradedClientState must be provided to perform an IBC breaking upgrade.
107
+ // This will make the chain commit to the correct upgraded (self) client state
108
+ // before the upgrade occurs, so that connecting chains can verify that the
109
+ // new upgraded client is valid by verifying a proof on the previous version
110
+ // of the chain. This will allow IBC connections to persist smoothly across
111
+ // planned chain upgrades
112
+ google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""];
113
+ }
@@ -7,8 +7,8 @@ import (
7
7
  "github.com/cosmos/cosmos-sdk/codec"
8
8
  "github.com/cosmos/cosmos-sdk/types/bech32"
9
9
 
10
- transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
11
- ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
10
+ transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
11
+ ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
12
12
  )
13
13
 
14
14
  type AddressRole string
@@ -8,9 +8,9 @@ import (
8
8
  codec "github.com/cosmos/cosmos-sdk/codec"
9
9
  cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
10
10
 
11
- transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
12
- clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
13
- channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types"
11
+ transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
12
+ clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
13
+ channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
14
14
 
15
15
  agtypes "github.com/Agoric/agoric-sdk/golang/cosmos/types"
16
16
  )
@@ -3,9 +3,9 @@ package types
3
3
  import (
4
4
  "encoding/json"
5
5
 
6
- clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
7
- channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types"
8
- "github.com/cosmos/ibc-go/v10/modules/core/exported"
6
+ clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
7
+ channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
8
+ "github.com/cosmos/ibc-go/v8/modules/core/exported"
9
9
  )
10
10
 
11
11
  var _ json.Marshaler = IBCPacket{}
@@ -11,9 +11,9 @@ import (
11
11
  "github.com/stretchr/testify/assert"
12
12
  "github.com/stretchr/testify/require"
13
13
 
14
- clienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
15
- channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types"
16
- ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
14
+ clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
15
+ channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
16
+ ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
17
17
  )
18
18
 
19
19
  func CreateTestChannelPacket() channeltypes.Packet {