From b8b0578bf0832862e73f3b568148cc04b7348408 Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Wed, 8 Jun 2022 10:40:42 +0200 Subject: [PATCH 1/7] Added feature std-wasm32 --- engine/Cargo.toml | 1 + engine/src/lib.rs | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/engine/Cargo.toml b/engine/Cargo.toml index b9c77c623..c6dfaf43c 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -47,6 +47,7 @@ rand = "0.7.3" [features] default = ["std"] std = ["borsh/std", "evm/std", "primitive-types/std", "rlp/std", "sha3/std", "ethabi/std", "logos/std", "bn/std", "aurora-engine-types/std", "rjson/std", "aurora-engine-precompiles/std", "aurora-engine-transactions/std"] +std-wasm32 = [] contract = ["aurora-engine-sdk/contract", "aurora-engine-precompiles/contract"] evm_bully = [] log = ["aurora-engine-sdk/log", "aurora-engine-precompiles/log"] diff --git a/engine/src/lib.rs b/engine/src/lib.rs index 652c118a7..edea89bbb 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -1,7 +1,10 @@ -#![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))] +#![cfg_attr(not(any(feature = "std", feature = "std-wasm32")), no_std)] +#![cfg_attr(not(any(feature = "std", feature = "std-wasm32")), feature(alloc_error_handler))] #![cfg_attr( - all(feature = "log", target_arch = "wasm32"), + all( + all(feature = "log", target_arch = "wasm32"), + not(feature = "std-wasm32") + ), feature(panic_info_message) )] @@ -35,6 +38,7 @@ mod prelude; static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; #[cfg(target_arch = "wasm32")] +#[cfg(not(feature = "std-wasm32"))] #[panic_handler] #[cfg_attr(not(feature = "log"), allow(unused_variables))] #[no_mangle] @@ -59,6 +63,7 @@ pub unsafe fn on_panic(info: &::core::panic::PanicInfo) -> ! { } #[cfg(target_arch = "wasm32")] +#[cfg(not(feature = "std-wasm32"))] #[alloc_error_handler] #[no_mangle] pub unsafe fn on_alloc_error(_: core::alloc::Layout) -> ! { From f7ffc36846696cbabd4c4595ed36b984b833b2a2 Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Thu, 9 Jun 2022 01:22:28 +0200 Subject: [PATCH 2/7] Added std by default --- Makefile | 2 -- engine-precompiles/Cargo.toml | 6 ++-- engine-precompiles/src/lib.rs | 2 -- engine-sdk/Cargo.toml | 5 ++- engine-sdk/src/lib.rs | 3 -- engine-standalone-storage/Cargo.toml | 10 +++--- engine-standalone-tracing/Cargo.toml | 6 ++-- engine-tests/Cargo.toml | 14 ++++---- engine-transactions/Cargo.toml | 9 +++-- engine-transactions/src/lib.rs | 3 -- engine-types/Cargo.toml | 6 ++-- engine-types/src/lib.rs | 11 ++---- engine/Cargo.toml | 18 +++++----- engine/src/lib.rs | 48 --------------------------- etc/self-contained-5bEgfRQ/Cargo.toml | 4 +-- etc/state-migration-test/Cargo.toml | 4 +-- 16 files changed, 40 insertions(+), 111 deletions(-) diff --git a/Makefile b/Makefile index 2118fe374..a5767a592 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,6 @@ target/wasm32-unknown-unknown/release/aurora_engine.wasm: Cargo.toml Cargo.lock --release \ --verbose \ -p aurora-engine \ - --no-default-features \ --features=$(FEATURES)$(ADDITIONAL_FEATURES) \ -Z avoid-dev-deps @@ -71,7 +70,6 @@ target/wasm32-unknown-unknown/debug/aurora_engine.wasm: Cargo.toml Cargo.lock $( $(CARGO) build \ --target wasm32-unknown-unknown \ -p aurora-engine \ - --no-default-features \ --features=$(FEATURES)$(ADDITIONAL_FEATURES) \ -Z avoid-dev-deps diff --git a/engine-precompiles/Cargo.toml b/engine-precompiles/Cargo.toml index fa9f3e8be..794af5d55 100644 --- a/engine-precompiles/Cargo.toml +++ b/engine-precompiles/Cargo.toml @@ -13,8 +13,8 @@ publish = false autobenches = false [dependencies] -aurora-engine-types = { path = "../engine-types", default-features = false } -aurora-engine-sdk = { path = "../engine-sdk", default-features = false } +aurora-engine-types = { path = "../engine-types" } +aurora-engine-sdk = { path = "../engine-sdk" } base64 = { version = "0.13.0", default-features = false, features = ["alloc"] } borsh = { version = "0.8.2", default-features = false } bn = { package = "aurora-bn", git = "https://github.com/aurora-is-near/aurora-bn.git", default-features = false } @@ -27,7 +27,7 @@ ripemd160 = { version = "0.9.1", default-features = false } sha2 = { version = "0.9.3", default-features = false } sha3 = { version = "0.9.1", default-features = false } ethabi = { git = "https://github.com/darwinia-network/ethabi", branch = "xavier-no-std", default-features = false } -hex = { version = "0.4", default-features = false, features = ["alloc"] } +hex = "0.4" [dev-dependencies] serde = { version = "1", features = ["derive"] } diff --git a/engine-precompiles/src/lib.rs b/engine-precompiles/src/lib.rs index c24286a17..dfb3e76a3 100644 --- a/engine-precompiles/src/lib.rs +++ b/engine-precompiles/src/lib.rs @@ -1,6 +1,4 @@ #![allow(dead_code)] -#![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))] pub mod account_ids; pub mod blake2; diff --git a/engine-sdk/Cargo.toml b/engine-sdk/Cargo.toml index feb770474..6dc8771f9 100644 --- a/engine-sdk/Cargo.toml +++ b/engine-sdk/Cargo.toml @@ -13,13 +13,12 @@ publish = false autobenches = false [dependencies] -aurora-engine-types = { path = "../engine-types", default-features = false } -borsh = { version = "0.8.2", default-features = false } +aurora-engine-types = { path = "../engine-types" } +borsh = "0.8.2" sha3 = { version = "0.9.1", default-features = false } sha2 = { version = "0.9.3", default-features = false } [features] -std = ["aurora-engine-types/std"] contract = [] log = [] mainnet = [] diff --git a/engine-sdk/src/lib.rs b/engine-sdk/src/lib.rs index 97beb87e5..e8df40891 100644 --- a/engine-sdk/src/lib.rs +++ b/engine-sdk/src/lib.rs @@ -1,6 +1,3 @@ -#![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))] - #[cfg(feature = "contract")] use crate::prelude::Address; use crate::prelude::{H256, STORAGE_PRICE_PER_BYTE}; diff --git a/engine-standalone-storage/Cargo.toml b/engine-standalone-storage/Cargo.toml index 0a78c5aab..c4236ff4f 100644 --- a/engine-standalone-storage/Cargo.toml +++ b/engine-standalone-storage/Cargo.toml @@ -14,11 +14,11 @@ autobenches = false crate-type = ["lib"] [dependencies] -aurora-engine = { path = "../engine", default-features = false, features = ["std"] } -aurora-engine-types = { path = "../engine-types", default-features = false, features = ["std"] } -aurora-engine-sdk = { path = "../engine-sdk", default-features = false, features = ["std"] } -aurora-engine-transactions = { path = "../engine-transactions", default-features = false, features = ["std"] } -borsh = { version = "0.8.2" } +aurora-engine = { path = "../engine" } +aurora-engine-types = { path = "../engine-types" } +aurora-engine-sdk = { path = "../engine-sdk" } +aurora-engine-transactions = { path = "../engine-transactions" } +borsh = "0.8.2" evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } rocksdb = { version = "0.18.0", default-features = false } postgres = "0.19.2" diff --git a/engine-standalone-tracing/Cargo.toml b/engine-standalone-tracing/Cargo.toml index c75c273c3..ac8d92bae 100644 --- a/engine-standalone-tracing/Cargo.toml +++ b/engine-standalone-tracing/Cargo.toml @@ -14,9 +14,9 @@ autobenches = false crate-type = ["lib"] [dependencies] -aurora-engine = { path = "../engine", default-features = false, features = ["std"] } -aurora-engine-types = { path = "../engine-types", default-features = false, features = ["std"] } -aurora-engine-sdk = { path = "../engine-sdk", default-features = false, features = ["std"] } +aurora-engine = { path = "../engine" } +aurora-engine-types = { path = "../engine-types" } +aurora-engine-sdk = { path = "../engine-sdk" } evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false, features = ["std"] } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false, features = ["std", "tracing"] } evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false, features = ["std", "tracing"] } diff --git a/engine-tests/Cargo.toml b/engine-tests/Cargo.toml index fd91499eb..1968e5a73 100644 --- a/engine-tests/Cargo.toml +++ b/engine-tests/Cargo.toml @@ -13,14 +13,14 @@ publish = false autobenches = false [dependencies] -aurora-engine = { path = "../engine", default-features = false, features = ["std", "tracing"] } -aurora-engine-types = { path = "../engine-types", default-features = false, features = ["std"] } -aurora-engine-sdk = { path = "../engine-sdk", default-features = false, features = ["std"] } -aurora-engine-precompiles = { path = "../engine-precompiles", default-features = false, features = ["std"] } -aurora-engine-transactions = { path = "../engine-transactions", default-features = false, features = ["std"] } +aurora-engine = { path = "../engine", features = ["tracing"] } +aurora-engine-types = { path = "../engine-types" } +aurora-engine-sdk = { path = "../engine-sdk" } +aurora-engine-precompiles = { path = "../engine-precompiles" } +aurora-engine-transactions = { path = "../engine-transactions" } engine-standalone-storage = { path = "../engine-standalone-storage" } engine-standalone-tracing = { path = "../engine-standalone-tracing" } -borsh = { version = "0.8.2", default-features = false } +borsh = "0.8.2" sha3 = { version = "0.9.1", default-features = false } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false, features = ["std", "tracing"] } evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false, features = ["std", "tracing"] } @@ -34,7 +34,7 @@ byte-slice-cast = { version = "1.0", default-features = false } ethabi = { git = "https://github.com/darwinia-network/ethabi", branch = "xavier-no-std" } serde = { version = "1", features = ["derive"] } serde_json = "1" -hex = { version = "0.4.3", default-features = false } +hex = "0.4" near-sdk = { git = "https://github.com/aurora-is-near/near-sdk-rs.git", rev = "ba2eddbfbf4484ac3e44b4c8119bbac4907d6e07" } near-sdk-sim = { git = "https://github.com/aurora-is-near/near-sdk-rs.git", rev = "ba2eddbfbf4484ac3e44b4c8119bbac4907d6e07" } near-crypto = { git = "https://github.com/birchmd/nearcore.git", rev = "980bc48dc02878fea1e0dbc5812ae7de49f12dda" } diff --git a/engine-transactions/Cargo.toml b/engine-transactions/Cargo.toml index a52ce7129..e34d877fc 100644 --- a/engine-transactions/Cargo.toml +++ b/engine-transactions/Cargo.toml @@ -13,14 +13,13 @@ publish = false autobenches = false [dependencies] -aurora-engine-types = { path = "../engine-types", default-features = false } -aurora-engine-sdk = { path = "../engine-sdk", default-features = false } -aurora-engine-precompiles = { path = "../engine-precompiles", default-features = false } +aurora-engine-types = { path = "../engine-types" } +aurora-engine-sdk = { path = "../engine-sdk" } +aurora-engine-precompiles = { path = "../engine-precompiles" } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } rlp = { version = "0.5.0", default-features = false } -hex = { version = "0.4", default-features = false, features = ["alloc"] } +hex = "0.4" serde = { version = "1", features = ["derive"], optional = true } [features] -std = ["aurora-engine-types/std", "aurora-engine-precompiles/std", "evm/std", "rlp/std", "hex/std"] impl-serde = ["aurora-engine-types/impl-serde", "serde"] diff --git a/engine-transactions/src/lib.rs b/engine-transactions/src/lib.rs index 8688adaad..ac4cee1cd 100644 --- a/engine-transactions/src/lib.rs +++ b/engine-transactions/src/lib.rs @@ -1,6 +1,3 @@ -#![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))] - use aurora_engine_types::types::{Address, Wei}; use aurora_engine_types::{vec, Vec, H160, U256}; use eip_2930::AccessTuple; diff --git a/engine-types/Cargo.toml b/engine-types/Cargo.toml index d1f971cfb..fb2fa0334 100644 --- a/engine-types/Cargo.toml +++ b/engine-types/Cargo.toml @@ -13,9 +13,9 @@ publish = false autobenches = false [dependencies] -borsh = { version = "0.8.2", default-features = false } +borsh = "0.8.2" ethabi = { git = "https://github.com/darwinia-network/ethabi", branch = "xavier-no-std", default-features = false } -hex = { version = "0.4", default-features = false, features = ["alloc"] } +hex = "0.4" primitive-types = { version = "0.10.0", default-features = false, features = ["rlp"] } sha3 = { version = "0.9.1", default-features = false } serde = { version = "1", features = ["derive"], optional = true } @@ -27,6 +27,4 @@ serde_json = "1" rand = "0.7.3" [features] -default = ["std"] -std = ["primitive-types/std"] impl-serde = ["primitive-types/impl-serde", "serde"] diff --git a/engine-types/src/lib.rs b/engine-types/src/lib.rs index 7250dab40..4df4fd3a5 100644 --- a/engine-types/src/lib.rs +++ b/engine-types/src/lib.rs @@ -1,17 +1,10 @@ -#![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))] -#![cfg_attr(feature = "log", feature(panic_info_message))] - pub mod account_id; pub mod parameters; pub mod storage; pub mod types; mod v0 { - extern crate alloc; - extern crate core; - - pub use alloc::{ + pub use std::{ borrow::ToOwned, borrow::{Cow, Cow::*}, boxed::Box, @@ -23,7 +16,7 @@ mod v0 { vec, vec::Vec, }; - pub use core::{ + pub use std::{ cmp::Ordering, fmt::Display, marker::PhantomData, mem, ops::Add, ops::Div, ops::Mul, ops::Sub, ops::SubAssign, }; diff --git a/engine/Cargo.toml b/engine/Cargo.toml index c6dfaf43c..11933b3da 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -16,12 +16,12 @@ autobenches = false crate-type = ["cdylib", "rlib"] [dependencies] -aurora-engine-types = { path = "../engine-types", default-features = false } -aurora-engine-sdk = { path = "../engine-sdk", default-features = false } -aurora-engine-precompiles = { path = "../engine-precompiles", default-features = false } -aurora-engine-transactions = { path = "../engine-transactions", default-features = false } +aurora-engine-types = { path = "../engine-types" } +aurora-engine-sdk = { path = "../engine-sdk" } +aurora-engine-precompiles = { path = "../engine-precompiles" } +aurora-engine-transactions = { path = "../engine-transactions" } base64 = { version = "0.13.0", default-features = false, features = ["alloc"] } -borsh = { version = "0.8.2", default-features = false } +borsh = "0.8.2" bn = { package = "aurora-bn", git = "https://github.com/aurora-is-near/aurora-bn.git", default-features = false } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } @@ -34,9 +34,9 @@ sha3 = { version = "0.9.1", default-features = false } wee_alloc = { version = "0.4.5", default-features = false } logos = { version = "0.12", default-features = false, features = ["export_derive"] } ethabi = { git = "https://github.com/darwinia-network/ethabi", branch = "xavier-no-std", default-features = false } -hex = { version = "0.4", default-features = false, features = ["alloc"] } +hex = "0.4" byte-slice-cast = { version = "1.0", default-features = false } -rjson = { git = "https://github.com/aurora-is-near/rjson", rev = "cc3da949", default-features = false, features = ["integer"] } +rjson = { git = "https://github.com/aurora-is-near/rjson", rev = "cc3da949", features = ["integer"] } serde = { version = "1", features = ["derive"], optional = true } [dev-dependencies] @@ -45,9 +45,7 @@ serde_json = "1" rand = "0.7.3" [features] -default = ["std"] -std = ["borsh/std", "evm/std", "primitive-types/std", "rlp/std", "sha3/std", "ethabi/std", "logos/std", "bn/std", "aurora-engine-types/std", "rjson/std", "aurora-engine-precompiles/std", "aurora-engine-transactions/std"] -std-wasm32 = [] +std = [] contract = ["aurora-engine-sdk/contract", "aurora-engine-precompiles/contract"] evm_bully = [] log = ["aurora-engine-sdk/log", "aurora-engine-precompiles/log"] diff --git a/engine/src/lib.rs b/engine/src/lib.rs index edea89bbb..127ffe637 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -1,20 +1,5 @@ -#![cfg_attr(not(any(feature = "std", feature = "std-wasm32")), no_std)] -#![cfg_attr(not(any(feature = "std", feature = "std-wasm32")), feature(alloc_error_handler))] -#![cfg_attr( - all( - all(feature = "log", target_arch = "wasm32"), - not(feature = "std-wasm32") - ), - feature(panic_info_message) -)] - use aurora_engine_types::parameters::PromiseCreateArgs; -#[cfg(not(feature = "std"))] -extern crate alloc; -#[cfg(not(feature = "std"))] -extern crate core; - mod map; #[cfg(feature = "meta-call")] pub mod meta_parsing; @@ -37,39 +22,6 @@ mod prelude; #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; -#[cfg(target_arch = "wasm32")] -#[cfg(not(feature = "std-wasm32"))] -#[panic_handler] -#[cfg_attr(not(feature = "log"), allow(unused_variables))] -#[no_mangle] -pub unsafe fn on_panic(info: &::core::panic::PanicInfo) -> ! { - #[cfg(feature = "log")] - { - use prelude::ToString; - - if let Some(msg) = info.message() { - let msg = if let Some(log) = info.location() { - prelude::format!("{} [{}]", msg, log) - } else { - msg.to_string() - }; - prelude::sdk::panic_utf8(msg.as_bytes()); - } else if let Some(log) = info.location() { - prelude::sdk::panic_utf8(log.to_string().as_bytes()); - } - } - - ::core::arch::wasm32::unreachable(); -} - -#[cfg(target_arch = "wasm32")] -#[cfg(not(feature = "std-wasm32"))] -#[alloc_error_handler] -#[no_mangle] -pub unsafe fn on_alloc_error(_: core::alloc::Layout) -> ! { - ::core::arch::wasm32::unreachable(); -} - #[cfg(feature = "contract")] mod contract { use borsh::{BorshDeserialize, BorshSerialize}; diff --git a/etc/self-contained-5bEgfRQ/Cargo.toml b/etc/self-contained-5bEgfRQ/Cargo.toml index 968113612..df3abf459 100644 --- a/etc/self-contained-5bEgfRQ/Cargo.toml +++ b/etc/self-contained-5bEgfRQ/Cargo.toml @@ -37,7 +37,7 @@ codegen-units = 1 rpath = false [dependencies] -borsh = { version = "0.8.2", default-features = false } +borsh = "0.8.2" aurora-engine = { path = "../../engine", default-features = false } aurora-engine-sdk = { path = "../../engine-sdk", default-features = false, features = ["contract"] } -aurora-engine-types = { path = "../../engine-types", default-features = false } +aurora-engine-types = { path = "../../engine-types" } diff --git a/etc/state-migration-test/Cargo.toml b/etc/state-migration-test/Cargo.toml index 0c3f92502..1537e1f16 100644 --- a/etc/state-migration-test/Cargo.toml +++ b/etc/state-migration-test/Cargo.toml @@ -37,7 +37,7 @@ codegen-units = 1 rpath = false [dependencies] -borsh = { version = "0.8.2", default-features = false } +borsh = "0.8.2" aurora-engine = { path = "../../engine", default-features = false } aurora-engine-sdk = { path = "../../engine-sdk", default-features = false, features = ["contract"] } -aurora-engine-types = { path = "../../engine-types", default-features = false } +aurora-engine-types = { path = "../../engine-types" } From dec3a9ab57f9c101e694fbceeb9d638c0a88bad8 Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Thu, 9 Jun 2022 19:19:54 +0200 Subject: [PATCH 3/7] Remove no-defaults: engine, precompiles --- engine-precompiles/Cargo.toml | 15 +++++++-------- engine/Cargo.toml | 18 +++++++++--------- etc/state-migration-test/Cargo.lock | 21 +++++++++++++++++++++ 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/engine-precompiles/Cargo.toml b/engine-precompiles/Cargo.toml index 794af5d55..7ee882284 100644 --- a/engine-precompiles/Cargo.toml +++ b/engine-precompiles/Cargo.toml @@ -15,17 +15,17 @@ autobenches = false [dependencies] aurora-engine-types = { path = "../engine-types" } aurora-engine-sdk = { path = "../engine-sdk" } -base64 = { version = "0.13.0", default-features = false, features = ["alloc"] } -borsh = { version = "0.8.2", default-features = false } +base64 = "0.13.0" +borsh = "0.8.2" bn = { package = "aurora-bn", git = "https://github.com/aurora-is-near/aurora-bn.git", default-features = false } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } -libsecp256k1 = { version = "0.7.0", default-features = false, features = ["static-context", "hmac"] } -num = { version = "0.4.0", default-features = false, features = ["alloc"] } +libsecp256k1 = { version = "0.7.0", features = ["static-context", "hmac"] } +num = "0.4.0" primitive-types = { version = "0.10.0", default-features = false, features = ["rlp"] } -ripemd160 = { version = "0.9.1", default-features = false } -sha2 = { version = "0.9.3", default-features = false } -sha3 = { version = "0.9.1", default-features = false } +ripemd160 = "0.9.1" +sha2 = "0.9.3" +sha3 = "0.9.1" ethabi = { git = "https://github.com/darwinia-network/ethabi", branch = "xavier-no-std", default-features = false } hex = "0.4" @@ -35,7 +35,6 @@ serde_json = "1" rand = "0.7.3" [features] -std = ["aurora-engine-types/std", "aurora-engine-sdk/std", "borsh/std", "bn/std", "evm/std", "evm-core/std", "libsecp256k1/std", "ripemd160/std", "sha2/std", "sha3/std", "ethabi/std"] contract = [] log = [] error_refund = [] diff --git a/engine/Cargo.toml b/engine/Cargo.toml index 11933b3da..59a8752ae 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -20,22 +20,22 @@ aurora-engine-types = { path = "../engine-types" } aurora-engine-sdk = { path = "../engine-sdk" } aurora-engine-precompiles = { path = "../engine-precompiles" } aurora-engine-transactions = { path = "../engine-transactions" } -base64 = { version = "0.13.0", default-features = false, features = ["alloc"] } +base64 = "0.13.0" borsh = "0.8.2" bn = { package = "aurora-bn", git = "https://github.com/aurora-is-near/aurora-bn.git", default-features = false } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } -libsecp256k1 = { version = "0.7.0", default-features = false } -num = { version = "0.4.0", default-features = false, features = ["alloc"] } +libsecp256k1 = { version = "0.7.0" } +num = "0.4.0" primitive-types = { version = "0.10.0", default-features = false, features = ["rlp"] } -ripemd160 = { version = "0.9.1", default-features = false } -rlp = { version = "0.5.0", default-features = false } -sha3 = { version = "0.9.1", default-features = false } -wee_alloc = { version = "0.4.5", default-features = false } -logos = { version = "0.12", default-features = false, features = ["export_derive"] } +ripemd160 = "0.9.1" +rlp = "0.5.0" +sha3 = "0.9.1" +wee_alloc = "0.4.5" +logos = { version = "0.12", features = ["export_derive"] } ethabi = { git = "https://github.com/darwinia-network/ethabi", branch = "xavier-no-std", default-features = false } hex = "0.4" -byte-slice-cast = { version = "1.0", default-features = false } +byte-slice-cast = "1.0" rjson = { git = "https://github.com/aurora-is-near/rjson", rev = "cc3da949", features = ["integer"] } serde = { version = "1", features = ["derive"], optional = true } diff --git a/etc/state-migration-test/Cargo.lock b/etc/state-migration-test/Cargo.lock index d7eb518cb..38fb0888e 100644 --- a/etc/state-migration-test/Cargo.lock +++ b/etc/state-migration-test/Cargo.lock @@ -797,6 +797,12 @@ dependencies = [ "syn", ] +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + [[package]] name = "primitive-types" version = "0.10.1" @@ -877,6 +883,18 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", "rand_core", ] @@ -885,6 +903,9 @@ name = "rand_core" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] [[package]] name = "regex-syntax" From 251ee35a1e5a97b3bd810221aeedf5b559cfd3d6 Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Thu, 9 Jun 2022 19:36:45 +0200 Subject: [PATCH 4/7] Remove no-defaults --- engine-sdk/Cargo.toml | 4 ++-- engine-standalone-tracing/Cargo.toml | 1 - engine-tests/Cargo.toml | 4 ++-- engine-transactions/Cargo.toml | 2 +- engine-types/Cargo.toml | 2 +- engine-types/src/lib.rs | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/engine-sdk/Cargo.toml b/engine-sdk/Cargo.toml index 6dc8771f9..d8b2dd91c 100644 --- a/engine-sdk/Cargo.toml +++ b/engine-sdk/Cargo.toml @@ -15,8 +15,8 @@ autobenches = false [dependencies] aurora-engine-types = { path = "../engine-types" } borsh = "0.8.2" -sha3 = { version = "0.9.1", default-features = false } -sha2 = { version = "0.9.3", default-features = false } +sha3 = "0.9.1" +sha2 = "0.9.3" [features] contract = [] diff --git a/engine-standalone-tracing/Cargo.toml b/engine-standalone-tracing/Cargo.toml index ac8d92bae..cdf78f122 100644 --- a/engine-standalone-tracing/Cargo.toml +++ b/engine-standalone-tracing/Cargo.toml @@ -24,7 +24,6 @@ evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = serde = { version = "1", features = ["derive"], optional = true } [features] -default = [] mainnet = [] testnet = [] impl-serde = ["aurora-engine-types/impl-serde", "serde"] diff --git a/engine-tests/Cargo.toml b/engine-tests/Cargo.toml index 1968e5a73..70400b238 100644 --- a/engine-tests/Cargo.toml +++ b/engine-tests/Cargo.toml @@ -21,11 +21,11 @@ aurora-engine-transactions = { path = "../engine-transactions" } engine-standalone-storage = { path = "../engine-standalone-storage" } engine-standalone-tracing = { path = "../engine-standalone-tracing" } borsh = "0.8.2" -sha3 = { version = "0.9.1", default-features = false } +sha3 = "0.9.1" evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false, features = ["std", "tracing"] } evm-runtime = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false, features = ["std", "tracing"] } evm-gasometer = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false, features = ["std", "tracing"] } -rlp = { version = "0.5.0", default-features = false } +rlp = "0.5.0" [dev-dependencies] base64 = "0.13.0" diff --git a/engine-transactions/Cargo.toml b/engine-transactions/Cargo.toml index e34d877fc..5b4f1d69e 100644 --- a/engine-transactions/Cargo.toml +++ b/engine-transactions/Cargo.toml @@ -17,7 +17,7 @@ aurora-engine-types = { path = "../engine-types" } aurora-engine-sdk = { path = "../engine-sdk" } aurora-engine-precompiles = { path = "../engine-precompiles" } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } -rlp = { version = "0.5.0", default-features = false } +rlp = "0.5.0" hex = "0.4" serde = { version = "1", features = ["derive"], optional = true } diff --git a/engine-types/Cargo.toml b/engine-types/Cargo.toml index fb2fa0334..b8e4201b8 100644 --- a/engine-types/Cargo.toml +++ b/engine-types/Cargo.toml @@ -17,7 +17,7 @@ borsh = "0.8.2" ethabi = { git = "https://github.com/darwinia-network/ethabi", branch = "xavier-no-std", default-features = false } hex = "0.4" primitive-types = { version = "0.10.0", default-features = false, features = ["rlp"] } -sha3 = { version = "0.9.1", default-features = false } +sha3 = "0.9.1" serde = { version = "1", features = ["derive"], optional = true } [dev-dependencies] diff --git a/engine-types/src/lib.rs b/engine-types/src/lib.rs index 4df4fd3a5..15f81550a 100644 --- a/engine-types/src/lib.rs +++ b/engine-types/src/lib.rs @@ -4,6 +4,7 @@ pub mod storage; pub mod types; mod v0 { + pub use primitive_types::{H160, H256, U256}; pub use std::{ borrow::ToOwned, borrow::{Cow, Cow::*}, @@ -20,7 +21,6 @@ mod v0 { cmp::Ordering, fmt::Display, marker::PhantomData, mem, ops::Add, ops::Div, ops::Mul, ops::Sub, ops::SubAssign, }; - pub use primitive_types::{H160, H256, U256}; } pub use v0::*; From 4a9852cfb2f5d18da97c4bcb026324d4a7070f74 Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Thu, 9 Jun 2022 19:58:06 +0200 Subject: [PATCH 5/7] Changed test_1inch_liquidity_protocol --- engine-tests/src/tests/one_inch.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine-tests/src/tests/one_inch.rs b/engine-tests/src/tests/one_inch.rs index 4e603eadb..a08e74297 100644 --- a/engine-tests/src/tests/one_inch.rs +++ b/engine-tests/src/tests/one_inch.rs @@ -23,7 +23,7 @@ fn test_1inch_liquidity_protocol() { let (result, profile, deployer_address) = helper.create_mooniswap_deployer(); assert!(result.gas_used >= 5_100_000); // more than 5.1M EVM gas used - assert_gas_bound(profile.all_gas(), 10); // less than 10 NEAR Tgas used + assert_gas_bound(profile.all_gas(), 11); // less than 11git NEAR Tgas used let (result, profile, pool_factory) = helper.create_pool_factory(&deployer_address); assert!(result.gas_used >= 2_800_000); // more than 2.8M EVM gas used From f1c4810e14cfb9de3bb6789a5971e1fcc70af824 Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Sat, 11 Jun 2022 20:11:16 +0200 Subject: [PATCH 6/7] Changed libsecp256k1 --- engine-precompiles/Cargo.toml | 2 +- engine/Cargo.toml | 2 +- etc/state-migration-test/Cargo.lock | 21 --------------------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/engine-precompiles/Cargo.toml b/engine-precompiles/Cargo.toml index 7ee882284..0f5ef6919 100644 --- a/engine-precompiles/Cargo.toml +++ b/engine-precompiles/Cargo.toml @@ -20,7 +20,7 @@ borsh = "0.8.2" bn = { package = "aurora-bn", git = "https://github.com/aurora-is-near/aurora-bn.git", default-features = false } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } -libsecp256k1 = { version = "0.7.0", features = ["static-context", "hmac"] } +libsecp256k1 = { version = "0.7.0", default-features = false, features = ["static-context", "hmac"] } num = "0.4.0" primitive-types = { version = "0.10.0", default-features = false, features = ["rlp"] } ripemd160 = "0.9.1" diff --git a/engine/Cargo.toml b/engine/Cargo.toml index 59a8752ae..892d22eb6 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -25,7 +25,7 @@ borsh = "0.8.2" bn = { package = "aurora-bn", git = "https://github.com/aurora-is-near/aurora-bn.git", default-features = false } evm = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } evm-core = { git = "https://github.com/aurora-is-near/sputnikvm.git", rev = "37448b6cacd98b06282cff5a559684505c29bd2b", default-features = false } -libsecp256k1 = { version = "0.7.0" } +libsecp256k1 = { version = "0.7.0", default-features = false } num = "0.4.0" primitive-types = { version = "0.10.0", default-features = false, features = ["rlp"] } ripemd160 = "0.9.1" diff --git a/etc/state-migration-test/Cargo.lock b/etc/state-migration-test/Cargo.lock index 38fb0888e..d7eb518cb 100644 --- a/etc/state-migration-test/Cargo.lock +++ b/etc/state-migration-test/Cargo.lock @@ -797,12 +797,6 @@ dependencies = [ "syn", ] -[[package]] -name = "ppv-lite86" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" - [[package]] name = "primitive-types" version = "0.10.1" @@ -883,18 +877,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", "rand_core", ] @@ -903,9 +885,6 @@ name = "rand_core" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] [[package]] name = "regex-syntax" From bcf3d615f17e1949801c5b6085df460c9a7bb19d Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Wed, 6 Jul 2022 21:07:58 +0200 Subject: [PATCH 7/7] oneinch test fix --- Cargo.lock | 2 -- engine-tests/src/tests/one_inch.rs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca50dfebe..4a8e7fe8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,8 +111,6 @@ source = "git+https://github.com/aurora-is-near/aurora-bn.git#8f1743884061981cac dependencies = [ "byteorder", "getrandom 0.2.7", - "rand 0.8.5", - "serde", ] [[package]] diff --git a/engine-tests/src/tests/one_inch.rs b/engine-tests/src/tests/one_inch.rs index a08e74297..8df92dca3 100644 --- a/engine-tests/src/tests/one_inch.rs +++ b/engine-tests/src/tests/one_inch.rs @@ -23,7 +23,7 @@ fn test_1inch_liquidity_protocol() { let (result, profile, deployer_address) = helper.create_mooniswap_deployer(); assert!(result.gas_used >= 5_100_000); // more than 5.1M EVM gas used - assert_gas_bound(profile.all_gas(), 11); // less than 11git NEAR Tgas used + assert_gas_bound(profile.all_gas(), 10); // less than 11git NEAR Tgas used let (result, profile, pool_factory) = helper.create_pool_factory(&deployer_address); assert!(result.gas_used >= 2_800_000); // more than 2.8M EVM gas used