mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 02:51:01 +00:00
Use real weights to compute message delivery and dispatch fee (#598)
* message fee formula * update GetDelvieryConfirmationTransactionFee * include cost of transactions (i.e. not only dispatch cost) in delivery_and_dispatch_fee * endow relayers fund account * include db ops weight in max tx weight estimation * (in bytes) Co-authored-by: Hernando Castano <castano.ha@gmail.com>
This commit is contained in:
committed by
Bastian Köcher
parent
fd7f2a45d8
commit
0f56f18778
@@ -315,8 +315,9 @@ parameter_types! {
|
||||
bp_millau::MAX_UNREWARDED_RELAYER_ENTRIES_AT_INBOUND_LANE;
|
||||
pub const MaxUnconfirmedMessagesAtInboundLane: bp_message_lane::MessageNonce =
|
||||
bp_millau::MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE;
|
||||
// TODO: https://github.com/paritytech/parity-bridges-common/pull/598
|
||||
pub GetDeliveryConfirmationTransactionFee: Balance = 0;
|
||||
// `IdentityFee` is used by Millau => we may use weight directly
|
||||
pub const GetDeliveryConfirmationTransactionFee: Balance =
|
||||
bp_millau::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT as _;
|
||||
pub const RootAccountForPayments: Option<AccountId> = None;
|
||||
}
|
||||
|
||||
@@ -594,3 +595,17 @@ impl_runtime_apis! {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[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>>(
|
||||
bp_millau::MAX_SINGLE_MESSAGE_DELIVERY_TX_WEIGHT,
|
||||
bp_millau::MAX_SINGLE_MESSAGE_DELIVERY_CONFIRMATION_TX_WEIGHT,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user