Closed hoh closed 3 years ago
Question: Should the mount point for the initial state (data
) and final state (export
) be enforced to be identical ?
Since Aleph messages can be ammended, it would make more sense to reference the code using the root _itemhash than the address of the emitter. Same for the runtime and the data.
The format therefore changes to contain a ref to the _itemhash and a field _latestamend that specifies whether the latest amend to the message should be used or only the original message.
This would give:
{
"type": "vm-function",
"address": "0x99eC8dc3831F67359a18420449fb028D5dCAa60f",
"content": {
"code": {
"encoding": "plain" | "zip" | "tar.gzip",
"entrypoint": "application",
either "content": "async def application(scope, receive, send):\n await send({'output': 'hola!'})",
or "ref": "c5e40cd89103d3c57327a514f465b83cd193d1331f307bc5a4c38bfec36ab37d",
"latest_amend": true
},
"on": {
"http": true,
"cron": "5 4 * * *",
"aleph": [
{"type": "POST", "channel": "FOUNDATION", "content": {"type": "calculation"}}
]
},
"environment":{
"reproducible": true,
"internet": false,
"aleph_api": false
},
"resources": {
"vcpus": 1,
"memory": 128,
"seconds": 1
},
"runtime": {
"ref": "c5e40cd89103d3c57327a514f465b83cd193d1331f307bc5a4c38bfec36ab37d",
"latest_amend": true,
"comment": "Aleph Alpine Linux with Python 3.8"
},
"data": {
"encoding": "tar.gzip",
"mount": "/mnt",
"ref": "c5e40cd89103d3c57327a514f465b83cd193d1331f307bc5a4c38bfec36ab37d",
"latest_amend": true
},
"export": {
"encoding": "tar.gzip",
"mount": "/mnt",
}
},
"time": 1618386753.856,
}
Current proposal makes the content accessible as message.content.content... As discussed we would need to change this so that it's accessed as message.content.
In the optics of using the first hash of a vm creation as its address we need to ensure there is enough "unique" parts in the content to make it really unique (as in no further creation will get the same hash).
The specification was further defined and accepted here: https://github.com/aleph-im/aleph-message/pull/2
This issue discusses the specification of the Aleph messages that instruct nodes to run code in virtual machines.
The content that need to be specified:
Here is a first proposal: