Skip to main content

MarloweTransfer sub-protocol

The MarloweTransfer sub-protocol is defined here:

Below is a state diagram for the MarloweLoad sub-protocol:

The MarloweTransfer sub-protocol is used to efficiently transfer contracts to and from the contract store. It uses the object bundle format and works in import or export mode.

Sub-protocol states

Protocol stateAgencyDescription
1. IdleClientThe server is waiting for the client to start an upload or a download.
2. ExportServerThe server is determining if the requested contract can be exported.
3. CanDownloadClientThe client can download the next partial object bundle from the server.
4. DownloadServerThe server is retrieving the next partial object bundle for the client.
5. CanUploadClientThe client can upload the next partial object bundle to the server.
6. UploadServerThe server is processing a partial object bundle from the client.
7. DoneNobodyThe protocol session is done.

Messages

MessageBegin stateEnd stateParameterDescription
1. StartImportIdleCanUploadThe client starts an import session.
2. RequestExport hashIdleExportThe client requests an export of the contract identified by its hash.
hashThe hash of the contract to export.
3. StartExportExportCanDownloadThe server has verified the export request and cleared the client to begin downloading.
4. ContractNotFoundExportIdleThe server was unable to find the given contract and is refusing the export request.
5. DoneIdleDoneThe client ends the session.
6. Upload bundlePartCanUploadUploadThe client uploads the next part of the bundle to the server.
bundlePartThe next part of the object bundle that comes after the previous one.
7. Uploaded mappingUploadCanUploadThe server has processed the uploaded bundle part and is ready for the next one.
mappingA mapping of contract labels in the bundle to their hashes (post-merkleization).
8. UploadFailed errUploadIdleThe client tried to upload an invalid bundle part.
errWhat went wrong while processing the bundle part.
9. ImportedCanUploadIdleThe client has no more bundle parts left to push.
10. Download nCanDownloadDownloadThe client requests the next n objects in the bundle.
nThe maximum number of objects the client wants to receive.
11. Downloaded bundlePartDownloadCanDownloadThe server sends the next bundle part to the client.
bundlePartThe next part of the object bundle that comes after the previous one.
12. ExportedDownloadIdleThe server has no more bundle parts to send.
13. CancelCanDownloadIdleThe client is cancelling the download.