-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Confidential message type (#99)
* Problem: A user cannot create a Confidential VM because we don't support that kind of messages, that have a different schema from Instances and Programs. Solution: Create a Confidential message schema with concrete fields. * Fix: Removed old implementation and Added new one using a field instead of a new message type. * Fix: Solve code quality issues. * Fix: Solved test issues after last changes. * Fix: Solved code quality issues on tests caused by different black versions. * Fix: Solve mypy issue on CI. * Fix: Added missing firmware field for confidentials. * Add class TrustedExecutionEnvironment * Add comment on retro-compatibility * Improve tests --------- Co-authored-by: Andres D. Molins <[email protected]> Co-authored-by: Hugo Herter <[email protected]>
- Loading branch information
1 parent
caef895
commit 2536bf7
Showing
7 changed files
with
220 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
aleph_message/tests/messages/instance_confidential_machine.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
{ | ||
"_id": { | ||
"$oid": "6080402d7f44efefd611dc1e" | ||
}, | ||
"chain": "ETH", | ||
"sender": "0x9319Ad3B7A8E0eE24f2E639c40D8eD124C5520Ba", | ||
"type": "INSTANCE", | ||
"channel": "Fun-dApps", | ||
"confirmed": true, | ||
"content": { | ||
"address": "0x9319Ad3B7A8E0eE24f2E639c40D8eD124C5520Ba", | ||
"allow_amend": false, | ||
"variables": { | ||
"VM_CUSTOM_VARIABLE": "SOMETHING", | ||
"VM_CUSTOM_VARIABLE_2": "32" | ||
}, | ||
"environment": { | ||
"reproducible": true, | ||
"internet": false, | ||
"aleph_api": false, | ||
"shared_cache": false, | ||
"hypervisor": "qemu", | ||
"trusted_execution": { | ||
"policy": 1, | ||
"firmware": "e258d248fda94c63753607f7c4494ee0fcbe92f1a76bfdac795c9d84101eb317" | ||
} | ||
}, | ||
"resources": { | ||
"vcpus": 1, | ||
"memory": 128, | ||
"seconds": 30 | ||
}, | ||
"requirements": { | ||
"cpu": { | ||
"architecture": "x86_64" | ||
}, | ||
"node": { | ||
"node_hash": "4d4db19afca380fdf06ba7f916153d0f740db9de9eee23ad26ba96a90d8a2920" | ||
} | ||
}, | ||
"rootfs": { | ||
"parent": { | ||
"ref": "549ec451d9b099cad112d4aaa2c00ac40fb6729a92ff252ff22eef0b5c3cb613", | ||
"use_latest": true | ||
}, | ||
"persistence": "host", | ||
"size_mib": 20000 | ||
}, | ||
"authorized_keys": [ | ||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGULT6A41Msmw2KEu0R9MvUjhuWNAsbdeZ0DOwYbt4Qt user@example", | ||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH0jqdc5dmt75QhTrWqeHDV9xN8vxbgFyOYs2fuQl7CI", | ||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDRsrQV1HVrcnskNhyH0may8TG9fHCPawpAi3ZgAWU6V/R7ezvZOHnZdaFeIsOpFbPbt/l67Fur3qniSXllI2kvuh2D4BBJ9PwwlB2sgWzFDF34ADsfLQf+C/vpwrWemEEE91Tpj0dWbnf219i3mZLxy/+5Sv6kUy9YJlzWnDEUbaMAZK2CXrlK90b9Ns7mT82h6h3x9dLF/oCjBAKOSxbH2X+KgsDEZT0soxyluDqKNgKflkav+pvKFyD4J9IWM4j36r80yW+OPGsHqWoWleEhprfNb60RJPwKAYCDiBiSg6wCq5P+kS15O79Ko45wPaYDUwhRoNTcrWeadvTaCZgz9X3KDHgrX6wzdKqzQwtQeabhCaIGLFRMNl1Oy/BR8VozPbIe/mY28IN84An50UYkbve7nOGJucKc4hKxZKEVPpnVpRtIoWGwBJY2fi6C6wy2pBa8UX4C4t9NLJjNQSwFBzYOrphLu3ZW9A+267nogQHGnsJ5xnQ/MXximP3BlwM= user@example" | ||
], | ||
"volumes": [ | ||
{ | ||
"comment": "Python libraries. Read-only since a 'ref' is specified.", | ||
"mount": "/opt/venv", | ||
"ref": "5f31b0706f59404fad3d0bff97ef89ddf24da4761608ea0646329362c662ba51", | ||
"use_latest": false | ||
}, | ||
{ | ||
"comment": "Ephemeral storage, read-write but will not persist after the VM stops", | ||
"mount": "/var/cache", | ||
"ephemeral": true, | ||
"size_mib": 5 | ||
}, | ||
{ | ||
"comment": "Working data persisted on the VM supervisor, not available on other nodes", | ||
"mount": "/var/lib/sqlite", | ||
"name": "sqlite-data", | ||
"persistence": "host", | ||
"size_mib": 10 | ||
}, | ||
{ | ||
"comment": "Working data persisted on the Aleph network. New VMs will try to use the latest version of this volume, with no guarantee against conflicts", | ||
"mount": "/var/lib/statistics", | ||
"name": "statistics", | ||
"persistence": "store", | ||
"size_mib": 10 | ||
}, | ||
{ | ||
"comment": "Raw drive to use by a process, do not mount it", | ||
"name": "raw-data", | ||
"persistence": "host", | ||
"size_mib": 10 | ||
} | ||
], | ||
"replaces": "0x9319Ad3B7A8E0eE24f2E639c40D8eD124C5520Ba", | ||
"time": 1619017773.8950517 | ||
}, | ||
"item_type": "inline", | ||
"signature": "0x372da8230552b8c3e65c05b31a0ff3a24666d66c575f8e11019f62579bf48c2b7fe2f0bbe907a2a5bf8050989cdaf8a59ff8a1cbcafcdef0656c54279b4aa0c71b", | ||
"size": 749, | ||
"time": 1619017773.8950577, | ||
"confirmations": [ | ||
{ | ||
"chain": "ETH", | ||
"height": 12284734, | ||
"hash": "0x67f2f3cde5e94e70615c92629c70d22dc959a118f46e9411b29659c2fce87cdc" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters