diff --git a/bridges/bin/millau/node/src/service.rs b/bridges/bin/millau/node/src/service.rs index 9cbd2b06a9b4..d5dc945cad24 100644 --- a/bridges/bin/millau/node/src/service.rs +++ b/bridges/bin/millau/node/src/service.rs @@ -134,8 +134,8 @@ pub fn new_full(mut config: Configuration) -> Result config .network - .notifications_protocols - .push(sc_finality_grandpa::GRANDPA_PROTOCOL_NAME.into()); + .extra_sets + .push(sc_finality_grandpa::grandpa_peers_set_config()); let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { @@ -336,8 +336,8 @@ pub fn new_light(mut config: Configuration) -> Result config .network - .notifications_protocols - .push(sc_finality_grandpa::GRANDPA_PROTOCOL_NAME.into()); + .extra_sets + .push(sc_finality_grandpa::grandpa_peers_set_config()); let select_chain = sc_consensus::LongestChain::new(backend.clone()); diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs index a163b933b1d3..9969eb96fa93 100644 --- a/bridges/bin/millau/runtime/src/lib.rs +++ b/bridges/bin/millau/runtime/src/lib.rs @@ -157,6 +157,7 @@ parameter_types! { read: 60_000_000, // ~0.06 ms = ~60 µs write: 200_000_000, // ~0.2 ms = 200 µs }; + pub const SS58Prefix: u8 = 86; } impl frame_system::Config for Runtime { @@ -203,6 +204,8 @@ impl frame_system::Config for Runtime { type BlockLength = bp_millau::BlockLength; /// The weight of database operations that the runtime can invoke. type DbWeight = DbWeight; + /// The designated SS58 prefix of this chain. + type SS58Prefix = SS58Prefix; } impl pallet_aura::Config for Runtime { diff --git a/bridges/bin/rialto/node/src/service.rs b/bridges/bin/rialto/node/src/service.rs index c235a8e757f8..d88f37ac0a80 100644 --- a/bridges/bin/rialto/node/src/service.rs +++ b/bridges/bin/rialto/node/src/service.rs @@ -134,8 +134,8 @@ pub fn new_full(mut config: Configuration) -> Result config .network - .notifications_protocols - .push(sc_finality_grandpa::GRANDPA_PROTOCOL_NAME.into()); + .extra_sets + .push(sc_finality_grandpa::grandpa_peers_set_config()); let (network, network_status_sinks, system_rpc_tx, network_starter) = sc_service::build_network(sc_service::BuildNetworkParams { @@ -335,8 +335,8 @@ pub fn new_light(mut config: Configuration) -> Result config .network - .notifications_protocols - .push(sc_finality_grandpa::GRANDPA_PROTOCOL_NAME.into()); + .extra_sets + .push(sc_finality_grandpa::grandpa_peers_set_config()); let select_chain = sc_consensus::LongestChain::new(backend.clone()); diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs index 154865c6a03b..e80281560c8a 100644 --- a/bridges/bin/rialto/runtime/src/lib.rs +++ b/bridges/bin/rialto/runtime/src/lib.rs @@ -165,6 +165,7 @@ parameter_types! { read: 60_000_000, // ~0.06 ms = ~60 µs write: 200_000_000, // ~0.2 ms = 200 µs }; + pub const SS58Prefix: u8 = 84; } impl frame_system::Config for Runtime { @@ -211,6 +212,8 @@ impl frame_system::Config for Runtime { type BlockLength = bp_rialto::BlockLength; /// The weight of database operations that the runtime can invoke. type DbWeight = DbWeight; + /// The designated SS58 prefix of this chain. + type SS58Prefix = SS58Prefix; } impl pallet_aura::Config for Runtime { diff --git a/bridges/modules/call-dispatch/src/lib.rs b/bridges/modules/call-dispatch/src/lib.rs index 74584ee570a8..a0c2af057252 100644 --- a/bridges/modules/call-dispatch/src/lib.rs +++ b/bridges/modules/call-dispatch/src/lib.rs @@ -424,6 +424,7 @@ mod tests { type BlockWeights = (); type BlockLength = (); type DbWeight = (); + type SS58Prefix = (); } impl Config for TestRuntime { diff --git a/bridges/modules/currency-exchange/src/benchmarking.rs b/bridges/modules/currency-exchange/src/benchmarking.rs index 73304ff40bc3..8b38d42eaa7e 100644 --- a/bridges/modules/currency-exchange/src/benchmarking.rs +++ b/bridges/modules/currency-exchange/src/benchmarking.rs @@ -54,8 +54,6 @@ pub trait Config: CurrencyExchangeConfig { } benchmarks_instance! { - _ { } - // Benchmark `import_peer_transaction` extrinsic with the best possible conditions: // * Proof is the transaction itself. // * Transaction has minimal size. diff --git a/bridges/modules/currency-exchange/src/lib.rs b/bridges/modules/currency-exchange/src/lib.rs index 4ff88e7b03ab..d3e12bff3902 100644 --- a/bridges/modules/currency-exchange/src/lib.rs +++ b/bridges/modules/currency-exchange/src/lib.rs @@ -347,6 +347,7 @@ mod tests { type BlockWeights = (); type BlockLength = (); type DbWeight = (); + type SS58Prefix = (); } impl Config for TestRuntime { diff --git a/bridges/modules/ethereum-contract/builtin/Cargo.toml b/bridges/modules/ethereum-contract/builtin/Cargo.toml index 101a03fb8c26..9275d10bf663 100644 --- a/bridges/modules/ethereum-contract/builtin/Cargo.toml +++ b/bridges/modules/ethereum-contract/builtin/Cargo.toml @@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "1.3.4" } -ethereum-types = "0.9.2" +ethereum-types = "0.10.0" finality-grandpa = "0.12.3" hex = "0.4" log = "0.4.11" diff --git a/bridges/modules/ethereum/src/benchmarking.rs b/bridges/modules/ethereum/src/benchmarking.rs index 35a202f3f2fe..5de6e80f16a1 100644 --- a/bridges/modules/ethereum/src/benchmarking.rs +++ b/bridges/modules/ethereum/src/benchmarking.rs @@ -26,8 +26,6 @@ use frame_benchmarking::benchmarks_instance; use frame_system::RawOrigin; benchmarks_instance! { - _ { } - // Benchmark `import_unsigned_header` extrinsic with the best possible conditions: // * Parent header is finalized. // * New header doesn't require receipts. diff --git a/bridges/modules/ethereum/src/mock.rs b/bridges/modules/ethereum/src/mock.rs index e6d105070fc3..af99d476b880 100644 --- a/bridges/modules/ethereum/src/mock.rs +++ b/bridges/modules/ethereum/src/mock.rs @@ -66,6 +66,7 @@ impl frame_system::Config for TestRuntime { type BlockWeights = (); type BlockLength = (); type DbWeight = (); + type SS58Prefix = (); } parameter_types! { diff --git a/bridges/modules/ethereum/src/test_utils.rs b/bridges/modules/ethereum/src/test_utils.rs index f41652f57081..ad4019412892 100644 --- a/bridges/modules/ethereum/src/test_utils.rs +++ b/bridges/modules/ethereum/src/test_utils.rs @@ -53,7 +53,7 @@ impl HeaderBuilder { Self { header: AuraHeader { gas_limit: GAS_LIMIT.into(), - seal: vec![bp_eth_poa::rlp_encode(¤t_step), vec![]], + seal: vec![bp_eth_poa::rlp_encode(¤t_step).to_vec(), vec![]], ..Default::default() }, parent_header: Default::default(), @@ -95,7 +95,7 @@ impl HeaderBuilder { pub fn with_number(number: u64) -> Self { Self::with_parent(&AuraHeader { number: number - 1, - seal: vec![bp_eth_poa::rlp_encode(&(number - 1)), vec![]], + seal: vec![bp_eth_poa::rlp_encode(&(number - 1)).to_vec(), vec![]], ..Default::default() }) } @@ -109,7 +109,7 @@ impl HeaderBuilder { parent_hash: parent_header.compute_hash(), number: parent_header.number + 1, gas_limit: GAS_LIMIT.into(), - seal: vec![bp_eth_poa::rlp_encode(¤t_step), vec![]], + seal: vec![bp_eth_poa::rlp_encode(¤t_step).to_vec(), vec![]], difficulty: calculate_score(parent_step, current_step, 0), ..Default::default() }, @@ -120,7 +120,7 @@ impl HeaderBuilder { /// Update step of this header. pub fn step(mut self, step: u64) -> Self { let parent_step = self.parent_header.step(); - self.header.seal[0] = rlp_encode(&step); + self.header.seal[0] = rlp_encode(&step).to_vec(); self.header.difficulty = parent_step .map(|parent_step| calculate_score(parent_step, step, 0)) .unwrap_or_default(); diff --git a/bridges/modules/ethereum/src/verification.rs b/bridges/modules/ethereum/src/verification.rs index aac1d20067b7..3882e6b529ed 100644 --- a/bridges/modules/ethereum/src/verification.rs +++ b/bridges/modules/ethereum/src/verification.rs @@ -637,11 +637,11 @@ mod tests { assert_eq!(default_verify(&header), Err(Error::MissingStep)); // when step is the same as for the parent block - header.seal[0] = rlp_encode(&42u64); + header.seal[0] = rlp_encode(&42u64).to_vec(); assert_eq!(default_verify(&header), Err(Error::DoubleVote)); // when step is OK - header.seal[0] = rlp_encode(&43u64); + header.seal[0] = rlp_encode(&43u64).to_vec(); assert_ne!(default_verify(&header), Err(Error::DoubleVote)); // now check with validate_step check enabled @@ -649,12 +649,12 @@ mod tests { config.validate_step_transition = 0; // when step is lesser that for the parent block - header.seal[0] = rlp_encode(&40u64); + header.seal[0] = rlp_encode(&40u64).to_vec(); header.seal = vec![vec![40], vec![]]; assert_eq!(verify_with_config(&config, &header), Err(Error::DoubleVote)); // when step is OK - header.seal[0] = rlp_encode(&44u64); + header.seal[0] = rlp_encode(&44u64).to_vec(); assert_ne!(verify_with_config(&config, &header), Err(Error::DoubleVote)); } @@ -720,7 +720,7 @@ mod tests { // when header signature is invalid let mut header = good_header.clone(); - header.seal[1] = rlp_encode(&H520::default()); + header.seal[1] = rlp_encode(&H520::default()).to_vec(); assert_eq!(default_verify(&header), Err(Error::NotValidator)); // when everything is OK diff --git a/bridges/modules/message-lane/src/benchmarking.rs b/bridges/modules/message-lane/src/benchmarking.rs index 3243a25f1631..4b0df8213a2a 100644 --- a/bridges/modules/message-lane/src/benchmarking.rs +++ b/bridges/modules/message-lane/src/benchmarking.rs @@ -89,8 +89,6 @@ pub trait Config: crate::Config { } benchmarks_instance! { - _ { } - // // Benchmarks that are used directly by the runtime. // diff --git a/bridges/modules/message-lane/src/mock.rs b/bridges/modules/message-lane/src/mock.rs index f4d98f4c6dc4..5b24a29eb9b2 100644 --- a/bridges/modules/message-lane/src/mock.rs +++ b/bridges/modules/message-lane/src/mock.rs @@ -93,6 +93,7 @@ impl frame_system::Config for TestRuntime { type BlockWeights = (); type BlockLength = (); type DbWeight = (); + type SS58Prefix = (); } parameter_types! { diff --git a/bridges/modules/shift-session-manager/src/lib.rs b/bridges/modules/shift-session-manager/src/lib.rs index 88928986f0df..102c3fcbc167 100644 --- a/bridges/modules/shift-session-manager/src/lib.rs +++ b/bridges/modules/shift-session-manager/src/lib.rs @@ -134,6 +134,7 @@ mod tests { type BlockWeights = (); type BlockLength = (); type DbWeight = (); + type SS58Prefix = (); } parameter_types! { diff --git a/bridges/modules/substrate/src/mock.rs b/bridges/modules/substrate/src/mock.rs index 7c2b5429ed98..e6415aae8e41 100644 --- a/bridges/modules/substrate/src/mock.rs +++ b/bridges/modules/substrate/src/mock.rs @@ -67,6 +67,7 @@ impl frame_system::Config for TestRuntime { type DbWeight = (); type BlockWeights = (); type BlockLength = (); + type SS58Prefix = (); } impl Config for TestRuntime { diff --git a/bridges/primitives/ethereum-poa/Cargo.toml b/bridges/primitives/ethereum-poa/Cargo.toml index 724f5594cdf4..726ca04c74bc 100644 --- a/bridges/primitives/ethereum-poa/Cargo.toml +++ b/bridges/primitives/ethereum-poa/Cargo.toml @@ -8,16 +8,16 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } -ethbloom = { version = "0.8", default-features = false } -fixed-hash = { version = "0.5", 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 } -impl-rlp = { version = "0.2", default-features = false } -impl-serde = { version = "0.2.3", optional = true } +impl-rlp = { version = "0.3", default-features = false } +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.7", default-features = false, features = ["codec", "rlp"] } -rlp = { version = "0.4", default-features = false } +primitive-types = { version = "0.8", 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 } triehash = { version = "0.8.2", default-features = false } diff --git a/bridges/primitives/ethereum-poa/src/lib.rs b/bridges/primitives/ethereum-poa/src/lib.rs index 63d2dda207e8..dc65ac432b14 100644 --- a/bridges/primitives/ethereum-poa/src/lib.rs +++ b/bridges/primitives/ethereum-poa/src/lib.rs @@ -289,7 +289,7 @@ impl AuraHeader { } } - s.out() + s.out().to_vec() } } @@ -320,7 +320,7 @@ impl UnsignedTransaction { pub fn rlp(&self, chain_id: Option) -> Bytes { let mut stream = RlpStream::new_list(if chain_id.is_some() { 9 } else { 6 }); self.rlp_to(chain_id, &mut stream); - stream.out() + stream.out().to_vec() } /// Encode to given rlp stream. @@ -392,7 +392,7 @@ impl Receipt { s.append(&log.data); } - s.out() + s.out().to_vec() } } @@ -412,7 +412,7 @@ impl SealedEmptyStep { for empty_step in empty_steps { s.begin_list(2).append(&empty_step.signature).append(&empty_step.step); } - s.out() + s.out().to_vec() } } diff --git a/bridges/primitives/ethereum-poa/src/signatures.rs b/bridges/primitives/ethereum-poa/src/signatures.rs index cab8fdfa2f43..21c6f3f860ff 100644 --- a/bridges/primitives/ethereum-poa/src/signatures.rs +++ b/bridges/primitives/ethereum-poa/src/signatures.rs @@ -49,7 +49,7 @@ impl SignHeader for AuraHeader { let message = self.seal_hash(false).unwrap(); let signature = sign(author, message); - self.seal[1] = rlp_encode(&signature); + self.seal[1] = rlp_encode(&signature).to_vec(); self } @@ -74,7 +74,7 @@ impl SignTransaction for UnsignedTransaction { stream.append(&signature_v); stream.append(&signature_r); stream.append(&signature_s); - stream.out() + stream.out().to_vec() } } diff --git a/bridges/primitives/millau/Cargo.toml b/bridges/primitives/millau/Cargo.toml index d512fc632a51..b72a0f4018b6 100644 --- a/bridges/primitives/millau/Cargo.toml +++ b/bridges/primitives/millau/Cargo.toml @@ -12,11 +12,11 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" bp-message-lane = { path = "../message-lane", default-features = false } bp-runtime = { path = "../runtime", default-features = false } -fixed-hash = { version = "0.6.1", 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-serde = { version = "0.3.1", optional = true } -parity-util-mem = { version = "0.7.0", default-features = false, features = ["primitive-types"] } +parity-util-mem = { version = "0.8.0", default-features = false, features = ["primitive-types"] } serde = { version = "1.0.101", optional = true, features = ["derive"] } # Substrate Based Dependencies diff --git a/bridges/relays/ethereum-client/Cargo.toml b/bridges/relays/ethereum-client/Cargo.toml index e1ae2a8446aa..ad50a18e3967 100644 --- a/bridges/relays/ethereum-client/Cargo.toml +++ b/bridges/relays/ethereum-client/Cargo.toml @@ -14,4 +14,4 @@ jsonrpsee = { git = "https://github.com/svyatonik/jsonrpsee.git", branch = "shar libsecp256k1 = { version = "0.3.4", default-features = false, features = ["hmac"] } log = "0.4.11" relay-utils = { path = "../utils" } -web3 = { version = "0.14", default-features = false } +web3 = { version = "0.15", default-features = false } diff --git a/bridges/relays/ethereum/Cargo.toml b/bridges/relays/ethereum/Cargo.toml index 4b13ff5d2479..4ff9430b4a1f 100644 --- a/bridges/relays/ethereum/Cargo.toml +++ b/bridges/relays/ethereum/Cargo.toml @@ -12,9 +12,9 @@ async-trait = "0.1.42" clap = { version = "2.33.3", features = ["yaml"] } codec = { package = "parity-scale-codec", version = "1.3.4" } env_logger = "0.8.2" -ethabi = "12.0" +ethabi = "13.0" ethabi-contract = "11.0" -ethabi-derive = "12.0" +ethabi-derive = "13.0" futures = "0.3.8" hex = "0.4" hex-literal = "0.3"