git.delta.rocks / unique-network / refs/commits / 502239632ae7

difftreelog

Migrate to Substrate v2.0.0 release

Greg Zaitsev2020-10-16parent: #0dbd5dd.patch.diff
in: master

13 files changed

modifiedCargo.lockdiffbeforeafterboth
before · Cargo.lock
599 packageslockfile v1
after · Cargo.lock
649 packageslockfile v1
modifiednode/Cargo.tomldiffbeforeafterboth
--- a/node/Cargo.toml
+++ b/node/Cargo.toml
@@ -1,7 +1,7 @@
 [build-dependencies.substrate-build-script-utils]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [[bin]]
 name = 'nft'
@@ -15,7 +15,7 @@
 license = 'Unlicense'
 name = 'nft'
 repository = 'https://github.com/substrate-developer-hub/nft/'
-version = '2.0.0-rc4'
+version = '2.0.0'
 
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
@@ -25,102 +25,133 @@
 log = '0.4.8'
 parking_lot = '0.10.0'
 structopt = '0.3.8'
-jsonrpc-core = '14.0.5'
+jsonrpc-core = '15.0.0'
 
 [dependencies.nft-runtime]
 path = '../runtime'
-version = '2.0.0-rc4'
+version = '2.0.0'
 
 [dependencies.sc-basic-authorship]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sc-cli]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sc-client-api]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sc-consensus]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.pallet-contracts-rpc]
 git = 'https://github.com/usetech-llc/substrate.git'
-version = '0.8.0-rc4'
-branch = 'rc4_ext_dispatch_reenabled'
+version = '0.8.0'
+branch = 'v2.0.0_release'
 
 [dependencies.sc-rpc]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
+version = '2.0.0'
+branch = 'v2.0.0_release'
+
+[dependencies.sp-api]
+git = 'https://github.com/usetech-llc/substrate.git'
+version = '2.0.0'
+branch = 'v2.0.0_release'
+
+[dependencies.sp-blockchain]
+git = 'https://github.com/usetech-llc/substrate.git'
+version = '2.0.0'
+branch = 'v2.0.0_release'
+
+[dependencies.sp-block-builder]
+git = 'https://github.com/usetech-llc/substrate.git'
+version = '2.0.0'
+branch = 'v2.0.0_release'
+
+[dependencies.sc-rpc-api]
+git = 'https://github.com/usetech-llc/substrate.git'
+version = '0.8.0'
+branch = 'v2.0.0_release'
+
+[dependencies.substrate-frame-rpc-system]
+git = 'https://github.com/usetech-llc/substrate.git'
+version = '2.0.0'
+branch = 'v2.0.0_release'
 
+[dependencies.pallet-transaction-payment-rpc]
+git = 'https://github.com/usetech-llc/substrate.git'
+version = '2.0.0'
+branch = 'v2.0.0_release'
+
 [dependencies.sc-consensus-aura]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sc-executor]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sc-finality-grandpa]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sc-network]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sc-service]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sc-transaction-pool]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-consensus]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sp-consensus-aura]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sp-core]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-finality-grandpa]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-inherents]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-runtime]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-transaction-pool]
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
modifiednode/src/chain_spec.rsdiffbeforeafterboth
--- a/node/src/chain_spec.rs
+++ b/node/src/chain_spec.rs
@@ -38,8 +38,8 @@
     (get_from_seed::<AuraId>(s), get_from_seed::<GrandpaId>(s))
 }
 
-pub fn development_config() -> ChainSpec {
-    ChainSpec::from_genesis(
+pub fn development_config() -> Result<ChainSpec, String> {
+    Ok(ChainSpec::from_genesis(
         "Development",
         "dev",
         ChainType::Development,
@@ -61,11 +61,11 @@
         None,
         None,
         None,
-    )
+    ))
 }
 
-pub fn local_testnet_config() -> ChainSpec {
-    ChainSpec::from_genesis(
+pub fn local_testnet_config() -> Result<ChainSpec, String> {
+    Ok(ChainSpec::from_genesis(
         "Local Testnet",
         "local_testnet",
         ChainType::Local,
@@ -98,7 +98,7 @@
         None,
         None,
         None,
-    )
+    ))
 }
 
 fn testnet_genesis(
modifiednode/src/cli.rsdiffbeforeafterboth
--- a/node/src/cli.rs
+++ b/node/src/cli.rs
@@ -1,11 +1,39 @@
-use sc_cli::{RunCmd, Subcommand};
 use structopt::StructOpt;
+use sc_cli::RunCmd;
 
 #[derive(Debug, StructOpt)]
 pub struct Cli {
-    #[structopt(subcommand)]
-    pub subcommand: Option<Subcommand>,
+	#[structopt(subcommand)]
+	pub subcommand: Option<Subcommand>,
+
+	#[structopt(flatten)]
+	pub run: RunCmd,
+}
+
+#[derive(Debug, StructOpt)]
+pub enum Subcommand {
+	/// Build a chain specification.
+	BuildSpec(sc_cli::BuildSpecCmd),
+
+	/// Validate blocks.
+	CheckBlock(sc_cli::CheckBlockCmd),
+
+	/// Export blocks.
+	ExportBlocks(sc_cli::ExportBlocksCmd),
+
+	/// Export the state of a given block into a chain spec.
+	ExportState(sc_cli::ExportStateCmd),
+
+	/// Import blocks.
+	ImportBlocks(sc_cli::ImportBlocksCmd),
 
-    #[structopt(flatten)]
-    pub run: RunCmd,
+	/// Remove the whole chain.
+	PurgeChain(sc_cli::PurgeChainCmd),
+
+	/// Revert the chain to a previous state.
+	Revert(sc_cli::RevertCmd),
+
+	// The custom benchmark subcommmand benchmarking runtime pallets.
+	// #[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
+	// Benchmark(frame_benchmarking_cli::BenchmarkCmd),
 }
modifiednode/src/command.rsdiffbeforeafterboth
--- a/node/src/command.rs
+++ b/node/src/command.rs
@@ -15,63 +15,121 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use crate::chain_spec;
-use crate::cli::Cli;
-use crate::service;
-use sc_cli::SubstrateCli;
+use crate::{chain_spec, service};
+use crate::cli::{Cli, Subcommand};
+use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec};
+use sc_service::PartialComponents;
+// use nft_runtime::Block;
 
 impl SubstrateCli for Cli {
-    fn impl_name() -> &'static str {
-        "Substrate Node"
-    }
+	fn impl_name() -> String {
+		"Substrate Node".into()
+	}
 
-    fn impl_version() -> &'static str {
-        env!("SUBSTRATE_CLI_IMPL_VERSION")
-    }
+	fn impl_version() -> String {
+		env!("SUBSTRATE_CLI_IMPL_VERSION").into()
+	}
 
-    fn description() -> &'static str {
-        env!("CARGO_PKG_DESCRIPTION")
-    }
+	fn description() -> String {
+		env!("CARGO_PKG_DESCRIPTION").into()
+	}
 
