@agoric/cosmos 0.35.0-u20.0 → 0.35.0-u21.0

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 (113) hide show
  1. package/.clang-format +116 -0
  2. package/CHANGELOG.md +14 -2
  3. package/Makefile +38 -67
  4. package/ante/ante.go +2 -2
  5. package/ante/inbound_test.go +1 -1
  6. package/app/app.go +173 -142
  7. package/app/export.go +6 -6
  8. package/app/genesis.go +4 -0
  9. package/app/sim_test.go +299 -50
  10. package/app/upgrade.go +125 -24
  11. package/app/upgrade_test.go +1 -1
  12. package/cmd/agd/agvm.go +1 -1
  13. package/cmd/agd/main.go +1 -1
  14. package/cmd/libdaemon/main.go +34 -1
  15. package/daemon/cmd/root.go +26 -35
  16. package/daemon/cmd/root_test.go +5 -4
  17. package/daemon/cmd/testnet.go +221 -95
  18. package/daemon/main.go +1 -0
  19. package/git-revision.txt +1 -1
  20. package/go.mod +93 -58
  21. package/go.sum +148 -95
  22. package/package.json +6 -3
  23. package/proto/agoric/swingset/genesis.proto +7 -11
  24. package/proto/agoric/swingset/msgs.proto +56 -75
  25. package/proto/agoric/swingset/query.proto +7 -10
  26. package/proto/agoric/swingset/swingset.proto +79 -108
  27. package/proto/agoric/vbank/genesis.proto +5 -5
  28. package/proto/agoric/vbank/msgs.proto +1 -2
  29. package/proto/agoric/vbank/vbank.proto +42 -52
  30. package/proto/agoric/vibc/msgs.proto +8 -11
  31. package/proto/agoric/vstorage/genesis.proto +6 -9
  32. package/proto/agoric/vstorage/query.proto +19 -48
  33. package/proto/agoric/vstorage/vstorage.proto +4 -10
  34. package/proto/agoric/vtransfer/genesis.proto +7 -7
  35. package/proto/buf.gen.gogo.yaml +8 -0
  36. package/proto/buf.gen.pulsar.yaml +17 -0
  37. package/proto/buf.gen.swagger.yaml +5 -0
  38. package/proto/buf.yaml +10 -0
  39. package/scripts/protocgen.sh +14 -21
  40. package/third_party/proto/amino/amino.proto +79 -0
  41. package/third_party/proto/cosmos/base/v1beta1/coin.proto +7 -2
  42. package/third_party/proto/cosmos/ics23/v1/proofs.proto +243 -0
  43. package/third_party/proto/cosmos/msg/v1/msg.proto +30 -0
  44. package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +17 -5
  45. package/third_party/proto/cosmos_proto/cosmos.proto +16 -1
  46. package/third_party/proto/gogoproto/gogo.proto +2 -2
  47. package/third_party/proto/google/protobuf/any.proto +6 -3
  48. package/third_party/proto/ibc/core/channel/v1/channel.proto +1 -1
  49. package/third_party/proto/ibc/core/client/v1/client.proto +4 -2
  50. package/types/address_hooks.go +2 -2
  51. package/types/address_hooks_test.go +3 -3
  52. package/types/ibc_packet.go +3 -3
  53. package/types/ibc_packet_test.go +3 -3
  54. package/vm/client.go +32 -7
  55. package/vm/proto_json.go +2 -2
  56. package/x/swingset/abci.go +1 -1
  57. package/x/swingset/alias.go +0 -1
  58. package/x/swingset/config.go +1 -1
  59. package/x/swingset/keeper/extension_snapshotter.go +1 -1
  60. package/x/swingset/keeper/extension_snapshotter_test.go +1 -1
  61. package/x/swingset/keeper/keeper.go +1 -1
  62. package/x/swingset/keeper/keeper_test.go +1 -1
  63. package/x/swingset/keeper/querier.go +1 -30
  64. package/x/swingset/keeper/swing_store_exports_handler.go +1 -1
  65. package/x/swingset/keeper/swing_store_exports_handler_test.go +1 -1
  66. package/x/swingset/module.go +1 -14
  67. package/x/swingset/types/default-params.go +24 -16
  68. package/x/swingset/types/genesis.pb.go +2 -2
  69. package/x/swingset/types/msgs.pb.go +4 -3
  70. package/x/swingset/types/msgs_test.go +1 -1
  71. package/x/swingset/types/query.pb.go +4 -3
  72. package/x/swingset/types/swingset.pb.go +2 -2
  73. package/x/vbank/genesis.go +1 -1
  74. package/x/vbank/keeper/querier.go +1 -21
  75. package/x/vbank/module.go +1 -16
  76. package/x/vbank/types/genesis.pb.go +2 -2
  77. package/x/vbank/types/msgs.pb.go +3 -2
  78. package/x/vbank/types/query.pb.go +4 -3
  79. package/x/vbank/types/vbank.pb.go +2 -2
  80. package/x/vbank/vbank_test.go +95 -16
  81. package/x/vibc/keeper/keeper.go +8 -5
  82. package/x/vibc/keeper/migrations.go +36 -0
  83. package/x/vibc/keeper/triggers.go +1 -1
  84. package/x/vibc/module.go +9 -17
  85. package/x/vibc/types/expected_keepers.go +5 -10
  86. package/x/vibc/types/ibc_module.go +4 -4
  87. package/x/vibc/types/msgs.go +1 -1
  88. package/x/vibc/types/msgs.pb.go +5 -4
  89. package/x/vibc/types/receiver.go +2 -2
  90. package/x/vlocalchain/keeper/keeper.go +3 -3
  91. package/x/vlocalchain/types/vlocalchain.pb.go +1 -1
  92. package/x/vlocalchain/vlocalchain_test.go +6 -6
  93. package/x/vstorage/alias.go +0 -1
  94. package/x/vstorage/client/cli/query.go +1 -1
  95. package/x/vstorage/genesis.go +1 -1
  96. package/x/vstorage/keeper/keeper.go +6 -5
  97. package/x/vstorage/keeper/keeper_test.go +24 -24
  98. package/x/vstorage/keeper/querier.go +1 -32
  99. package/x/vstorage/keeper/querier_test.go +41 -6
  100. package/x/vstorage/module.go +1 -14
  101. package/x/vstorage/types/genesis.pb.go +2 -2
  102. package/x/vstorage/types/query.pb.go +8 -5
  103. package/x/vstorage/types/vstorage.pb.go +2 -2
  104. package/x/vstorage/vstorage_test.go +3 -3
  105. package/x/vtransfer/genesis.go +1 -1
  106. package/x/vtransfer/ibc_middleware.go +4 -4
  107. package/x/vtransfer/ibc_middleware_test.go +10 -11
  108. package/x/vtransfer/keeper/keeper.go +5 -5
  109. package/x/vtransfer/module.go +1 -14
  110. package/x/vtransfer/types/expected_keepers.go +2 -18
  111. package/x/vtransfer/types/genesis.pb.go +2 -2
  112. package/x/vtransfer/utils_test.go +15 -15
  113. package/daemon/cmd/genaccounts.go +0 -195
