>,
+ pool: Arc,
_marker: PhantomData,
}
-impl TxPool
+impl TxPool
where
C: ProvideRuntimeApi,
C: HeaderMetadata + HeaderBackend + 'static,
C: Send + Sync + 'static,
- B: BlockT + Send + Sync + 'static,
- A: ChainApi + 'static,
+ B: BlockT + Send + Sync + 'static,
+ P: sc_transaction_pool_api::TransactionPool + 'static,
C::Api: TxPoolRuntimeApi,
{
/// Use the transaction graph interface to get the extrinsics currently in the ready and future
@@ -52,20 +51,14 @@ where
T: GetT + Serialize,
{
// Collect transactions in the ready validated pool.
- let txs_ready = self
- .graph
- .validated_pool()
- .ready()
- .map(|in_pool_tx| in_pool_tx.data().clone())
- .collect();
+ let txs_ready = self.pool.ready().map(|in_pool_tx| (**in_pool_tx.data()).clone()).collect();
// Collect transactions in the future validated pool.
let txs_future = self
- .graph
- .validated_pool()
+ .pool
.futures()
- .iter()
- .map(|(_hash, extrinsic)| extrinsic.clone())
+ .into_iter()
+ .map(|in_pool_tx| (**in_pool_tx.data()).clone())
.collect();
// Use the runtime to match the (here) opaque extrinsics against ethereum transactions.
@@ -95,12 +88,19 @@ where
// Build the T response.
let mut pending = TransactionMap::::new();
for txn in ethereum_txns.ready.iter() {
- let hash = txn.hash();
- let nonce = match txn {
+ let hash_raw = txn.hash();
+ let hash_bytes: [u8; 32] = hash_raw.0;
+ let hash = ethereum_types::H256::from(hash_bytes);
+
+ let nonce_raw = match txn {
TransactionV2::Legacy(t) => t.nonce,
TransactionV2::EIP2930(t) => t.nonce,
TransactionV2::EIP1559(t) => t.nonce,
+ TransactionV2::EIP7702(t) => t.nonce,
};
+ let nonce_bytes = nonce_raw.to_big_endian();
+ let nonce = ethereum_types::U256::from_big_endian(&nonce_bytes);
+
let from_address = match public_key(txn) {
Ok(pk) => H160::from(H256::from_slice(Keccak256::digest(pk).as_slice())),
Err(_e) => H160::default(),
@@ -112,12 +112,19 @@ where
}
let mut queued = TransactionMap::::new();
for txn in ethereum_txns.future.iter() {
- let hash = txn.hash();
- let nonce = match txn {
+ let hash_raw = txn.hash();
+ let hash_bytes: [u8; 32] = hash_raw.0;
+ let hash = ethereum_types::H256::from(hash_bytes);
+
+ let nonce_raw = match txn {
TransactionV2::Legacy(t) => t.nonce,
TransactionV2::EIP2930(t) => t.nonce,
TransactionV2::EIP1559(t) => t.nonce,
+ TransactionV2::EIP7702(t) => t.nonce,
};
+ let nonce_bytes = nonce_raw.to_big_endian();
+ let nonce = ethereum_types::U256::from_big_endian(&nonce_bytes);
+
let from_address = match public_key(txn) {
Ok(pk) => H160::from(H256::from_slice(Keccak256::digest(pk).as_slice())),
Err(_e) => H160::default(),
@@ -131,19 +138,19 @@ where
}
}
-impl TxPool {
- pub fn new(client: Arc, graph: Arc>) -> Self {
- Self { client, graph, _marker: PhantomData }
+impl TxPool {
+ pub fn new(client: Arc, pool: Arc) -> Self {
+ Self { client, pool, _marker: PhantomData }
}
}
-impl TxPoolServer for TxPool
+impl TxPoolServer for TxPool
where
C: ProvideRuntimeApi,
C: HeaderMetadata + HeaderBackend,
C: Send + Sync + 'static,
- B: BlockT + Send + Sync + 'static,
- A: ChainApi + 'static,
+ B: BlockT + Send + Sync + 'static,
+ P: sc_transaction_pool_api::TransactionPool + 'static,
C::Api: TxPoolRuntimeApi,
{
fn content(&self) -> RpcResult>> {
@@ -155,13 +162,13 @@ where
}
fn status(&self) -> RpcResult> {
- let status = self.graph.validated_pool().status();
+ let status = self.pool.status();
Ok(TxPoolResult { pending: U256::from(status.ready), queued: U256::from(status.future) })
}
}
-impl Clone for TxPool {
+impl Clone for TxPool {
fn clone(&self) -> Self {
- Self::new(self.client.clone(), self.graph.clone())
+ Self::new(self.client.clone(), self.pool.clone())
}
}
diff --git a/frost/src/error.rs b/frost/src/error.rs
index 9c10d4ca2..920c536a2 100644
--- a/frost/src/error.rs
+++ b/frost/src/error.rs
@@ -5,6 +5,7 @@ use thiserror_nostd_notrait::Error;
use crate::{Ciphersuite, Identifier};
#[derive(Error, Debug, Clone, Copy, Eq, PartialEq)]
+#[allow(dead_code)]
pub struct ParticipantError(Identifier);
/// An error related to FROST.
diff --git a/frost/src/keys.rs b/frost/src/keys.rs
index 0498853e9..1e5e81567 100644
--- a/frost/src/keys.rs
+++ b/frost/src/keys.rs
@@ -471,10 +471,10 @@ pub fn split(
) -> Result<(BTreeMap, SecretShare>, PublicKeyPackage), Error> {
validate_num_of_signers(min_signers, max_signers)?;
- if let IdentifierList::Custom(identifiers) = &identifiers {
- if identifiers.len() != max_signers as usize {
- return Err(Error::IncorrectNumberOfIdentifiers);
- }
+ if let IdentifierList::Custom(identifiers) = &identifiers &&
+ identifiers.len() != max_signers as usize
+ {
+ return Err(Error::IncorrectNumberOfIdentifiers);
}
let verifying_key = VerifyingKey::from(key);
@@ -500,11 +500,10 @@ pub fn split(
secret_shares_by_id.insert(secret_share.identifier, secret_share);
}
- Ok((secret_shares_by_id, PublicKeyPackage {
- header: Header::default(),
- verifying_shares,
- verifying_key,
- }))
+ Ok((
+ secret_shares_by_id,
+ PublicKeyPackage { header: Header::default(), verifying_shares, verifying_key },
+ ))
}
/// Evaluate the polynomial with the given coefficients (constant term first)
diff --git a/node/Cargo.toml b/node/Cargo.toml
index 8ab6cbbdd..120e7071a 100644
--- a/node/Cargo.toml
+++ b/node/Cargo.toml
@@ -120,6 +120,7 @@ tangle-crypto-primitives = { workspace = true }
tangle-primitives = { workspace = true, features = ["std"] }
tangle-runtime = { workspace = true, features = ["std"] }
tangle-testnet-runtime = { workspace = true, optional = true }
+tangle-subxt = { workspace = true }
futures-timer = { workspace = true }
blueprint-manager = { workspace = true, optional = true }
@@ -127,9 +128,8 @@ blueprint-runner = { workspace = true, optional = true }
blueprint-keystore = { workspace = true, optional = true }
[dev-dependencies]
-tangle-subxt = { workspace = true }
sp-tracing = { workspace = true }
-alloy = { version = "0.9", features = ["full", "provider-debug-api"] }
+alloy = { version = "1.0.35", features = ["full", "provider-debug-api"] }
anyhow = "1.0"
[features]
@@ -159,4 +159,6 @@ fast-runtime = ["tangle-testnet-runtime/fast-runtime", "tangle-runtime/fast-runt
metadata-hash = ["tangle-testnet-runtime?/metadata-hash", "tangle-runtime/metadata-hash"]
manual-seal = ["tangle-testnet-runtime/manual-seal"]
blueprint-manager = ["dep:blueprint-manager", "dep:blueprint-runner", "dep:blueprint-keystore"]
-try-runtime = []
+try-runtime = [
+ "tangle-runtime/try-runtime",
+]
diff --git a/node/src/chainspec/mainnet.rs b/node/src/chainspec/mainnet.rs
index 84be0d111..6603a2bd9 100644
--- a/node/src/chainspec/mainnet.rs
+++ b/node/src/chainspec/mainnet.rs
@@ -222,12 +222,15 @@ fn mainnet_genesis(
}
Precompiles::used_addresses_h160().for_each(|address| {
- map.insert(address, fp_evm::GenesisAccount {
- nonce: Default::default(),
- balance: Default::default(),
- storage: Default::default(),
- code: revert_bytecode.to_vec(),
- });
+ map.insert(
+ address,
+ fp_evm::GenesisAccount {
+ nonce: Default::default(),
+ balance: Default::default(),
+ storage: Default::default(),
+ code: revert_bytecode.to_vec(),
+ },
+ );
});
map
};
diff --git a/node/src/chainspec/testnet.rs b/node/src/chainspec/testnet.rs
index 78d5b438f..d0a8ade51 100644
--- a/node/src/chainspec/testnet.rs
+++ b/node/src/chainspec/testnet.rs
@@ -269,12 +269,15 @@ fn testnet_genesis(
}
Precompiles::used_addresses_h160().for_each(|address| {
- map.insert(address, fp_evm::GenesisAccount {
- nonce: Default::default(),
- balance: Default::default(),
- storage: Default::default(),
- code: revert_bytecode.to_vec(),
- });
+ map.insert(
+ address,
+ fp_evm::GenesisAccount {
+ nonce: Default::default(),
+ balance: Default::default(),
+ storage: Default::default(),
+ code: revert_bytecode.to_vec(),
+ },
+ );
});
let fully_loaded_accounts = get_fully_funded_accounts_for([
@@ -330,6 +333,10 @@ fn testnet_genesis(
"invulnerables": initial_authorities.iter().map(|x| x.0.clone()).collect::>(),
"slashRewardFraction": Perbill::from_percent(10),
"stakers" : stakers,
+ "forceEra": "ForceNew",
+ "canceledPayout": 0u128,
+ "minNominatorBond": UNIT,
+ "minValidatorBond": UNIT,
},
"council": {
"members": council_members,
@@ -353,13 +360,16 @@ fn testnet_genesis(
}
fn generate_fully_loaded_evm_account_for(acc: &str) -> (H160, fp_evm::GenesisAccount) {
- (H160::from_str(acc).expect("internal H160 is valid; qed"), fp_evm::GenesisAccount {
- balance: U256::from_str("0xffffffffffffffffffffffffffffffff")
- .expect("internal U256 is valid; qed"),
- code: Default::default(),
- nonce: Default::default(),
- storage: Default::default(),
- })
+ (
+ H160::from_str(acc).expect("internal H160 is valid; qed"),
+ fp_evm::GenesisAccount {
+ balance: U256::from_str("0xffffffffffffffffffffffffffffffff")
+ .expect("internal U256 is valid; qed"),
+ code: Default::default(),
+ nonce: Default::default(),
+ storage: Default::default(),
+ },
+ )
}
fn get_fully_funded_accounts_for<'a, T: AsRef<[&'a str]>>(
diff --git a/node/src/cli.rs b/node/src/cli.rs
index c2709402a..2e4ef2308 100644
--- a/node/src/cli.rs
+++ b/node/src/cli.rs
@@ -87,12 +87,9 @@ pub enum Subcommand {
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
- /// Try some command against runtime state.
- #[cfg(feature = "try-runtime")]
- TryRuntime(try_runtime_cli::TryRuntimeCmd),
-
- /// Try some command against runtime state. Note: `try-runtime` feature must be enabled.
- #[cfg(not(feature = "try-runtime"))]
+ /// Try-runtime has migrated to a standalone
+ /// [CLI](). The subcommand exists as a stub and
+ /// deprecation notice. It will be removed entirely some time after January 2024.
TryRuntime,
/// Db meta columns information.
diff --git a/node/src/command.rs b/node/src/command.rs
index c4bf28227..05b16cba1 100644
--- a/node/src/command.rs
+++ b/node/src/command.rs
@@ -107,6 +107,7 @@ impl SubstrateCli for Cli {
}
/// Parse and run command line arguments
+#[allow(clippy::result_large_err)]
pub fn run() -> sc_cli::Result<()> {
let cli = Cli::from_args();
@@ -147,7 +148,7 @@ pub fn run() -> sc_cli::Result<()> {
Some(Subcommand::ExportBlocks(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|mut config| {
- let (client, _, import_queue, task_manager, _) =
+ let (client, _, _import_queue, task_manager, _) =
service::new_chain_ops(&mut config, &cli.eth)?;
Ok((cmd.run(client, config.database), task_manager))
})
@@ -165,7 +166,7 @@ pub fn run() -> sc_cli::Result<()> {
Some(Subcommand::ExportState(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|mut config| {
- let (client, _, import_queue, task_manager, _) =
+ let (client, _, _import_queue, task_manager, _) =
service::new_chain_ops(&mut config, &cli.eth)?;
Ok((cmd.run(client, config.chain_spec), task_manager))
})
@@ -209,7 +210,7 @@ pub fn run() -> sc_cli::Result<()> {
Some(Subcommand::Revert(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|mut config| {
- let (client, backend, import_queue, task_manager, _) =
+ let (client, backend, _import_queue, task_manager, _) =
service::new_chain_ops(&mut config, &cli.eth)?;
let aux_revert = Box::new(|client, _, blocks| {
sc_consensus_grandpa::revert(client, blocks)?;
@@ -235,7 +236,7 @@ pub fn run() -> sc_cli::Result<()> {
);
}
- cmd.run_with_spec::, sp_io::SubstrateHostFunctions>(Some(
+ cmd.run_with_spec::, ()>(Some(
config.chain_spec,
))
},
@@ -261,14 +262,13 @@ pub fn run() -> sc_cli::Result<()> {
},
BenchmarkCmd::Overhead(_cmd) => Err("Unsupported benchmarking command".into()),
BenchmarkCmd::Extrinsic(_cmd) => Err("Unsupported benchmarking command".into()),
- BenchmarkCmd::Machine(cmd) => {
- cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone())
- },
+ BenchmarkCmd::Machine(cmd) =>
+ cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()),
}
})
},
#[cfg(feature = "manual-seal")]
- Some(Subcommand::Benchmark(cmd)) => {
+ Some(Subcommand::Benchmark(_cmd)) => {
unimplemented!()
},
Some(Subcommand::FrontierDb(cmd)) => {
@@ -283,23 +283,7 @@ pub fn run() -> sc_cli::Result<()> {
cmd.run(client, frontier_backend)
})
},
- #[cfg(feature = "try-runtime")]
- Some(Subcommand::TryRuntime(cmd)) => {
- let runner = cli.create_runner(cmd)?;
- runner.async_run(|config| {
- // we don't need any of the components of new_partial, just a runtime, or a task
- // manager to do `async_run`.
- let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
- let task_manager =
- sc_service::TaskManager::new(config.tokio_handle.clone(), registry)
- .map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?;
- Ok((cmd.run::(config), task_manager))
- })
- },
- #[cfg(not(feature = "try-runtime"))]
- Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
- You can enable it with `--features try-runtime`."
- .into()),
+ Some(Subcommand::TryRuntime) => Err("The `try-runtime` subcommand has been migrated to a standalone CLI (https://github.com/paritytech/try-runtime-cli). It is no longer being maintained here and will be removed entirely some time after January 2024. Please remove this subcommand from your runtime and use the standalone CLI.".into()),
Some(Subcommand::ChainInfo(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run::(&config))
diff --git a/node/src/distributions/mainnet.rs b/node/src/distributions/mainnet.rs
index aa86d9129..a22358e95 100644
--- a/node/src/distributions/mainnet.rs
+++ b/node/src/distributions/mainnet.rs
@@ -391,10 +391,13 @@ pub fn get_distribution_for(
let amount_after_cliff = (vested_amount as f64 * remaining_fraction) as u128;
let amount_unlocked_per_block_after_cliff =
vesting_per_block(amount_after_cliff, total_vesting_schedule - vesting_cliff);
- vesting.push((address, vec![
- (amount_on_cliff, amount_on_cliff, vesting_cliff),
- (amount_after_cliff, amount_unlocked_per_block_after_cliff, vesting_cliff),
- ]));
+ vesting.push((
+ address,
+ vec![
+ (amount_on_cliff, amount_on_cliff, vesting_cliff),
+ (amount_after_cliff, amount_unlocked_per_block_after_cliff, vesting_cliff),
+ ],
+ ));
});
DistributionResult { claims, vesting, vesting_length: total_vesting_schedule, vesting_cliff }
diff --git a/node/src/distributions/testnet.rs b/node/src/distributions/testnet.rs
index a02987049..fae2428c9 100644
--- a/node/src/distributions/testnet.rs
+++ b/node/src/distributions/testnet.rs
@@ -95,12 +95,15 @@ pub fn get_evm_balance_distribution() -> Vec<(H160, GenesisAccount)> {
.into_iter()
.chain(get_discord_list())
.map(|address| {
- (address, GenesisAccount {
- balance: U256::from(ENDOWMENT),
- code: Default::default(),
- nonce: Default::default(),
- storage: Default::default(),
- })
+ (
+ address,
+ GenesisAccount {
+ balance: U256::from(ENDOWMENT),
+ code: Default::default(),
+ nonce: Default::default(),
+ storage: Default::default(),
+ },
+ )
})
.collect()
}
diff --git a/node/src/eth.rs b/node/src/eth.rs
index bd32b0b44..98746de75 100644
--- a/node/src/eth.rs
+++ b/node/src/eth.rs
@@ -169,6 +169,7 @@ pub struct FrontierPartialComponents {
pub fee_history_cache_limit: FeeHistoryCacheLimit,
}
+#[allow(clippy::result_large_err)]
pub fn new_frontier_partial(
config: &EthConfiguration,
) -> Result {
diff --git a/node/src/lib.rs b/node/src/lib.rs
index 058d0c6cb..6819c2a53 100644
--- a/node/src/lib.rs
+++ b/node/src/lib.rs
@@ -1,3 +1,5 @@
+#![allow(unexpected_cfgs)]
+
#[cfg(feature = "blueprint-manager")]
pub mod blueprint_service;
pub mod chainspec;
diff --git a/node/src/main.rs b/node/src/main.rs
index 1b376d6d3..784a7b798 100644
--- a/node/src/main.rs
+++ b/node/src/main.rs
@@ -1,5 +1,6 @@
//! Substrate Node Template CLI library.
#![warn(missing_docs)]
+#![allow(unexpected_cfgs)]
mod chainspec;
#[macro_use]
@@ -24,6 +25,7 @@ mod manual_seal;
#[cfg(feature = "manual-seal")]
use manual_seal as service;
+#[allow(clippy::result_large_err)]
fn main() -> sc_cli::Result<()> {
command::run()
}
diff --git a/node/src/manual_seal.rs b/node/src/manual_seal.rs
index 1b83b497c..9d671cacc 100644
--- a/node/src/manual_seal.rs
+++ b/node/src/manual_seal.rs
@@ -18,12 +18,12 @@ pub use crate::eth::{EthConfiguration, db_config_dir};
use crate::{
cli::Sealing,
eth::{
- BackendType, EthApi, FrontierBackend, FrontierBlockImport, FrontierPartialComponents,
- RpcConfig, StorageOverride, StorageOverrideHandler, new_frontier_partial,
- spawn_frontier_tasks,
+ BackendType, FrontierBackend, FrontierBlockImport, FrontierPartialComponents, RpcConfig,
+ StorageOverride, StorageOverrideHandler, new_frontier_partial, spawn_frontier_tasks,
},
};
use futures::{FutureExt, future};
+use jsonrpsee::RpcModule;
use sc_client_api::{Backend, BlockBackend};
use sc_consensus::BasicQueue;
use sc_consensus_babe::BabeWorkerHandle;
@@ -68,14 +68,14 @@ type GrandpaBlockImport =
pub fn new_partial(
config: &Configuration,
eth_config: &EthConfiguration,
- build_import_queue: BIQ,
+ _build_import_queue: BIQ,
) -> Result<
sc_service::PartialComponents<
FullClient,
FullBackend,
FullSelectChain,
sc_consensus::DefaultImportQueue,
- sc_transaction_pool::FullPool,
+ sc_transaction_pool::TransactionPoolHandle,
(
Option,
BoxBlockImport,
@@ -125,11 +125,7 @@ where
.transpose()?;
// Create the WasmExecutor with allow_missing_host_functions flag set to true
- let executor = WasmExecutor::builder()
- .with_max_runtime_instances(config.max_runtime_instances)
- .with_runtime_cache_size(config.runtime_cache_size)
- .with_allow_missing_host_functions(true)
- .build();
+ let executor = WasmExecutor::builder().with_allow_missing_host_functions(true).build();
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::(
@@ -146,12 +142,15 @@ where
let select_chain = sc_consensus::LongestChain::new(backend.clone());
- let transaction_pool = sc_transaction_pool::BasicPool::new_full(
- config.transaction_pool.clone(),
- config.role.is_authority().into(),
- config.prometheus_registry(),
- task_manager.spawn_essential_handle(),
- client.clone(),
+ let transaction_pool = Arc::new(
+ sc_transaction_pool::Builder::new(
+ task_manager.spawn_essential_handle(),
+ client.clone(),
+ config.role.is_authority().into(),
+ )
+ .with_options(config.transaction_pool.clone())
+ .with_prometheus(config.prometheus_registry())
+ .build(),
);
let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import(
@@ -199,9 +198,9 @@ where
)?;
//let slot_duration = babe_link.config().slot_duration();
- let slot_duration = 0; // This is important to allow continous block
+ let _slot_duration = 0; // This is important to allow continous block
- let target_gas_price = eth_config.target_gas_price;
+ let _target_gas_price = eth_config.target_gas_price;
let import_queue = sc_consensus_manual_seal::import_queue(
Box::new(block_import.clone()),
@@ -263,7 +262,7 @@ pub fn build_manual_seal_import_queue(
/// Builds a new service for a full client.
pub async fn new_full::Hash>>(
RunFullParams {
- mut config,
+ config,
eth_config,
rpc_config,
debug_output: _,
@@ -289,7 +288,7 @@ pub async fn new_full::Hash,
Network,
- >::new(&config.network);
+ >::new(
+ &config.network,
+ config.prometheus_config.as_ref().map(|cfg| cfg.registry.clone()),
+ );
let peer_store_handle = net_config.peer_store_handle();
let metrics = Network::register_notification_metrics(
@@ -321,13 +323,13 @@ pub async fn new_full| -> Result, sc_service::Error> {
+ let deny_unsafe = sc_rpc_api::DenyUnsafe::No;
+ let subscription_task_executor = spawner.clone();
+
let deps = crate::rpc::FullDeps {
client: client.clone(),
pool: pool.clone(),
@@ -507,8 +518,7 @@ pub async fn new_full {
@@ -599,7 +609,7 @@ pub async fn new_full {
+pub struct EthDeps {
/// The client instance to use.
pub client: Arc,
/// Transaction pool instance.
pub pool: Arc,
/// Graph pool instance.
- pub graph: Arc>,
+ pub graph: Arc,
/// Ethereum transaction converter.
pub converter: Option,
/// The Node authority flag
@@ -91,7 +93,7 @@ pub struct EthDeps {
pub pending_create_inherent_data_providers: CIDP,
}
-impl Clone for EthDeps {
+impl Clone for EthDeps {
fn clone(&self) -> Self {
Self {
client: self.client.clone(),
@@ -120,9 +122,10 @@ impl Clone for EthDeps(
+#[allow(dead_code, clippy::extra_unused_type_parameters)]
+pub fn create_eth(
mut io: RpcModule<()>,
- deps: EthDeps,
+ deps: EthDeps,
subscription_task_executor: SubscriptionTaskExecutor,
pubsub_notification_sinks: Arc<
fc_mapping_sync::EthereumBlockNotificationSinks<
@@ -137,13 +140,13 @@ where
+ BlockBuilderApi
+ ConvertTransactionRuntimeApi
+ EthereumRuntimeRPCApi,
- C::Api: rpc_primitives_debug::DebugRuntimeApi,
+ // TEMPORARY: Debug and Trace APIs have Hash type mismatches with stable2503
+ // C::Api: rpc_primitives_debug::DebugRuntimeApi,
C::Api: rpc_primitives_txpool::TxPoolRuntimeApi,
C: BlockchainEvents + StorageProvider + 'static,
C: HeaderBackend + HeaderMetadata + StorageProvider,
BE: Backend + 'static,
- P: TransactionPool + 'static,
- A: ChainApi + 'static,
+ P: TransactionPool + 'static,
CT: ConvertTransaction<::Extrinsic> + Send + Sync + 'static,
CIDP: CreateInherentDataProviders + Send + Sync + 'static,
EC: EthConfig,
@@ -156,8 +159,6 @@ where
use rpc_debug::{Debug, DebugServer};
use rpc_trace::{Trace, TraceServer};
- #[cfg(feature = "txpool")]
- use fc_rpc::{TxPool, TxPoolApiServer};
let EthDeps {
client,
pool,
@@ -176,7 +177,7 @@ where
fee_history_cache_limit,
execute_gas_limit_multiplier,
forced_parent_hashes,
- tracing_config,
+ tracing_config: _tracing_config,
pending_create_inherent_data_providers,
} = deps;
@@ -186,7 +187,7 @@ where
}
io.merge(
- Eth::::new(
+ Eth::::new(
client.clone(),
pool.clone(),
graph.clone(),
@@ -225,7 +226,7 @@ where
io.merge(
EthPubSub::new(
- pool,
+ pool.clone(),
client.clone(),
sync,
subscription_task_executor,
@@ -248,19 +249,20 @@ where
io.merge(Web3::new(client.clone()).into_rpc())?;
#[cfg(feature = "txpool")]
- io.merge(rpc_txpool::TxPool::new(Arc::clone(&client), graph).into_rpc())?;
+ io.merge(TxPoolServer::into_rpc(TxPool::new(Arc::clone(&client), pool)))?;
- if let Some(tracing_config) = tracing_config {
- if let Some(trace_filter_requester) = tracing_config.tracing_requesters.trace {
- io.merge(
- Trace::new(client, trace_filter_requester, tracing_config.trace_filter_max_count)
- .into_rpc(),
- )?;
- }
+ // TEMPORARY: Disabled due to H256 type mismatches with stable2503
+ // if let Some(tracing_config) = tracing_config {
+ // if let Some(trace_filter_requester) = tracing_config.tracing_requesters.trace {
+ // io.merge(
+ // Trace::new(client, trace_filter_requester, tracing_config.trace_filter_max_count)
+ // .into_rpc(),
+ // )?;
+ // }
- if let Some(debug_requester) = tracing_config.tracing_requesters.debug {
- io.merge(Debug::new(debug_requester).into_rpc())?;
- }
- }
+ // if let Some(debug_requester) = tracing_config.tracing_requesters.debug {
+ // io.merge(Debug::new(debug_requester).into_rpc())?;
+ // }
+ // }
Ok(io)
}
diff --git a/node/src/rpc/mod.rs b/node/src/rpc/mod.rs
index c3b6af435..450da0d3d 100644
--- a/node/src/rpc/mod.rs
+++ b/node/src/rpc/mod.rs
@@ -75,7 +75,7 @@ pub struct GrandpaDeps {
}
/// Full client dependencies.
-pub struct FullDeps {
+pub struct FullDeps {
/// The client instance to use.
pub client: Arc,
/// Transaction pool instance.
@@ -83,7 +83,7 @@ pub struct FullDeps {
/// Whether to deny unsafe calls
pub deny_unsafe: DenyUnsafe,
/// Ethereum-compatibility specific dependencies.
- pub eth: EthDeps,
+ pub eth: EthDeps,
/// BABE specific dependencies.
pub babe: Option,
/// The SelectChain Strategy
@@ -94,6 +94,7 @@ pub struct FullDeps {
pub backend: Arc,
}
+#[allow(dead_code)]
pub struct DefaultEthConfig(std::marker::PhantomData<(C, BE)>);
impl fc_rpc::EthConfig for DefaultEthConfig
@@ -108,8 +109,8 @@ where
/// Instantiate all Full RPC extensions.
#[cfg(feature = "testnet")]
-pub fn create_full(
- deps: FullDeps,
+pub fn create_full(
+ deps: FullDeps,
subscription_task_executor: SubscriptionTaskExecutor,
pubsub_notification_sinks: Arc<
fc_mapping_sync::EthereumBlockNotificationSinks<
@@ -132,7 +133,8 @@ where
C::Api: pallet_credits_rpc::CreditsRuntimeApi,
C::Api: fp_rpc::ConvertTransactionRuntimeApi,
C::Api: fp_rpc::EthereumRuntimeRPCApi,
- C::Api: rpc_primitives_debug::DebugRuntimeApi,
+ // TEMPORARY: Debug and Trace APIs have Hash type mismatches with stable2503
+ // C::Api: rpc_primitives_debug::DebugRuntimeApi,
C::Api: rpc_primitives_txpool::TxPoolRuntimeApi,
C::Api: BabeApi,
C: BlockchainEvents + 'static,
@@ -141,8 +143,7 @@ where
+ StorageProvider,
BE: Backend + 'static,
C::Api: pallet_ismp_runtime_api::IsmpRuntimeApi,
- P: TransactionPool + 'static,
- A: ChainApi + 'static,
+ P: TransactionPool + 'static,
CT: fp_rpc::ConvertTransaction<::Extrinsic> + Send + Sync + 'static,
SC: SelectChain + 'static,
B: sc_client_api::Backend + Send + Sync + 'static,
@@ -158,7 +159,7 @@ where
use substrate_frame_rpc_system::{System, SystemApiServer};
let mut io = RpcModule::new(());
- let FullDeps { client, pool, deny_unsafe, eth, babe, select_chain, grandpa, backend } = deps;
+ let FullDeps { client, pool, deny_unsafe: _, eth, babe, select_chain, grandpa, backend } = deps;
let GrandpaDeps {
shared_voter_state,
@@ -168,7 +169,7 @@ where
finality_provider,
} = grandpa;
- io.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
+ io.merge(System::new(client.clone(), pool).into_rpc())?;
io.merge(TransactionPayment::new(client.clone()).into_rpc())?;
io.merge(ServicesClient::new(client.clone()).into_rpc())?;
io.merge(RewardsClient::new(client.clone()).into_rpc())?;
@@ -177,10 +178,7 @@ where
if let Some(babe) = babe {
let BabeDeps { babe_worker_handle, keystore } = babe;
- io.merge(
- Babe::new(client.clone(), babe_worker_handle, keystore, select_chain, deny_unsafe)
- .into_rpc(),
- )?;
+ io.merge(Babe::new(client.clone(), babe_worker_handle, keystore, select_chain).into_rpc())?;
}
io.merge(
@@ -195,7 +193,7 @@ where
)?;
// Ethereum compatibility RPCs
- let io = create_eth::<_, _, _, _, _, _, _, DefaultEthConfig>(
+ let io = create_eth::<_, _, _, _, _, _, DefaultEthConfig>(
io,
eth,
subscription_task_executor,
@@ -207,8 +205,8 @@ where
/// Instantiate all Full RPC extensions.
#[cfg(not(feature = "testnet"))]
-pub fn create_full(
- deps: FullDeps,
+pub fn create_full(
+ deps: FullDeps,
subscription_task_executor: SubscriptionTaskExecutor,
pubsub_notification_sinks: Arc<
fc_mapping_sync::EthereumBlockNotificationSinks<
@@ -223,7 +221,8 @@ where
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi,
C::Api: fp_rpc::ConvertTransactionRuntimeApi,
C::Api: fp_rpc::EthereumRuntimeRPCApi,
- C::Api: rpc_primitives_debug::DebugRuntimeApi,
+ // TEMPORARY: Debug and Trace APIs have Hash type mismatches with stable2503
+ // C::Api: rpc_primitives_debug::DebugRuntimeApi,
C::Api: rpc_primitives_txpool::TxPoolRuntimeApi,
C::Api: BabeApi,
C: BlockchainEvents + 'static,
@@ -232,8 +231,7 @@ where
+ StorageProvider,
BE: Backend + 'static,
// C::Api: pallet_ismp_runtime_api::IsmpRuntimeApi,
- P: TransactionPool + 'static,
- A: ChainApi + 'static,
+ P: TransactionPool + 'static,
CT: fp_rpc::ConvertTransaction<::Extrinsic> + Send + Sync + 'static,
SC: SelectChain + 'static,
B: sc_client_api::Backend + Send + Sync + 'static,
@@ -263,10 +261,7 @@ where
if let Some(babe) = babe {
let BabeDeps { babe_worker_handle, keystore } = babe;
- io.merge(
- Babe::new(client.clone(), babe_worker_handle, keystore, select_chain, deny_unsafe)
- .into_rpc(),
- )?;
+ io.merge(Babe::new(client.clone(), babe_worker_handle, keystore, select_chain).into_rpc())?;
}
let GrandpaDeps {
@@ -277,7 +272,7 @@ where
finality_provider,
} = grandpa;
- io.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
+ io.merge(System::new(client.clone(), pool).into_rpc())?;
io.merge(TransactionPayment::new(client.clone()).into_rpc())?;
io.merge(ServicesClient::new(client.clone()).into_rpc())?;
io.merge(RewardsClient::new(client.clone()).into_rpc())?;
@@ -296,7 +291,7 @@ where
)?;
// Ethereum compatibility RPCs
- let io = create_eth::<_, _, _, _, _, _, _, DefaultEthConfig>(
+ let io = create_eth::<_, _, _, _, _, _, DefaultEthConfig>(
io,
eth,
subscription_task_executor,
diff --git a/node/src/rpc/tracing.rs b/node/src/rpc/tracing.rs
index 2ea205ce6..dbaf9efd3 100644
--- a/node/src/rpc/tracing.rs
+++ b/node/src/rpc/tracing.rs
@@ -32,74 +32,78 @@ use substrate_prometheus_endpoint::Registry as PrometheusRegistry;
use tokio::sync::Semaphore;
#[derive(Clone)]
+#[allow(dead_code)]
pub struct RpcRequesters {
pub debug: Option,
pub trace: Option,
}
// Spawn the tasks that are required to run a tracing node.
+// TEMPORARY: Disabled due to H256 type mismatches with stable2503
+#[allow(dead_code)]
pub fn spawn_tracing_tasks(
- task_manager: &TaskManager,
- client: Arc,
- backend: Arc,
- frontier_backend: Arc,
- overrides: Arc>,
- rpc_config: &RpcConfig,
- prometheus: Option,
+ _task_manager: &TaskManager,
+ _client: Arc,
+ _backend: Arc,
+ _frontier_backend: Arc,
+ _overrides: Arc