Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update polkadot-v1.0.0 branch with latest (10-08-23) master #1149

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
071d030
Handle `u64` conversion (#1091)
tgmichel Jul 29, 2023
1b03f49
feat: make txpool rpc optional (#1104)
koushiro Jul 29, 2023
a1c5a57
Update the approach to obtain `(weight_limit, proof_size_base_cost)` …
boundless-forest Jul 30, 2023
312ae8c
Bump semver and truffle in /ts-tests (#1111)
dependabot[bot] Jul 30, 2023
130c259
Bump semver and truffle in /template/examples/contract-erc20/truffle …
dependabot[bot] Jul 30, 2023
5927a42
Bump semver from 5.7.1 to 5.7.2 in /docs (#1105)
dependabot[bot] Jul 30, 2023
eaf1705
Bump tough-cookie and web3 in /template/utils (#1103)
dependabot[bot] Jul 30, 2023
d0533c5
Bump tough-cookie and web3 in /template/examples/contract-hello (#1102)
dependabot[bot] Jul 30, 2023
e424762
Adds correct filepath to test_precompile_test_vectors* panics (#1083)
Jouzo Jul 30, 2023
9f1a73b
Check EIP-3607 at transaction validation (#1084)
librelois Jul 30, 2023
611a2b2
Add `CallOrCreateInfo` to `ValidatedTransaction` apply result. (#1099)
shaunxw Jul 31, 2023
bf7ef1c
Bump serde from 1.0.171 to 1.0.179 (#1132)
dependabot[bot] Jul 31, 2023
276cf59
Bump smallvec from 1.10.0 to 1.11.0 (#1131)
dependabot[bot] Jul 31, 2023
4d234a7
Bump thiserror from 1.0.40 to 1.0.44 (#1130)
dependabot[bot] Jul 31, 2023
db6472b
Bump parity-db from 0.4.9 to 0.4.10 (#1129)
dependabot[bot] Jul 31, 2023
194f6bb
Bump openssl from 0.10.48 to 0.10.55 (#1128)
dependabot[bot] Jul 31, 2023
ff8bd85
feat: add fc-api to improve fc-db (#1076)
koushiro Jul 31, 2023
c020c05
Add docs to ConvertTransaction and NoTransactionConverter (#977)
sorpaas Aug 1, 2023
d85f108
Bump log from 0.4.17 to 0.4.19 (#1138)
dependabot[bot] Aug 1, 2023
017d5a9
Bump serde_json from 1.0.93 to 1.0.104 (#1137)
dependabot[bot] Aug 1, 2023
ef9f16c
Bump async-trait from 0.1.63 to 0.1.72 (#1136)
dependabot[bot] Aug 1, 2023
504bc47
Bump tempfile from 3.3.0 to 3.7.0 (#1135)
dependabot[bot] Aug 1, 2023
0bb1c7f
Bump num from 0.4.0 to 0.4.1 (#1134)
dependabot[bot] Aug 1, 2023
22aaafe
Add `AsRef` and `AsMut` for `AccountId20` (#1139)
boundless-forest Aug 1, 2023
8b1f329
build: merge branch 'frontier/master' into polkadot-v1.0.0
MaciejBaj Aug 10, 2023
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
149 changes: 92 additions & 57 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ members = [
"frame/evm/precompile/bls12377",
"frame/evm/precompile/dispatch",
"frame/evm/precompile/curve25519",
"client/api",
"client/consensus",
"client/rpc-core",
"client/rpc",
Expand Down Expand Up @@ -53,8 +54,8 @@ impl-serde = { version = "0.4.0", default-features = false }
jsonrpsee = "0.16.2"
kvdb-rocksdb = "0.19.0"
libsecp256k1 = { version = "0.7.1", default-features = false }
log = { version = "0.4.17", default-features = false }
parity-db = "0.4.9"
log = { version = "0.4.19", default-features = false }
parity-db = "0.4.10"
parking_lot = "0.12.1"
rlp = { version = "0.5.2", default-features = false }
scale-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = ["derive"] }
Expand Down Expand Up @@ -135,6 +136,7 @@ substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/
substrate-test-runtime-client = { version = "2.0.0", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
# Frontier Client
fc-api = { version = "1.0.0-dev", path = "client/api" }
fc-cli = { version = "1.0.0-dev", path = "client/cli", default-features = false }
fc-consensus = { version = "2.0.0-dev", path = "client/consensus" }
fc-db = { version = "2.0.0-dev", path = "client/db", default-features = false }
Expand Down
20 changes: 20 additions & 0 deletions client/api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[package]
name = "fc-api"
version = "1.0.0-dev"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
description = "Frontier client interfaces"
authors = { workspace = true }
edition = { workspace = true }
repository = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
async-trait = { workspace = true }
scale-codec = { package = "parity-scale-codec", workspace = true }
# Substrate
sp-core = { workspace = true, features = ["default"] }
sp-runtime = { workspace = true, features = ["default"] }
# Frontier
fp-storage = { workspace = true, features = ["default"] }
81 changes: 81 additions & 0 deletions client/api/src/backend.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This file is part of Frontier.
//
// Copyright (c) 2023 Parity Technologies (UK) Ltd.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use scale_codec::{Decode, Encode};
// Substrate
use sp_core::{H160, H256};
use sp_runtime::traits::Block as BlockT;
// Frontier
use fp_storage::EthereumStorageSchema;

#[derive(Clone, Debug, Eq, PartialEq, Encode, Decode)]
pub struct TransactionMetadata<Block: BlockT> {
pub substrate_block_hash: Block::Hash,
pub ethereum_block_hash: H256,
pub ethereum_index: u32,
}

/// The frontier backend interface.
#[async_trait::async_trait]
pub trait Backend<Block: BlockT>: Send + Sync {
/// Get the substrate hash with the given ethereum block hash.
async fn block_hash(
&self,
ethereum_block_hash: &H256,
) -> Result<Option<Vec<Block::Hash>>, String>;

/// Get the transaction metadata with the given ethereum block hash.
async fn transaction_metadata(
&self,
ethereum_transaction_hash: &H256,
) -> Result<Vec<TransactionMetadata<Block>>, String>;

/// Returns reference to log indexer backend.
fn log_indexer(&self) -> &dyn LogIndexerBackend<Block>;

/// Indicate whether the log indexing feature is supported.
fn is_indexed(&self) -> bool {
self.log_indexer().is_indexed()
}
}

#[derive(Debug, Eq, PartialEq)]
pub struct FilteredLog<Block: BlockT> {
pub substrate_block_hash: Block::Hash,
pub ethereum_block_hash: H256,
pub block_number: u32,
pub ethereum_storage_schema: EthereumStorageSchema,
pub transaction_index: u32,
pub log_index: u32,
}

/// The log indexer backend interface.
#[async_trait::async_trait]
pub trait LogIndexerBackend<Block: BlockT>: Send + Sync {
/// Indicate whether the log indexing feature is supported.
fn is_indexed(&self) -> bool;

/// Filter the logs by the parameters.
async fn filter_logs(
&self,
from_block: u64,
to_block: u64,
addresses: Vec<H160>,
topics: Vec<Vec<Option<H256>>>,
) -> Result<Vec<FilteredLog<Block>>, String>;
}
23 changes: 23 additions & 0 deletions client/api/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This file is part of Frontier.
//
// Copyright (c) 2023 Parity Technologies (UK) Ltd.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// 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 backend;

pub use self::backend::*;
1 change: 1 addition & 0 deletions client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ sp-consensus = { workspace = true }
sp-io = { workspace = true }
substrate-test-runtime-client = { workspace = true }
# Frontier
fc-api = { workspace = true }
fc-db = { workspace = true, features = ["rocksdb"] }
frontier-template-runtime = { workspace = true, features = ["default"] }

Expand Down
16 changes: 8 additions & 8 deletions client/cli/src/frontier_db_cmd/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ fn commitment_create() {
);

// Expect the offchain-stored transaction metadata to match the one we stored in the runtime.
let expected_transaction_metadata = fc_db::TransactionMetadata {
block_hash,
let expected_transaction_metadata = fc_api::TransactionMetadata {
substrate_block_hash: block_hash,
ethereum_block_hash,
ethereum_index: 0,
};
Expand Down Expand Up @@ -660,8 +660,8 @@ fn commitment_update() {
);

// Expect the offchain-stored transaction metadata to match the one we stored in the runtime.
let expected_transaction_metadata_a1_t1 = fc_db::TransactionMetadata {
block_hash: block_a1_hash,
let expected_transaction_metadata_a1_t1 = fc_api::TransactionMetadata {
substrate_block_hash: block_a1_hash,
ethereum_block_hash,
ethereum_index: 0,
};
Expand Down Expand Up @@ -706,13 +706,13 @@ fn commitment_update() {
);

// Expect the offchain-stored transaction metadata to have data for both blocks.
let expected_transaction_metadata_a2_t1 = fc_db::TransactionMetadata {
block_hash: block_a2_hash,
let expected_transaction_metadata_a2_t1 = fc_api::TransactionMetadata {
substrate_block_hash: block_a2_hash,
ethereum_block_hash,
ethereum_index: 0,
};
let expected_transaction_metadata_a2_t2 = fc_db::TransactionMetadata {
block_hash: block_a2_hash,
let expected_transaction_metadata_a2_t2 = fc_api::TransactionMetadata {
substrate_block_hash: block_a2_hash,
ethereum_block_hash,
ethereum_index: 1,
};
Expand Down
5 changes: 3 additions & 2 deletions client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ log = { workspace = true }
parity-db = { workspace = true }
parking_lot = { workspace = true }
scale-codec = { package = "parity-scale-codec", workspace = true }
smallvec = { version = "1.10", optional = true }
smallvec = { version = "1.11", optional = true }
sqlx = { workspace = true, features = ["runtime-tokio-native-tls", "sqlite"], optional = true }
tokio = { workspace = true, features = ["macros", "sync"], optional = true }
# Substrate
Expand All @@ -32,6 +32,7 @@ sp-database = { workspace = true }
sp-runtime = { workspace = true }
sp-storage = { workspace = true, optional = true }
# Frontier
fc-api = { workspace = true }
fc-storage = { workspace = true, optional = true }
fp-consensus = { workspace = true, features = ["default"], optional = true }
fp-rpc = { workspace = true, features = ["default"], optional = true }
Expand All @@ -40,7 +41,7 @@ fp-storage = { workspace = true, features = ["default"] }
[dev-dependencies]
futures = { workspace = true }
maplit = "1.0.2"
tempfile = "3.3.0"
tempfile = "3.7.0"
# Substrate
sc-block-builder = { workspace = true }
sp-consensus = { workspace = true }
Expand Down
Loading
Loading