@@ -0,0 +1,243 @@
1
+ syntax = "proto3";
2
+
3
+ package cosmos.ics23.v1;
4
+
5
+ option go_package = "github.com/cosmos/ics23/go;ics23";
6
+
7
+ enum HashOp {
8
+ // NO_HASH is the default if no data passed. Note this is an illegal argument some places.
9
+ NO_HASH = 0;
10
+ SHA256 = 1;
11
+ SHA512 = 2;
12
+ KECCAK256 = 3;
13
+ RIPEMD160 = 4;
14
+ BITCOIN = 5; // ripemd160(sha256(x))
15
+ SHA512_256 = 6;
16
+ BLAKE2B_512 = 7;
17
+ BLAKE2S_256 = 8;
18
+ BLAKE3 = 9;
19
+ }
20
+
21
+ /**
22
+ LengthOp defines how to process the key and value of the LeafOp
23
+ to include length information. After encoding the length with the given
24
+ algorithm, the length will be prepended to the key and value bytes.
25
+ (Each one with it's own encoded length)
26
+ */
27
+ enum LengthOp {
28
+ // NO_PREFIX don't include any length info
29
+ NO_PREFIX = 0;
30
+ // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length
31
+ VAR_PROTO = 1;
32
+ // VAR_RLP uses rlp int encoding of the length
33
+ VAR_RLP = 2;
34
+ // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer
35
+ FIXED32_BIG = 3;
36
+ // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer
37
+ FIXED32_LITTLE = 4;
38
+ // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer
39
+ FIXED64_BIG = 5;
40
+ // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer
41
+ FIXED64_LITTLE = 6;
42
+ // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)
43
+ REQUIRE_32_BYTES = 7;
44
+ // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)
45
+ REQUIRE_64_BYTES = 8;
46
+ }
47
+
48
+ /**
49
+ ExistenceProof takes a key and a value and a set of steps to perform on it.
50
+ The result of peforming all these steps will provide a "root hash", which can
51
+ be compared to the value in a header.
52
+
53
+ Since it is computationally infeasible to produce a hash collission for any of the used
54
+ cryptographic hash functions, if someone can provide a series of operations to transform
55
+ a given key and value into a root hash that matches some trusted root, these key and values
56
+ must be in the referenced merkle tree.
57
+
58
+ The only possible issue is maliablity in LeafOp, such as providing extra prefix data,
59
+ which should be controlled by a spec. Eg. with lengthOp as NONE,
60
+ prefix = FOO, key = BAR, value = CHOICE
61
+ and
62
+ prefix = F, key = OOBAR, value = CHOICE
63
+ would produce the same value.
64
+
65
+ With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field
66
+ in the ProofSpec is valuable to prevent this mutability. And why all trees should
67
+ length-prefix the data before hashing it.
68
+ */
69
+ message ExistenceProof {
70
+ bytes key = 1;
71
+ bytes value = 2;
72
+ LeafOp leaf = 3;
73
+ repeated InnerOp path = 4;
74
+ }
75
+
76
+ /*
77
+ NonExistenceProof takes a proof of two neighbors, one left of the desired key,
78
+ one right of the desired key. If both proofs are valid AND they are neighbors,
79
+ then there is no valid proof for the given key.
80
+ */
81
+ message NonExistenceProof {
82
+ bytes key = 1; // TODO: remove this as unnecessary??? we prove a range
83
+ ExistenceProof left = 2;
84
+ ExistenceProof right = 3;
85
+ }
86
+
87
+ /*
88
+ CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages
89
+ */
90
+ message CommitmentProof {
91
+ oneof proof {
92
+ ExistenceProof exist = 1;
93
+ NonExistenceProof nonexist = 2;
94
+ BatchProof batch = 3;
95
+ CompressedBatchProof compressed = 4;
96
+ }
97
+ }
98
+
99
+ /**
100
+ LeafOp represents the raw key-value data we wish to prove, and
101
+ must be flexible to represent the internal transformation from
102
+ the original key-value pairs into the basis hash, for many existing
103
+ merkle trees.
104
+
105
+ key and value are passed in. So that the signature of this operation is:
106
+ leafOp(key, value) -> output
107
+
108
+ To process this, first prehash the keys and values if needed (ANY means no hash in this case):
109
+ hkey = prehashKey(key)
110
+ hvalue = prehashValue(value)
111
+
112
+ Then combine the bytes, and hash it
113
+ output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
114
+ */
115
+ message LeafOp {
116
+ HashOp hash = 1;
117
+ HashOp prehash_key = 2;
118
+ HashOp prehash_value = 3;
119
+ LengthOp length = 4;
120
+ // prefix is a fixed bytes that may optionally be included at the beginning to differentiate
121
+ // a leaf node from an inner node.
122
+ bytes prefix = 5;
123
+ }
124
+
125
+ /**
126
+ InnerOp represents a merkle-proof step that is not a leaf.
127
+ It represents concatenating two children and hashing them to provide the next result.
128
+
129
+ The result of the previous step is passed in, so the signature of this op is:
130
+ innerOp(child) -> output
131
+
132
+ The result of applying InnerOp should be:
133
+ output = op.hash(op.prefix || child || op.suffix)
134
+
135
+ where the || operator is concatenation of binary data,
136
+ and child is the result of hashing all the tree below this step.
137
+
138
+ Any special data, like prepending child with the length, or prepending the entire operation with
139
+ some value to differentiate from leaf nodes, should be included in prefix and suffix.
140
+ If either of prefix or suffix is empty, we just treat it as an empty string
141
+ */
142
+ message InnerOp {
143
+ HashOp hash = 1;
144
+ bytes prefix = 2;
145
+ bytes suffix = 3;
146
+ }
147
+
148
+ /**
149
+ ProofSpec defines what the expected parameters are for a given proof type.
150
+ This can be stored in the client and used to validate any incoming proofs.
151
+
152
+ verify(ProofSpec, Proof) -> Proof | Error
153
+
154
+ As demonstrated in tests, if we don't fix the algorithm used to calculate the
155
+ LeafHash for a given tree, there are many possible key-value pairs that can
156
+ generate a given hash (by interpretting the preimage differently).
157
+ We need this for proper security, requires client knows a priori what
158
+ tree format server uses. But not in code, rather a configuration object.
159
+ */
160
+ message ProofSpec {
161
+ // any field in the ExistenceProof must be the same as in this spec.
162
+ // except Prefix, which is just the first bytes of prefix (spec can be longer)
163
+ LeafOp leaf_spec = 1;
164
+ InnerSpec inner_spec = 2;
165
+ // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
166
+ // the max_depth is interpreted as 128 if set to 0
167
+ int32 max_depth = 3;
168
+ // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
169
+ int32 min_depth = 4;
170
+ // prehash_key_before_comparison is a flag that indicates whether to use the
171
+ // prehash_key specified by LeafOp to compare lexical ordering of keys for
172
+ // non-existence proofs.
173
+ bool prehash_key_before_comparison = 5;
174
+ }
175
+
176
+ /*
177
+ InnerSpec contains all store-specific structure info to determine if two proofs from a
178
+ given store are neighbors.
179
+
180
+ This enables:
181
+
182
+ isLeftMost(spec: InnerSpec, op: InnerOp)
183
+ isRightMost(spec: InnerSpec, op: InnerOp)
184
+ isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
185
+ */
186
+ message InnerSpec {
187
+ // Child order is the ordering of the children node, must count from 0
188
+ // iavl tree is [0, 1] (left then right)
189
+ // merk is [0, 2, 1] (left, right, here)
190
+ repeated int32 child_order = 1;
191
+ int32 child_size = 2;
192
+ int32 min_prefix_length = 3;
193
+ // the max prefix length must be less than the minimum prefix length + child size
194
+ int32 max_prefix_length = 4;
195
+ // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)
196
+ bytes empty_child = 5;
197
+ // hash is the algorithm that must be used for each InnerOp
198
+ HashOp hash = 6;
199
+ }
200
+
201
+ /*
202
+ BatchProof is a group of multiple proof types than can be compressed
203
+ */
204
+ message BatchProof {
205
+ repeated BatchEntry entries = 1;
206
+ }
207
+
208
+ // Use BatchEntry not CommitmentProof, to avoid recursion
209
+ message BatchEntry {
210
+ oneof proof {
211
+ ExistenceProof exist = 1;
212
+ NonExistenceProof nonexist = 2;
213
+ }
214
+ }
215
+
216
+ /****** all items here are compressed forms *******/
217
+
218
+ message CompressedBatchProof {
219
+ repeated CompressedBatchEntry entries = 1;
220
+ repeated InnerOp lookup_inners = 2;
221
+ }
222
+
223
+ // Use BatchEntry not CommitmentProof, to avoid recursion
224
+ message CompressedBatchEntry {
225
+ oneof proof {
226
+ CompressedExistenceProof exist = 1;
227
+ CompressedNonExistenceProof nonexist = 2;
228
+ }
229
+ }
230
+
231
+ message CompressedExistenceProof {
232
+ bytes key = 1;
233
+ bytes value = 2;
234
+ LeafOp leaf = 3;
235
+ // these are indexes into the lookup_inners table in CompressedBatchProof
236
+ repeated int32 path = 4;
237
+ }
238
+
239
+ message CompressedNonExistenceProof {
240
+ bytes key = 1; // TODO: remove this as unnecessary??? we prove a range
241
+ CompressedExistenceProof left = 2;
242
+ CompressedExistenceProof right = 3;
243
+ }
@@ -0,0 +1,30 @@
1
+ syntax = "proto3";
2
+
3
+ package cosmos.msg.v1;
4
+
5
+ import "google/protobuf/descriptor.proto";
6
+
7
+ // TODO(fdymylja): once we fully migrate to protov2 the go_package needs to be updated.
8
+ // We need this right now because gogoproto codegen needs to import the extension.
9
+ option go_package = "github.com/cosmos/cosmos-sdk/types/msgservice";
10
+
11
+ extend google.protobuf.ServiceOptions {
12
+ // service indicates that the service is a Msg service and that requests
13
+ // must be transported via blockchain transactions rather than gRPC.
14
+ // Tooling can use this annotation to distinguish between Msg services and
15
+ // other types of services via reflection.
16
+ bool service = 11110000;
17
+ }
18
+
19
+ extend google.protobuf.MessageOptions {
20
+ // signer must be used in cosmos messages in order
21
+ // to signal to external clients which fields in a
22
+ // given cosmos message must be filled with signer
23
+ // information (address).
24
+ // The field must be the protobuf name of the message
25
+ // field extended with this MessageOption.
26
+ // The field must either be of string kind, or of message
27
+ // kind in case the signer information is contained within
28
+ // a message inside the cosmos message.
29
+ repeated string signer = 11110000;
30
+ }
@@ -5,12 +5,14 @@ import "google/protobuf/any.proto";
5
5
  import "gogoproto/gogo.proto";
