@@ -5,13 +5,16 @@ import "amino/amino.proto";
55import "cosmos/msg/v1/msg.proto" ;
66import "cosmos_proto/cosmos.proto" ;
77import "gogoproto/gogo.proto" ;
8+ import "agoric/swingset/swingset.proto" ;
89
910option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types" ;
1011
1112// Transactions.
1213service Msg {
1314 // Install a JavaScript sources bundle on the chain's SwingSet controller.
1415 rpc InstallBundle (MsgInstallBundle ) returns (MsgInstallBundleResponse );
16+ // Send a chunk of a bundle to tolerate RPC message size limits.
17+ rpc SendChunk (MsgSendChunk ) returns (MsgSendChunkResponse );
1518 // Send inbound messages.
1619 rpc DeliverInbound (MsgDeliverInbound ) returns (MsgDeliverInboundResponse );
1720 // Perform a low-privilege wallet action.
@@ -127,6 +130,10 @@ message MsgProvision {
127130message MsgProvisionResponse {}
128131
129132// MsgInstallBundle carries a signed bundle to SwingSet.
133+ // Of the fields bundle, compressed_bundle, and chunked_artifact, exactly one
134+ // must be present: bundle if complete and uncompressed, compressed_bundle if
135+ // complete and compressed, or chunked_artifact for a manifest of chunks to be
136+ // submitted in subsequent messages.
130137message MsgInstallBundle {
131138 // Until agoric-upgrade-22 this message didn't have an amino name
132139 // but no clients actually used amino encoding
@@ -140,26 +147,28 @@ message MsgInstallBundle {
140147 (gogoproto.jsontag ) = "submitter" ,
141148 (gogoproto.moretags ) = "yaml:\"submitter\""
142149 ];
143- // Either bundle or compressed_bundle will be set.
144150 // Default compression algorithm is gzip.
145151 bytes compressed_bundle = 3 [
146152 (amino.dont_omitempty ) = true ,
147153 (amino.field_name ) = "compressedBundle" ,
148154 (gogoproto.jsontag ) = "compressedBundle" ,
149155 (gogoproto.moretags ) = "yaml:\"compressedBundle\""
150156 ];
151- // Size in bytes of uncompression of compressed_bundle.
157+ // Total size in bytes of the bundle artifact, before compression and after
158+ // decompression.
152159 int64 uncompressed_size = 4 [
153160 (amino.dont_omitempty ) = true ,
154161 (amino.field_name ) = "uncompressedSize" ,
155162 (gogoproto.jsontag ) = "uncompressedSize"
156163 ];
164+ // Declaration of a chunked bundle.
165+ ChunkedArtifact chunked_artifact = 5 [
166+ (amino.field_name ) = "chunkedArtifact" ,
167+ (gogoproto.jsontag ) = "chunkedArtifact" ,
168+ (gogoproto.moretags ) = "yaml:\"chunkedArtifact\""
169+ ];
157170}
158171
159- // MsgInstallBundleResponse is an empty acknowledgement that an install bundle
160- // message has been queued for the SwingSet kernel's consideration.
161- message MsgInstallBundleResponse {}
162-
163172// MsgCoreEval defines an SDK message for a core eval.
164173message MsgCoreEval {
165174 option (cosmos.msg.v1.signer ) = "authority" ;
@@ -181,3 +190,61 @@ message MsgCoreEvalResponse {
181190 // The result of the core eval.
182191 string result = 1 [(gogoproto.moretags ) = "yaml:\"result\"" ];
183192}
193+
194+ // MsgInstallBundleResponse is either an empty acknowledgement that a bundle
195+ // installation message has been queued for the SwingSet kernel's
196+ // consideration, or for MsgInstallBundle requests that have a chunked artifact
197+ // manifest instead of a compressed or uncompressed bundle: the identifier
198+ // assigned for the chunked artifact for reference in subsequent MsgSendChunk
199+ // messages.
200+ message MsgInstallBundleResponse {
201+ // The assigned identifier for a chunked artifact, if the caller is expected
202+ // to call back with MsgSendChunk messages.
203+ uint64 chunked_artifact_id = 1 [
204+ (amino.field_name ) = "chunkedArtifactId" ,
205+ (gogoproto.jsontag ) = "chunkedArtifactId" ,
206+ (gogoproto.moretags ) = "yaml:\"chunkedArtifactId\""
207+ ];
208+ }
209+
210+ // MsgSendChunk carries a chunk of an artifact through RPC to the chain.
211+ // Individual chunks are addressed by the chunked artifact identifier and
212+ // the zero-based index of the chunk among all chunks as mentioned in the
213+ // manifest provided to MsgInstallBundle.
214+ message MsgSendChunk {
215+ uint64 chunked_artifact_id = 1 [
216+ (amino.field_name ) = "chunkedArtifactId" ,
217+ (gogoproto.jsontag ) = "chunkedArtifactId" ,
218+ (gogoproto.moretags ) = "yaml:\"chunkedArtifactId\""
219+ ];
220+ bytes submitter = 2 [
221+ (amino.encoding ) = "legacy_address" ,
222+ (amino.field_name ) = "submitter" ,
223+ (gogoproto.casttype ) = "github.com/cosmos/cosmos-sdk/types.AccAddress" ,
224+ (gogoproto.jsontag ) = "submitter" ,
225+ (gogoproto.moretags ) = "yaml:\"submitter\""
226+ ];
227+ uint64 chunk_index = 3 [
228+ (amino.field_name ) = "chunkIndex" ,
229+ (gogoproto.jsontag ) = "chunkIndex" ,
230+ (gogoproto.moretags ) = "yaml:\"chunkIndex\""
231+ ];
232+ bytes chunk_data = 4 [
233+ (amino.field_name ) = "chunkIndex" ,
234+ (gogoproto.jsontag ) = "chunkData" ,
235+ (gogoproto.moretags ) = "yaml:\"chunkData\""
236+ ];
237+ }
238+
239+ // MsgSendChunkResponse is an acknowledgement that a chunk has been received by
240+ // the chain.
241+ message MsgSendChunkResponse {
242+ uint64 chunked_artifact_id = 1 [
243+ (amino.field_name ) = "chunkedArtifactId" ,
244+ (gogoproto.jsontag ) = "chunkedArtifactId" ,
245+ (gogoproto.moretags ) = "yaml:\"chunkedArtifactId\""
246+ ];
247+ // The current state of the chunk.
248+ ChunkInfo chunk = 2
249+ [(amino.field_name ) = "chunk", (gogoproto.jsontag) = "chunk", (gogoproto.moretags) = "yaml:\"chunk\"" ];
250+ }
0 commit comments