Update Substrate Dependency (#566)

* Update `sp-io` dependency

* Rename Trait to Config

* RustFmt

* Bump `sp-io` again

* Use new frame_system weight types in Rialto and Millau runtimes

* Update test Runtimes to use new weight types

* Bump `sp-io` again

* Update to not-the latest first.

* Update benchmarks.

* Another Trai.

* Move new weight types into runtime primitive crates

This allows us to check limits for extrinsics from other parts
of the codebase without pulling in the entire chain runtime.

* Remove leftover comments

* Move new functions to a better location

* Small formatting fixes

* Add actual documentation to new weight config types

* Decrease maximum block weight of Millau chain

* Decreease maximum block length of Millau chain

Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
This commit is contained in:
Hernando Castano
2020-12-16 04:52:53 -05:00
committed by Bastian Köcher
parent 8a5b51a944
commit ee655b1057
31 changed files with 328 additions and 293 deletions
@@ -89,12 +89,12 @@ impl MessageBridge for WithRialtoMessageBridge {
type BridgedChain = Rialto;
fn maximal_extrinsic_size_on_target_chain() -> u32 {
bp_rialto::MAXIMUM_EXTRINSIC_SIZE
bp_rialto::max_extrinsic_size()
}
fn weight_limits_of_message_on_bridged_chain(message_payload: &[u8]) -> RangeInclusive<Weight> {
// we don't want to relay too large messages + keep reserve for future upgrades
let upper_limit = bp_rialto::MAXIMUM_EXTRINSIC_WEIGHT / 2;
let upper_limit = bp_rialto::max_extrinsic_weight() / 2;
// given Rialto chain parameters (`TransactionByteFee`, `WeightToFee`, `FeeMultiplierUpdate`),
// the minimal weight of the message may be computed as message.length()
@@ -116,12 +116,12 @@ impl MessageBridge for WithRialtoMessageBridge {
}
fn this_weight_to_this_balance(weight: Weight) -> bp_millau::Balance {
<crate::Runtime as pallet_transaction_payment::Trait>::WeightToFee::calc(&weight)
<crate::Runtime as pallet_transaction_payment::Config>::WeightToFee::calc(&weight)
}
fn bridged_weight_to_bridged_balance(weight: Weight) -> bp_rialto::Balance {
// we're using the same weights in both chains now
<crate::Runtime as pallet_transaction_payment::Trait>::WeightToFee::calc(&weight) as _
<crate::Runtime as pallet_transaction_payment::Config>::WeightToFee::calc(&weight) as _
}
fn this_balance_to_bridged_balance(this_balance: bp_millau::Balance) -> bp_rialto::Balance {