From 7aa51f8d30fb1be3a4476ea2cc1999536feebee5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= <tomusdrw@users.noreply.github.com>
Date: Tue, 16 Feb 2021 07:10:01 +0100
Subject: [PATCH] Update to latest substrate (#723)

* Bump substrate deps.

* Bump scale.

* Bump ethabi.

* Remove inherent from aura.

* Migrate to construct_runtime

* cargo fmt --all
---
 bridges/bin/millau/node/Cargo.toml            |  1 -
 bridges/bin/millau/node/src/service.rs        | 13 ++--
 bridges/bin/millau/runtime/Cargo.toml         |  2 +-
 bridges/bin/millau/runtime/src/lib.rs         |  2 +-
 bridges/bin/rialto/node/src/service.rs        | 13 ++--
 bridges/bin/rialto/runtime/Cargo.toml         |  2 +-
 bridges/bin/rialto/runtime/src/lib.rs         |  2 +-
 bridges/bin/runtime-common/Cargo.toml         |  2 +-
 bridges/modules/call-dispatch/Cargo.toml      |  3 +-
 bridges/modules/call-dispatch/src/lib.rs      | 76 ++++++++++---------
 bridges/modules/currency-exchange/Cargo.toml  |  2 +-
 bridges/modules/currency-exchange/src/lib.rs  | 26 ++++---
 .../ethereum-contract/builtin/Cargo.toml      |  4 +-
 bridges/modules/ethereum/Cargo.toml           |  2 +-
 bridges/modules/ethereum/src/mock.rs          | 29 ++++---
 bridges/modules/finality-verifier/Cargo.toml  |  4 +-
 bridges/modules/finality-verifier/src/mock.rs | 28 ++++---
 bridges/modules/message-lane/Cargo.toml       |  2 +-
 bridges/modules/message-lane/src/lib.rs       | 10 +--
 bridges/modules/message-lane/src/mock.rs      | 38 +++++-----
 .../modules/shift-session-manager/Cargo.toml  |  3 +-
 .../modules/shift-session-manager/src/lib.rs  | 23 ++++--
 bridges/modules/substrate/Cargo.toml          |  4 +-
 bridges/modules/substrate/src/mock.rs         | 23 ++++--
 .../primitives/currency-exchange/Cargo.toml   |  2 +-
 bridges/primitives/ethereum-poa/Cargo.toml    |  4 +-
 bridges/primitives/header-chain/Cargo.toml    |  4 +-
 .../primitives/message-dispatch/Cargo.toml    |  2 +-
 bridges/primitives/message-lane/Cargo.toml    |  2 +-
 bridges/primitives/millau/Cargo.toml          |  4 +-
 bridges/primitives/runtime/Cargo.toml         |  2 +-
 bridges/primitives/test-utils/Cargo.toml      |  2 +-
 bridges/relays/ethereum-client/Cargo.toml     |  4 +-
 bridges/relays/ethereum/Cargo.toml            |  8 +-
 bridges/relays/kusama-client/Cargo.toml       |  2 +-
 bridges/relays/millau-client/Cargo.toml       |  2 +-
 bridges/relays/polkadot-client/Cargo.toml     |  2 +-
 bridges/relays/rialto-client/Cargo.toml       |  2 +-
 bridges/relays/substrate-client/Cargo.toml    |  2 +-
 bridges/relays/substrate-client/src/error.rs  |  2 +-
 bridges/relays/substrate/Cargo.toml           |  2 +-
 41 files changed, 200 insertions(+), 162 deletions(-)

diff --git a/bridges/bin/millau/node/Cargo.toml b/bridges/bin/millau/node/Cargo.toml
index f1e59a45243..a03078163a1 100644
--- a/bridges/bin/millau/node/Cargo.toml
+++ b/bridges/bin/millau/node/Cargo.toml
@@ -38,7 +38,6 @@ sc-keystore = { git = "https://github.com/paritytech/substrate.git", branch = "m
 sc-service = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
 sc-rpc = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
 sc-transaction-pool = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
-sc-telemetry = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
 sp-consensus = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
 sp-consensus-aura = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
 sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
diff --git a/bridges/bin/millau/node/src/service.rs b/bridges/bin/millau/node/src/service.rs
index aef79d9170b..6727ee682d8 100644
--- a/bridges/bin/millau/node/src/service.rs
+++ b/bridges/bin/millau/node/src/service.rs
@@ -35,7 +35,6 @@ pub use sc_executor::NativeExecutor;
 use sc_finality_grandpa::SharedVoterState;
 use sc_keystore::LocalKeystore;
 use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
-use sc_telemetry::TelemetrySpan;
 use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
 use sp_inherents::InherentDataProviders;
 use std::sync::Arc;
@@ -71,7 +70,6 @@ pub fn new_partial(
 				AuraPair,
 			>,
 			sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
-			Option<TelemetrySpan>,
 		),
 	>,
 	ServiceError,
@@ -81,7 +79,7 @@ pub fn new_partial(
 	}
 	let inherent_data_providers = sp_inherents::InherentDataProviders::new();
 
-	let (client, backend, keystore_container, task_manager, telemetry_span) =
+	let (client, backend, keystore_container, task_manager) =
 		sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
 	let client = Arc::new(client);
 
@@ -89,6 +87,7 @@ pub fn new_partial(
 
 	let transaction_pool = sc_transaction_pool::BasicPool::new_full(
 		config.transaction_pool.clone(),
+		config.role.is_authority().into(),
 		config.prometheus_registry(),
 		task_manager.spawn_handle(),
 		client.clone(),
@@ -120,7 +119,7 @@ pub fn new_partial(
 		select_chain,
 		transaction_pool,
 		inherent_data_providers,
-		other: (aura_block_import, grandpa_link, telemetry_span),
+		other: (aura_block_import, grandpa_link),
 	})
 }
 
@@ -142,7 +141,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
 		select_chain,
 		transaction_pool,
 		inherent_data_providers,
-		other: (block_import, grandpa_link, telemetry_span),
+		other: (block_import, grandpa_link),
 	} = new_partial(&config)?;
 
 	if let Some(url) = &config.keystore_remote {
@@ -276,7 +275,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
 		network_status_sinks,
 		system_rpc_tx,
 		config,
-		telemetry_span,
 	})?;
 
 	if role.is_authority() {
@@ -356,7 +354,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
 
 /// Builds a new service for a light client.
 pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError> {
-	let (client, backend, keystore_container, mut task_manager, on_demand, telemetry_span) =
+	let (client, backend, keystore_container, mut task_manager, on_demand) =
 		sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;
 
 	config
@@ -425,7 +423,6 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
 		network,
 		network_status_sinks,
 		system_rpc_tx,
-		telemetry_span,
 	})?;
 
 	network_starter.start_network();
diff --git a/bridges/bin/millau/runtime/Cargo.toml b/bridges/bin/millau/runtime/Cargo.toml
index 358537e32fa..3173294bec7 100644
--- a/bridges/bin/millau/runtime/Cargo.toml
+++ b/bridges/bin/millau/runtime/Cargo.toml
@@ -8,7 +8,7 @@ repository = "https://github.com/paritytech/parity-bridges-common/"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
 hex-literal = "0.3"
 serde = { version = "1.0.123", optional = true, features = ["derive"] }
 
diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs
index bd261f4e918..7a4bcae9668 100644
--- a/bridges/bin/millau/runtime/src/lib.rs
+++ b/bridges/bin/millau/runtime/src/lib.rs
@@ -373,7 +373,7 @@ construct_runtime!(
 		System: frame_system::{Module, Call, Config, Storage, Event<T>},
 		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
 		Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
-		Aura: pallet_aura::{Module, Config<T>, Inherent},
+		Aura: pallet_aura::{Module, Config<T>},
 		Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
 		Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
 		TransactionPayment: pallet_transaction_payment::{Module, Storage},
diff --git a/bridges/bin/rialto/node/src/service.rs b/bridges/bin/rialto/node/src/service.rs
index f54e43b16da..fdac6d23279 100644
--- a/bridges/bin/rialto/node/src/service.rs
+++ b/bridges/bin/rialto/node/src/service.rs
@@ -35,7 +35,6 @@ pub use sc_executor::NativeExecutor;
 use sc_finality_grandpa::SharedVoterState;
 use sc_keystore::LocalKeystore;
 use sc_service::{error::Error as ServiceError, Configuration, TaskManager};
-use sc_telemetry::TelemetrySpan;
 use sp_consensus_aura::sr25519::AuthorityPair as AuraPair;
 use sp_inherents::InherentDataProviders;
 use std::sync::Arc;
@@ -71,7 +70,6 @@ pub fn new_partial(
 				AuraPair,
 			>,
 			sc_finality_grandpa::LinkHalf<Block, FullClient, FullSelectChain>,
-			Option<TelemetrySpan>,
 		),
 	>,
 	ServiceError,
@@ -81,7 +79,7 @@ pub fn new_partial(
 	}
 	let inherent_data_providers = sp_inherents::InherentDataProviders::new();
 
-	let (client, backend, keystore_container, task_manager, telemetry_span) =
+	let (client, backend, keystore_container, task_manager) =
 		sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
 	let client = Arc::new(client);
 
@@ -89,6 +87,7 @@ pub fn new_partial(
 
 	let transaction_pool = sc_transaction_pool::BasicPool::new_full(
 		config.transaction_pool.clone(),
+		config.role.is_authority().into(),
 		config.prometheus_registry(),
 		task_manager.spawn_handle(),
 		client.clone(),
@@ -120,7 +119,7 @@ pub fn new_partial(
 		select_chain,
 		transaction_pool,
 		inherent_data_providers,
-		other: (aura_block_import, grandpa_link, telemetry_span),
+		other: (aura_block_import, grandpa_link),
 	})
 }
 
@@ -142,7 +141,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
 		select_chain,
 		transaction_pool,
 		inherent_data_providers,
-		other: (block_import, grandpa_link, telemetry_span),
+		other: (block_import, grandpa_link),
 	} = new_partial(&config)?;
 
 	if let Some(url) = &config.keystore_remote {
@@ -276,7 +275,6 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
 		network_status_sinks,
 		system_rpc_tx,
 		config,
-		telemetry_span,
 	})?;
 
 	if role.is_authority() {
@@ -356,7 +354,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
 
 /// Builds a new service for a light client.
 pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError> {
-	let (client, backend, keystore_container, mut task_manager, on_demand, telemetry_span) =
+	let (client, backend, keystore_container, mut task_manager, on_demand) =
 		sc_service::new_light_parts::<Block, RuntimeApi, Executor>(&config)?;
 
 	config
@@ -425,7 +423,6 @@ pub fn new_light(mut config: Configuration) -> Result<TaskManager, ServiceError>
 		network,
 		network_status_sinks,
 		system_rpc_tx,
-		telemetry_span,
 	})?;
 
 	network_starter.start_network();
diff --git a/bridges/bin/rialto/runtime/Cargo.toml b/bridges/bin/rialto/runtime/Cargo.toml
index ebd259aa503..712092ea066 100644
--- a/bridges/bin/rialto/runtime/Cargo.toml
+++ b/bridges/bin/rialto/runtime/Cargo.toml
@@ -8,7 +8,7 @@ repository = "https://github.com/paritytech/parity-bridges-common/"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
 hex-literal = "0.3"
 libsecp256k1 = { version = "0.3.4", optional = true, default-features = false, features = ["hmac"] }
 serde = { version = "1.0.123", optional = true, features = ["derive"] }
diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs
index 84055f92a62..fc6ae5b01b4 100644
--- a/bridges/bin/rialto/runtime/src/lib.rs
+++ b/bridges/bin/rialto/runtime/src/lib.rs
@@ -484,7 +484,7 @@ construct_runtime!(
 		System: frame_system::{Module, Call, Config, Storage, Event<T>},
 		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
 		Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
-		Aura: pallet_aura::{Module, Config<T>, Inherent},
+		Aura: pallet_aura::{Module, Config<T>},
 		Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
 		Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
 		TransactionPayment: pallet_transaction_payment::{Module, Storage},
diff --git a/bridges/bin/runtime-common/Cargo.toml b/bridges/bin/runtime-common/Cargo.toml
index 99cc02c20ba..1a6a5db5370 100644
--- a/bridges/bin/runtime-common/Cargo.toml
+++ b/bridges/bin/runtime-common/Cargo.toml
@@ -8,7 +8,7 @@ repository = "https://github.com/paritytech/parity-bridges-common/"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
 ed25519-dalek = { version = "1.0", default-features = false, optional = true }
 hash-db = { version = "0.15.2", default-features = false }
 
diff --git a/bridges/modules/call-dispatch/Cargo.toml b/bridges/modules/call-dispatch/Cargo.toml
index 9c25e3a8eb1..9b4c0bfeea4 100644
--- a/bridges/modules/call-dispatch/Cargo.toml
+++ b/bridges/modules/call-dispatch/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 
 # Bridge dependencies
 
@@ -24,6 +24,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "ma
 
 [dev-dependencies]
 sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
+serde = "1.0"
 
 [features]
 default = ["std"]
diff --git a/bridges/modules/call-dispatch/src/lib.rs b/bridges/modules/call-dispatch/src/lib.rs
index 53466607acc..5eeca178d14 100644
--- a/bridges/modules/call-dispatch/src/lib.rs
+++ b/bridges/modules/call-dispatch/src/lib.rs
@@ -395,7 +395,7 @@ where
 #[cfg(test)]
 mod tests {
 	use super::*;
-	use frame_support::{impl_outer_dispatch, impl_outer_event, impl_outer_origin, parameter_types, weights::Weight};
+	use frame_support::{parameter_types, weights::Weight};
 	use frame_system::{EventRecord, Phase};
 	use sp_core::H256;
 	use sp_runtime::{
@@ -405,9 +405,6 @@ mod tests {
 	};
 
 	type AccountId = u64;
-	type CallDispatch = Module<TestRuntime>;
-	type System = frame_system::Module<TestRuntime>;
-
 	type MessageId = [u8; 4];
 
 	#[derive(Debug, Encode, Decode, Clone, PartialEq, Eq)]
@@ -440,28 +437,19 @@ mod tests {
 		}
 	}
 
-	#[derive(Clone, Eq, PartialEq)]
-	pub struct TestRuntime;
+	type Block = frame_system::mocking::MockBlock<TestRuntime>;
+	type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
 
-	mod call_dispatch {
-		pub use crate::Event;
-	}
+	use crate as call_dispatch;
 
-	impl_outer_event! {
-		pub enum TestEvent for TestRuntime {
-			frame_system<T>,
-			call_dispatch<T>,
-		}
-	}
-
-	impl_outer_origin! {
-		pub enum Origin for TestRuntime where system = frame_system {}
-	}
-
-	impl_outer_dispatch! {
-		pub enum Call for TestRuntime where origin: Origin {
-			frame_system::System,
-			call_dispatch::CallDispatch,
+	frame_support::construct_runtime! {
+		pub enum TestRuntime where
+			Block = Block,
+			NodeBlock = Block,
+			UncheckedExtrinsic = UncheckedExtrinsic,
+		{
+			System: frame_system::{Module, Call, Config, Storage, Event<T>},
+			CallDispatch: call_dispatch::{Module, Call, Event<T>},
 		}
 	}
 
@@ -482,10 +470,10 @@ mod tests {
 		type AccountId = AccountId;
 		type Lookup = IdentityLookup<Self::AccountId>;
 		type Header = Header;
-		type Event = TestEvent;
+		type Event = Event;
 		type BlockHashCount = BlockHashCount;
 		type Version = ();
-		type PalletInfo = ();
+		type PalletInfo = PalletInfo;
 		type AccountData = ();
 		type OnNewAccount = ();
 		type OnKilledAccount = ();
@@ -498,7 +486,7 @@ mod tests {
 	}
 
 	impl Config for TestRuntime {
-		type Event = TestEvent;
+		type Event = Event;
 		type MessageId = MessageId;
 		type SourceChainAccountId = AccountId;
 		type TargetChainAccountPublic = TestAccountPublic;
@@ -586,7 +574,7 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageVersionSpecMismatch(
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageVersionSpecMismatch(
 						bridge,
 						id,
 						TEST_SPEC_VERSION,
@@ -614,7 +602,7 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageWeightMismatch(
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageWeightMismatch(
 						bridge, id, 1973000, 0,
 					)),
 					topics: vec![],
@@ -642,7 +630,9 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageSignatureMismatch(bridge, id)),
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageSignatureMismatch(
+						bridge, id
+					)),
 					topics: vec![],
 				}],
 			);
@@ -662,7 +652,7 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageRejected(bridge, id)),
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageRejected(bridge, id)),
 					topics: vec![],
 				}],
 			);
@@ -686,7 +676,9 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageCallDecodeFailed(bridge, id)),
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageCallDecodeFailed(
+						bridge, id
+					)),
 					topics: vec![],
 				}],
 			);
@@ -711,7 +703,7 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageCallRejected(bridge, id)),
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageCallRejected(bridge, id)),
 					topics: vec![],
 				}],
 			);
@@ -732,7 +724,11 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageDispatched(bridge, id, Ok(()))),
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched(
+						bridge,
+						id,
+						Ok(())
+					)),
 					topics: vec![],
 				}],
 			);
@@ -755,7 +751,11 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageDispatched(bridge, id, Ok(()))),
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched(
+						bridge,
+						id,
+						Ok(())
+					)),
 					topics: vec![],
 				}],
 			);
@@ -778,7 +778,11 @@ mod tests {
 				System::events(),
 				vec![EventRecord {
 					phase: Phase::Initialization,
-					event: TestEvent::call_dispatch(Event::<TestRuntime>::MessageDispatched(bridge, id, Ok(()))),
+					event: Event::call_dispatch(call_dispatch::Event::<TestRuntime>::MessageDispatched(
+						bridge,
+						id,
+						Ok(())
+					)),
 					topics: vec![],
 				}],
 			);
diff --git a/bridges/modules/currency-exchange/Cargo.toml b/bridges/modules/currency-exchange/Cargo.toml
index 967d5786590..f92eb2ca7b6 100644
--- a/bridges/modules/currency-exchange/Cargo.toml
+++ b/bridges/modules/currency-exchange/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 serde = { version = "1.0", optional = true }
 
 # Bridge dependencies
