Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

EVM-RS -> EthereumVM #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "evm"
name = "ethereumvm"
version = "0.11.0"
license = "Apache-2.0"
authors = ["Wei Tang <[email protected]>", "Mike Lubinets <[email protected]>"]
description = "SputnikVM - a Portable Blockchain Virtual Machine"
description = "EthereumVM - a Portable Blockchain Virtual Machine"
repository = "https://github.com/ethereumproject/evm-rs"
keywords = ["no_std", "ethereum"]
edition = "2018"

[lib]
name = "evm"
name = "ethereumvm"

[dependencies]
sha3 = "0.6"
Expand Down
4 changes: 2 additions & 2 deletions FORMATTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repository incorporates a certain formatting style derived from the [rustfm
Any other configuration is the **stable** `rustfmt` default.

#### Running the formatter
`evm-rs` is a complex project with a lot of sub-crates, so `cargo fmt` should be invoked with an `--all` argument.
`ethereumvm` is a complex project with a lot of sub-crates, so `cargo fmt` should be invoked with an `--all` argument.
```bash
cargo fmt --all
```
Expand All @@ -16,7 +16,7 @@ More info can be found at the [project page](https://github.com/rust-lang/rustfm
#### Manual formatting overrides
The formatting constraint is checked within Travis CI and Jenkins continuous integration pipelines, hence any pull-request should be formatted before it may be merged.

Though, as most of the tooling generally is, `rustfmt` isn’t perfect and sometimes one would requite to force the manual formatting, as, for instance, it’s required for the `Patch` interface in `evm-rs`
Though, as most of the tooling generally is, `rustfmt` isn’t perfect and sometimes one would requite to force the manual formatting, as, for instance, it’s required for the `Patch` interface in `ethereumvm`
##### Original code
```rust
pub struct EmbeddedAccountPatch;
Expand Down
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# SputnikVM: Rust Ethereum Virtual Machine Implementation
# EthereumVM: Rust Ethereum Virtual Machine Implementation

[![Build Status](https://travis-ci.org/ethereumproject/evm-rs.svg?branch=master)](https://travis-ci.org/ethereumproject/evm-rs)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](./LICENSE)

| Name | Description | Crates.io | Documentation |
|--------------------|:---------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------:|
| evm | Core library for the Ethereum Virtual Machine | [![crates.io](https://img.shields.io/crates/v/evm.svg)](https://crates.io/crates/evm) | [![Documentation](https://docs.rs/evm/badge.svg)](https://docs.rs/evm) |
| evm-stateful | Merkle Trie stateful wrapper for SputnikVM | [![crates.io](https://img.shields.io/crates/v/evm-stateful.svg)](https://crates.io/crates/evm-stateful) | [![Documentation](https://docs.rs/evm-stateful/badge.svg)](https://docs.rs/evm-stateful) |
| ethereumvm | Core library for the Ethereum Virtual Machine | [![crates.io](https://img.shields.io/crates/v/ethereumvm.svg)](https://crates.io/crates/ethereumvm) | [![Documentation](https://docs.rs/ethereumvm/badge.svg)](https://docs.rs/ethereumvm) |
| ethereumvm-stateful| Merkle Trie stateful wrapper for EthereumVM | [![crates.io](https://img.shields.io/crates/v/ethereumvm-stateful.svg)](https://crates.io/crates/ethereumvm-stateful) | [![Documentation](https://docs.rs/ethereumvm-stateful/badge.svg)](https://docs.rs/ethereumvm-stateful) |

## Features

Expand All @@ -20,47 +20,47 @@

## Supported Networks

* Foundation ([evm-network-foundation](./network/foundation))
* Classic ([evm-network-classic](./network/classic))
* Ellaism ([evm-network-ellaism](./network/ellaism))
* Expanse ([evm-network-expanse](./network/expanse))
* Musicoin ([evm-network-musicoin](./network/musicoin))
* Ubiq ([evm-network-ubiq](./network/ubiq))
* All of the above and other networks ([evm-network-dynamic](./network/dynamic))
* Foundation ([ethereumvm-network-foundation](./network/foundation))
* Classic ([ethereumvm-network-classic](./network/classic))
* Ellaism ([ethereumvm-network-ellaism](./network/ellaism))
* Expanse ([ethereumvm-network-expanse](./network/expanse))
* Musicoin ([ethereumvm-network-musicoin](./network/musicoin))
* Ubiq ([ethereumvm-network-ubiq](./network/ubiq))
* All of the above and other networks ([ethereumvm-network-dynamic](./network/dynamic))

## Supported Networks

| Network | Crates.io | Documentation |
|------------------|:---------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------:|
| Any Network | [![crates.io](https://img.shields.io/crates/v/evm-network.svg)](https://crates.io/crates/evm-network) | [![Documentation](https://docs.rs/evm-network/badge.svg)](https://docs.rs/evm-network) |
| Ethereum Classic | [![crates.io](https://img.shields.io/crates/v/evm-network-classic.svg)](https://crates.io/crates/evm-network-classic) | [![Documentation](https://docs.rs/evm-network-classic/badge.svg)](https://docs.rs/evm-network-classic) |
| Ethereum | [![crates.io](https://img.shields.io/crates/v/evm-network-foundation.svg)](https://crates.io/crates/evm-network-foundation) | [![Documentation](https://docs.rs/evm-network-foundation/badge.svg)](https://docs.rs/evm-network-foundation) |
| Ellaism | [![crates.io](https://img.shields.io/crates/v/evm-network-ellaism.svg)](https://crates.io/crates/evm-network-ellaism) | [![Documentation](https://docs.rs/evm-network-ellaism/badge.svg)](https://docs.rs/evm-network-ellaism) |
| Ubiq | [![crates.io](https://img.shields.io/crates/v/evm-network-ubiq.svg)](https://crates.io/crates/evm-network-ubiq) | [![Documentation](https://docs.rs/evm-network-ubiq/badge.svg)](https://docs.rs/evm-network-ubiq) |
| Expanse | [![crates.io](https://img.shields.io/crates/v/evm-network-expanse.svg)](https://crates.io/crates/evm-network-expanse) | [![Documentation](https://docs.rs/evm-network-expanse/badge.svg)](https://docs.rs/evm-network-expanse) |
| Musicoin | [![crates.io](https://img.shields.io/crates/v/evm-network-musicoin.svg)](https://crates.io/crates/evm-network-musicoin) | [![Documentation](https://docs.rs/evm-network-musicoin/badge.svg)](https://docs.rs/evm-network-musicoin) |
| Any Network | [![crates.io](https://img.shields.io/crates/v/ethereumvm-network.svg)](https://crates.io/crates/ethereumvm-network) | [![Documentation](https://docs.rs/ethereumvm-network/badge.svg)](https://docs.rs/ethereumvm-network) |
| Ethereum Classic | [![crates.io](https://img.shields.io/crates/v/ethereumvm-network-classic.svg)](https://crates.io/crates/ethereumvm-network-classic) | [![Documentation](https://docs.rs/ethereumvm-network-classic/badge.svg)](https://docs.rs/ethereumvm-network-classic) |
| Ethereum | [![crates.io](https://img.shields.io/crates/v/ethereumvm-network-foundation.svg)](https://crates.io/crates/ethereumvm-network-foundation) | [![Documentation](https://docs.rs/ethereumvm-network-foundation/badge.svg)](https://docs.rs/ethereumvm-network-foundation) |
| Ellaism | [![crates.io](https://img.shields.io/crates/v/ethereumvm-network-ellaism.svg)](https://crates.io/crates/ethereumvm-network-ellaism) | [![Documentation](https://docs.rs/ethereumvm-network-ellaism/badge.svg)](https://docs.rs/ethereumvm-network-ellaism) |
| Ubiq | [![crates.io](https://img.shields.io/crates/v/ethereumvm-network-ubiq.svg)](https://crates.io/crates/ethereumvm-network-ubiq) | [![Documentation](https://docs.rs/ethereumvm-network-ubiq/badge.svg)](https://docs.rs/ethereumvm-network-ubiq) |
| Expanse | [![crates.io](https://img.shields.io/crates/v/ethereumvm-network-expanse.svg)](https://crates.io/crates/ethereumvm-network-expanse) | [![Documentation](https://docs.rs/ethereumvm-network-expanse/badge.svg)](https://docs.rs/ethereumvm-network-expanse) |
| Musicoin | [![crates.io](https://img.shields.io/crates/v/ethereumvm-network-musicoin.svg)](https://crates.io/crates/ethereumvm-network-musicoin) | [![Documentation](https://docs.rs/ethereumvm-network-musicoin/badge.svg)](https://docs.rs/ethereumvm-network-musicoin) |

## Precompiled Contracts

The core library has the initial four precompiled contracts embedded. To use the bn128 and modexp precompiled contracts introduced by the Byzantium hard fork, pull the following crates.

| Name | Description | Crates.io | Documentation |
|------------------------------|:----------------------------:|:---------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------:|
| evm-precompiled-bn128 | bn128 precompiled contracts | [![crates.io](https://img.shields.io/crates/v/evm-precompiled-bn128.svg)](https://crates.io/crates/evm-precompiled-bn128) | [![Documentation](https://docs.rs/evm-precompiled-bn128/badge.svg)](https://docs.rs/evm-precompiled-bn128) |
| evm-precompiled-modexp | modexp precompiled contracts | [![crates.io](https://img.shields.io/crates/v/evm-precompiled-modexp.svg)](https://crates.io/crates/evm-precompiled-modexp) | [![Documentation](https://docs.rs/evm-precompiled-modexp/badge.svg)](https://docs.rs/evm-precompiled-modexp) |
| ethereumvm-precompiled-bn128 | bn128 precompiled contracts | [![crates.io](https://img.shields.io/crates/v/ethereumvm-precompiled-bn128.svg)](https://crates.io/crates/ethereumvm-precompiled-bn128) | [![Documentation](https://docs.rs/ethereumvm-precompiled-bn128/badge.svg)](https://docs.rs/ethereumvm-precompiled-bn128) |
| ethereumvm-precompiled-modexp | modexp precompiled contracts | [![crates.io](https://img.shields.io/crates/v/ethereumvm-precompiled-modexp.svg)](https://crates.io/crates/ethereumvm-precompiled-modexp) | [![Documentation](https://docs.rs/ethereumvm-precompiled-modexp/badge.svg)](https://docs.rs/ethereumvm-precompiled-modexp) |

## Related projects

* [ethereum-rs](https://github.com/etclabscore/ethereum-rs) -
common traits and structs for Ethereum.
* [etclient](https://source.that.world/source/etclient) -
bare-minimal Ethereum client written in Rust.
* [SputnikVM FFI](https://github.com/ethereumproject/evm-ffi) - SputnikVM C and Go FFI bindings
* [SputnikVM Dev](https://github.com/ethereumproject/evm-dev) - SputnikVM instance for Smart Contract development,
* [EthereumVM FFI](https://github.com/ethereumproject/evm-ffi) - EthereumVM C and Go FFI bindings
* [EthereumVM Dev](https://github.com/ethereumproject/evm-dev) - EthereumVM instance for Smart Contract development,
provides testing environment and mock for JSON RPC API
* [SputnikVM in Browser](https://github.com/sorpaas/sputnikvm-in-browser) - experimental version of SputnikVM
* [EthereumVM in Browser](https://github.com/sorpaas/sputnikvm-in-browser) - experimental version of EthereumVM
compiled into WebAssembly, therefore can be launched in a browser on Node.js
* [SputnikVM for embedded devices](https://github.com/sorpaas/sputnikvm-on-rux) - experimental project to run on
* [EthereumVM for embedded devices](https://github.com/sorpaas/sputnikvm-on-rux) - experimental project to run on
full functional EVM on embedded devices

## Dependencies
Expand All @@ -70,28 +70,28 @@ before is not supported.

## Documentation

* [Latest release documentation](https://docs.rs/evm)
* [Latest release documentation](https://docs.rs/ethereumvm)

## Build from sources

SputnikVM is written Rust. If you are not familiar with Rust please
EthereumVM is written Rust. If you are not familiar with Rust please
see the
[getting started guide](https://doc.rust-lang.org/book/getting-started.html).

### Build

To start working with SputnikVM you'll
To start working with EthereumVM you'll
need to install [rustup](https://www.rustup.rs/), then you can do:

```bash
$ git clone [email protected]:ethereumproject/evm-rs.git
$ cd evm-rs
$ git clone [email protected]:ethereumproject/evm-rs.git ethereumvm
$ cd ethereumvm
$ cargo build --release --all
```

### Testing

We currently use two ways to test SputnikVM and ensure its execution
We currently use two ways to test EthereumVM and ensure its execution
aligns with other Ethereum Virtual Machine implementations:

* [jsontests](/jsontests): This uses part of the Ethereum
Expand Down
10 changes: 5 additions & 5 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "evm-cli"
name = "ethereumvm-cli"
version = "0.0.0"
license = "Apache-2.0"
authors = ["Wei Tang <[email protected]>"]
description = "SputnikVM CLI"
description = "EthereumVM CLI"
repository = "https://github.com/ethereumproject/evm-rs"
edition = "2018"

Expand All @@ -17,14 +17,14 @@ edition = "2018"
autobins = false

[[bin]]
name = "evm-cli"
name = "ethereumvm-cli"
path = "src/bin/main.rs"

[dependencies]
ethereum-bigint = "0.2"
ethereum-hexutil = "0.2"
evm = { path = ".." }
evm-network-classic = { path = "../network/classic" }
ethereumvm = { path = ".." }
ethereumvm-network-classic = { path = "../network/classic" }
gethrpc = { path = '../gethrpc' }
clap = "2.22"
serde_json = "1.0"
Expand Down
8 changes: 4 additions & 4 deletions cli/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use std::str::FromStr;
use bigint::{Address, Gas, H256, M256, U256};
use hexutil::read_hex;

use evm::{
use ethereumvm::{
AccountCommitment, Context, HeaderParams, RequireError, SeqContextVM, SeqTransactionVM, TransactionAction,
VMStatus, ValidTransaction, VM,
};
use evm_network_classic::{
use ethereumvm_network_classic::{
MainnetByzantiumPatch, MainnetConstantinoplePatch, MainnetEIP150Patch, MainnetEIP160Patch, MainnetFrontierPatch,
MainnetHomesteadPatch,
};
Expand Down Expand Up @@ -149,10 +149,10 @@ fn handle_fire_with_rpc<T: GethRPCClient>(client: &mut T, vm: &mut VM, block_num
use clap::clap_app;

fn main() {
let matches = clap_app!(evm =>
let matches = clap_app!(ethereumvm =>
(version: "0.1")
(author: "Ethereum Classic Contributors")
(about: "CLI tool for SputnikVM.")
(about: "CLI tool for EthereumVM.")
(@arg CREATE: --create "Execute a CreateContract transaction instead of message call.")
(@arg PROFILE: --profile "Whether to output a profiling result for the execution.")
(@arg PROFILE_DUMP: --profile_dump +takes_value "Dump profiler result as HTML.")
Expand Down
2 changes: 1 addition & 1 deletion jsontests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name = "performance"
harness = false

[dependencies]
evm = { path = '..' }
ethereumvm = { path = '..' }
jsontests-derive = { path = "./jsontests-derive" }
ethereum-bigint = "0.2"
ethereum-hexutil = "0.2"
Expand Down
4 changes: 2 additions & 2 deletions jsontests/benches/performance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#[macro_use]
extern crate jsontests_derive;
extern crate evm;
extern crate ethereumvm;
extern crate jsontests;
#[macro_use]
extern crate criterion;
Expand All @@ -18,7 +18,7 @@ use std::time::Duration;
struct _Performance;

pub fn criterion_cfg() -> Criterion {
// Due to poor SputnikVM performance, there's no chance to get a lot of measurements
// Due to poor EthereumVM performance, there's no chance to get a lot of measurements
// and higher threshold is needed
Criterion::default()
.sample_size(2)
Expand Down
2 changes: 1 addition & 1 deletion jsontests/jsontests-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ fn derive_patch(config: &Config) -> (Ident, Ident) {
if let Some(patch) = config.patch.as_ref() {
(patch.name.clone(), patch.path.clone())
} else {
(Ident::from("VMTestPatch"), Ident::from("evm::VMTestPatch"))
(Ident::from("VMTestPatch"), Ident::from("ethereumvm::VMTestPatch"))
}
}
2 changes: 1 addition & 1 deletion jsontests/src/blockchain.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use bigint::{Address, Gas, H256, M256, U256};
use evm::{AccountChange, AccountCommitment, Context, HeaderParams, Log};
use ethereumvm::{AccountChange, AccountCommitment, Context, HeaderParams, Log};
use hexutil::*;

use rlp;
Expand Down
6 changes: 3 additions & 3 deletions jsontests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extern crate bigint;
extern crate criterion;
extern crate env_logger;
extern crate evm;
extern crate ethereumvm;
extern crate hexutil;
extern crate rlp;
extern crate serde_json;
Expand All @@ -14,8 +14,8 @@ pub mod util;
pub use self::blockchain::{create_block, create_context, JSONBlock};

use bigint::{Address, Gas, H256, M256, U256};
use evm::errors::RequireError;
use evm::{Context, Patch, SeqContextVM, VMStatus, VM};
use ethereumvm::errors::RequireError;
use ethereumvm::{Context, Patch, SeqContextVM, VMStatus, VM};
use hexutil::*;
use serde_json::Value;
use std::ops::Deref;
Expand Down
2 changes: 1 addition & 1 deletion jsontests/src/util.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use evm::Patch;
use ethereumvm::Patch;
use serde_json as json;
use serde_json::Value;

Expand Down
2 changes: 1 addition & 1 deletion jsontests/tests/eiptests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
extern crate jsontests_derive;

use bigint::{Address, Gas};
use evm::{EmbeddedAccountPatch, Patch, Precompiled, EMBEDDED_PRECOMPILEDS};
use ethereumvm::{EmbeddedAccountPatch, Patch, Precompiled, EMBEDDED_PRECOMPILEDS};

// Shifting opcodes tests
#[derive(JsonTests)]
Expand Down
2 changes: 1 addition & 1 deletion jsontests/tests/inputlimits.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(non_snake_case)]

use evm::VMTestPatch;
use ethereumvm::VMTestPatch;
use jsontests::test_transaction;
use serde_json::Value;

Expand Down
16 changes: 8 additions & 8 deletions network/classic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
[package]
name = "evm-network-classic"
name = "ethereumvm-network-classic"
version = "0.11.0"
description = "Ethereum Classic patches for SputnikVM. Deprecated and will be dropped in future releases: use evm-network instead"
description = "Ethereum Classic patches for EthereumVM. Deprecated and will be dropped in future releases: use ethereumvm-network instead"
license = "Apache-2.0"
authors = ["Wei Tang <[email protected]>"]
repository = "https://github.com/ethereumproject/evm-rs"
edition = "2018"

[dependencies]
evm = { version = "0.11", path = "../..", default-features = false }
evm-precompiled-bn128 = { version = "0.11", path = "../../precompiled/bn128", default-features = false}
evm-precompiled-modexp = { version = "0.11", path = "../../precompiled/modexp", default-features = false }
ethereumvm = { version = "0.11", path = "../..", default-features = false }
ethereumvm-precompiled-bn128 = { version = "0.11", path = "../../precompiled/bn128", default-features = false}
ethereumvm-precompiled-modexp = { version = "0.11", path = "../../precompiled/modexp", default-features = false }
ethereum-bigint = { version = "0.2", default-features = false }

[features]
default = ["std", "rust-secp256k1"]
rlp = ["ethereum-bigint/rlp"]
c-secp256k1 = ["evm/c-secp256k1", "evm-precompiled-bn128/c-secp256k1", "evm-precompiled-modexp/c-secp256k1"]
rust-secp256k1 = ["evm/rust-secp256k1", "evm-precompiled-bn128/rust-secp256k1", "evm-precompiled-modexp/rust-secp256k1"]
std = ["evm/std"]
c-secp256k1 = ["ethereumvm/c-secp256k1", "ethereumvm-precompiled-bn128/c-secp256k1", "ethereumvm-precompiled-modexp/c-secp256k1"]
rust-secp256k1 = ["ethereumvm/rust-secp256k1", "ethereumvm-precompiled-bn128/rust-secp256k1", "ethereumvm-precompiled-modexp/rust-secp256k1"]
std = ["ethereumvm/std"]
Loading