Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
6,001 changes: 2,027 additions & 3,974 deletions Cargo.lock

Large diffs are not rendered by default.

209 changes: 75 additions & 134 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
hex-literal = "0.4.1"
impl-serde = { version = "0.4.0", default-features = false }
impl-trait-for-tuples = "0.2.1"
jsonrpsee = "0.23.2"
jsonrpsee = "0.24.7"
kvdb-rocksdb = "0.19.0"
libsecp256k1 = { version = "0.7.1", default-features = false }
log = { version = "0.4.21", default-features = false }
Expand All @@ -77,81 +77,82 @@ thiserror = "1.0"
tokio = "1.37.0"

# Substrate Client
sc-basic-authorship = "0.42.0"
sc-block-builder = "0.40.0"
sc-chain-spec = "35.0.0"
sc-cli = { default-features = false , version = "0.44.0" }
sc-client-api = "35.1.0"
sc-client-db = { default-features = false , version = "0.42.0" }
sc-consensus = "0.41.0"
sc-consensus-aura = "0.42.0"
sc-consensus-grandpa = "0.27.0"
sc-consensus-manual-seal = "0.43.0"
sc-executor = "0.39.0"
sc-keystore = "32.0.0"
sc-network = "0.42.0"
sc-network-common = "0.41.0"
sc-network-sync = "0.41.0"
sc-offchain = "37.0.0"
sc-rpc = "37.0.0"
sc-rpc-api = "0.41.0"
sc-service = { default-features = false , version = "0.43.0" }
sc-telemetry = "22.0.0"
sc-transaction-pool = "35.0.0"
sc-transaction-pool-api = "35.0.0"
sc-utils = "17.0.0"
sc-basic-authorship = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-block-builder = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-chain-spec = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-cli = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-client-api = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-client-db = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-consensus = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-consensus-aura = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-consensus-grandpa = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-consensus-manual-seal = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-executor = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-keystore = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-network = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-network-common = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-network-sync = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-offchain = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-rpc = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-rpc-server = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-rpc-api = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-service = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-telemetry = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-transaction-pool = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-transaction-pool-api = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sc-utils = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
# Substrate Primitive
sp-api = { default-features = false , version = "33.0.0" }
sp-block-builder = { default-features = false , version = "33.0.0" }
sp-blockchain = "35.1.0"
sp-consensus = "0.39.1"
sp-consensus-aura = { default-features = false , version = "0.39.0" }
sp-consensus-grandpa = { default-features = false , version = "20.0.0" }
sp-core = { default-features = false , version = "34.0.0" }
sp-crypto-hashing = { default-features = false , version = "0.1.0" }
sp-database = "10.0.0"
sp-externalities = { default-features = false , version = "0.29.0" }
sp-genesis-builder = { default-features = false , version = "0.14.0" }
sp-inherents = { default-features = false , version = "33.0.0" }
sp-io = { default-features = false , version = "37.0.0" }
sp-keyring = "38.0.0"
sp-offchain = { default-features = false , version = "33.0.0" }
sp-runtime = { default-features = false , version = "38.0.0" }
sp-runtime-interface = { default-features = false , version = "28.0.0" }
sp-session = { default-features = false , version = "34.0.0" }
sp-state-machine = { default-features = false , version = "0.42.0" }
sp-std = { default-features = false , version = "14.0.0" }
sp-storage = { default-features = false , version = "21.0.0" }
sp-timestamp = { default-features = false , version = "33.0.0" }
sp-transaction-pool = { default-features = false , version = "33.0.0" }
sp-version = { default-features = false , version = "36.0.0" }
sp-weights = { default-features = false , version = "31.0.0" }
sp-api = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-block-builder = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-blockchain = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-consensus = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-consensus-aura = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-consensus-grandpa = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-core = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-crypto-hashing = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-database = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-externalities = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-genesis-builder = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-inherents = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-io = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-keyring = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-offchain = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-runtime = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-runtime-interface = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-session = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-state-machine = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-std = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-storage = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-timestamp = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-transaction-pool = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-version = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
sp-weights = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
# Substrate FRAME
frame-benchmarking = { default-features = false , version = "36.0.0" }
frame-executive = { default-features = false , version = "36.0.0" }
frame-support = { default-features = false , version = "36.0.0" }
frame-system = { default-features = false , version = "36.0.0" }
frame-system-benchmarking = { default-features = false , version = "36.0.0" }
frame-system-rpc-runtime-api = { default-features = false , version = "33.0.0" }
pallet-aura = { default-features = false , version = "35.0.0" }
pallet-balances = { default-features = false , version = "37.0.0" }
pallet-grandpa = { default-features = false , version = "36.0.0" }
pallet-sudo = { default-features = false , version = "36.0.0" }
pallet-timestamp = { default-features = false , version = "35.0.0" }
pallet-transaction-payment = { default-features = false , version = "36.0.0" }
pallet-transaction-payment-rpc = "38.0.0"
pallet-transaction-payment-rpc-runtime-api = { default-features = false , version = "36.0.0" }
pallet-utility = { default-features = false , version = "36.0.0" }
frame-benchmarking = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
frame-executive = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
frame-support = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
frame-system = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
frame-system-benchmarking = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
frame-system-rpc-runtime-api = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-aura = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-balances = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-grandpa = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-sudo = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-timestamp = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-transaction-payment = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-transaction-payment-rpc = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-transaction-payment-rpc-runtime-api = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
pallet-utility = { default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
# Substrate Utility
frame-benchmarking-cli = "40.0.0"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.17.0" }
substrate-build-script-utils = "11.0.0"
substrate-frame-rpc-system = "36.0.0"
substrate-test-runtime-client = "2.0.0"
substrate-wasm-builder = "23.0.0"
frame-benchmarking-cli = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
substrate-build-script-utils = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
substrate-frame-rpc-system = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
substrate-test-runtime-client = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }
substrate-wasm-builder = { git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }

# XCM
xcm = { package = "staging-xcm", default-features = false , version = "14.0.1" }
xcm = { package = "staging-xcm", default-features = false , git = "https://github.com/UniqueNetwork/polkadot-sdk", branch = "v20241023" }

# Arkworks
ark-bls12-377 = { version = "0.4.0", default-features = false, features = ["curve"] }
Expand Down Expand Up @@ -195,69 +196,9 @@ precompile-utils = { path = "precompiles", default-features = false }
# Frontier Template
frontier-template-runtime = { path = "template/runtime", default-features = false }

[workspace.metadata.deppatcher.originals.workspace.dependencies]
sc-cli = { version = "0.42.0" }
sc-client-db = { version = "0.41.0" }
sc-service = { version = "0.41.0" }
sp-api = { version = "32.0.0" }
sp-block-builder = { version = "32.0.0" }
sp-consensus-aura = { version = "0.38.0" }
sp-consensus-grandpa = { version = "19.0.0" }
sp-core = { version = "33.0.1" }
sp-externalities = { version = "0.28.0" }
sp-genesis-builder = { version = "0.13.0" }
sp-inherents = { version = "32.0.0" }
sp-io = { version = "36.0.0" }
sp-offchain = { version = "32.0.0" }
sp-runtime = { version = "37.0.0" }
sp-runtime-interface = { version = "27.0.0" }
sp-session = { version = "33.0.0" }
sp-state-machine = { version = "0.41.0" }
sp-timestamp = { version = "32.0.0" }
sp-transaction-pool = { version = "32.0.0" }
sp-version = { version = "35.0.0" }
frame-benchmarking = { version = "34.0.0" }
frame-executive = { version = "34.0.0" }
frame-support = { version = "34.0.0" }
frame-system = { version = "34.0.1" }
frame-system-benchmarking = { version = "34.0.0" }
frame-system-rpc-runtime-api = { version = "32.0.0" }
pallet-aura = { version = "33.0.0" }
pallet-balances = { version = "35.0.0" }
pallet-grandpa = { version = "34.0.0" }
pallet-sudo = { version = "34.0.0" }
pallet-timestamp = { version = "33.0.0" }
pallet-transaction-payment = { version = "34.0.0" }
pallet-transaction-payment-rpc-runtime-api = { version = "34.0.0" }
pallet-utility = { version = "34.0.0" }
substrate-test-runtime-client = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.11.0" }
staging-xcm = { version = "13.0.1" }
sc-basic-authorship = { version = "0.40.0" }
sc-block-builder = { version = "0.39.0" }
sc-chain-spec = { version = "33.0.0" }
sc-client-api = { version = "34.0.0" }
sc-consensus = { version = "0.39.1" }
sc-consensus-aura = { version = "0.40.0" }
sc-consensus-grandpa = { version = "0.25.0" }
sc-consensus-manual-seal = { version = "0.41.0" }
sc-executor = { version = "0.38.0" }
sc-keystore = { version = "31.0.0" }
sc-network = { version = "0.40.0" }
sc-network-common = { version = "0.39.0" }
sc-network-sync = { version = "0.39.0" }
sc-offchain = { version = "35.0.0" }
sc-rpc = { version = "35.0.0" }
sc-rpc-api = { version = "0.39.0" }
sc-telemetry = { version = "20.0.0" }
sc-transaction-pool = { version = "34.0.0" }
sc-transaction-pool-api = { version = "34.0.0" }
sp-blockchain = { version = "34.0.0" }
sp-consensus = { version = "0.38.0" }
sp-keyring = { version = "37.0.0" }
pallet-transaction-payment-rpc = { version = "36.0.0" }
frame-benchmarking-cli = { version = "38.0.0" }
substrate-frame-rpc-system = { version = "34.0.0" }
substrate-wasm-builder = { version = "22.0.0" }
[patch.crates-io]
substrate-test-runtime-client = { path = "/home/ubuntu/unique-polkadot-sdk/substrate/test-utils/runtime/client" }
frame-benchmarking = { path = "/home/ubuntu/unique-polkadot-sdk/substrate/frame/benchmarking" }