-    fn author() -> &'static str {
-        env!("CARGO_PKG_AUTHORS")
-    }
+	fn author() -> String {
+		env!("CARGO_PKG_AUTHORS").into()
+	}
 
-    fn support_url() -> &'static str {
-        "support.anonymous.an"
-    }
+	fn support_url() -> String {
+		"support.anonymous.an".into()
+	}
 
-    fn copyright_start_year() -> i32 {
-        2017
-    }
+	fn copyright_start_year() -> i32 {
+		2017
+	}
 
-    fn executable_name() -> &'static str {
-        env!("CARGO_PKG_NAME")
-    }
+	fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
+		Ok(match id {
+			"dev" => Box::new(chain_spec::development_config()?),
+			"" | "local" => Box::new(chain_spec::local_testnet_config()?),
+			path => Box::new(chain_spec::ChainSpec::from_json_file(
+				std::path::PathBuf::from(path),
+			)?),
+		})
+	}
 
-    fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
-        Ok(match id {
-            "dev" => Box::new(chain_spec::development_config()),
-            "" | "local" => Box::new(chain_spec::local_testnet_config()),
-            path => Box::new(chain_spec::ChainSpec::from_json_file(
-                std::path::PathBuf::from(path),
-            )?),
-        })
-    }
+	fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
+		&nft_runtime::VERSION
+	}
 }
 
 /// Parse and run command line arguments
 pub fn run() -> sc_cli::Result<()> {
-    let cli = Cli::from_args();
+	let cli = Cli::from_args();
+
+	match &cli.subcommand {
+		Some(Subcommand::BuildSpec(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
+		},
+		Some(Subcommand::CheckBlock(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, import_queue, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, import_queue), task_manager))
+			})
+		},
+		Some(Subcommand::ExportBlocks(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, config.database), task_manager))
+			})
+		},
+		Some(Subcommand::ExportState(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, config.chain_spec), task_manager))
+			})
+		},
+		Some(Subcommand::ImportBlocks(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, import_queue, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, import_queue), task_manager))
+			})
+		},
+		Some(Subcommand::PurgeChain(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.sync_run(|config| cmd.run(config.database))
+		},
+		Some(Subcommand::Revert(cmd)) => {
+			let runner = cli.create_runner(cmd)?;
+			runner.async_run(|config| {
+				let PartialComponents { client, task_manager, backend, ..}
+					= service::new_partial(&config)?;
+				Ok((cmd.run(client, backend), task_manager))
+			})
+		},
+		// Some(Subcommand::Benchmark(cmd)) => {
+		// 	if cfg!(feature = "runtime-benchmarks") {
+		// 		let runner = cli.create_runner(cmd)?;
 
-    match &cli.subcommand {
-        Some(subcommand) => {
-            let runner = cli.create_runner(subcommand)?;
-            runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0))
-        }
-        None => {
-            let runner = cli.create_runner(&cli.run)?;
-            runner.run_node(service::new_light, service::new_full, nft_runtime::VERSION)
-        }
-    }
+		// 		runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
+		// 	} else {
+		// 		Err("Benchmarking wasn't enabled when building the node. \
+		// 		You can enable it with `--features runtime-benchmarks`.".into())
+		// 	}
+		// },
+		None => {
+			let runner = cli.create_runner(&cli.run)?;
+			runner.run_node_until_exit(|config| match config.role {
+				Role::Light => service::new_light(config),
+				_ => service::new_full(config),
+			})
+		}
+	}
 }
addednode/src/lib.rsdiffbeforeafterboth
--- /dev/null
+++ b/node/src/lib.rs
@@ -0,0 +1,3 @@
+pub mod chain_spec;
+pub mod service;
+pub mod rpc;
modifiednode/src/main.rsdiffbeforeafterboth
--- a/node/src/main.rs
+++ b/node/src/main.rs
@@ -6,6 +6,7 @@
 mod service;
 mod cli;
 mod command;