6
6
  import "google/protobuf/timestamp.proto";
7
7
  import "cosmos_proto/cosmos.proto";
8
+ import "amino/amino.proto";
8
9
 
9
10
  option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types";
10
11
  option (gogoproto.goproto_getters_all) = false;
11
12
 
12
13
  // Plan specifies information about a planned upgrade and when it should occur.
13
14
  message Plan {
15
+ option (amino.name) = "cosmos-sdk/Plan";
14
16
  option (gogoproto.equal) = true;
15
17
  option (gogoproto.goproto_stringer) = false;
16
18
 
@@ -26,10 +28,10 @@ message Plan {
26
28
  // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic
27
29
  // has been removed from the SDK.
28
30
  // If this field is not empty, an error will be thrown.
29
- google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false];
31
+ google.protobuf.Timestamp time = 2
32
+ [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (amino.dont_omitempty) = true];
30
33
 
31
34
  // The height at which the upgrade must be performed.
32
- // Only used if Time is not set.
33
35
  int64 height = 3;
34
36
 
35
37
  // Any application specific upgrade info to be included on-chain
@@ -49,12 +51,18 @@ message Plan {
49
51
  message SoftwareUpgradeProposal {
50
52
  option deprecated = true;
51
53
  option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
54
+ option (amino.name) = "cosmos-sdk/SoftwareUpgradeProposal";
52
55
  option (gogoproto.equal) = true;
53
56
  option (gogoproto.goproto_stringer) = false;
54
57
 
55
- string title = 1;
58
+ // title of the proposal
59
+ string title = 1;
60
+
61
+ // description of the proposal
56
62
  string description = 2;
57
- Plan plan = 3 [(gogoproto.nullable) = false];
63
+
64
+ // plan of the proposal
65
+ Plan plan = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
58
66
  }
59
67
 
60
68
  // CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software
@@ -64,10 +72,14 @@ message SoftwareUpgradeProposal {
64
72
  message CancelSoftwareUpgradeProposal {
65
73
  option deprecated = true;
66
74
  option (cosmos_proto.implements_interface) = "cosmos.gov.v1beta1.Content";
75
+ option (amino.name) = "cosmos-sdk/CancelSoftwareUpgradeProposal";
67
76
  option (gogoproto.equal) = true;
68
77
  option (gogoproto.goproto_stringer) = false;
69
78
 
70
- string title = 1;
79
+ // title of the proposal
80
+ string title = 1;
81
+
82
+ // description of the proposal
71
83
  string description = 2;
72
84
  }
73
85
 
@@ -5,6 +5,12 @@ import "google/protobuf/descriptor.proto";
5
5
 
6
6
  option go_package = "github.com/cosmos/cosmos-proto;cosmos_proto";
7
7
 
8
+ extend google.protobuf.MethodOptions {
9
+
10
+ // method_added_in is used to indicate from which version the method was added.
11
+ string method_added_in = 93001;
12
+ }
13
+
8
14
  extend google.protobuf.MessageOptions {
9
15
 
10
16
  // implements_interface is used to indicate the type name of the interface
@@ -13,6 +19,9 @@ extend google.protobuf.MessageOptions {
13
19
  // interfaces. Interfaces should be declared using a declare_interface
14
20
  // file option.
15
21
  repeated string implements_interface = 93001;
22
+
23
+ // message_added_in is used to indicate from which version the message was added.
24
+ string message_added_in = 93002;
16
25
  }
17
26
 
18
27
  extend google.protobuf.FieldOptions {
@@ -27,6 +36,9 @@ extend google.protobuf.FieldOptions {
27
36
  // generators may choose to use this information to map this field to a
28
37
  // language-specific type representing the scalar.
29
38
  string scalar = 93002;
39
+
40
+ // field_added_in is used to indicate from which version the field was added.
41
+ string field_added_in = 93003;
30
42
  }
31
43
 
32
44
  extend google.protobuf.FileOptions {
@@ -46,6 +58,9 @@ extend google.protobuf.FileOptions {
46
58
  // expected that the declaration will be found in a protobuf file named
47
59
  // a/b/scalars.proto in the file descriptor set.
48
60
  repeated ScalarDescriptor declare_scalar = 793022;
61
+
62
+ // file_added_in is used to indicate from which the version the file was added.
63
+ string file_added_in = 793023;
49
64
  }
50
65
 
51
66
  // InterfaceDescriptor describes an interface type to be used with
@@ -94,4 +109,4 @@ enum ScalarType {
94
109
  SCALAR_TYPE_UNSPECIFIED = 0;
95
110
  SCALAR_TYPE_STRING = 1;
96
111
  SCALAR_TYPE_BYTES = 2;
97
- }
112
+ }
@@ -1,7 +1,7 @@
1
1
  // Protocol Buffers for Go with Gadgets
2
2
  //
3
3
  // Copyright (c) 2013, The GoGo Authors. All rights reserved.
4
- // http://github.com/gogo/protobuf
4
+ // http://github.com/cosmos/gogoproto
5
5
  //
6
6
  // Redistribution and use in source and binary forms, with or without
7
7
  // modification, are permitted provided that the following conditions are
@@ -33,7 +33,7 @@ import "google/protobuf/descriptor.proto";
33
33
 
34
34
  option java_package = "com.google.protobuf";
35
35
  option java_outer_classname = "GoGoProtos";
36
- option go_package = "github.com/gogo/protobuf/gogoproto";
36
+ option go_package = "github.com/cosmos/gogoproto/gogoproto";
37
37
 
38
38
  extend google.protobuf.EnumOptions {
39
39
  optional bool goproto_enum_prefix = 62001;
@@ -33,7 +33,7 @@ syntax = "proto3";
33
33
  package google.protobuf;
34
34
 
35
35
  option csharp_namespace = "Google.Protobuf.WellKnownTypes";
36
- option go_package = "types";
36
+ option go_package = "google.golang.org/protobuf/types/known/anypb";
37
37
  option java_package = "com.google.protobuf";
38
38
  option java_outer_classname = "AnyProto";
39
39
  option java_multiple_files = true;
@@ -77,10 +77,13 @@ option objc_class_prefix = "GPB";
77
77
  // Example 4: Pack and unpack a message in Go
78
78
  //
79
79
  // foo := &pb.Foo{...}
80
- // any, err := ptypes.MarshalAny(foo)
80
+ // any, err := anypb.New(foo)
81
+ // if err != nil {
82
+ // ...
83
+ // }
81
84
  // ...
82
85
  // foo := &pb.Foo{}
83
- // if err := ptypes.UnmarshalAny(any, foo); err != nil {
86
+ // if err := any.UnmarshalTo(foo); err != nil {
84
87
  // ...
85
88
  // }
86
89
  //
@@ -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/v6/modules/core/04-channel/types";
5
+ option go_package = "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types";
6
6
 
7
7
  import "gogoproto/gogo.proto";
8
8
  import "ibc/core/client/v1/client.proto";
@@ -2,7 +2,7 @@ syntax = "proto3";
2
2
 
3
3
  package ibc.core.client.v1;
4
4
 
5
- option go_package = "github.com/cosmos/ibc-go/v6/modules/core/02-client/types";
5
+ option go_package = "github.com/cosmos/ibc-go/v7/modules/core/02-client/types";
6
6
 
7
7
  import "gogoproto/gogo.proto";
8
8
  import "google/protobuf/any.proto";
@@ -98,6 +98,8 @@ message Height {
98
98
 
99
99
  // Params defines the set of IBC light client parameters.
100
100
  message Params {
101
- // allowed_clients defines the list of allowed client state types.
101
+ // allowed_clients defines the list of allowed client state types which can be created
102
+ // and interacted with. If a client type is removed from the allowed clients list, usage
103
+ // of this client will be disabled until it is added again to the list.
102
104
  repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""];
103
105
  }
@@ -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/v6/modules/apps/transfer/types"
11
- ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
10
+ transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
11
+ ibcexported "github.com/cosmos/ibc-go/v7/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/v6/modules/apps/transfer/types"
12
- clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
13
- channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
11
+ transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
12
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
13
+ channeltypes "github.com/cosmos/ibc-go/v7/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/v6/modules/core/02-client/types"
7
- channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
8
- "github.com/cosmos/ibc-go/v6/modules/core/exported"
6
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
7
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
8
+ "github.com/cosmos/ibc-go/v7/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/v6/modules/core/02-client/types"
15
- channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
16
- ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
14
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
15
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
16
+ ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
17
17
  )
18
18
 
19
19
  func CreateTestChannelPacket() channeltypes.Packet {
package/vm/client.go CHANGED
@@ -4,6 +4,7 @@ import (
4
4
  "context"
5
5
  "fmt"
6
6
  "net/rpc"
7
+ "sync"
7
8
  )
8
9
 
9
10
  // ReceiveMessageMethod is the name of the method we call in order to have the
@@ -34,12 +35,21 @@ var _ rpc.ClientCodec = (*ClientCodec)(nil)
34
35
  // having the WriteRequest() method fabricate a Receive() call to clear the rpc
35
36
  // state.
36
37
  type ClientCodec struct {
37
- ctx context.Context
38
- send func(port, rPort int, msg string)
39
- outbound map[int]rpc.Request
40
- inbound chan *rpc.Response
41
- replies map[uint64]string
38
+ ctx context.Context
39
+ send func(port, rPort int, msg string)
40
+ inbound chan *rpc.Response
41
+
42
+ // reqMutex protects outbound requests.
43
+ reqMutex sync.Mutex
44
+ outbound map[int]rpc.Request
45
+
46
+ // Scratch space to communicate between ReadResponseHeader and
47
+ // ReadResponseBody (protected by mutex in "net/rpc" implementation).
42
48
  replyToRead uint64
49
+
50
+ // mutex protects replies map
51
+ mutex sync.Mutex
52
+ replies map[uint64]string
43
53
  }
44
54
 
45
55
  // NewClientCodec creates a new ClientCodec.
@@ -64,7 +74,11 @@ func (cc *ClientCodec) WriteRequest(r *rpc.Request, body interface{}) error {
64
74
  return fmt.Errorf("body %T is not a Message", body)
65
75
  }
66
76
  rPort := int(r.Seq + 1) // rPort is 1-indexed to indicate it's required
77
+
78
+ cc.reqMutex.Lock()
67
79
  cc.outbound[rPort] = *r
80
+ cc.reqMutex.Unlock()
81
+
68
82
  var senderReplyPort int
69
83
  if msg.NeedsReply {
70
84
  senderReplyPort = rPort
@@ -85,18 +99,27 @@ func (cc *ClientCodec) ReadResponseHeader(r *rpc.Response) error {
85
99
  }
86
100
 
87
101
  // ReadResponseBody decodes a response body (currently just string) from the VM.
102
+ // and will always be called immediately after ReadResponseHeader (cf.
103
+ // https://pkg.go.dev/net/rpc#ClientCodec ).
88
104
  func (cc *ClientCodec) ReadResponseBody(body interface{}) error {
105
+ cc.mutex.Lock()
106
+ reply := cc.replies[cc.replyToRead]
107
+ delete(cc.replies, cc.replyToRead)
108
+ cc.mutex.Unlock()
109
+
89
110
  if body != nil {
90
- *body.(*string) = cc.replies[cc.replyToRead]
111
+ *body.(*string) = reply
91
112
  }
92
- delete(cc.replies, cc.replyToRead)
93
113
  return nil
94
114
  }
95
115
 
96
116
  // Receive is called by the VM to send a response to the client.
97
117
  func (cc *ClientCodec) Receive(rPort int, isError bool, data string) error {
118
+ cc.reqMutex.Lock()
98
119
  outb := cc.outbound[rPort]
99
120
  delete(cc.outbound, rPort)
121
+ cc.reqMutex.Unlock()
122
+
100
123
  resp := &rpc.Response{
101
124
  ServiceMethod: outb.ServiceMethod,
102
125
  Seq: outb.Seq,
@@ -104,7 +127,9 @@ func (cc *ClientCodec) Receive(rPort int, isError bool, data string) error {
104
127
  if isError {
105
128
  resp.Error = data
106
129
  } else {
130
+ cc.mutex.Lock()
107
131
  cc.replies[resp.Seq] = data
132
+ cc.mutex.Unlock()
108
133
  }
109
134
  cc.inbound <- resp
110
135
  return nil
package/vm/proto_json.go CHANGED
@@ -3,8 +3,8 @@ package vm
3
3
  import (
4
4
  "encoding/json"
5
5
 
6
- "github.com/gogo/protobuf/jsonpb"
7
- "github.com/gogo/protobuf/proto"
6
+ "github.com/cosmos/gogoproto/jsonpb"
7
+ "github.com/cosmos/gogoproto/proto"
8
8
  )
9
9
 
10
10
  // We need jsonpb for its access to the global registry.
@@ -6,9 +6,9 @@ import (
6
6
  "fmt"
7
7
  "time"
8
8
 
9
+ abci "github.com/cometbft/cometbft/abci/types"
9
10
  "github.com/cosmos/cosmos-sdk/telemetry"
10
11
  sdk "github.com/cosmos/cosmos-sdk/types"
11
- abci "github.com/tendermint/tendermint/abci/types"
12
12
 
13
13
  "github.com/Agoric/agoric-sdk/golang/cosmos/vm"
14
14
  "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types"
@@ -13,7 +13,6 @@ const (
13
13
 
14
14
  var (
15
15
  NewKeeper = keeper.NewKeeper
16
- NewQuerier = keeper.NewQuerier
17
16
  NewMsgDeliverInbound = types.NewMsgDeliverInbound
18
17
  NewMsgProvision = types.NewMsgProvision
19
18
  NewMailbox = types.NewMailbox
@@ -7,9 +7,9 @@ import (
7
7
  "github.com/spf13/viper"
8
8
 
9
9
  "github.com/cosmos/cosmos-sdk/client/flags"
10
- pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types"
11
10
  serverconfig "github.com/cosmos/cosmos-sdk/server/config"
12
11
  servertypes "github.com/cosmos/cosmos-sdk/server/types"
12
+ pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types"
13
13
 
14
14
  "github.com/Agoric/agoric-sdk/golang/cosmos/util"
15
15
  )
@@ -9,9 +9,9 @@ import (
9
9
 
10
10
  agoric "github.com/Agoric/agoric-sdk/golang/cosmos/types"
11
11
  "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types"
12
+ "github.com/cometbft/cometbft/libs/log"
12
13
  "github.com/cosmos/cosmos-sdk/baseapp"
13
14
  snapshots "github.com/cosmos/cosmos-sdk/snapshots/types"
14
- "github.com/tendermint/tendermint/libs/log"
15
15
  )
16
16
 
17
17
  // This module implements a Cosmos ExtensionSnapshotter to capture and restore
@@ -4,7 +4,7 @@ import (
4
4
  "io"
5
5
  "testing"
6
6
 
7
- "github.com/tendermint/tendermint/libs/log"
7
+ "github.com/cometbft/cometbft/libs/log"
8
8
  )
9
9
 
10
10
  func newTestExtensionSnapshotter() *ExtensionSnapshotter {