[profile.release]
# Substrate runtime requires unwinding.
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ where
}

async fn import_block(
&mut self,
&self,
block: BlockImportParams<B>,
) -> Result<ImportResult, Self::Error> {
// We validate that there are only one frontier log. No other
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ sc-consensus-aura = { workspace = true }
sc-network = { workspace = true }
sc-network-sync = { workspace = true }
sc-rpc = { workspace = true }
sc-rpc-server = { workspace = true }
sc-service = { workspace = true }
sc-transaction-pool = { workspace = true }
sc-transaction-pool-api = { workspace = true }
sc-utils = { workspace = true }
sp-api = { workspace = true, features = ["default"] }
Expand Down
21 changes: 9 additions & 12 deletions client/rpc/src/eth/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ use ethereum_types::{H256, U256};
use jsonrpsee::core::RpcResult;
// Substrate
use sc_client_api::backend::{Backend, StorageProvider};
use sc_transaction_pool::ChainApi;
use sc_transaction_pool_api::InPoolTransaction;
use sc_transaction_pool_api::{InPoolTransaction, TransactionPool};
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
use sp_core::hashing::keccak_256;
Expand All @@ -37,14 +36,14 @@ use crate::{
frontier_backend_client, internal_err,
};

impl<B, C, P, CT, BE, A, CIDP, EC> Eth<B, C, P, CT, BE, A, CIDP, EC>
impl<B, C, P, CT, BE, CIDP, EC> Eth<B, C, P, CT, BE, CIDP, EC>
where
B: BlockT,
C: ProvideRuntimeApi<B>,
C::Api: EthereumRuntimeRPCApi<B>,
C: HeaderBackend<B> + StorageProvider<B, BE> + 'static,
BE: Backend<B> + 'static,
A: ChainApi<Block = B>,
P: TransactionPool<Block = B> + 'static,
{
pub async fn block_by_hash(&self, hash: H256, full: bool) -> RpcResult<Option<RichBlock>> {
let BlockInfo {
Expand Down Expand Up @@ -89,7 +88,7 @@ where
let client = Arc::clone(&self.client);
let block_data_cache = Arc::clone(&self.block_data_cache);
let backend = Arc::clone(&self.backend);
let graph = Arc::clone(&self.graph);
let pool = Arc::clone(&self.pool);

match frontier_backend_client::native_block_id::<B, C>(
client.as_ref(),
Expand Down Expand Up @@ -144,20 +143,18 @@ where
let mut xts: Vec<<B as BlockT>::Extrinsic> = Vec::new();
// ready validated pool
xts.extend(
graph
.validated_pool()
pool
.ready()
.map(|in_pool_tx| in_pool_tx.data().clone())
.map(|in_pool_tx| (**in_pool_tx.data()).clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
);

// future validated pool
xts.extend(
graph
.validated_pool()
pool
.futures()
.iter()
.map(|(_hash, extrinsic)| extrinsic.clone())
.map(|in_pool_tx| (**in_pool_tx.data()).clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
);

Expand Down Expand Up @@ -198,7 +195,7 @@ where
if let BlockNumberOrHash::Pending = number_or_hash {
// get the pending transactions count
return Ok(Some(U256::from(
self.graph.validated_pool().ready().count(),
self.pool.ready().count(),
)));
}

Expand Down
9 changes: 5 additions & 4 deletions client/rpc/src/eth/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use ethereum_types::{H160, U256, U64};
use jsonrpsee::core::RpcResult;
// Substrate
use sc_client_api::backend::{Backend, StorageProvider};
use sc_transaction_pool::ChainApi;
use sc_transaction_pool_api::TransactionPool;
use sp_api::ProvideRuntimeApi;
use sp_blockchain::HeaderBackend;
use sp_consensus::SyncOracle;
Expand All @@ -31,14 +31,14 @@ use fp_rpc::EthereumRuntimeRPCApi;

use crate::{eth::Eth, internal_err};

impl<B, C, P, CT, BE, A, CIDP, EC> Eth<B, C, P, CT, BE, A, CIDP, EC>
impl<B, C, P, CT, BE, CIDP, EC> Eth<B, C, P, CT, BE, CIDP, EC>
where
B: BlockT,
C: ProvideRuntimeApi<B>,
C::Api: EthereumRuntimeRPCApi<B>,
C: HeaderBackend<B> + StorageProvider<B, BE> + 'static,
BE: Backend<B>,
A: ChainApi<Block = B>,
P: TransactionPool<Block = B>
{
pub fn protocol_version(&self) -> RpcResult<u64> {
Ok(1)
Expand All @@ -49,8 +49,9 @@ where
let current_number = self.client.info().best_number;
let highest_number = self
.sync
.best_seen_block()
.status()
.await
.map(|status| status.best_seen_block)
.map_err(|_| internal_err("fetch best_seen_block failed"))?
.unwrap_or(current_number);

Expand Down
Loading