diff --git a/bridges/modules/currency-exchange/src/lib.rs b/bridges/modules/currency-exchange/src/lib.rs
index 463b052caca..9d1eb9f4489 100644
--- a/bridges/modules/currency-exchange/src/lib.rs
+++ b/bridges/modules/currency-exchange/src/lib.rs
@@ -212,7 +212,7 @@ fn prepare_deposit_details<T: Config<I>, I: Instance>(
 mod tests {
 	use super::*;
 	use bp_currency_exchange::LockFundsTransaction;
-	use frame_support::{assert_noop, assert_ok, impl_outer_origin, parameter_types, weights::Weight};
+	use frame_support::{assert_noop, assert_ok, construct_runtime, parameter_types, weights::Weight};
 	use sp_core::H256;
 	use sp_runtime::{
 		testing::Header,
@@ -313,11 +313,19 @@ mod tests {
 		}
 	}
 
-	#[derive(Clone, Eq, PartialEq)]
-	pub struct TestRuntime;
-
-	impl_outer_origin! {
-		pub enum Origin for TestRuntime where system = frame_system {}
+	type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
+	type Block = frame_system::mocking::MockBlock<TestRuntime>;
+	use crate as pallet_bridge_currency_exchange;
+
+	construct_runtime! {
+		pub enum TestRuntime where
+			Block = Block,
+			NodeBlock = Block,
+			UncheckedExtrinsic = UncheckedExtrinsic,
+		{
+			System: frame_system::{Module, Call, Config, Storage, Event<T>},
+			Exchange: pallet_bridge_currency_exchange::{Module},
+		}
 	}
 
 	parameter_types! {
@@ -330,7 +338,7 @@ mod tests {
 	impl frame_system::Config for TestRuntime {
 		type Origin = Origin;
 		type Index = u64;
-		type Call = ();
+		type Call = Call;
 		type BlockNumber = u64;
 		type Hash = H256;
 		type Hashing = BlakeTwo256;
@@ -340,7 +348,7 @@ mod tests {
 		type Event = ();
 		type BlockHashCount = BlockHashCount;
 		type Version = ();
-		type PalletInfo = ();
+		type PalletInfo = PalletInfo;
 		type AccountData = ();
 		type OnNewAccount = ();
 		type OnKilledAccount = ();
@@ -362,8 +370,6 @@ mod tests {
 		type DepositInto = DummyDepositInto;
 	}
 
-	type Exchange = Module<TestRuntime>;
-
 	fn new_test_ext() -> sp_io::TestExternalities {
 		let t = frame_system::GenesisConfig::default()
 			.build_storage::<TestRuntime>()
diff --git a/bridges/modules/ethereum-contract/builtin/Cargo.toml b/bridges/modules/ethereum-contract/builtin/Cargo.toml
index 1deb6a6c595..c65a490516f 100644
--- a/bridges/modules/ethereum-contract/builtin/Cargo.toml
+++ b/bridges/modules/ethereum-contract/builtin/Cargo.toml
@@ -7,9 +7,9 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 ethereum-types = "0.11.0"
-finality-grandpa = "0.12.3"
+finality-grandpa = "0.13.0"
 hex = "0.4"
 log = "0.4.14"
 
diff --git a/bridges/modules/ethereum/Cargo.toml b/bridges/modules/ethereum/Cargo.toml
index 66db6f95861..080957d7801 100644
--- a/bridges/modules/ethereum/Cargo.toml
+++ b/bridges/modules/ethereum/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 libsecp256k1 = { version = "0.3.4", default-features = false, features = ["hmac"], optional = true }
 serde = { version = "1.0", optional = true }
 
diff --git a/bridges/modules/ethereum/src/mock.rs b/bridges/modules/ethereum/src/mock.rs
index af99d476b88..bf5fc54da6e 100644
--- a/bridges/modules/ethereum/src/mock.rs
+++ b/bridges/modules/ethereum/src/mock.rs
@@ -18,9 +18,9 @@ pub use crate::test_utils::{insert_header, validator_utils::*, validators_change
 pub use bp_eth_poa::signatures::secret_to_address;
 
 use crate::validators::{ValidatorsConfiguration, ValidatorsSource};
-use crate::{AuraConfiguration, ChainTime, Config, GenesisConfig, PruningStrategy};
+use crate::{AuraConfiguration, ChainTime, Config, GenesisConfig as CrateGenesisConfig, PruningStrategy};
 use bp_eth_poa::{Address, AuraHeader, H256, U256};
-use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
+use frame_support::{parameter_types, weights::Weight};
 use secp256k1::SecretKey;
 use sp_runtime::{
 	testing::Header as SubstrateHeader,
@@ -30,11 +30,20 @@ use sp_runtime::{
 
 pub type AccountId = u64;
 
-#[derive(Clone, Eq, PartialEq, Debug)]
-pub struct TestRuntime;
+type Block = frame_system::mocking::MockBlock<TestRuntime>;
+type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
 
-impl_outer_origin! {
-	pub enum Origin for TestRuntime where system = frame_system {}
+use crate as pallet_ethereum;
+
+frame_support::construct_runtime! {
+	pub enum TestRuntime where
+		Block = Block,
+		NodeBlock = Block,
+		UncheckedExtrinsic = UncheckedExtrinsic,
+	{
+		System: frame_system::{Module, Call, Config, Storage, Event<T>},
+		Ethereum: pallet_ethereum::{Module, Call},
+	}
 }
 
 parameter_types! {
@@ -47,17 +56,17 @@ parameter_types! {
 impl frame_system::Config for TestRuntime {
 	type Origin = Origin;
 	type Index = u64;
-	type Call = ();
+	type Call = Call;
 	type BlockNumber = u64;
 	type Hash = H256;
 	type Hashing = BlakeTwo256;
 	type AccountId = AccountId;
 	type Lookup = IdentityLookup<Self::AccountId>;
 	type Header = SubstrateHeader;
-	type Event = ();
+	type Event = Event;
 	type BlockHashCount = BlockHashCount;
 	type Version = ();
-	type PalletInfo = ();
+	type PalletInfo = PalletInfo;
 	type AccountData = ();
 	type OnNewAccount = ();
 	type OnKilledAccount = ();
@@ -134,7 +143,7 @@ pub fn run_test_with_genesis<T>(
 	let validators = validators(total_validators);
 	let addresses = validators_addresses(total_validators);
 	sp_io::TestExternalities::new(
-		GenesisConfig {
+		CrateGenesisConfig {
 			initial_header: genesis.clone(),
 			initial_difficulty: 0.into(),
 			initial_validators: addresses.clone(),
diff --git a/bridges/modules/finality-verifier/Cargo.toml b/bridges/modules/finality-verifier/Cargo.toml
index b98f995b616..060c6c3be67 100644
--- a/bridges/modules/finality-verifier/Cargo.toml
+++ b/bridges/modules/finality-verifier/Cargo.toml
@@ -8,8 +8,8 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
-finality-grandpa = { version = "0.12.3", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
+finality-grandpa = { version = "0.13.0", default-features = false }
 serde = { version = "1.0", optional = true }
 
 # Bridge Dependencies
diff --git a/bridges/modules/finality-verifier/src/mock.rs b/bridges/modules/finality-verifier/src/mock.rs
index d492759f1bb..b78cce664ba 100644
--- a/bridges/modules/finality-verifier/src/mock.rs
+++ b/bridges/modules/finality-verifier/src/mock.rs
@@ -16,7 +16,7 @@
 
 use crate::pallet::{BridgedHeader, Config};
 use bp_runtime::{BlockNumberOf, Chain};
-use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
+use frame_support::{construct_runtime, parameter_types, weights::Weight};
 use sp_runtime::{
 	testing::{Header, H256},
 	traits::{BlakeTwo256, IdentityLookup},
@@ -27,11 +27,21 @@ pub type AccountId = u64;
 pub type TestHeader = BridgedHeader<TestRuntime>;
 pub type TestNumber = BlockNumberOf<<TestRuntime as Config>::BridgedChain>;
 
-#[derive(Clone, Eq, PartialEq, Debug)]
-pub struct TestRuntime;
+type Block = frame_system::mocking::MockBlock<TestRuntime>;
+type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
 
-impl_outer_origin! {
-	pub enum Origin for TestRuntime where system = frame_system {}
+use crate as finality_verifier;
+
+construct_runtime! {
+	pub enum TestRuntime where
+		Block = Block,
+		NodeBlock = Block,
+		UncheckedExtrinsic = UncheckedExtrinsic,
+	{
+		System: frame_system::{Module, Call, Config, Storage, Event<T>},
+		Bridge: pallet_substrate_bridge::{Module},
+		FinalityVerifier: finality_verifier::{Module},
+	}
 }
 
 parameter_types! {
@@ -44,7 +54,7 @@ parameter_types! {
 impl frame_system::Config for TestRuntime {
 	type Origin = Origin;
 	type Index = u64;
-	type Call = ();
+	type Call = Call;
 	type BlockNumber = u64;
 	type Hash = H256;
 	type Hashing = BlakeTwo256;
@@ -54,7 +64,7 @@ impl frame_system::Config for TestRuntime {
 	type Event = ();
 	type BlockHashCount = BlockHashCount;
 	type Version = ();
-	type PalletInfo = ();
+	type PalletInfo = PalletInfo;
 	type AccountData = ();
 	type OnNewAccount = ();
 	type OnKilledAccount = ();
@@ -74,9 +84,9 @@ parameter_types! {
 	pub const MaxRequests: u32 = 2;
 }
 
-impl crate::pallet::Config for TestRuntime {
+impl finality_verifier::Config for TestRuntime {
 	type BridgedChain = TestBridgedChain;
-	type HeaderChain = pallet_substrate_bridge::Module<TestRuntime>;
+	type HeaderChain = pallet_substrate_bridge::Module<Self>;
 	type AncestryProof = Vec<<Self::BridgedChain as Chain>::Header>;
 	type AncestryChecker = Checker<<Self::BridgedChain as Chain>::Header, Self::AncestryProof>;
 	type MaxRequests = MaxRequests;
diff --git a/bridges/modules/message-lane/Cargo.toml b/bridges/modules/message-lane/Cargo.toml
index 83721a645fd..be07b1173ac 100644
--- a/bridges/modules/message-lane/Cargo.toml
+++ b/bridges/modules/message-lane/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 num-traits = { version = "0.2", default-features = false }
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
 
diff --git a/bridges/modules/message-lane/src/lib.rs b/bridges/modules/message-lane/src/lib.rs
index d6ae1d09257..117bd2b465b 100644
--- a/bridges/modules/message-lane/src/lib.rs
+++ b/bridges/modules/message-lane/src/lib.rs
@@ -821,9 +821,9 @@ fn verify_and_decode_messages_proof<Chain: SourceHeaderChain<Fee>, Fee, Dispatch
 mod tests {
 	use super::*;
 	use crate::mock::{
-		message, run_test, Origin, TestEvent, TestMessageDeliveryAndDispatchPayment, TestMessagesDeliveryProof,
-		TestMessagesProof, TestPayload, TestRuntime, PAYLOAD_REJECTED_BY_TARGET_CHAIN, REGULAR_PAYLOAD, TEST_LANE_ID,
-		TEST_RELAYER_A, TEST_RELAYER_B,
+		message, run_test, Event as TestEvent, Origin, TestMessageDeliveryAndDispatchPayment,
+		TestMessagesDeliveryProof, TestMessagesProof, TestPayload, TestRuntime, PAYLOAD_REJECTED_BY_TARGET_CHAIN,
+		REGULAR_PAYLOAD, TEST_LANE_ID, TEST_RELAYER_A, TEST_RELAYER_B,
 	};
 	use bp_message_lane::UnrewardedRelayersState;
 	use frame_support::{assert_noop, assert_ok};
@@ -847,7 +847,7 @@ mod tests {
 			System::<TestRuntime>::events(),
 			vec![EventRecord {
 				phase: Phase::Initialization,
-				event: TestEvent::message_lane(RawEvent::MessageAccepted(TEST_LANE_ID, 1)),
+				event: TestEvent::pallet_message_lane(RawEvent::MessageAccepted(TEST_LANE_ID, 1)),
 				topics: vec![],
 			}],
 		);
@@ -876,7 +876,7 @@ mod tests {
 			System::<TestRuntime>::events(),
 			vec![EventRecord {
 				phase: Phase::Initialization,
-				event: TestEvent::message_lane(RawEvent::MessagesDelivered(TEST_LANE_ID, 1, 1)),
+				event: TestEvent::pallet_message_lane(RawEvent::MessagesDelivered(TEST_LANE_ID, 1, 1)),
 				topics: vec![],
 			}],
 		);
diff --git a/bridges/modules/message-lane/src/mock.rs b/bridges/modules/message-lane/src/mock.rs
index 244d580f057..340360a1268 100644
--- a/bridges/modules/message-lane/src/mock.rs
+++ b/bridges/modules/message-lane/src/mock.rs
@@ -25,7 +25,7 @@ use bp_message_lane::{
 };
 use bp_runtime::Size;
 use codec::{Decode, Encode};
-use frame_support::{impl_outer_event, impl_outer_origin, parameter_types, weights::Weight};
+use frame_support::{parameter_types, weights::Weight};
 use sp_core::H256;
 use sp_runtime::{
 	testing::Header as SubstrateHeader,
@@ -49,25 +49,23 @@ impl sp_runtime::traits::Convert<H256, AccountId> for AccountIdConverter {
 	}
 }
 
-#[derive(Clone, Eq, PartialEq, Debug)]
-pub struct TestRuntime;
+type Block = frame_system::mocking::MockBlock<TestRuntime>;
+type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
 
-mod message_lane {
-	pub use crate::Event;
-}
+use crate as pallet_message_lane;
 
-impl_outer_event! {
-	pub enum TestEvent for TestRuntime {
-		frame_system<T>,
-		pallet_balances<T>,
-		message_lane<T>,
+frame_support::construct_runtime! {
+	pub enum TestRuntime where
+		Block = Block,
+		NodeBlock = Block,
+		UncheckedExtrinsic = UncheckedExtrinsic,
+	{
+		System: frame_system::{Module, Call, Config, Storage, Event<T>},
+		Balances: pallet_balances::{Module, Call, Event<T>},
+		MessageLane: pallet_message_lane::{Module, Call, Event<T>},
 	}
 }
 
-impl_outer_origin! {
-	pub enum Origin for TestRuntime where system = frame_system {}
-}
-
 parameter_types! {
 	pub const BlockHashCount: u64 = 250;
 	pub const MaximumBlockWeight: Weight = 1024;
@@ -78,17 +76,17 @@ parameter_types! {
 impl frame_system::Config for TestRuntime {
 	type Origin = Origin;
 	type Index = u64;
-	type Call = ();
+	type Call = Call;
 	type BlockNumber = u64;
 	type Hash = H256;
 	type Hashing = BlakeTwo256;
 	type AccountId = AccountId;
 	type Lookup = IdentityLookup<Self::AccountId>;
 	type Header = SubstrateHeader;
-	type Event = TestEvent;
+	type Event = Event;
 	type BlockHashCount = BlockHashCount;
 	type Version = ();
-	type PalletInfo = ();
+	type PalletInfo = PalletInfo;
 	type AccountData = pallet_balances::AccountData<Balance>;
 	type OnNewAccount = ();
 	type OnKilledAccount = ();
@@ -108,7 +106,7 @@ impl pallet_balances::Config for TestRuntime {
 	type MaxLocks = ();
 	type Balance = Balance;
 	type DustRemoval = ();
-	type Event = TestEvent;
+	type Event = Event;
 	type ExistentialDeposit = ExistentialDeposit;
 	type AccountStore = frame_system::Module<TestRuntime>;
 	type WeightInfo = ();
@@ -121,7 +119,7 @@ parameter_types! {
 }
 
 impl Config for TestRuntime {
-	type Event = TestEvent;
+	type Event = Event;
 	type WeightInfo = ();
 	type MaxMessagesToPruneAtOnce = MaxMessagesToPruneAtOnce;
 	type MaxUnrewardedRelayerEntriesAtInboundLane = MaxUnrewardedRelayerEntriesAtInboundLane;
diff --git a/bridges/modules/shift-session-manager/Cargo.toml b/bridges/modules/shift-session-manager/Cargo.toml
index 1cba12f2f5c..04a5194c349 100644
--- a/bridges/modules/shift-session-manager/Cargo.toml
+++ b/bridges/modules/shift-session-manager/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 
 # Substrate Dependencies
 
@@ -20,6 +20,7 @@ sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "master
 [dev-dependencies]
 sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
 sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
+serde = "1.0"
 
 [features]
 default = ["std"]
diff --git a/bridges/modules/shift-session-manager/src/lib.rs b/bridges/modules/shift-session-manager/src/lib.rs
index 0d16e0b7d1f..ef96fc5318c 100644
--- a/bridges/modules/shift-session-manager/src/lib.rs
+++ b/bridges/modules/shift-session-manager/src/lib.rs
@@ -93,16 +93,23 @@ mod tests {
 		traits::{BlakeTwo256, ConvertInto, IdentityLookup},
 		Perbill, RuntimeAppPublic,
 	};
-	use frame_support::{impl_outer_origin, parameter_types, weights::Weight, BasicExternalities};
+	use frame_support::{parameter_types, weights::Weight, BasicExternalities};
 	use sp_core::H256;
 
 	type AccountId = u64;
 
-	#[derive(Clone, Eq, PartialEq)]
-	pub struct TestRuntime;
-
-	impl_outer_origin! {
-		pub enum Origin for TestRuntime {}
+	type Block = frame_system::mocking::MockBlock<TestRuntime>;
+	type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
+
+	frame_support::construct_runtime! {
+		pub enum TestRuntime where
+			Block = Block,
+			NodeBlock = Block,
+			UncheckedExtrinsic = UncheckedExtrinsic,
+		{
+			System: frame_system::{Module, Call, Config, Storage, Event<T>},
+			Session: pallet_session::{Module},
+		}
 	}
 
 	parameter_types! {
@@ -115,7 +122,7 @@ mod tests {
 	impl frame_system::Config for TestRuntime {
 		type Origin = Origin;
 		type Index = u64;
-		type Call = ();
+		type Call = Call;
 		type BlockNumber = u64;
 		type Hash = H256;
 		type Hashing = BlakeTwo256;
@@ -125,7 +132,7 @@ mod tests {
 		type Event = ();
 		type BlockHashCount = BlockHashCount;
 		type Version = ();
-		type PalletInfo = ();
+		type PalletInfo = PalletInfo;
 		type AccountData = ();
 		type OnNewAccount = ();
 		type OnKilledAccount = ();
diff --git a/bridges/modules/substrate/Cargo.toml b/bridges/modules/substrate/Cargo.toml
index 02c3b17047e..dd047d6b899 100644
--- a/bridges/modules/substrate/Cargo.toml
+++ b/bridges/modules/substrate/Cargo.toml
@@ -8,8 +8,8 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
-finality-grandpa = { version = "0.12.3", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
+finality-grandpa = { version = "0.13.0", default-features = false }
 hash-db = { version = "0.15.2", default-features = false }
 serde = { version = "1.0", optional = true }
 
diff --git a/bridges/modules/substrate/src/mock.rs b/bridges/modules/substrate/src/mock.rs
index e5b0c26c13a..c13c466c3a8 100644
--- a/bridges/modules/substrate/src/mock.rs
+++ b/bridges/modules/substrate/src/mock.rs
@@ -22,7 +22,7 @@
 
 use crate::{BridgedBlockHash, BridgedBlockNumber, BridgedHeader, Config};
 use bp_runtime::Chain;
-use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
+use frame_support::{parameter_types, weights::Weight};
 use sp_runtime::{
 	testing::{Header, H256},
 	traits::{BlakeTwo256, IdentityLookup},
@@ -34,11 +34,20 @@ pub type TestHeader = BridgedHeader<TestRuntime>;
 pub type TestNumber = BridgedBlockNumber<TestRuntime>;
 pub type TestHash = BridgedBlockHash<TestRuntime>;
 
-#[derive(Clone, Eq, PartialEq, Debug)]
-pub struct TestRuntime;
+type Block = frame_system::mocking::MockBlock<TestRuntime>;
+type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<TestRuntime>;
 
-impl_outer_origin! {
-	pub enum Origin for TestRuntime where system = frame_system {}
+use crate as pallet_substrate;
+
+frame_support::construct_runtime! {
+	pub enum TestRuntime where
+		Block = Block,
+		NodeBlock = Block,
+		UncheckedExtrinsic = UncheckedExtrinsic,
+	{
+		System: frame_system::{Module, Call, Config, Storage, Event<T>},
+		Substrate: pallet_substrate::{Module, Call},
+	}
 }
 
 parameter_types! {
@@ -51,7 +60,7 @@ parameter_types! {
 impl frame_system::Config for TestRuntime {
 	type Origin = Origin;
 	type Index = u64;
-	type Call = ();
+	type Call = Call;
 	type BlockNumber = u64;
 	type Hash = H256;
 	type Hashing = BlakeTwo256;
@@ -61,7 +70,7 @@ impl frame_system::Config for TestRuntime {
 	type Event = ();
 	type BlockHashCount = BlockHashCount;
 	type Version = ();
-	type PalletInfo = ();
+	type PalletInfo = PalletInfo;
 	type AccountData = ();
 	type OnNewAccount = ();
 	type OnKilledAccount = ();
diff --git a/bridges/primitives/currency-exchange/Cargo.toml b/bridges/primitives/currency-exchange/Cargo.toml
index 01f7005902b..585855b294e 100644
--- a/bridges/primitives/currency-exchange/Cargo.toml
+++ b/bridges/primitives/currency-exchange/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 
 # Substrate Dependencies
 
diff --git a/bridges/primitives/ethereum-poa/Cargo.toml b/bridges/primitives/ethereum-poa/Cargo.toml
index 726ca04c74b..86cb43193c0 100644
--- a/bridges/primitives/ethereum-poa/Cargo.toml
+++ b/bridges/primitives/ethereum-poa/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 ethbloom = { version = "0.10.0", default-features = false, features = ["rlp"] }
 fixed-hash = { version = "0.7", default-features = false }
 hash-db = { version = "0.15.2", default-features = false }
@@ -16,7 +16,7 @@ impl-serde = { version = "0.3.1", optional = true }
 libsecp256k1 = { version = "0.3.4", default-features = false, features = ["hmac"] }
 parity-bytes = { version = "0.1", default-features = false }
 plain_hasher = { version = "0.2.2", default-features = false }
-primitive-types = { version = "0.8", default-features = false, features = ["codec", "rlp"] }
+primitive-types = { version = "0.9", default-features = false, features = ["codec", "rlp"] }
 rlp = { version = "0.5", default-features = false }
 serde = { version = "1.0", optional = true }
 serde-big-array = { version = "0.2", optional = true }
diff --git a/bridges/primitives/header-chain/Cargo.toml b/bridges/primitives/header-chain/Cargo.toml
index ecd5f05940e..0dc16930392 100644
--- a/bridges/primitives/header-chain/Cargo.toml
+++ b/bridges/primitives/header-chain/Cargo.toml
@@ -7,8 +7,8 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
-finality-grandpa = { version = "0.12.3", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
+finality-grandpa = { version = "0.13.0", default-features = false }
 serde = { version = "1.0", optional = true }
 
 # Substrate Dependencies
diff --git a/bridges/primitives/message-dispatch/Cargo.toml b/bridges/primitives/message-dispatch/Cargo.toml
index a6bf4b7cc57..293c637e8df 100644
--- a/bridges/primitives/message-dispatch/Cargo.toml
+++ b/bridges/primitives/message-dispatch/Cargo.toml
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
 bp-runtime = { path = "../runtime", default-features = false }
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 
 [features]
 default = ["std"]
diff --git a/bridges/primitives/message-lane/Cargo.toml b/bridges/primitives/message-lane/Cargo.toml
index e002ccd36a2..451a3c0400a 100644
--- a/bridges/primitives/message-lane/Cargo.toml
+++ b/bridges/primitives/message-lane/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
 
 # Bridge dependencies
 
diff --git a/bridges/primitives/millau/Cargo.toml b/bridges/primitives/millau/Cargo.toml
index b72a0f4018b..aea2f8eec2e 100644
--- a/bridges/primitives/millau/Cargo.toml
+++ b/bridges/primitives/millau/Cargo.toml
@@ -14,9 +14,9 @@ bp-message-lane = { path = "../message-lane", default-features = false }
 bp-runtime = { path = "../runtime", default-features = false }
 fixed-hash = { version = "0.7.0", default-features = false }
 hash256-std-hasher = { version = "0.15.2", default-features = false }
-impl-codec = { version = "0.4.2", default-features = false }
+impl-codec = { version = "0.5.0", default-features = false }
 impl-serde = { version = "0.3.1", optional = true }
-parity-util-mem = { version = "0.8.0", default-features = false, features = ["primitive-types"] }
+parity-util-mem = { version = "0.9.0", default-features = false, features = ["primitive-types"] }
 serde = { version = "1.0.101", optional = true, features = ["derive"] }
 
 # Substrate Based Dependencies
diff --git a/bridges/primitives/runtime/Cargo.toml b/bridges/primitives/runtime/Cargo.toml
index a5aaa1cfa64..50305013ceb 100644
--- a/bridges/primitives/runtime/Cargo.toml
+++ b/bridges/primitives/runtime/Cargo.toml
@@ -7,7 +7,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false }
+codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
 num-traits = { version = "0.2", default-features = false }
 
 # Substrate Dependencies
diff --git a/bridges/primitives/test-utils/Cargo.toml b/bridges/primitives/test-utils/Cargo.toml
index aa330d4521f..944700e9d3c 100644
--- a/bridges/primitives/test-utils/Cargo.toml
+++ b/bridges/primitives/test-utils/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-finality-grandpa = { version = "0.12.3" }
+finality-grandpa = { version = "0.13.0" }
 bp-header-chain = { path = "../header-chain" }
 sp-finality-grandpa = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
 sp-keyring = { git = "https://github.com/paritytech/substrate.git", branch = "master" }
diff --git a/bridges/relays/ethereum-client/Cargo.toml b/bridges/relays/ethereum-client/Cargo.toml
index ad50a18e396..b0f6485ffd3 100644
--- a/bridges/relays/ethereum-client/Cargo.toml
+++ b/bridges/relays/ethereum-client/Cargo.toml
@@ -7,11 +7,11 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
 bp-eth-poa = { path = "../../primitives/ethereum-poa" }
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 headers-relay = { path = "../headers-relay" }
 hex-literal = "0.3"
 jsonrpsee = { git = "https://github.com/svyatonik/jsonrpsee.git", branch = "shared-client-in-rpc-api", default-features = false, features = ["http"] }
 libsecp256k1 = { version = "0.3.4", default-features = false, features = ["hmac"] }
 log = "0.4.11"
 relay-utils = { path = "../utils" }
-web3 = { version = "0.15", default-features = false }
+web3 = { version = "0.15", git = "https://github.com/tomusdrw/rust-web3.git", branch ="td-ethabi", default-features = false }
diff --git a/bridges/relays/ethereum/Cargo.toml b/bridges/relays/ethereum/Cargo.toml
index 8f58c27330e..33435485556 100644
--- a/bridges/relays/ethereum/Cargo.toml
+++ b/bridges/relays/ethereum/Cargo.toml
@@ -10,11 +10,11 @@ ansi_term = "0.12"
 async-std = "1.9.0"
 async-trait = "0.1.42"
 clap = { version = "2.33.3", features = ["yaml"] }
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 env_logger = "0.8.2"
-ethabi = "13.0"
-ethabi-contract = "11.0"
-ethabi-derive = "13.0"
+ethabi = { git = "https://github.com/paritytech/ethabi.git", branch = "td-eth-types-11" }
+ethabi-contract = { git = "https://github.com/paritytech/ethabi.git", branch = "td-eth-types-11" }
+ethabi-derive = { git = "https://github.com/paritytech/ethabi.git", branch = "td-eth-types-11" }
 futures = "0.3.12"
 hex = "0.4"
 hex-literal = "0.3"
diff --git a/bridges/relays/kusama-client/Cargo.toml b/bridges/relays/kusama-client/Cargo.toml
index 4ea971f0e14..6695758113a 100644
--- a/bridges/relays/kusama-client/Cargo.toml
+++ b/bridges/relays/kusama-client/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 headers-relay = { path = "../headers-relay" }
 relay-substrate-client = { path = "../substrate-client" }
 relay-utils = { path = "../utils" }
diff --git a/bridges/relays/millau-client/Cargo.toml b/bridges/relays/millau-client/Cargo.toml
index 3ca42573073..c05d44a42e9 100644
--- a/bridges/relays/millau-client/Cargo.toml
+++ b/bridges/relays/millau-client/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 headers-relay = { path = "../headers-relay" }
 relay-substrate-client = { path = "../substrate-client" }
 relay-utils = { path = "../utils" }
diff --git a/bridges/relays/polkadot-client/Cargo.toml b/bridges/relays/polkadot-client/Cargo.toml
index e4b1d84eaa1..5a05aa0a2cf 100644
--- a/bridges/relays/polkadot-client/Cargo.toml
+++ b/bridges/relays/polkadot-client/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 headers-relay = { path = "../headers-relay" }
 relay-substrate-client = { path = "../substrate-client" }
 relay-utils = { path = "../utils" }
diff --git a/bridges/relays/rialto-client/Cargo.toml b/bridges/relays/rialto-client/Cargo.toml
index 007ddfd2672..6c90defe37a 100644
--- a/bridges/relays/rialto-client/Cargo.toml
+++ b/bridges/relays/rialto-client/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2018"
 license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 
 [dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 headers-relay = { path = "../headers-relay" }
 relay-substrate-client = { path = "../substrate-client" }
 relay-utils = { path = "../utils" }
diff --git a/bridges/relays/substrate-client/Cargo.toml b/bridges/relays/substrate-client/Cargo.toml
index 320abf280f0..1c60f861e2e 100644
--- a/bridges/relays/substrate-client/Cargo.toml
+++ b/bridges/relays/substrate-client/Cargo.toml
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 [dependencies]
 async-std = "1.6.5"
 async-trait = "0.1.40"
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 jsonrpsee = { git = "https://github.com/svyatonik/jsonrpsee.git", branch = "shared-client-in-rpc-api", default-features = false, features = ["ws"] }
 log = "0.4.11"
 num-traits = "0.2"
diff --git a/bridges/relays/substrate-client/src/error.rs b/bridges/relays/substrate-client/src/error.rs
index f0212ed501a..f5bb250d9fb 100644
--- a/bridges/relays/substrate-client/src/error.rs
+++ b/bridges/relays/substrate-client/src/error.rs
@@ -78,7 +78,7 @@ impl ToString for Error {
 		match self {
 			Self::WsConnectionError(e) => e.to_string(),
 			Self::Request(e) => e.to_string(),
-			Self::ResponseParseFailed(e) => e.what().to_string(),
+			Self::ResponseParseFailed(e) => e.to_string(),
 			Self::UninitializedBridgePallet => "The Substrate bridge pallet has not been initialized yet.".into(),
 			Self::AccountDoesNotExist => "Account does not exist on the chain".into(),
 			Self::ClientNotSynced(health) => format!("Substrate client is not synced: {}", health),
diff --git a/bridges/relays/substrate/Cargo.toml b/bridges/relays/substrate/Cargo.toml
index 137741a1354..6ea5e839d8e 100644
--- a/bridges/relays/substrate/Cargo.toml
+++ b/bridges/relays/substrate/Cargo.toml
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
 [dependencies]
 async-std = "1.9.0"
 async-trait = "0.1.42"
-codec = { package = "parity-scale-codec", version = "1.3.4" }
+codec = { package = "parity-scale-codec", version = "2.0.0" }
 futures = "0.3.12"
 hex = "0.4"
 log = "0.4.14"
-- 
GitLab