https://github.com/automata-network/revm-sgx
https://github.com/automata-network/revm-sgx
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/automata-network/revm-sgx
- Owner: automata-network
- License: apache-2.0
- Created: 2024-04-04T16:24:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-14T02:24:23.000Z (2 months ago)
- Last Synced: 2025-03-14T03:26:33.983Z (2 months ago)
- Language: Rust
- Size: 98.6 KB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# revm-sgx
[](LICENSE) [](https://github.com/automata-network/automata-sgx-sdk)This enclave app is the SGX version of the Rust EVM executor or short REVME. The official standard version can be found [here](https://github.com/bluealloy/revm/tree/main/bins/revme). Presently, its primary application is in executing Ethereum tests.
## Prerequisite
* SGX-SDK 2.24 installation
* Cargo and Rust installation, currently requires `nightly-2024-02-01` rustc version
* Basic dev toolkits installation like cmake
* For setup the environment, refers to [Dockerfile](https://github.com/automata-network/automata-sgx-sdk/blob/main/docker/ubuntu-20.04.Dockerfile)If you're using Azure, the following are recommended configurations:
* VM spec: `Standard_DC4s_v3`
* OS spec: `Ubuntu Server 20.04 LTS` or `Ubuntu Server 22.04 LTS`## Getting Started
The enclave app takes a path to the directory where ethereum statetest json can be found. It recursively parses all json files in the specified directory and executes them.
Running all [ethereum tests](https://github.com/ethereum/tests) checks that revm is compliant to the ethereum specs.
To run [ethereum tests](https://github.com/ethereum/tests) locally, clone the [tests](https://github.com/ethereum/tests) repository and provide the test directory. Below, we clone the repo and execute the GeneralStateTests suite of tests.
```shell
$ git clone https://github.com/ethereum/tests.git
$ git clone https://github.com/automata-network/revm-sgx.git
$ cd revm-sgx
$ # cargo install cargo-sgx
$ cargo sgx run ../tests/GeneralStateTests/Cancun/*
```## How it works
In order to run revm in Intel SGX, we leverage the automata-sgx-sdk implementation. See the [official docs](https://github.com/automata-network/automata-sgx-sdk) to view more details.
To ensure successful compilation, other necessary adjustments include:
* Use sgx_rand instead of the normal rand and getrandom crate, whose instructions are not compatible in SGX.
* Ensure all cryptographic algorithms are compatible in SGX.