Skip to content

Commit

Permalink
Merge branch 'master' into nish-eth-call-state-override-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaztec committed Mar 25, 2023
2 parents 7f57f01 + d13668c commit e0e1493
Show file tree
Hide file tree
Showing 57 changed files with 536 additions and 92 deletions.
23 changes: 22 additions & 1 deletion Cargo.lock

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

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ members = [
"client/db",
"client/storage",
"client/mapping-sync",
"primitives/account",
"primitives/consensus",
"primitives/dynamic-fee",
"primitives/evm",
Expand All @@ -41,9 +42,11 @@ environmental = { version = "1.1.3", default-features = false }
ethereum = { version = "0.14.0", default-features = false }
ethereum-types = { version = "0.14.1", default-features = false }
evm = { version = "0.37.0", default-features = false }
impl-serde = { version = "0.4.0", default-features = false }
jsonrpsee = "0.16.2"
kvdb-rocksdb = "0.17.0"
libsecp256k1 = "0.7.1"
libsecp256k1 = { version = "0.7.1", default-features = false }
log = { version = "0.4.17", default-features = false }
parity-db = "0.4.2"
rlp = { version = "0.5", default-features = false }
scale-codec = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] }
Expand All @@ -53,6 +56,7 @@ serde_json = "1.0"
# Substrate Client
sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down Expand Up @@ -124,6 +128,7 @@ fc-rpc = { version = "2.0.0-dev", path = "client/rpc" }
fc-rpc-core = { version = "1.1.0-dev", path = "client/rpc-core" }
fc-storage = { version = "1.0.0-dev", path = "client/storage" }
# Frontier Primitive
fp-account = { version = "1.0.0-dev", path = "primitives/account", default-features = false }
fp-consensus = { version = "2.0.0-dev", path = "primitives/consensus", default-features = false }
fp-dynamic-fee = { version = "1.0.0", path = "primitives/dynamic-fee", default-features = false }
fp-ethereum = { version = "1.0.0-dev", path = "primitives/ethereum", default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]

mod frontier_db_cmd;

pub use self::frontier_db_cmd::FrontierDbCmd;
2 changes: 2 additions & 0 deletions client/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]

use std::{collections::HashMap, marker::PhantomData, sync::Arc};

// Substrate
Expand Down
2 changes: 2 additions & 0 deletions client/db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]

#[cfg(feature = "parity-db")]
mod parity_db_adapter;
mod upgrade;
Expand Down
1 change: 1 addition & 0 deletions client/mapping-sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![allow(clippy::too_many_arguments)]
#![deny(unused_crate_dependencies)]

mod worker;

Expand Down
2 changes: 2 additions & 0 deletions client/rpc-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]

pub mod types;

mod eth;
Expand Down
2 changes: 1 addition & 1 deletion client/rpc-core/src/types/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ where

/// Filter Address
pub type FilterAddress = VariadicValue<H160>;
/// Topic, supports `A` | `null` | `[A,B,C]` | `[A,[B,C]]` | [null,[B,C]] | [null,[null,C]]
/// Topic, supports `A` | `null` | `[A,B,C]` | `[A,[B,C]]` | `[null,[B,C]]` | `[null,[null,C]]`
pub type Topic = VariadicValue<Option<VariadicValue<Option<H256>>>>;
/// FlatTopic, simplifies the matching logic.
pub type FlatTopic = VariadicValue<Option<H256>>;
Expand Down
1 change: 1 addition & 0 deletions client/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
clippy::len_zero,
clippy::new_without_default
)]
#![deny(unused_crate_dependencies)]

mod eth;
mod eth_pubsub;
Expand Down
2 changes: 2 additions & 0 deletions client/storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#![deny(unused_crate_dependencies)]

mod overrides;
pub use self::overrides::*;

Expand Down
18 changes: 18 additions & 0 deletions docs/accounts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Frontier provides two different strategies for handling `H160` addresses.

# H256 -> H160 mapping

The first strategy consists of of a truncated hash scheme, where the first 160 LE bytes of a `H256` address are used to form the `H160` address.

`AccountId32` is the Account type used for `frame_system::pallet::Config::AccountId`.

The Runtime's `Signature` type is configured as [`sp_runtime::MultiSignature`](https://docs.rs/sp-runtime/2.0.1/sp_runtime/enum.MultiSignature.html), which means signatures can be:
- `Sr25519`
- `Ed25519`
- `ECDSA`

# Native H160 via AccountId20

The second strategy consists of using `fp-account` so that `AccountId20` is the Account type used for `frame_system::pallet::Config::AccountId`.

The Runtime's `Signature` type is configured as `EthereumSigner`, which means only `ECDSA` signatures are supported.
6 changes: 3 additions & 3 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2226,9 +2226,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001219:
version "1.0.30001230"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001230.tgz#8135c57459854b2240b57a4a6786044bdc5a9f71"
integrity sha512-5yBd5nWCBS+jWKTcHOzXwo5xzcj4ePE/yjtkZyUV1BTUmrBaA9MRGC+e7mxnqXSA90CmCA8L3eKLaSUkt099IQ==
version "1.0.30001468"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001468.tgz#0101837c6a4e38e6331104c33dcfb3bdf367a4b7"
integrity sha512-zgAo8D5kbOyUcRAgSmgyuvBkjrGk5CGYG5TYgFdpQv+ywcyEpo1LOWoG8YmoflGnh+V+UsNuKYedsoYs0hzV5A==

caseless@~0.12.0:
version "0.12.0"
Expand Down
2 changes: 1 addition & 1 deletion frame/base-fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fp-evm = { workspace = true }

[dev-dependencies]
# Substrate
sp-io = { workspace = true }
sp-io = { workspace = true, features = ["default"] }

