@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.
- package/.clang-format +116 -0
- package/CHANGELOG.md +14 -2
- package/Makefile +38 -67
- package/ante/ante.go +2 -2
- package/ante/inbound_test.go +1 -1
- package/app/app.go +173 -142
- package/app/export.go +6 -6
- package/app/genesis.go +4 -0
- package/app/sim_test.go +299 -50
- package/app/upgrade.go +125 -24
- package/app/upgrade_test.go +1 -1
- package/cmd/agd/agvm.go +1 -1
- package/cmd/agd/main.go +1 -1
- package/cmd/libdaemon/main.go +34 -1
- package/daemon/cmd/root.go +26 -35
- package/daemon/cmd/root_test.go +5 -4
- package/daemon/cmd/testnet.go +221 -95
- package/daemon/main.go +1 -0
- package/git-revision.txt +1 -1
- package/go.mod +93 -58
- package/go.sum +148 -95
- package/package.json +6 -3
- package/proto/agoric/swingset/genesis.proto +7 -11
- package/proto/agoric/swingset/msgs.proto +56 -75
- package/proto/agoric/swingset/query.proto +7 -10
- package/proto/agoric/swingset/swingset.proto +79 -108
- package/proto/agoric/vbank/genesis.proto +5 -5
- package/proto/agoric/vbank/msgs.proto +1 -2
- package/proto/agoric/vbank/vbank.proto +42 -52
- package/proto/agoric/vibc/msgs.proto +8 -11
- package/proto/agoric/vstorage/genesis.proto +6 -9
- package/proto/agoric/vstorage/query.proto +19 -48
- package/proto/agoric/vstorage/vstorage.proto +4 -10
- package/proto/agoric/vtransfer/genesis.proto +7 -7
- package/proto/buf.gen.gogo.yaml +8 -0
- package/proto/buf.gen.pulsar.yaml +17 -0
- package/proto/buf.gen.swagger.yaml +5 -0
- package/proto/buf.yaml +10 -0
- package/scripts/protocgen.sh +14 -21
- package/third_party/proto/amino/amino.proto +79 -0
- package/third_party/proto/cosmos/base/v1beta1/coin.proto +7 -2
- package/third_party/proto/cosmos/ics23/v1/proofs.proto +243 -0
- package/third_party/proto/cosmos/msg/v1/msg.proto +30 -0
- package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +17 -5
- package/third_party/proto/cosmos_proto/cosmos.proto +16 -1
- package/third_party/proto/gogoproto/gogo.proto +2 -2
- package/third_party/proto/google/protobuf/any.proto +6 -3
- package/third_party/proto/ibc/core/channel/v1/channel.proto +1 -1
- package/third_party/proto/ibc/core/client/v1/client.proto +4 -2
- package/types/address_hooks.go +2 -2
- package/types/address_hooks_test.go +3 -3
- package/types/ibc_packet.go +3 -3
- package/types/ibc_packet_test.go +3 -3
- package/vm/client.go +32 -7
- package/vm/proto_json.go +2 -2
- package/x/swingset/abci.go +1 -1
- package/x/swingset/alias.go +0 -1
- package/x/swingset/config.go +1 -1
- package/x/swingset/keeper/extension_snapshotter.go +1 -1
- package/x/swingset/keeper/extension_snapshotter_test.go +1 -1
- package/x/swingset/keeper/keeper.go +1 -1
- package/x/swingset/keeper/keeper_test.go +1 -1
- package/x/swingset/keeper/querier.go +1 -30
- package/x/swingset/keeper/swing_store_exports_handler.go +1 -1
- package/x/swingset/keeper/swing_store_exports_handler_test.go +1 -1
- package/x/swingset/module.go +1 -14
- package/x/swingset/types/default-params.go +24 -16
- package/x/swingset/types/genesis.pb.go +2 -2
- package/x/swingset/types/msgs.pb.go +4 -3
- package/x/swingset/types/msgs_test.go +1 -1
- package/x/swingset/types/query.pb.go +4 -3
- package/x/swingset/types/swingset.pb.go +2 -2
- package/x/vbank/genesis.go +1 -1
- package/x/vbank/keeper/querier.go +1 -21
- package/x/vbank/module.go +1 -16
- package/x/vbank/types/genesis.pb.go +2 -2
- package/x/vbank/types/msgs.pb.go +3 -2
- package/x/vbank/types/query.pb.go +4 -3
- package/x/vbank/types/vbank.pb.go +2 -2
- package/x/vbank/vbank_test.go +95 -16
- package/x/vibc/keeper/keeper.go +8 -5
- package/x/vibc/keeper/migrations.go +36 -0
- package/x/vibc/keeper/triggers.go +1 -1
- package/x/vibc/module.go +9 -17
- package/x/vibc/types/expected_keepers.go +5 -10
- package/x/vibc/types/ibc_module.go +4 -4
- package/x/vibc/types/msgs.go +1 -1
- package/x/vibc/types/msgs.pb.go +5 -4
- package/x/vibc/types/receiver.go +2 -2
- package/x/vlocalchain/keeper/keeper.go +3 -3
- package/x/vlocalchain/types/vlocalchain.pb.go +1 -1
- package/x/vlocalchain/vlocalchain_test.go +6 -6
- package/x/vstorage/alias.go +0 -1
- package/x/vstorage/client/cli/query.go +1 -1
- package/x/vstorage/genesis.go +1 -1
- package/x/vstorage/keeper/keeper.go +6 -5
- package/x/vstorage/keeper/keeper_test.go +24 -24
- package/x/vstorage/keeper/querier.go +1 -32
- package/x/vstorage/keeper/querier_test.go +41 -6
- package/x/vstorage/module.go +1 -14
- package/x/vstorage/types/genesis.pb.go +2 -2
- package/x/vstorage/types/query.pb.go +8 -5
- package/x/vstorage/types/vstorage.pb.go +2 -2
- package/x/vstorage/vstorage_test.go +3 -3
- package/x/vtransfer/genesis.go +1 -1
- package/x/vtransfer/ibc_middleware.go +4 -4
- package/x/vtransfer/ibc_middleware_test.go +10 -11
- package/x/vtransfer/keeper/keeper.go +5 -5
- package/x/vtransfer/module.go +1 -14
- package/x/vtransfer/types/expected_keepers.go +2 -18
- package/x/vtransfer/types/genesis.pb.go +2 -2
- package/x/vtransfer/utils_test.go +15 -15
- 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
|
|
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
|
-
|
|
58
|
+
// title of the proposal
|
|
59
|
+
string title = 1;
|
|
60
|
+
|
|
61
|
+
// description of the proposal
|
|
56
62
|
string description = 2;
|
|
57
|
-
|
|
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
|
-
|
|
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/
|
|
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/
|
|
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 :=
|
|
80
|
+
// any, err := anypb.New(foo)
|
|
81
|
+
// if err != nil {
|
|
82
|
+
// ...
|
|
83
|
+
// }
|
|
81
84
|
// ...
|
|
82
85
|
// foo := &pb.Foo{}
|
|
83
|
-
// if err :=
|
|
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/
|
|
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/
|
|
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
|
}
|
package/types/address_hooks.go
CHANGED
|
@@ -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/
|
|
11
|
-
ibcexported "github.com/cosmos/ibc-go/
|
|
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/
|
|
12
|
-
clienttypes "github.com/cosmos/ibc-go/
|
|
13
|
-
channeltypes "github.com/cosmos/ibc-go/
|
|
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
|
)
|
package/types/ibc_packet.go
CHANGED
|
@@ -3,9 +3,9 @@ package types
|
|
|
3
3
|
import (
|
|
4
4
|
"encoding/json"
|
|
5
5
|
|
|
6
|
-
clienttypes "github.com/cosmos/ibc-go/
|
|
7
|
-
channeltypes "github.com/cosmos/ibc-go/
|
|
8
|
-
"github.com/cosmos/ibc-go/
|
|
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{}
|
package/types/ibc_packet_test.go
CHANGED
|
@@ -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/
|
|
15
|
-
channeltypes "github.com/cosmos/ibc-go/
|
|
16
|
-
ibcexported "github.com/cosmos/ibc-go/
|
|
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
|
|
38
|
-
send
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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) =
|
|
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
package/x/swingset/abci.go
CHANGED
|
@@ -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"
|
package/x/swingset/alias.go
CHANGED
package/x/swingset/config.go
CHANGED
|
@@ -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
|