mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 01:41:03 +00:00
Account proof size in weight formula (#679)
* fix broken message lane benchmarks * proof-size related benchmarks * impl Size for proof parameters * include proof weight into weight formula * left TODO * fixed proof size * WeightInfoExt::receive_messages_proof_weight * charge for extra message bytes delivery in send_message * removed default impl of WeightsInfoExt * moved weight formulas to WeightInfoExt * receive_messages_proof_outbound_lane_state_overhead is included twice in weight * typo * typo * fixed TODO * more asserts * started wotk on message-lane documentation * expected_extra_storage_proof_size() is actually expected in delivery confirmation tx * update README.md * ensure_able_to_receive_confirmation * test rialto message lane weights * removed TODO * removed unnecessary trait requirements * fixed arguments * fix compilation * decreased basic delivery tx weight * fmt * clippy * Update modules/message-lane/src/benchmarking.rs Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * structs * Update primitives/millau/src/lib.rs Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * removed readme.md * removed obsolete trait bounds * Revert "removed readme.md" This reverts commit 50b7376a41687a94c27bf77565434be153f87ca1. * Update bin/runtime-common/src/messages.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Update bin/runtime-common/src/messages.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Update bin/runtime-common/src/messages.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Update bin/runtime-common/src/messages.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Update bin/runtime-common/src/messages.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Update bin/runtime-common/src/messages.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * Update bin/runtime-common/src/messages.rs Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com> * PreComputedSize Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
fb7c191234
commit
2f457775bb
@@ -623,13 +623,49 @@ where
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use bridge_runtime_common::messages;
|
||||
|
||||
#[test]
|
||||
fn ensure_millau_message_lane_weights_are_correct() {
|
||||
// TODO: https://github.com/paritytech/parity-bridges-common/issues/390
|
||||
pallet_message_lane::ensure_weights_are_correct::<pallet_message_lane::weights::RialtoWeight<Runtime>>(
|
||||
type Weights = pallet_message_lane::weights::RialtoWeight<Runtime>;
|
||||
|
||||
pallet_message_lane::ensure_weights_are_correct::<Weights>(
|
||||
bp_millau::MAX_SINGLE_MESSAGE_DELIVERY_TX_WEIGHT,
|
||||
bp_millau::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT,
|
||||
);
|
||||
|
||||
let max_incoming_message_proof_size = bp_rialto::EXTRA_STORAGE_PROOF_SIZE.saturating_add(
|
||||
messages::target::maximal_incoming_message_size(bp_millau::max_extrinsic_size()),
|
||||
);
|
||||
pallet_message_lane::ensure_able_to_receive_message::<Weights>(
|
||||
bp_millau::max_extrinsic_size(),
|
||||
bp_millau::max_extrinsic_weight(),
|
||||
max_incoming_message_proof_size,
|
||||
bridge_runtime_common::messages::transaction_weight_without_multiplier(
|
||||
bp_millau::BlockWeights::get().get(DispatchClass::Normal).base_extrinsic,
|
||||
max_incoming_message_proof_size as _,
|
||||
0,
|
||||
),
|
||||
messages::target::maximal_incoming_message_dispatch_weight(bp_millau::max_extrinsic_weight()),
|
||||
);
|
||||
|
||||
let max_incoming_inbound_lane_data_proof_size = bp_message_lane::InboundLaneData::<()>::encoded_size_hint(
|
||||
bp_millau::MAXIMAL_ENCODED_ACCOUNT_ID_SIZE,
|
||||
bp_rialto::MAX_UNREWARDED_RELAYER_ENTRIES_AT_INBOUND_LANE as _,
|
||||
)
|
||||
.unwrap_or(u32::MAX);
|
||||
pallet_message_lane::ensure_able_to_receive_confirmation::<Weights>(
|
||||
bp_millau::max_extrinsic_size(),
|
||||
bp_millau::max_extrinsic_weight(),
|
||||
max_incoming_inbound_lane_data_proof_size,
|
||||
bp_rialto::MAX_UNREWARDED_RELAYER_ENTRIES_AT_INBOUND_LANE,
|
||||
bp_rialto::MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE,
|
||||
bridge_runtime_common::messages::transaction_weight_without_multiplier(
|
||||
bp_millau::BlockWeights::get().get(DispatchClass::Normal).base_extrinsic,
|
||||
max_incoming_inbound_lane_data_proof_size as _,
|
||||
0,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user