+mod rpc;
 
 fn main() -> sc_cli::Result<()> {
     command::run()
addednode/src/rpc.rsdiffbeforeafterboth
--- /dev/null
+++ b/node/src/rpc.rs
@@ -0,0 +1,64 @@
+//! A collection of node-specific RPC methods.
+//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer
+//! used by Substrate nodes. This file extends those RPC definitions with
+//! capabilities that are specific to this project's runtime configuration.
+
+#![warn(missing_docs)]
+
+use std::sync::Arc;
+
+use nft_runtime::{opaque::Block, AccountId, Balance, Index};
+use sp_api::ProvideRuntimeApi;
+use sp_blockchain::{Error as BlockChainError, HeaderMetadata, HeaderBackend};
+use sp_block_builder::BlockBuilder;
+pub use sc_rpc_api::DenyUnsafe;
+use sp_transaction_pool::TransactionPool;
+
+
+/// Full client dependencies.
+pub struct FullDeps<C, P> {
+	/// The client instance to use.
+	pub client: Arc<C>,
+	/// Transaction pool instance.
+	pub pool: Arc<P>,
+	/// Whether to deny unsafe calls
+	pub deny_unsafe: DenyUnsafe,
+}
+
+/// Instantiate all full RPC extensions.
+pub fn create_full<C, P>(
+	deps: FullDeps<C, P>,
+) -> jsonrpc_core::IoHandler<sc_rpc::Metadata> where
+	C: ProvideRuntimeApi<Block>,
+	C: HeaderBackend<Block> + HeaderMetadata<Block, Error=BlockChainError> + 'static,
+	C: Send + Sync + 'static,
+	C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
+	C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
+	C::Api: BlockBuilder<Block>,
+	P: TransactionPool + 'static,
+{
+	use substrate_frame_rpc_system::{FullSystem, SystemApi};
+	use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
+
+	let mut io = jsonrpc_core::IoHandler::default();
+	let FullDeps {
+		client,
+		pool,
+		deny_unsafe,
+	} = deps;
+
+	io.extend_with(
+		SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))
+	);
+
+	io.extend_with(
+		TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))
+	);
+
+	// Extend this RPC with a custom API by using the following syntax.
+	// `YourRpcStruct` should have a reference to a client, which is needed
+	// to call into the runtime.
+	// `io.extend_with(YourRpcTrait::to_delegate(YourRpcStruct::new(ReferenceToClient, ...)));`
+
+	io
+}
modifiednode/src/service.rsdiffbeforeafterboth
--- a/node/src/service.rs
+++ b/node/src/service.rs
@@ -1,274 +1,303 @@
 //! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
 
+use std::sync::Arc;
+use std::time::Duration;
+use sc_client_api::{ExecutorProvider, RemoteBackend};
 use nft_runtime::{self, opaque::Block, RuntimeApi};
-use sc_client_api::ExecutorProvider;
-use sc_consensus::LongestChain;
+use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
+use sp_inherents::InherentDataProviders;
 use sc_executor::native_executor_instance;
 pub use sc_executor::NativeExecutor;
-use sc_finality_grandpa::{
-    FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState,
-    StorageAndProofProvider,
-};
-use sc_service::{error::Error as ServiceError, AbstractService, Configuration, ServiceBuilder};
-use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
-use sp_inherents::InherentDataProviders;
-use std::sync::Arc;
-use std::time::Duration;
+use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};
+use sc_finality_grandpa::{FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState};
 
 // Our native executor instance.
 native_executor_instance!(
-    pub Executor,
+	pub Executor,
     nft_runtime::api::dispatch,
     nft_runtime::native_version,
+	// frame_benchmarking::benchmarking::HostFunctions,
 );
 
-/// Starts a `ServiceBuilder` for a full service.
-///
-/// Use this macro if you don't actually need the full service, but just the builder in order to
-/// be able to perform chain operations.
-macro_rules! new_full_start {
-    ($config:expr) => {{
-        use jsonrpc_core::IoHandler;
-        use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
-        use std::sync::Arc;
-
-        let mut import_setup = None;
-        let inherent_data_providers = sp_inherents::InherentDataProviders::new();
+type FullClient = sc_service::TFullClient<Block, RuntimeApi, Executor>;
+type FullBackend = sc_service::TFullBackend<Block>;
+type FullSelectChain = sc_consensus::LongestChain<FullBackend, Block>;
 
-        let builder = sc_service::ServiceBuilder::new_full::<
-            nft_runtime::opaque::Block,
-            nft_runtime::RuntimeApi,
-            crate::service::Executor,
-        >($config)?
-        .with_select_chain(|_config, backend| Ok(sc_consensus::LongestChain::new(backend.clone())))?
-        .with_transaction_pool(|builder| {
-            let pool_api = sc_transaction_pool::FullChainApi::new(builder.client().clone());
-            Ok(sc_transaction_pool::BasicPool::new(
-                builder.config().transaction_pool.clone(),
-                std::sync::Arc::new(pool_api),
-                builder.prometheus_registry(),
-            ))
-        })?
-        .with_import_queue(
-            |_config, client, mut select_chain, _transaction_pool, spawn_task_handle, registry| {
-                let select_chain = select_chain
-                    .take()
-                    .ok_or_else(|| sc_service::Error::SelectChainRequired)?;
+pub fn new_partial(config: &Configuration) -> Result<sc_service::PartialComponents<
+	FullClient, FullBackend, FullSelectChain,
+	sp_consensus::DefaultImportQueue<Block, FullClient>,
+	sc_transaction_pool::FullPool<Block, FullClient>,
+	(
+		sc_consensus_aura::AuraBlockImport<
+			Block,
+			FullClient,
+			sc_finality_grandpa::GrandpaBlockImport<FullBackend, Block, FullClient, FullSelectChain>,
+			AuraPair
+		>,
+		sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>
+	)
+>, ServiceError> {
+	let inherent_data_providers = sp_inherents::InherentDataProviders::new();
 
-                let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
-                    client.clone(),
-                    &(client.clone() as Arc<_>),
-                    select_chain,
-                )?;
+	let (client, backend, keystore, task_manager) =
+		sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
+	let client = Arc::new(client);
 
-                let aura_block_import =
-                    sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(
-                        grandpa_block_import.clone(),
-                        client.clone(),
-                    );
+	let select_chain = sc_consensus::LongestChain::new(backend.clone());
 
-                let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
-                    sc_consensus_aura::slot_duration(&*client)?,
-                    aura_block_import,
-                    Some(Box::new(grandpa_block_import.clone())),
-                    None,
-                    client,
-                    inherent_data_providers.clone(),
-                    spawn_task_handle,
-                    registry,
-                )?;
+	let transaction_pool = sc_transaction_pool::BasicPool::new_full(
+		config.transaction_pool.clone(),
+		config.prometheus_registry(),
+		task_manager.spawn_handle(),
+		client.clone(),
+	);
 
-                import_setup = Some((grandpa_block_import, grandpa_link));
+	let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import(
+		client.clone(), &(client.clone() as Arc<_>), select_chain.clone(),
+	)?;
 
-                Ok(import_queue)
-            },
-        )?
-        .with_rpc_extensions(|builder| -> Result<IoHandler<sc_rpc::Metadata>, _> {
-            let handler = pallet_contracts_rpc::Contracts::new(builder.client().clone());
-            let delegate = pallet_contracts_rpc::ContractsApi::to_delegate(handler);
+	let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(
+		grandpa_block_import.clone(), client.clone(),
+	);
 
-            let mut io = IoHandler::default();
-            io.extend_with(delegate);
-            Ok(io)
-        })?;
+	let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>(
+		sc_consensus_aura::slot_duration(&*client)?,
+		aura_block_import.clone(),
+		Some(Box::new(grandpa_block_import.clone())),
+		None,
+		client.clone(),
+		inherent_data_providers.clone(),
+		&task_manager.spawn_handle(),
+		config.prometheus_registry(),
+		sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()),
+	)?;
 
-        (builder, import_setup, inherent_data_providers)
-    }};
+	Ok(sc_service::PartialComponents {
+		client, backend, task_manager, import_queue, keystore, select_chain, transaction_pool,
+		inherent_data_providers,
+		other: (aura_block_import, grandpa_link),
+	})
 }
 
 /// Builds a new service for a full client.
-pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceError> {
-    let role = config.role.clone();
-    let force_authoring = config.force_authoring;
-    let name = config.network.node_name.clone();
-    let disable_grandpa = config.disable_grandpa;
+pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
+	let sc_service::PartialComponents {
+		client, backend, mut task_manager, import_queue, keystore, select_chain, transaction_pool,
+		inherent_data_providers,
+		other: (block_import, grandpa_link),
+	} = new_partial(&config)?;
 
-    let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);
+	let finality_proof_provider =
+		GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
 
-    let (block_import, grandpa_link) = import_setup.take().expect(
-        "Link Half and Block Import are present for Full Services or setup failed before. qed",
-    );
+	let (network, network_status_sinks, system_rpc_tx, network_starter) =
+		sc_service::build_network(sc_service::BuildNetworkParams {
+			config: &config,
+			client: client.clone(),
+			transaction_pool: transaction_pool.clone(),
+			spawn_handle: task_manager.spawn_handle(),
+			import_queue,
+			on_demand: None,
+			block_announce_validator_builder: None,
+			finality_proof_request_builder: None,
+			finality_proof_provider: Some(finality_proof_provider.clone()),
+		})?;
 
-    let service = builder
-        .with_finality_proof_provider(|client, backend| {
-            // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
-            let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
-            Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
-        })?
-        .build_full()?;
+	if config.offchain_worker.enabled {
+		sc_service::build_offchain_workers(
+			&config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(),
+		);
+	}
 
-    if role.is_authority() {
-        let proposer = sc_basic_authorship::ProposerFactory::new(
-            service.client(),
-            service.transaction_pool(),
-            service.prometheus_registry().as_ref(),
-        );
+	let role = config.role.clone();
+	let force_authoring = config.force_authoring;
+	let name = config.network.node_name.clone();
+	let enable_grandpa = !config.disable_grandpa;
+	let prometheus_registry = config.prometheus_registry().cloned();
+	let telemetry_connection_sinks = sc_service::TelemetryConnectionSinks::default();
 
-        let client = service.client();
-        let select_chain = service
-            .select_chain()
-            .ok_or(ServiceError::SelectChainRequired)?;
+	let rpc_extensions_builder = {
+		let client = client.clone();
+		let pool = transaction_pool.clone();
 
-        let can_author_with =
-            sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
+		Box::new(move |deny_unsafe, _| {
+			let deps = crate::rpc::FullDeps {
+				client: client.clone(),
+				pool: pool.clone(),
+				deny_unsafe,
+			};
 
-        let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(
-            sc_consensus_aura::slot_duration(&*client)?,
-            client,
-            select_chain,
-            block_import,
-            proposer,
-            service.network(),
-            inherent_data_providers.clone(),
-            force_authoring,
-            service.keystore(),
-            can_author_with,
-        )?;
+			crate::rpc::create_full(deps)
+		})
+	};
 
-        // the AURA authoring task is considered essential, i.e. if it
-        // fails we take down the service with it.
-        service
-            .spawn_essential_task_handle()
-            .spawn_blocking("aura", aura);
-    }
+	sc_service::spawn_tasks(sc_service::SpawnTasksParams {
+		network: network.clone(),
+		client: client.clone(),
+		keystore: keystore.clone(),
+		task_manager: &mut task_manager,
+		transaction_pool: transaction_pool.clone(),
+		telemetry_connection_sinks: telemetry_connection_sinks.clone(),
+		rpc_extensions_builder: rpc_extensions_builder,
+		on_demand: None,
+		remote_blockchain: None,
+		backend, network_status_sinks, system_rpc_tx, config,
+	})?;
 
