Skip to content

Commit

Permalink
Joint uplift PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinonard committed Jul 6, 2022
1 parent 175e42f commit 43845ec
Show file tree
Hide file tree
Showing 26 changed files with 537 additions and 405 deletions.
563 changes: 329 additions & 234 deletions Cargo.lock

Large diffs are not rendered by default.

24 changes: 10 additions & 14 deletions client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ serde_json = "1.0"

# Parity
ethereum-types = "0.13.1"

# Substrate
sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", features = ["wasmtime"] }
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", features = ["wasmtime"] }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }

# Frontier
sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", features = ["wasmtime"] }
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", features = ["wasmtime"] }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
fc-db = { path = "../db" }
fp-rpc = { version = "3.0.0-dev", path = "../../primitives/rpc" }
fp-storage = { version = "2.0.0-dev", path = "../../primitives/storage" }
Expand All @@ -36,10 +32,10 @@ tempfile = "3.3.0"
# Parity
codec = { package = "parity-scale-codec", version = "3.0.0" }
# Substrate
sc-block-builder = { version = "0.10.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" }
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
# Frontier
frontier-template-runtime = { path = "../../template/runtime" }
14 changes: 7 additions & 7 deletions client/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ async-trait = "0.1"
thiserror = "1.0"

# Substrate
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }

# Frontier
fc-db = { version = "2.0.0-dev", path = "../db" }
Expand Down
10 changes: 5 additions & 5 deletions client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ repository = "https://github.com/paritytech/frontier/"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
parking_lot = "0.12.1"
parking_lot = "0.12.0"

# Parity
codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] }
kvdb-rocksdb = { version = "0.15.2", optional = true }
parity-db = { version = "0.3.14", optional = true }

# Substrate
sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-database = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }

# Frontier
fp-storage = { version = "2.0.0-dev", path = "../../primitives/storage" }
Expand Down
8 changes: 4 additions & 4 deletions client/mapping-sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ futures-timer = "3.0.1"
log = "0.4.17"

# Substrate
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }

# Frontier
fc-db = { version = "2.0.0-dev", path = "../db" }
Expand Down
38 changes: 19 additions & 19 deletions client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ libsecp256k1 = "0.7"
rlp = "0.5"

# Substrate
prometheus-endpoint = { package = "substrate-prometheus-endpoint", 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-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-storage = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-block-builder = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-storage = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }

# Frontier
fc-db = { version = "2.0.0-dev", path = "../db" }
Expand All @@ -53,11 +53,11 @@ fp-storage = { version = "2.0.0-dev", path = "../../primitives/storage" }
[dev-dependencies]
tempfile = "3.3.0"
# Substrate
beefy-primitives = { version = "4.0.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-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
beefy-primitives = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-block-builder = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sc-client-db = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
# Frontier
frontier-template-runtime = { path = "../../template/runtime" }

Expand Down
19 changes: 17 additions & 2 deletions client/rpc/src/eth/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use sp_runtime::traits::{BlakeTwo256, Block as BlockT};
use fc_rpc_core::types::*;

use crate::{
eth::{rich_block_build, Eth},
eth::{empty_block_from, rich_block_build, Eth},
frontier_backend_client, internal_err,
};

Expand Down Expand Up @@ -132,7 +132,22 @@ where
base_fee,
)))
}
_ => Ok(None),
_ => {
if let BlockNumber::Num(block_number) = number {
let eth_block = empty_block_from(block_number.into());
let eth_hash =
H256::from_slice(keccak_256(&rlp::encode(&eth_block.header)).as_slice());
Ok(Some(rich_block_build(
eth_block,
Default::default(),
Some(eth_hash),
full,
None,
)))
} else {
Ok(None)
}
}
}
}

Expand Down
23 changes: 23 additions & 0 deletions client/rpc/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,29 @@ fn rich_block_build(
}
}

fn empty_block_from(number: U256) -> ethereum::BlockV2 {
let ommers = Vec::<ethereum::Header>::new();
let receipts = Vec::<ethereum::ReceiptV2>::new();
let receipts_root = ethereum::util::ordered_trie_root(receipts.iter().map(|r| rlp::encode(r)));
let logs_bloom = ethereum_types::Bloom::default();
let partial_header = ethereum::PartialHeader {
parent_hash: H256::default(),
beneficiary: Default::default(),
state_root: Default::default(),
receipts_root,
logs_bloom,
difficulty: U256::zero(),
number,
gas_limit: U256::from(4_000_000),
gas_used: U256::zero(),
timestamp: Default::default(),
extra_data: Vec::new(),
mix_hash: H256::default(),
nonce: H64::default(),
};
ethereum::Block::new(partial_header, Default::default(), ommers)
}

fn transaction_build(
ethereum_transaction: EthereumTransaction,
block: Option<EthereumBlock>,
Expand Down
10 changes: 5 additions & 5 deletions frame/base-fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
scale-info = { version = "2.1.2", default-features = false, features = ["derive"] }

# Substrate
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
# Substrate FRAME
frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

# Frontier
fp-evm = { version = "3.0.0-dev", path = "../../primitives/evm", default-features = false }

[dev-dependencies]
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }

[features]
default = ["std"]
Expand Down
16 changes: 8 additions & 8 deletions frame/dynamic-fee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
scale-info = { version = "2.1.2", default-features = false, features = ["derive"] }

# Substrate
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-std = { version = "4.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-inherents = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-std = { version = "4.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
# Substrate FRAME
frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

# Frontier
fp-dynamic-fee = { version = "1.0.0", path = "../../primitives/dynamic-fee", default-features = false }
fp-evm = { version = "3.0.0-dev", path = "../../primitives/evm", default-features = false }

[dev-dependencies]
pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }

[features]
default = ["std"]
Expand Down
16 changes: 8 additions & 8 deletions frame/ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ rlp = { version = "0.5", default-features = false }
scale-info = { version = "2.1.2", default-features = false, features = ["derive"] }

# Substrate
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-std = { version = "4.0.0", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-io = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-runtime = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
sp-std = { version = "4.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
# Substrate FRAME
frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
frame-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }
pallet-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24", default-features = false }

# Frontier
fp-consensus = { version = "2.0.0-dev", path = "../../primitives/consensus", default-features = false }
Expand All @@ -44,9 +44,9 @@ hex = "0.4.3"
# Parity
libsecp256k1 = { version = "0.7", features = ["static-context", "hmac"] }
# Substrate
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { version = "6.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }
# Substrate FRAME
pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.24" }

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

0 comments on commit 43845ec

Please sign in to comment.