[features]
default = ["std"]
Expand Down
1 change: 1 addition & 0 deletions frame/base-fee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::comparison_chain)]
#![deny(unused_crate_dependencies)]

#[cfg(test)]
mod tests;
Expand Down
7 changes: 3 additions & 4 deletions frame/dynamic-fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ frame-support = { workspace = true }
frame-system = { workspace = true }
sp-core = { workspace = true }
sp-inherents = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
# Frontier
fp-dynamic-fee = { workspace = true }
fp-evm = { workspace = true }

[dev-dependencies]
# Substrate
pallet-timestamp = { workspace = true }
sp-io = { workspace = true }
pallet-timestamp = { workspace = true, features = ["default"] }
sp-io = { workspace = true, features = ["default"] }
sp-runtime = { workspace = true, features = ["default"] }

[features]
default = ["std"]
Expand All @@ -37,7 +37,6 @@ std = [
# Substrate
"sp-core/std",
"sp-inherents/std",
"sp-runtime/std",
"sp-std/std",
# Substrate
"frame-system/std",
Expand Down
1 change: 1 addition & 0 deletions frame/dynamic-fee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]

#[cfg(test)]
mod tests;
Expand Down
7 changes: 4 additions & 3 deletions frame/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ targets = ["x86_64-unknown-linux-gnu"]
ethereum = { workspace = true, features = ["with-codec"] }
ethereum-types = { workspace = true }
evm = { workspace = true, features = ["with-codec"] }
rlp = { workspace = true }
scale-codec = { package = "parity-scale-codec", workspace = true }
scale-info = { workspace = true }

Expand All @@ -31,16 +30,18 @@ fp-consensus = { workspace = true }
fp-ethereum = { workspace = true }
fp-evm = { workspace = true }
fp-rpc = { workspace = true }
fp-self-contained = { workspace = true }
fp-storage = { workspace = true }
pallet-evm = { workspace = true }

[dev-dependencies]
hex = "0.4.3"
libsecp256k1 = { workspace = true, features = ["static-context", "hmac"] }
rlp = { workspace = true }
# Substrate
pallet-balances = { workspace = true, features = ["default"] }
sp-core = { workspace = true }
sp-core = { workspace = true, features = ["default"] }
# Frontier
fp-self-contained = { workspace = true, features = ["default"] }

[features]
default = ["std"]
Expand Down
4 changes: 3 additions & 1 deletion frame/ethereum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::comparison_chain, clippy::large_enum_variant)]
#![deny(unused_crate_dependencies)]

#[cfg(all(feature = "std", test))]
mod mock;
Expand Down Expand Up @@ -64,7 +65,8 @@ pub use ethereum::{
};
pub use fp_rpc::TransactionStatus;

#[derive(Clone, Eq, PartialEq, RuntimeDebug, Encode, Decode, MaxEncodedLen, TypeInfo)]
#[derive(Clone, Eq, PartialEq, RuntimeDebug)]
#[derive(Encode, Decode, MaxEncodedLen, TypeInfo)]
pub enum RawOrigin {
EthereumTransaction(H160),
}
Expand Down
1 change: 1 addition & 0 deletions frame/evm-chain-id/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]

pub use pallet::*;

Expand Down
6 changes: 4 additions & 2 deletions frame/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ environmental = { workspace = true, optional = true }
evm = { workspace = true, features = ["with-codec"] }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
impl-trait-for-tuples = "0.2.2"
log = { version = "0.4.17", default-features = false }
log = { workspace = true }
rlp = { workspace = true }
scale-codec = { package = "parity-scale-codec", workspace = true }
scale-info = { workspace = true }
Expand All @@ -30,12 +30,13 @@ sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
# Frontier
fp-account = { workspace = true }
fp-evm = { workspace = true }

[dev-dependencies]
# Substrate
pallet-balances = { workspace = true, features = ["default"] }
pallet-evm-precompile-simple = { workspace = true }
pallet-evm-precompile-simple = { workspace = true, features = ["default"] }

[features]
default = ["std"]
Expand All @@ -58,6 +59,7 @@ std = [
"sp-runtime/std",
"sp-std/std",
# Frontier
"fp-account/std",
"fp-evm/std",
]
runtime-benchmarks = [
Expand Down
1 change: 1 addition & 0 deletions frame/evm/precompile/blake2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]

extern crate alloc;

Expand Down
1 change: 1 addition & 0 deletions frame/evm/precompile/bn128/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]

extern crate alloc;

Expand Down
1 change: 1 addition & 0 deletions frame/evm/precompile/curve25519/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// limitations under the License.

#![cfg_attr(not(feature = "std"), no_std)]
#![deny(unused_crate_dependencies)]

extern crate alloc;
use alloc::vec::Vec;
Expand Down
14 changes: 7 additions & 7 deletions frame/evm/precompile/dispatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ pallet-evm = { workspace = true }
scale-codec = { package = "parity-scale-codec", workspace = true }
scale-info = { workspace = true }
# Substrate
frame-system = { workspace = true }
frame-system = { workspace = true, features = ["default"] }
pallet-balances = { workspace = true, features = ["default"] }
pallet-timestamp = { workspace = true }
pallet-utility = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
pallet-timestamp = { workspace = true, features = ["default"] }
pallet-utility = { workspace = true, features = ["default"] }
sp-core = { workspace = true, features = ["default"] }
sp-io = { workspace = true, features = ["default"] }
sp-runtime = { workspace = true, features = ["default"] }
sp-std = { workspace = true, features = ["default"] }

[features]
default = ["std"]
Expand Down

0 comments on commit e0e1493

Please sign in to comment.