-    // if the node isn't actively participating in consensus then it doesn't
-    // need a keystore, regardless of which protocol we use below.
-    let keystore = if role.is_authority() {
-        Some(service.keystore() as sp_core::traits::BareCryptoStorePtr)
-    } else {
-        None
-    };
+	if role.is_authority() {
+		let proposer = sc_basic_authorship::ProposerFactory::new(
+			client.clone(),
+			transaction_pool,
+			prometheus_registry.as_ref(),
+		);
 
-    let grandpa_config = sc_finality_grandpa::Config {
-        // FIXME #1578 make this available through chainspec
-        gossip_duration: Duration::from_millis(333),
-        justification_period: 512,
-        name: Some(name),
-        observer_enabled: false,
-        keystore,
-        is_authority: role.is_network_authority(),
-    };
+		let can_author_with =
+			sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
 
-    let enable_grandpa = !disable_grandpa;
-    if enable_grandpa {
-        // start the full GRANDPA voter
-        // NOTE: non-authorities could run the GRANDPA observer protocol, but at
-        // this point the full voter should provide better guarantees of block
-        // and vote data availability than the observer. The observer has not
-        // been tested extensively yet and having most nodes in a network run it
-        // could lead to finality stalls.
-        let grandpa_config = sc_finality_grandpa::GrandpaParams {
-            config: grandpa_config,
-            link: grandpa_link,
-            network: service.network(),
-            inherent_data_providers: inherent_data_providers.clone(),
-            telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
-            voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
-            prometheus_registry: service.prometheus_registry(),
-            shared_voter_state: SharedVoterState::empty(),
-        };
+		let aura = sc_consensus_aura::start_aura::<_, _, _, _, _, AuraPair, _, _, _>(
+			sc_consensus_aura::slot_duration(&*client)?,
+			client.clone(),
+			select_chain,
+			block_import,
+			proposer,
+			network.clone(),
+			inherent_data_providers.clone(),
+			force_authoring,
+			keystore.clone(),
+			can_author_with,
+		)?;
+
+		// the AURA authoring task is considered essential, i.e. if it
+		// fails we take down the service with it.
+		task_manager.spawn_essential_handle().spawn_blocking("aura", aura);
+	}
+
+	// if the node isn't actively participating in consensus then it doesn't
+	// need a keystore, regardless of which protocol we use below.
+	let keystore = if role.is_authority() {
+		Some(keystore as sp_core::traits::BareCryptoStorePtr)
+	} else {
+		None
+	};
+
+	let grandpa_config = sc_finality_grandpa::Config {
+		// FIXME #1578 make this available through chainspec
+		gossip_duration: Duration::from_millis(333),
+		justification_period: 512,
+		name: Some(name),
+		observer_enabled: false,
+		keystore,
+		is_authority: role.is_network_authority(),
+	};
+
+	if enable_grandpa {
+		// start the full GRANDPA voter
+		// NOTE: non-authorities could run the GRANDPA observer protocol, but at
+		// this point the full voter should provide better guarantees of block
+		// and vote data availability than the observer. The observer has not
+		// been tested extensively yet and having most nodes in a network run it
+		// could lead to finality stalls.
+		let grandpa_config = sc_finality_grandpa::GrandpaParams {
+			config: grandpa_config,
+			link: grandpa_link,
+			network,
+			inherent_data_providers,
+			telemetry_on_connect: Some(telemetry_connection_sinks.on_connect_stream()),
+			voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(),
+			prometheus_registry,
+			shared_voter_state: SharedVoterState::empty(),
+		};
 
-        // the GRANDPA voter task is considered infallible, i.e.
-        // if it fails we take down the service with it.
-        service.spawn_essential_task_handle().spawn_blocking(
-            "grandpa-voter",
-            sc_finality_grandpa::run_grandpa_voter(grandpa_config)?,
-        );
-    } else {
-        sc_finality_grandpa::setup_disabled_grandpa(
-            service.client(),
-            &inherent_data_providers,
-            service.network(),
-        )?;
-    }
+		// the GRANDPA voter task is considered infallible, i.e.
+		// if it fails we take down the service with it.
+		task_manager.spawn_essential_handle().spawn_blocking(
+			"grandpa-voter",
+			sc_finality_grandpa::run_grandpa_voter(grandpa_config)?
+		);
+	} else {
+		sc_finality_grandpa::setup_disabled_grandpa(
+			client,
+			&inherent_data_providers,
+			network,
+		)?;
+	}
 
-    Ok(service)
+	network_starter.start_network();
+	Ok(task_manager)
 }
 
 /// Builds a new service for a light client.
