Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CheckMetadataHash extension #337

Merged
merged 6 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests
  • Loading branch information
bkchr committed May 31, 2024
commit 03cf81918c20082536a80a0a091a30e3e33c3004
1 change: 1 addition & 0 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ where
frame_system::CheckNonce::<Runtime>::from(nonce),
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
);
let raw_payload = SignedPayload::new(call, extra)
.map_err(|e| {
Expand Down
2 changes: 2 additions & 0 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ where
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(tip),
claims::PrevalidateAttests::<Runtime>::new(),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
);
let raw_payload = SignedPayload::new(call, extra)
.map_err(|e| {
Expand Down Expand Up @@ -2803,6 +2804,7 @@ mod test_fees {
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
claims::PrevalidateAttests::<Runtime>::new(),
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
);
let uxt = UncheckedExtrinsic {
function: call,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ frame_support::parameter_types! {

/// Transaction fee that is paid at the Kusama BridgeHub for delivering single inbound message.
/// (initially was calculated by test `BridgeHubKusama::can_calculate_fee_for_complex_message_delivery_transaction` + `33%`)
pub const BridgeHubKusamaBaseDeliveryFeeInKsms: u128 = 56_374_989_788;
pub const BridgeHubKusamaBaseDeliveryFeeInKsms: u128 = 56_375_433_121;

/// Transaction fee that is paid at the Kusama BridgeHub for delivering single outbound message confirmation.
/// (initially was calculated by test `BridgeHubKusama::can_calculate_fee_for_complex_message_confirmation_transaction` + `33%`)
pub const BridgeHubKusamaBaseConfirmationFeeInKsms: u128 = 53_808_755_240;
pub const BridgeHubKusamaBaseConfirmationFeeInKsms: u128 = 53_809_198_573;
}

/// Compute the total estimated fee that needs to be paid in KSMs by the sender when sending
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ fn construct_extrinsic(
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
BridgeRejectObsoleteHeadersAndMessages,
(RefundBridgeHubPolkadotMessages::default()),
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
);
let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
let signature = payload.using_encoded(|e| sender.sign(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ fn construct_extrinsic(
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
BridgeRejectObsoleteHeadersAndMessages,
(RefundBridgeHubPolkadotMessages::default()),
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
);
let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
let signature = payload.using_encoded(|e| sender.sign(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ frame_support::parameter_types! {

/// Transaction fee that is paid at the Polkadot BridgeHub for delivering single inbound message.
/// (initially was calculated by test `BridgeHubPolkadot::can_calculate_fee_for_complex_message_delivery_transaction` + `33%`)
pub const BridgeHubPolkadotBaseDeliveryFeeInDots: Balance = 16_912_512_364;
pub const BridgeHubPolkadotBaseDeliveryFeeInDots: Balance = 16_912_645_364;

/// Transaction fee that is paid at the Polkadot BridgeHub for delivering single outbound message confirmation.
/// (initially was calculated by test `BridgeHubPolkadot::can_calculate_fee_for_complex_message_confirmation_transaction` + `33%`)
pub const BridgeHubPolkadotBaseConfirmationFeeInDots: Balance = 16_142_641_864;
pub const BridgeHubPolkadotBaseConfirmationFeeInDots: Balance = 16_142_774_864;
}

/// Compute the total estimated fee that needs to be paid in DOTs by the sender when sending
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ fn construct_extrinsic(
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
BridgeRejectObsoleteHeadersAndMessages,
(RefundBridgeHubKusamaMessages::default()),
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
);
let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
let signature = payload.using_encoded(|e| sender.sign(e));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ fn construct_extrinsic(
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
BridgeRejectObsoleteHeadersAndMessages,
(RefundBridgeHubKusamaMessages::default()),
frame_metadata_hash_extension::CheckMetadataHash::<Runtime>::new(false),
);
let payload = SignedPayload::new(call.clone(), extra.clone()).unwrap();
let signature = payload.using_encoded(|e| sender.sign(e));
Expand Down
Loading