Skip to content

Commit

Permalink
revm-precompiles to revm-precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita committed Jan 29, 2023
1 parent 07bcdb6 commit 8c22748
Show file tree
Hide file tree
Showing 18 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ structure:
* revm -> main EVM library.
* revm-primitives -> Primitive data types.
* revm-interpreter -> Execution loop with instructions
* revm-precompiles -> EVM precompiles
* revm-precompile -> EVM precompiles
* bins:
* revme: cli binary, used for running state test json
* revm-test: test binaries with contracts, used mostly to check performance
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "REVM Precompiles - Ethereum compatible precompiled contracts"
edition = "2021"
keywords = ["no_std", "ethereum", "evm", "revm", "precompiles"]
license = "MIT"
name = "revm-precompiles"
name = "revm-precompile"
repository = "https://github.com/bluealloy/revm"
version = "2.0.0"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions crates/revm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
date 29.01.2022

This is big release that has core changes that breaks compatibility. In summary:
* Project is refactored into `revm-primitives`,`revm-precompiles`,`revm-interpreter` and `revm` to have more flexibility and separation of concerns. And include paths in revm reflect that. So try to find include as `revm::primitives` or `revm::interpreter`
* Project is refactored into `revm-primitives`,`revm-precompile`,`revm-interpreter` and `revm` to have more flexibility and separation of concerns. And include paths in revm reflect that. So try to find include as `revm::primitives` or `revm::interpreter`
* Parity `primitive-types` was replaced with `ruint` for big numbers and subset of macros are used for native `B160`/`B256` types.
* Interpreter instructions are unified and now all of them have same signature.
* web3 db was replaces with ethers alternative.
* revmjs lib was removed from crates.
* `revm_precompile` was renamed to `revm-precompile.`
* `revm_precompiles` was renamed to `revm-precompile.`

* Return types are made to have more insight of what have happened inside revm.
* Snailtracer benchmark got around 20% faster.
Expand Down
4 changes: 2 additions & 2 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "3.0.0"
readme = "../../README.md"

[dependencies]
revm-precompiles = { path = "../precompiles", version = "2.0.0", default-features = false }
revm-precompile = { path = "../precompile", version = "2.0.0", default-features = false }
revm-interpreter = { path = "../interpreter", version = "1.0.0", default-features = false }

auto_impl = { version = "1.0", default-features = false }
Expand Down Expand Up @@ -40,7 +40,7 @@ dev = [
"optional_eip3607",
"optional_gas_refund",
]
secp256k1 = ["revm-precompiles/secp256k1"]
secp256k1 = ["revm-precompile/secp256k1"]
memory_limit = ["revm-interpreter/memory_limit"]
no_gas_measuring = ["revm-interpreter/no_gas_measuring"]
optional_balance_check = ["revm-interpreter/optional_balance_check"]
Expand Down
12 changes: 6 additions & 6 deletions crates/revm/src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
};
use alloc::boxed::Box;
use revm_interpreter::primitives::ResultAndState;
use revm_precompiles::Precompiles;
use revm_precompile::Precompiles;

/// Struct that takes Database and enabled transact to update state directly to database.
/// additionally it allows user to set all environment parameters.
Expand Down Expand Up @@ -150,25 +150,25 @@ macro_rules! create_evm {
};
}

pub fn to_precompile_id(spec_id: SpecId) -> revm_precompiles::SpecId {
pub fn to_precompile_id(spec_id: SpecId) -> revm_precompile::SpecId {
match spec_id {
SpecId::FRONTIER
| SpecId::FRONTIER_THAWING
| SpecId::HOMESTEAD
| SpecId::DAO_FORK
| SpecId::TANGERINE
| SpecId::SPURIOUS_DRAGON => revm_precompiles::SpecId::HOMESTEAD,
| SpecId::SPURIOUS_DRAGON => revm_precompile::SpecId::HOMESTEAD,
SpecId::BYZANTIUM | SpecId::CONSTANTINOPLE | SpecId::PETERSBURG => {
revm_precompiles::SpecId::BYZANTIUM
revm_precompile::SpecId::BYZANTIUM
}
SpecId::ISTANBUL | SpecId::MUIR_GLACIER => revm_precompiles::SpecId::ISTANBUL,
SpecId::ISTANBUL | SpecId::MUIR_GLACIER => revm_precompile::SpecId::ISTANBUL,
SpecId::BERLIN
| SpecId::LONDON
| SpecId::ARROW_GLACIER
| SpecId::GRAY_GLACIER
| SpecId::MERGE
| SpecId::MERGE_EOF
| SpecId::LATEST => revm_precompiles::SpecId::BERLIN,
| SpecId::LATEST => revm_precompile::SpecId::BERLIN,
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/revm/src/evm_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ use crate::primitives::{
SpecId::{self, *},
TransactTo, B160, B256, KECCAK_EMPTY, U256,
};
use crate::{db::Database, journaled_state::JournaledState, precompiles, Inspector};
use crate::{db::Database, journaled_state::JournaledState, precompile, Inspector};
use alloc::vec::Vec;
use core::{cmp::min, marker::PhantomData};
use revm_precompiles::{Precompile, Precompiles};
use revm_precompile::{Precompile, Precompiles};

pub struct EVMData<'a, DB: Database> {
pub env: &'a mut Env,
Expand Down Expand Up @@ -701,7 +701,7 @@ impl<'a, GSPEC: Spec, DB: Database, const INSPECT: bool> EVMImpl<'a, GSPEC, DB,
}
}
Err(e) => {
let ret = if let precompiles::Error::OutOfGas = e {
let ret = if let precompile::Error::OutOfGas = e {
InstructionResult::OutOfGas
} else {
InstructionResult::PrecompileError
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub use journaled_state::{JournalEntry, JournaledState};
extern crate alloc;

/// reexport `revm_precompiles`
pub use revm_precompiles as precompiles;
pub use revm_precompile as precompile;

// reexport `revm_interpreter`
pub use revm_interpreter as interpreter;
Expand Down

0 comments on commit 8c22748

Please sign in to comment.