-pub fn new_light(config: Configuration) -> Result<impl AbstractService, ServiceError> {
-    let inherent_data_providers = InherentDataProviders::new();
+pub fn new_light(config: Configuration) -> Result<TaskManager, ServiceError> {
+	let (client, backend, keystore, mut task_manager, on_demand) =
+		sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;
+
+	let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light(
+		config.transaction_pool.clone(),
+		config.prometheus_registry(),
+		task_manager.spawn_handle(),
+		client.clone(),
+		on_demand.clone(),
+	));
 
-    ServiceBuilder::new_light::<Block, RuntimeApi, Executor>(config)?
-        .with_select_chain(|_config, backend| Ok(LongestChain::new(backend.clone())))?
-        .with_transaction_pool(|builder| {
-            let fetcher = builder
-                .fetcher()
-                .ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
+	let grandpa_block_import = sc_finality_grandpa::light_block_import(
+		client.clone(), backend.clone(), &(client.clone() as Arc<_>),
+		Arc::new(on_demand.checker().clone()) as Arc<_>,
+	)?;
+	let finality_proof_import = grandpa_block_import.clone();
+	let finality_proof_request_builder =
+		finality_proof_import.create_finality_proof_request_builder();
+
+	let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>(
+		sc_consensus_aura::slot_duration(&*client)?,
+		grandpa_block_import,
+		None,
+		Some(Box::new(finality_proof_import)),
+		client.clone(),
+		InherentDataProviders::new(),
+		&task_manager.spawn_handle(),
+		config.prometheus_registry(),
+		sp_consensus::NeverCanAuthor,
+	)?;
 
-            let pool_api =
-                sc_transaction_pool::LightChainApi::new(builder.client().clone(), fetcher.clone());
-            let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
-                builder.config().transaction_pool.clone(),
-                Arc::new(pool_api),
-                builder.prometheus_registry(),
-                sc_transaction_pool::RevalidationType::Light,
-            );
-            Ok(pool)
-        })?
-        .with_import_queue_and_fprb(
-            |_config,
-             client,
-             backend,
-             fetcher,
-             _select_chain,
-             _tx_pool,
-             spawn_task_handle,
-             prometheus_registry| {
-                let fetch_checker = fetcher
-                    .map(|fetcher| fetcher.checker().clone())
-                    .ok_or_else(|| {
-                        "Trying to start light import queue without active fetch checker"
-                    })?;
-                let grandpa_block_import = sc_finality_grandpa::light_block_import(
-                    client.clone(),
-                    backend,
-                    &(client.clone() as Arc<_>),
-                    Arc::new(fetch_checker),
-                )?;
-                let finality_proof_import = grandpa_block_import.clone();
-                let finality_proof_request_builder =
-                    finality_proof_import.create_finality_proof_request_builder();
+	let finality_proof_provider =
+		GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone());
+
+	let (network, network_status_sinks, system_rpc_tx, network_starter) =
+		sc_service::build_network(sc_service::BuildNetworkParams {
+			config: &config,
+			client: client.clone(),
+			transaction_pool: transaction_pool.clone(),
+			spawn_handle: task_manager.spawn_handle(),
+			import_queue,
+			on_demand: Some(on_demand.clone()),
+			block_announce_validator_builder: None,
+			finality_proof_request_builder: Some(finality_proof_request_builder),
+			finality_proof_provider: Some(finality_proof_provider),
+		})?;
+
+	if config.offchain_worker.enabled {
+		sc_service::build_offchain_workers(
+			&config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(),
+		);
+	}
+
+	sc_service::spawn_tasks(sc_service::SpawnTasksParams {
+		remote_blockchain: Some(backend.remote_blockchain()),
+		transaction_pool,
+		task_manager: &mut task_manager,
+		on_demand: Some(on_demand),
+		rpc_extensions_builder: Box::new(|_, _| ()),
+		telemetry_connection_sinks: sc_service::TelemetryConnectionSinks::default(),
+		config,
+		client,
+		keystore,
+		backend,
+		network,
+		network_status_sinks,
+		system_rpc_tx,
+	 })?;
 
-                let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>(
-                    sc_consensus_aura::slot_duration(&*client)?,
-                    grandpa_block_import,
-                    None,
-                    Some(Box::new(finality_proof_import)),
-                    client,
-                    inherent_data_providers.clone(),
-                    spawn_task_handle,
-                    prometheus_registry,
-                )?;
+	 network_starter.start_network();
 
-                Ok((import_queue, finality_proof_request_builder))
-            },
-        )?
-        .with_finality_proof_provider(|client, backend| {
-            // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
-            let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
-            Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
-        })?
-        .build_light()
+	 Ok(task_manager)
 }
modifiedpallets/nft/Cargo.tomldiffbeforeafterboth
--- a/pallets/nft/Cargo.toml
+++ b/pallets/nft/Cargo.toml
@@ -7,31 +7,31 @@
 [dependencies.frame-support]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.frame-system]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 [dev-dependencies.sp-core]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dev-dependencies.sp-io]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-runtime]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 	
 [dependencies]
 # third-party dependencies
@@ -41,15 +41,15 @@
 [dependencies.sp-std]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.transaction-payment]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-transaction-payment'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [package]
 authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
@@ -59,7 +59,7 @@
 license = 'Unlicense'
 name = 'pallet-nft'
 repository = 'https://github.com/substrate-developer-hub/nft/'
-version = '2.0.0-rc4'
+version = '2.0.0'
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
 
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -1718,7 +1718,7 @@
 impl<T: Trait + transaction_payment::Trait + Send + Sync> ChargeTransactionPayment<T>
 where
     T::Call:
-        Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Module<T>, T>,
+        Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Call<T>>,
     BalanceOf<T>: Send + Sync + FixedPointOperand,
 {
     /// utility constructor. Used only in client/factory code.
@@ -1855,8 +1855,7 @@
     for ChargeTransactionPayment<T>
 where
     BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
-    T::Call:
-        Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Module<T>, T>,
+    T::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Call<T>>,
 {
     const IDENTIFIER: &'static str = "ChargeTransactionPayment";
     type AccountId = T::AccountId;
modifiedruntime/Cargo.tomldiffbeforeafterboth
--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -2,15 +2,15 @@
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-aura'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.balances]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-balances'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.codec]
 default-features = false
@@ -22,48 +22,48 @@
 git = 'https://github.com/usetech-llc/substrate.git'
 default-features = false
 package = 'pallet-contracts'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.contracts-primitives]
 git = 'https://github.com/usetech-llc/substrate.git'
 default-features = false
 package = 'pallet-contracts-primitives'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.contracts-rpc-runtime-api]
 git = 'https://github.com/usetech-llc/substrate.git'
 default-features = false
 package = 'pallet-contracts-rpc-runtime-api'
-version = '0.8.0-rc4'
-branch = 'rc4_ext_dispatch_reenabled'
+version = '0.8.0'
+branch = 'v2.0.0_release'
 
 [dependencies.frame-executive]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.frame-support]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.grandpa]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-grandpa'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.randomness-collective-flip]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-randomness-collective-flip'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.serde]
 features = ['derive']
