{"id":20433876,"url":"https://github.com/flashbots/gramine-andromeda-revm","last_synced_at":"2025-04-12T21:09:34.869Z","repository":{"id":219149959,"uuid":"718793813","full_name":"flashbots/gramine-andromeda-revm","owner":"flashbots","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-11T16:32:51.000Z","size":391,"stargazers_count":5,"open_issues_count":1,"forks_count":4,"subscribers_count":10,"default_branch":"attest","last_synced_at":"2025-04-12T21:09:29.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashbots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-14T20:13:12.000Z","updated_at":"2024-08-27T15:37:31.000Z","dependencies_parsed_at":"2024-06-11T20:04:08.967Z","dependency_job_id":"715d8c52-9609-40e4-9423-ce662fb1dd85","html_url":"https://github.com/flashbots/gramine-andromeda-revm","commit_stats":null,"previous_names":["flashbots/gramine-andromeda-revm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgramine-andromeda-revm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgramine-andromeda-revm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgramine-andromeda-revm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashbots%2Fgramine-andromeda-revm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashbots","download_url":"https://codeload.github.com/flashbots/gramine-andromeda-revm/tar.gz/refs/heads/attest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631676,"owners_count":21136562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:22:07.608Z","updated_at":"2025-04-12T21:09:34.848Z","avatar_url":"https://github.com/flashbots.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!WARNING]\n\u003e This repository is a work in progress, and for now only functions as a showcase. This code *is not intended to secure any valuable information*.\n\n# Andromeda MEVM in Gramine\n\nThis is a gramine environment for running [Andromeda REVM](github.com/flashbots/suave-andromeda-revm) in a TEE.\n\nThe TEE service (gramine-sirrah) uses stdin and stdout for passing data in and out of the REVM, which currently supports two commands:\n* `advance [height]`, which advances the suave chain to requested height (or to latest if no height provided)\n* `execute tx_data`, which executes the requested data. For data format see [Andromeda REVM](github.com/flashbots/suave-andromeda-revm).\n\nThe TEE service is stateless, so make sure that you have `suave-geth` running. TEE will connect to `http://localhost:8545` by default, which you can override by passing `--rpc` flag. The RPC is used for fetching chain data along with their proofs.\n\nWe also provide a simple http and tpc [server](server.py) for handling requests to and from the TEE service, for example usage see [andromeda-sirrah-contracts](github.com/flashbots/andromeda-sirrah-contracts).\n\n## Current measurement\n\n```\nmr_signer: f0365ce7081fda379914c703fe08648db1cce3747e8c10f74ff742926399f15a\nmr_enclave: cd4a0af69a811a223a92379b08a84b2e3ecdd7a199bb0656ebd1cd689df8c402\n```\n\n## Run locally\n\nThe Andromeda `revm-andromeda` relies on gramine features for the precompiles, specifically `/dev/attestation/quote` and `/dev/urandom/`.  \nRunning outside of an enclave, we can still simulate this. For example `/dev/urandom` works anyway. The other Andromeda precompiles, `volatile{Get/Set}` are directly managed in-memory by `suave-andromeda-revm`. \n\n```shell\ncargo build\ncargo run\n```\n\n## Replicate build using Docker (no SGX Required)\nTo build and print the MRENCLAVE:\n```shell\ndocker build --tag gramine-andromeda-revm .\ndocker run --rm gramine-andromeda-revm\n```\n\n## Extract reproducible binaries built using docker\n\n```shell\ndocker build --output=. -f=binaries.Dockerfile .\n```\nAlternatively, run `make docker-binaries` which does the same. Note that the binaries will be pulled from dockerhub as opposed to local image. This ensures the MRSIGNER is matching.  \n\nThe above will output sgx-revm.sig, sgx-revm.manifest, sgx-revm.manifest.sgx into the main directory, and gramine-sirrah into target/release directory. Continue as if you just ran `SGX=1 make all`. Since we are outputing the binaries, you might encounter errors if you are not using the same OS as the docker target (ubuntu 22.04).\n\nFor now we are still checking the `mr_signer`, if you want to connect to one of the predeployed Andromeda contracts without configuring your `mr_signer` you can pull binaries from `ruteri/gramine-andromeda-revm:latest`.\n\n## How to replicate the execution on an SGX-enabled environment (still using Docker)\n\n```shell\ndocker run -it --device /dev/sgx_enclave \\\n       -v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket \\\n       gramine-andromeda-revm \"gramine-sgx ./sgx-revm\"\n```\n\n## License\n\nThe code in this project is free software under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fgramine-andromeda-revm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashbots%2Fgramine-andromeda-revm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashbots%2Fgramine-andromeda-revm/lists"}