update Substrate/Polkadot/Cumulus refs (#1562)

* update Substrate/Polkadot/Cumulus refs

* finality-grandpa 0.16

* fix miillau-runtime compilation

* fix rialto runtime compilation

* fixed rialto-parachain runtime compilation

* backport GRANDPA test fixes

* helper instead of removed record_all_keys

* substrate-relay is compiling

* millau-bridge-node at least compiles

* rialto-bridge-node at least compiles

* rialto-parachain-collator compiles

* fixings tests (wip)

* fmt

* fixed BEEFY alert

* clippy

* removed unused dep

* -extra var

* move Leaf to mod mmr

* fix benchmarks
This commit is contained in:
Svyatoslav Nikolsky
2022-09-09 10:56:39 +03:00
committed by Bastian Köcher
parent ad38cdb873
commit 95c30c780c
32 changed files with 416 additions and 292 deletions
+1 -1
View File
@@ -70,4 +70,4 @@ bp-test-utils = { path = "../../primitives/test-utils" }
hex-literal = "0.3"
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
tempfile = "3.2"
finality-grandpa = { version = "0.15.0" }
finality-grandpa = { version = "0.16.0" }
+2 -2
View File
@@ -19,7 +19,7 @@ use bp_runtime::{
Chain as ChainBase, EncodedOrDecodedCall, HashOf, TransactionEra, TransactionEraOf,
};
use codec::{Codec, Encode};
use frame_support::weights::{Weight, WeightToFeePolynomial};
use frame_support::weights::{Weight, WeightToFee};
use jsonrpsee::core::{DeserializeOwned, Serialize};
use num_traits::Zero;
use sc_transaction_pool_api::TransactionStatus;
@@ -61,7 +61,7 @@ pub trait Chain: ChainBase + Clone {
type Call: Clone + Codec + Dispatchable + Debug + Send;
/// Type that is used by the chain, to convert from weight to fee.
type WeightToFee: WeightToFeePolynomial<Balance = Self::Balance>;
type WeightToFee: WeightToFee<Balance = Self::Balance>;
}
/// Substrate-based relay chain that supports parachains.
@@ -22,7 +22,7 @@ bp-parachains = { path = "../../primitives/parachains" }
bp-polkadot-core = { path = "../../primitives/polkadot-core" }
bridge-runtime-common = { path = "../../bin/runtime-common" }
finality-grandpa = { version = "0.15.0" }
finality-grandpa = { version = "0.16.0" }
finality-relay = { path = "../finality" }
parachains-relay = { path = "../parachains" }
relay-utils = { path = "../utils" }
@@ -510,7 +510,7 @@ mod tests {
// i.e. weight reserved for messages dispatch allows dispatch of non-trivial messages.
//
// Any significant change in this values should attract additional attention.
(1024, 216_583_333_334),
(1024, 216_609_134_667),
);
}
}
@@ -36,7 +36,7 @@ use bridge_runtime_common::messages::{
source::FromBridgedChainMessagesDeliveryProof, target::FromBridgedChainMessagesProof,
};
use codec::Encode;
use frame_support::weights::{Weight, WeightToFeePolynomial};
use frame_support::weights::{Weight, WeightToFee};
use messages_relay::{
message_lane::{MessageLane, SourceHeaderIdOf, TargetHeaderIdOf},
message_lane_loop::{TargetClient, TargetClientState},
@@ -502,8 +502,8 @@ fn compute_fee_multiplier<C: Chain>(
) -> FixedU128 {
let adjusted_weight_fee_difference =
larger_adjusted_weight_fee.saturating_sub(smaller_adjusted_weight_fee);
let smaller_tx_unadjusted_weight_fee = WeightToFeeOf::<C>::calc(&smaller_tx_weight);
let larger_tx_unadjusted_weight_fee = WeightToFeeOf::<C>::calc(&larger_tx_weight);
let smaller_tx_unadjusted_weight_fee = WeightToFeeOf::<C>::weight_to_fee(&smaller_tx_weight);
let larger_tx_unadjusted_weight_fee = WeightToFeeOf::<C>::weight_to_fee(&larger_tx_weight);
FixedU128::saturating_from_rational(
adjusted_weight_fee_difference,
larger_tx_unadjusted_weight_fee.saturating_sub(smaller_tx_unadjusted_weight_fee),
@@ -516,7 +516,7 @@ fn compute_prepaid_messages_refund<C: ChainWithMessages>(
total_prepaid_nonces: MessageNonce,
fee_multiplier: FixedU128,
) -> BalanceOf<C> {
fee_multiplier.saturating_mul_int(WeightToFeeOf::<C>::calc(
fee_multiplier.saturating_mul_int(WeightToFeeOf::<C>::weight_to_fee(
&C::PAY_INBOUND_DISPATCH_FEE_WEIGHT_AT_CHAIN.saturating_mul(total_prepaid_nonces),
))
}
@@ -560,16 +560,15 @@ mod tests {
#[test]
fn compute_fee_multiplier_returns_sane_results() {
let multiplier = FixedU128::saturating_from_rational(1, 1000);
let multiplier: FixedU128 = bp_rococo::WeightToFee::weight_to_fee(&1).into();
let smaller_weight = 1_000_000;
let smaller_adjusted_weight_fee =
multiplier.saturating_mul_int(WeightToFeeOf::<Rococo>::calc(&smaller_weight));
multiplier.saturating_mul_int(WeightToFeeOf::<Rococo>::weight_to_fee(&smaller_weight));
let larger_weight = smaller_weight + 200_000;
let larger_adjusted_weight_fee =
multiplier.saturating_mul_int(WeightToFeeOf::<Rococo>::calc(&larger_weight));
multiplier.saturating_mul_int(WeightToFeeOf::<Rococo>::weight_to_fee(&larger_weight));
assert_eq!(
compute_fee_multiplier::<Rococo>(
smaller_adjusted_weight_fee,