@@ -73,113 +73,121 @@
 [dependencies.sp-api]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-block-builder]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-consensus-aura]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '0.8.0-rc4'
+branch = 'v2.0.0_release'
+version = '0.8.0'
 
 [dependencies.sp-core]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-inherents]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
-
-[dependencies.sp-io]
-default-features = false
-git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-offchain]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-runtime]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-session]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-std]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-transaction-pool]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sp-version]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.sudo]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-sudo'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.system]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'frame-system'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.nft]
 default-features = false
 package = 'pallet-nft'
 path = '../pallets/nft'
-version = '2.0.0-rc4'
+version = '2.0.0'
 
 [dependencies.timestamp]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-timestamp'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
 
 [dependencies.transaction-payment]
 default-features = false
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'pallet-transaction-payment'
-branch = 'rc4_ext_dispatch_reenabled'
-version = '2.0.0-rc4'
+branch = 'v2.0.0_release'
+version = '2.0.0'
+
+[dependencies.frame-system-rpc-runtime-api]
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+version = '2.0.0'
+branch = 'v2.0.0_release'
+
+[dependencies.transaction-payment-rpc-runtime-api]
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+package = 'pallet-transaction-payment-rpc-runtime-api'
+version = '2.0.0'
+branch = 'v2.0.0_release'
+
 [build-dependencies.wasm-builder-runner]
 git = 'https://github.com/usetech-llc/substrate.git'
 package = 'substrate-wasm-builder-runner'
-branch = 'rc4_ext_dispatch_reenabled'
 version = '1.0.5'
+branch = 'v2.0.0_release'
 
 [package]
 authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
@@ -188,7 +196,8 @@
 license = 'Unlicense'
 name = 'nft-runtime'
 repository = 'https://github.com/usetech-llc/nft_parachain/'
-version = '2.0.0-rc4'
+version = '2.0.0'
+
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
 
@@ -203,6 +212,7 @@
     'contracts-rpc-runtime-api/std',
     'frame-executive/std',
     'frame-support/std',
+    'frame-system-rpc-runtime-api/std',
     'grandpa/std',
     'randomness-collective-flip/std',
     'serde',
@@ -211,7 +221,6 @@
     'sp-consensus-aura/std',
     'sp-core/std',
     'sp-inherents/std',
-    'sp-io/std',
     'sp-offchain/std',
     'sp-runtime/std',
     'sp-session/std',
@@ -222,5 +231,6 @@
     'system/std',
     'timestamp/std',
     'transaction-payment/std',
+    'transaction-payment-rpc-runtime-api/std',
     'nft/std',
 ]
modifiedruntime/src/lib.rsdiffbeforeafterboth
--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -194,15 +194,16 @@
     type AvailableBlockRatio = AvailableBlockRatio;
     /// Version of the runtime.
     type Version = Version;
-    /// Converts a module to the index of the module in `construct_runtime!`.
-    /// This type is being generated by `construct_runtime!`.
-    type ModuleToIndex = ModuleToIndex;
+ 	/// This type is being generated by `construct_runtime!`.
+    type PalletInfo = PalletInfo;
     /// What to do if a new account is created.
     type OnNewAccount = ();
     /// What to do if an account is fully reaped from the system.
     type OnKilledAccount = ();
     /// The data to be stored in an account.
     type AccountData = balances::AccountData<Balance>;
+	/// Weight information for the extrinsics of this pallet.
+	type SystemWeightInfo = ();
 }
 
 impl aura::Trait for Runtime {
@@ -210,20 +211,22 @@
 }
 
 impl grandpa::Trait for Runtime {
-    type Event = Event;
-    type Call = Call;
+	type Event = Event;
+	type Call = Call;
 
-    type KeyOwnerProofSystem = ();
+	type KeyOwnerProofSystem = ();
 
-    type KeyOwnerProof =
-        <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
+	type KeyOwnerProof =
+		<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
 
-    type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
-        KeyTypeId,
-        GrandpaId,
-    )>>::IdentificationTuple;
+	type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
+		KeyTypeId,
+		GrandpaId,
+	)>>::IdentificationTuple;
 
-    type HandleEquivocation = ();
+	type HandleEquivocation = ();
+
+	type WeightInfo = ();
 }
 
 parameter_types! {
@@ -231,25 +234,29 @@
 }
 
 impl timestamp::Trait for Runtime {
-    /// A timestamp: milliseconds since the unix epoch.
-    type Moment = u64;
-    type OnTimestampSet = Aura;
-    type MinimumPeriod = MinimumPeriod;
+	/// A timestamp: milliseconds since the unix epoch.
+	type Moment = u64;
+	type OnTimestampSet = Aura;
+	type MinimumPeriod = MinimumPeriod;
+	type WeightInfo = ();
 }
 
 parameter_types! {
     // pub const ExistentialDeposit: u128 = 500;
     pub const ExistentialDeposit: u128 = 0;
+	pub const MaxLocks: u32 = 50;
 }
 
 impl balances::Trait for Runtime {
-    /// The type for recording an account's balance.
-    type Balance = Balance;
-    /// The ubiquitous event type.
-    type Event = Event;
-    type DustRemoval = ();
-    type ExistentialDeposit = ExistentialDeposit;
-    type AccountStore = System;
+	type MaxLocks = MaxLocks;
+	/// The type for recording an account's balance.
+	type Balance = Balance;
+	/// The ubiquitous event type.
+	type Event = Event;
+	type DustRemoval = ();
+	type ExistentialDeposit = ExistentialDeposit;
+	type AccountStore = System;
+	type WeightInfo = ();
 }
 
 pub const MILLICENTS: Balance = 1_000_000_000;
@@ -264,23 +271,22 @@
 }
 
 impl contracts::Trait for Runtime {
-    type Call = Call;
-    type Time = Timestamp;
-    type Randomness = RandomnessCollectiveFlip;
-    type Currency = Balances;
-    type Event = Event;
-    type DetermineContractAddress = contracts::SimpleAddressDeterminer<Runtime>;
-    type TrieIdGenerator = contracts::TrieIdFromParentCounter<Runtime>;
-    type RentPayment = ();
-    type SignedClaimHandicap = contracts::DefaultSignedClaimHandicap;
-    type TombstoneDeposit = TombstoneDeposit;
-    type StorageSizeOffset = contracts::DefaultStorageSizeOffset;
-    type RentByteFee = RentByteFee;
-    type RentDepositOffset = RentDepositOffset;
-    type SurchargeReward = SurchargeReward;
-    type MaxDepth = contracts::DefaultMaxDepth;
-    type MaxValueSize = contracts::DefaultMaxValueSize;
-    type WeightPrice = transaction_payment::Module<Self>;
+	type Time = Timestamp;
+	type Randomness = RandomnessCollectiveFlip;
+	type Currency = Balances;
+	type Event = Event;
+	type DetermineContractAddress = contracts::SimpleAddressDeterminer<Runtime>;
+	type TrieIdGenerator = contracts::TrieIdFromParentCounter<Runtime>;
+	type RentPayment = ();
+	type SignedClaimHandicap = contracts::DefaultSignedClaimHandicap;
+	type TombstoneDeposit = TombstoneDeposit;
+	type StorageSizeOffset = contracts::DefaultStorageSizeOffset;
+	type RentByteFee = RentByteFee;
+	type RentDepositOffset = RentDepositOffset;
+	type SurchargeReward = SurchargeReward;
+	type MaxDepth = contracts::DefaultMaxDepth;
+	type MaxValueSize = contracts::DefaultMaxValueSize;
+	type WeightPrice = transaction_payment::Module<Self>;
 }
 
 parameter_types! {
@@ -315,7 +321,7 @@
         RandomnessCollectiveFlip: randomness_collective_flip::{Module, Call, Storage},
         Contracts: contracts::{Module, Call, Config, Storage, Event<T>},
         Timestamp: timestamp::{Module, Call, Storage, Inherent},
-        Aura: aura::{Module, Config<T>, Inherent(Timestamp)},
+        Aura: aura::{Module, Config<T>, Inherent},
         Grandpa: grandpa::{Module, Call, Storage, Config, Event},
         Balances: balances::{Module, Call, Storage, Config<T>, Event<T>},
         TransactionPayment: transaction_payment::{Module, Storage},
@@ -364,15 +370,16 @@
             gas_limit: u64,
             input_data: Vec<u8>,
         ) -> ContractExecResult {
-            let exec_result =
-                Contracts::bare_call(origin, dest.into(), value, gas_limit, input_data);
-            match exec_result {
-                Ok(v) => ContractExecResult::Success {
-                    status: v.status,
-                    data: v.data,
-                },
-                Err(_) => ContractExecResult::Error,
-            }
+			let (exec_result, gas_consumed) =
+				Contracts::bare_call(origin, dest.into(), value, gas_limit, input_data);
+			match exec_result {
+				Ok(v) => ContractExecResult::Success {
+					flags: v.flags.bits(),
+					data: v.data,
+					gas_consumed: gas_consumed,
+				},
+				Err(_) => ContractExecResult::Error,
+			}
         }
 
         fn get_storage(
@@ -471,29 +478,45 @@
         }
     }
 
-    impl fg_primitives::GrandpaApi<Block> for Runtime {
-        fn grandpa_authorities() -> GrandpaAuthorityList {
-            Grandpa::grandpa_authorities()
-        }
+	impl fg_primitives::GrandpaApi<Block> for Runtime {
+		fn grandpa_authorities() -> GrandpaAuthorityList {
+			Grandpa::grandpa_authorities()
+		}
 
-        fn submit_report_equivocation_extrinsic(
-            _equivocation_proof: fg_primitives::EquivocationProof<
-                <Block as BlockT>::Hash,
-                NumberFor<Block>,
-            >,
-            _key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
-        ) -> Option<()> {
-            None
-        }
+		fn submit_report_equivocation_unsigned_extrinsic(
+			_equivocation_proof: fg_primitives::EquivocationProof<
+				<Block as BlockT>::Hash,
+				NumberFor<Block>,
+			>,
+			_key_owner_proof: fg_primitives::OpaqueKeyOwnershipProof,
+		) -> Option<()> {
+			None
+		}
 
-        fn generate_key_ownership_proof(
-            _set_id: fg_primitives::SetId,
-            _authority_id: GrandpaId,
-        ) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
-            // NOTE: this is the only implementation possible since we've
-            // defined our key owner proof type as a bottom type (i.e. a type
-            // with no values).
-            None
-        }
+		fn generate_key_ownership_proof(
+			_set_id: fg_primitives::SetId,
+			_authority_id: GrandpaId,
+		) -> Option<fg_primitives::OpaqueKeyOwnershipProof> {
+			// NOTE: this is the only implementation possible since we've
+			// defined our key owner proof type as a bottom type (i.e. a type
+			// with no values).
+			None
+		}
     }
+    
+	impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {
+		fn account_nonce(account: AccountId) -> Index {
+			System::account_nonce(account)
+		}
+	}
+
+	impl transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {
+		fn query_info(
+			uxt: <Block as BlockT>::Extrinsic,
+			len: u32,
+		) -> transaction_payment_rpc_runtime_api::RuntimeDispatchInfo<Balance> {
+			TransactionPayment::query_info(uxt, len)
+		}
+	}
+
 }