Skip to content
GitLab
Explore
Sign in
parity
Mirrored projects
polkadot-sdk
Compare revisions
be1d7d05e5f32b1bfa67aec2f6344d2c6ff60f50 to aceda4659509d426d364188fa72555de58b887ba
Hide whitespace changes
Inline
Side-by-side
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/xcm_config.rs
View file @
aceda465
...
...
@@ -19,7 +19,6 @@ use super::{
ParachainSystem
,
PolkadotXcm
,
Runtime
,
RuntimeCall
,
RuntimeEvent
,
RuntimeOrigin
,
TransactionByteFee
,
WeightToFee
,
XcmpQueue
,
};
use
crate
::
bridge_common_config
::{
DeliveryRewardInBalance
,
RequiredStakeForStakeAndSlash
};
use
frame_support
::{
parameter_types
,
traits
::{
tokens
::
imbalance
::
ResolveTo
,
ConstU32
,
Contains
,
Equals
,
Everything
,
Nothing
},
...
...
@@ -39,16 +38,16 @@ use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use
sp_runtime
::
traits
::
AccountIdConversion
;
use
xcm
::
latest
::
prelude
::
*
;
use
xcm_builder
::{
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
Allow
KnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WeightInfoBounds
,
WithComputedOrigin
,
WithUniqueTopic
,
XcmFeeManagerFromComponents
,
XcmFeeToAccount
,
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
Allow
HrmpNotificationsFromRelayChain
,
AllowKnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WeightInfoBounds
,
WithComputedOrigin
,
WithUniqueTopic
,
XcmFeeManagerFromComponents
,
XcmFeeToAccount
,
};
use
xcm_executor
::
{
traits
::
WithOriginFilter
,
XcmExecutor
}
;
use
xcm_executor
::
XcmExecutor
;
parameter_types!
{
pub
const
WestendLocation
:
Location
=
Location
::
parent
();
...
...
@@ -119,73 +118,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
}
}
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
/// account for proof size weights.
///
/// Calls that are allowed through this filter must:
/// 1. Have a fixed weight;
/// 2. Cannot lead to another call being made;
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
pub
struct
SafeCallFilter
;
impl
Contains
<
RuntimeCall
>
for
SafeCallFilter
{
fn
contains
(
call
:
&
RuntimeCall
)
->
bool
{
#[cfg(feature
=
"runtime-benchmarks"
)]
{
if
matches!
(
call
,
RuntimeCall
::
System
(
frame_system
::
Call
::
remark_with_event
{
..
}))
{
return
true
}
}
// Allow to change dedicated storage items (called by governance-like)
match
call
{
RuntimeCall
::
System
(
frame_system
::
Call
::
set_storage
{
items
})
if
items
.iter
()
.all
(|(
k
,
_
)|
{
k
.eq
(
&
DeliveryRewardInBalance
::
key
())
|
k
.eq
(
&
RequiredStakeForStakeAndSlash
::
key
())
})
=>
return
true
,
_
=>
(),
};
matches!
(
call
,
RuntimeCall
::
PolkadotXcm
(
pallet_xcm
::
Call
::
force_xcm_version
{
..
}
|
pallet_xcm
::
Call
::
force_default_xcm_version
{
..
}
)
|
RuntimeCall
::
System
(
frame_system
::
Call
::
set_heap_pages
{
..
}
|
frame_system
::
Call
::
set_code
{
..
}
|
frame_system
::
Call
::
set_code_without_checks
{
..
}
|
frame_system
::
Call
::
authorize_upgrade
{
..
}
|
frame_system
::
Call
::
authorize_upgrade_without_checks
{
..
}
|
frame_system
::
Call
::
kill_prefix
{
..
},
)
|
RuntimeCall
::
ParachainSystem
(
..
)
|
RuntimeCall
::
Timestamp
(
..
)
|
RuntimeCall
::
Balances
(
..
)
|
RuntimeCall
::
CollatorSelection
(
..
)
|
RuntimeCall
::
Session
(
pallet_session
::
Call
::
purge_keys
{
..
})
|
RuntimeCall
::
XcmpQueue
(
..
)
|
RuntimeCall
::
MessageQueue
(
..
)
|
RuntimeCall
::
BridgeRococoGrandpa
(
pallet_bridge_grandpa
::
Call
::
<
Runtime
,
crate
::
bridge_to_rococo_config
::
BridgeGrandpaRococoInstance
,
>
::
initialize
{
..
})
|
RuntimeCall
::
BridgeRococoGrandpa
(
pallet_bridge_grandpa
::
Call
::
<
Runtime
,
crate
::
bridge_to_rococo_config
::
BridgeGrandpaRococoInstance
,
>
::
set_operating_mode
{
..
})
|
RuntimeCall
::
BridgeRococoParachains
(
pallet_bridge_parachains
::
Call
::
<
Runtime
,
crate
::
bridge_to_rococo_config
::
BridgeParachainRococoInstance
,
>
::
set_operating_mode
{
..
})
|
RuntimeCall
::
BridgeRococoMessages
(
pallet_bridge_messages
::
Call
::
<
Runtime
,
crate
::
bridge_to_rococo_config
::
WithBridgeHubRococoMessagesInstance
,
>
::
set_operating_mode
{
..
})
)
}
}
pub
type
Barrier
=
TrailingSetTopicAsId
<
DenyThenTry
<
DenyReserveTransferToRelayChain
,
...
...
@@ -207,6 +139,8 @@ pub type Barrier = TrailingSetTopicAsId<
)
>
,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom
<
ParentRelayOrSiblingParachains
>
,
// HRMP notifications from the relay chain are OK.
AllowHrmpNotificationsFromRelayChain
,
),
UniversalLocation
,
ConstU32
<
8
>
,
...
...
@@ -265,8 +199,8 @@ impl xcm_executor::Config for XcmConfig {
>
;
type
MessageExporter
=
(
crate
::
bridge_to_rococo_config
::
ToBridgeHubRococoHaulBlobExporter
,);
type
UniversalAliases
=
Nothing
;
type
CallDispatcher
=
WithOriginFilter
<
SafeCallFilter
>
;
type
SafeCallFilter
=
SafeCallFilter
;
type
CallDispatcher
=
RuntimeCall
;
type
SafeCallFilter
=
Everything
;
type
Aliasers
=
Nothing
;
type
TransactionalProcessor
=
FrameTransactionalProcessor
;
type
HrmpNewChannelOpenRequestHandler
=
();
...
...
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/tests/tests.rs
View file @
aceda465
...
...
@@ -94,11 +94,10 @@ fn construct_and_apply_extrinsic(
r
.unwrap
()
}
fn
construct_and_estimate_extrinsic_fee
(
batch
:
pallet_utility
::
Call
<
Runtime
>
)
->
Balance
{
let
batch_call
=
RuntimeCall
::
Utility
(
batch
);
let
batch_info
=
batch_call
.get_dispatch_info
();
let
xt
=
construct_extrinsic
(
Alice
,
batch_call
);
TransactionPayment
::
compute_fee
(
xt
.encoded_size
()
as
_
,
&
batch_info
,
0
)
fn
construct_and_estimate_extrinsic_fee
(
call
:
RuntimeCall
)
->
Balance
{
let
info
=
call
.get_dispatch_info
();
let
xt
=
construct_extrinsic
(
Alice
,
call
);
TransactionPayment
::
compute_fee
(
xt
.encoded_size
()
as
_
,
&
info
,
0
)
}
fn
collator_session_keys
()
->
bridge_hub_test_utils
::
CollatorSessionKeys
<
Runtime
>
{
...
...
@@ -271,22 +270,6 @@ fn relayed_incoming_message_works() {
)
}
#[test]
pub
fn
complex_relay_extrinsic_works
()
{
from_parachain
::
complex_relay_extrinsic_works
::
<
RuntimeTestsAdapter
>
(
collator_session_keys
(),
slot_durations
(),
bp_bridge_hub_westend
::
BRIDGE_HUB_WESTEND_PARACHAIN_ID
,
bp_bridge_hub_rococo
::
BRIDGE_HUB_ROCOCO_PARACHAIN_ID
,
SIBLING_PARACHAIN_ID
,
BridgeHubRococoChainId
::
get
(),
Westend
,
XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO
,
||
(),
construct_and_apply_extrinsic
,
);
}
#[test]
pub
fn
can_calculate_weight_for_paid_export_message_with_reserve_transfer
()
{
bridge_hub_test_utils
::
check_sane_fees_values
(
...
...
@@ -309,12 +292,12 @@ pub fn can_calculate_weight_for_paid_export_message_with_reserve_transfer() {
}
#[test]
pub
fn
can_calculate_fee_for_
complex
_message_delivery_transaction
()
{
pub
fn
can_calculate_fee_for_
standalone
_message_delivery_transaction
()
{
bridge_hub_test_utils
::
check_sane_fees_values
(
"bp_bridge_hub_westend::BridgeHubWestendBaseDeliveryFeeInWnds"
,
bp_bridge_hub_westend
::
BridgeHubWestendBaseDeliveryFeeInWnds
::
get
(),
||
{
from_parachain
::
can_calculate_fee_for_
complex
_message_delivery_transaction
::
<
from_parachain
::
can_calculate_fee_for_
standalone
_message_delivery_transaction
::
<
RuntimeTestsAdapter
,
>
(
collator_session_keys
(),
construct_and_estimate_extrinsic_fee
)
},
...
...
@@ -328,12 +311,12 @@ pub fn can_calculate_fee_for_complex_message_delivery_transaction() {
}
#[test]
pub
fn
can_calculate_fee_for_
complex
_message_confirmation_transaction
()
{
pub
fn
can_calculate_fee_for_
standalone
_message_confirmation_transaction
()
{
bridge_hub_test_utils
::
check_sane_fees_values
(
"bp_bridge_hub_westend::BridgeHubWestendBaseConfirmationFeeInWnds"
,
bp_bridge_hub_westend
::
BridgeHubWestendBaseConfirmationFeeInWnds
::
get
(),
||
{
from_parachain
::
can_calculate_fee_for_
complex
_message_confirmation_transaction
::
<
from_parachain
::
can_calculate_fee_for_
standalone
_message_confirmation_transaction
::
<
RuntimeTestsAdapter
,
>
(
collator_session_keys
(),
construct_and_estimate_extrinsic_fee
)
},
...
...
cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_grandpa_chain.rs
View file @
aceda465
...
...
@@ -41,6 +41,7 @@ use frame_system::pallet_prelude::BlockNumberFor;
use
parachains_runtimes_test_utils
::{
AccountIdOf
,
BasicParachainRuntime
,
CollatorSessionKeys
,
RuntimeCallOf
,
SlotDurations
,
};
use
sp_core
::
Get
;
use
sp_keyring
::
AccountKeyring
::
*
;
use
sp_runtime
::{
traits
::
Header
as
HeaderT
,
AccountId32
};
use
xcm
::
latest
::
prelude
::
*
;
...
...
@@ -162,7 +163,14 @@ pub fn relayed_incoming_message_works<RuntimeHelper>(
test_data
::
from_grandpa_chain
::
make_complex_relayer_delivery_proofs
::
<
RuntimeHelper
::
MB
,
(),
>
(
lane_id
,
xcm
.into
(),
message_nonce
,
message_destination
,
relay_header_number
);
>
(
lane_id
,
xcm
.into
(),
message_nonce
,
message_destination
,
relay_header_number
,
false
,
);
let
relay_chain_header_hash
=
relay_chain_header
.hash
();
vec!
[
...
...
@@ -202,6 +210,142 @@ pub fn relayed_incoming_message_works<RuntimeHelper>(
);
}
/// Test-case makes sure that Runtime can dispatch XCM messages submitted by relayer,
/// with proofs (finality, message) independently submitted.
/// Finality proof is submitted for free in this test.
/// Also verifies relayer transaction signed extensions work as intended.
pub
fn
free_relay_extrinsic_works
<
RuntimeHelper
>
(
collator_session_key
:
CollatorSessionKeys
<
RuntimeHelper
::
Runtime
>
,
slot_durations
:
SlotDurations
,
runtime_para_id
:
u32
,
bridged_chain_id
:
bp_runtime
::
ChainId
,
sibling_parachain_id
:
u32
,
local_relay_chain_id
:
NetworkId
,
lane_id
:
LaneId
,
prepare_configuration
:
impl
Fn
(),
construct_and_apply_extrinsic
:
fn
(
sp_keyring
::
AccountKeyring
,
RuntimeCallOf
<
RuntimeHelper
::
Runtime
>
,
)
->
sp_runtime
::
DispatchOutcome
,
)
where
RuntimeHelper
:
WithRemoteGrandpaChainHelper
,
RuntimeHelper
::
Runtime
:
pallet_balances
::
Config
,
AccountIdOf
<
RuntimeHelper
::
Runtime
>
:
From
<
AccountId32
>
,
RuntimeCallOf
<
RuntimeHelper
::
Runtime
>
:
From
<
BridgeGrandpaCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>>
+
From
<
BridgeMessagesCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>>
,
UnderlyingChainOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
:
ChainWithGrandpa
,
<
RuntimeHelper
::
Runtime
as
BridgeMessagesConfig
<
RuntimeHelper
::
MPI
>>
::
SourceHeaderChain
:
SourceHeaderChain
<
MessagesProof
=
FromBridgedChainMessagesProof
<
HashOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
,
>
,
>
,
{
// ensure that the runtime allows free header submissions
let
free_headers_interval
=
<
RuntimeHelper
::
Runtime
as
BridgeGrandpaConfig
<
RuntimeHelper
::
GPI
,
>>
::
FreeHeadersInterval
::
get
()
.expect
(
"this test requires runtime, configured to accept headers for free; qed"
);
helpers
::
relayed_incoming_message_works
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
AllPalletsWithoutSystem
,
RuntimeHelper
::
MPI
,
>
(
collator_session_key
,
slot_durations
,
runtime_para_id
,
sibling_parachain_id
,
local_relay_chain_id
,
construct_and_apply_extrinsic
,
|
relayer_id_at_this_chain
,
relayer_id_at_bridged_chain
,
message_destination
,
message_nonce
,
xcm
|
{
prepare_configuration
();
// start with bridged relay chain block#0
let
initial_block_number
=
0
;
helpers
::
initialize_bridge_grandpa_pallet
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
(
test_data
::
initialization_data
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
(
initial_block_number
,
),
);
// free relay chain header is `0 + free_headers_interval`
let
relay_header_number
=
initial_block_number
+
free_headers_interval
;
// relayer balance shall not change after relay and para header submissions
let
initial_relayer_balance
=
pallet_balances
::
Pallet
::
<
RuntimeHelper
::
Runtime
>
::
free_balance
(
relayer_id_at_this_chain
.clone
(),
);
// initialize the `FreeHeadersRemaining` storage value
pallet_bridge_grandpa
::
Pallet
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
::
on_initialize
(
0u32
.into
(),
);
// generate bridged relay chain finality, parachain heads and message proofs,
// to be submitted by relayer to this chain.
let
(
relay_chain_header
,
grandpa_justification
,
message_proof
)
=
test_data
::
from_grandpa_chain
::
make_complex_relayer_delivery_proofs
::
<
RuntimeHelper
::
MB
,
(),
>
(
lane_id
,
xcm
.into
(),
message_nonce
,
message_destination
,
relay_header_number
.into
(),
true
,
);
let
relay_chain_header_hash
=
relay_chain_header
.hash
();
vec!
[
(
BridgeGrandpaCall
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
::
submit_finality_proof
{
finality_target
:
Box
::
new
(
relay_chain_header
),
justification
:
grandpa_justification
,
}
.into
(),
Box
::
new
((
helpers
::
VerifySubmitGrandpaFinalityProofOutcome
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
::
expect_best_header_hash
(
relay_chain_header_hash
,
),
helpers
::
VerifyRelayerBalance
::
<
RuntimeHelper
::
Runtime
>
::
expect_relayer_balance
(
relayer_id_at_this_chain
.clone
(),
initial_relayer_balance
,
),
))
),
(
BridgeMessagesCall
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>
::
receive_messages_proof
{
relayer_id_at_bridged_chain
,
proof
:
message_proof
,
messages_count
:
1
,
dispatch_weight
:
Weight
::
from_parts
(
1000000000
,
0
),
}
.into
(),
Box
::
new
((
helpers
::
VerifySubmitMessagesProofOutcome
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>
::
expect_last_delivered_nonce
(
lane_id
,
1
,
),
helpers
::
VerifyRelayerRewarded
::
<
RuntimeHelper
::
Runtime
>
::
expect_relayer_reward
(
relayer_id_at_this_chain
,
RewardsAccountParams
::
new
(
lane_id
,
bridged_chain_id
,
RewardsAccountOwner
::
ThisChain
,
),
),
)),
),
]
},
);
}
/// Test-case makes sure that Runtime can dispatch XCM messages submitted by relayer,
/// with proofs (finality, message) batched together in signed extrinsic.
/// Also verifies relayer transaction signed extensions work as intended.
...
...
@@ -265,7 +409,14 @@ pub fn complex_relay_extrinsic_works<RuntimeHelper>(
test_data
::
from_grandpa_chain
::
make_complex_relayer_delivery_proofs
::
<
RuntimeHelper
::
MB
,
(),
>
(
lane_id
,
xcm
.into
(),
message_nonce
,
message_destination
,
relay_header_number
);
>
(
lane_id
,
xcm
.into
(),
message_nonce
,
message_destination
,
relay_header_number
,
false
,
);
let
relay_chain_header_hash
=
relay_chain_header
.hash
();
vec!
[(
...
...
@@ -344,6 +495,7 @@ where
1
,
[
GlobalConsensus
(
Polkadot
),
Parachain
(
1_000
)]
.into
(),
1u32
.into
(),
false
,
);
// generate batch call that provides finality for bridged relay and parachains + message
...
...
@@ -423,3 +575,109 @@ where
compute_extrinsic_fee
(
batch
)
})
}
/// Estimates transaction fee for default message delivery transaction from bridged GRANDPA chain.
pub
fn
can_calculate_fee_for_standalone_message_delivery_transaction
<
RuntimeHelper
>
(
collator_session_key
:
CollatorSessionKeys
<
RuntimeHelper
::
Runtime
>
,
compute_extrinsic_fee
:
fn
(
<
RuntimeHelper
::
Runtime
as
frame_system
::
Config
>
::
RuntimeCall
,
)
->
u128
,
)
->
u128
where
RuntimeHelper
:
WithRemoteGrandpaChainHelper
,
RuntimeCallOf
<
RuntimeHelper
::
Runtime
>
:
From
<
BridgeMessagesCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>>
,
UnderlyingChainOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
:
ChainWithGrandpa
,
<
RuntimeHelper
::
Runtime
as
BridgeMessagesConfig
<
RuntimeHelper
::
MPI
>>
::
SourceHeaderChain
:
SourceHeaderChain
<
MessagesProof
=
FromBridgedChainMessagesProof
<
HashOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
,
>
,
>
,
{
run_test
::
<
RuntimeHelper
::
Runtime
,
_
>
(
collator_session_key
,
1000
,
vec!
[],
||
{
// generate bridged relay chain finality, parachain heads and message proofs,
// to be submitted by relayer to this chain.
//
// we don't care about parameter values here, apart from the XCM message size. But we
// do not need to have a large message here, because we're charging for every byte of
// the message additionally
let
(
_
,
_
,
message_proof
)
=
test_data
::
from_grandpa_chain
::
make_complex_relayer_delivery_proofs
::
<
RuntimeHelper
::
MB
,
(),
>
(
LaneId
::
default
(),
vec!
[
Instruction
::
<
()
>
::
ClearOrigin
;
1_024
]
.into
(),
1
,
[
GlobalConsensus
(
Polkadot
),
Parachain
(
1_000
)]
.into
(),
1u32
.into
(),
false
,
);
let
call
=
test_data
::
from_grandpa_chain
::
make_standalone_relayer_delivery_call
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
,
RuntimeHelper
::
MPI
,
>
(
message_proof
,
helpers
::
relayer_id_at_bridged_chain
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>
(),
);
compute_extrinsic_fee
(
call
)
})
}
/// Estimates transaction fee for default message confirmation transaction (batched with required
/// proofs) from bridged parachain.
pub
fn
can_calculate_fee_for_standalone_message_confirmation_transaction
<
RuntimeHelper
>
(
collator_session_key
:
CollatorSessionKeys
<
RuntimeHelper
::
Runtime
>
,
compute_extrinsic_fee
:
fn
(
<
RuntimeHelper
::
Runtime
as
frame_system
::
Config
>
::
RuntimeCall
,
)
->
u128
,
)
->
u128
where
RuntimeHelper
:
WithRemoteGrandpaChainHelper
,
AccountIdOf
<
RuntimeHelper
::
Runtime
>
:
From
<
AccountId32
>
,
MessageThisChain
<
RuntimeHelper
::
MB
>
:
bp_runtime
::
Chain
<
AccountId
=
AccountIdOf
<
RuntimeHelper
::
Runtime
>>
,
RuntimeCallOf
<
RuntimeHelper
::
Runtime
>
:
From
<
BridgeMessagesCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>>
,
UnderlyingChainOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
:
ChainWithGrandpa
,
<
RuntimeHelper
::
Runtime
as
BridgeMessagesConfig
<
RuntimeHelper
::
MPI
>>
::
TargetHeaderChain
:
TargetHeaderChain
<
XcmAsPlainPayload
,
AccountIdOf
<
RuntimeHelper
::
Runtime
>
,
MessagesDeliveryProof
=
FromBridgedChainMessagesDeliveryProof
<
HashOf
<
UnderlyingChainOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>>
,
>
,
>
,
{
run_test
::
<
RuntimeHelper
::
Runtime
,
_
>
(
collator_session_key
,
1000
,
vec!
[],
||
{
// generate bridged relay chain finality, parachain heads and message proofs,
// to be submitted by relayer to this chain.
let
unrewarded_relayers
=
UnrewardedRelayersState
{
unrewarded_relayer_entries
:
1
,
total_messages
:
1
,
..
Default
::
default
()
};
let
(
_
,
_
,
message_delivery_proof
)
=
test_data
::
from_grandpa_chain
::
make_complex_relayer_confirmation_proofs
::
<
RuntimeHelper
::
MB
,
(),
>
(
LaneId
::
default
(),
1u32
.into
(),
AccountId32
::
from
(
Alice
.public
())
.into
(),
unrewarded_relayers
.clone
(),
);
let
call
=
test_data
::
from_grandpa_chain
::
make_standalone_relayer_confirmation_call
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
,
RuntimeHelper
::
MPI
,
>
(
message_delivery_proof
,
unrewarded_relayers
);
compute_extrinsic_fee
(
call
)
})
}
cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/from_parachain.rs
View file @
aceda465
...
...
@@ -42,6 +42,7 @@ use frame_system::pallet_prelude::BlockNumberFor;
use
parachains_runtimes_test_utils
::{
AccountIdOf
,
BasicParachainRuntime
,
CollatorSessionKeys
,
RuntimeCallOf
,
SlotDurations
,
};
use
sp_core
::
Get
;
use
sp_keyring
::
AccountKeyring
::
*
;
use
sp_runtime
::{
traits
::
Header
as
HeaderT
,
AccountId32
};
use
xcm
::
latest
::
prelude
::
*
;
...
...
@@ -188,6 +189,7 @@ pub fn relayed_incoming_message_works<RuntimeHelper>(
para_header_number
,
relay_header_number
,
bridged_para_id
,
false
,
);
let
parachain_head_hash
=
parachain_head
.hash
();
...
...
@@ -241,6 +243,177 @@ pub fn relayed_incoming_message_works<RuntimeHelper>(
);
}
/// Test-case makes sure that Runtime can dispatch XCM messages submitted by relayer,
/// with proofs (finality, para heads, message) independently submitted.
/// Finality and para heads are submitted for free in this test.
/// Also verifies relayer transaction signed extensions work as intended.
pub
fn
free_relay_extrinsic_works
<
RuntimeHelper
>
(
collator_session_key
:
CollatorSessionKeys
<
RuntimeHelper
::
Runtime
>
,
slot_durations
:
SlotDurations
,
runtime_para_id
:
u32
,
bridged_para_id
:
u32
,
bridged_chain_id
:
bp_runtime
::
ChainId
,
sibling_parachain_id
:
u32
,
local_relay_chain_id
:
NetworkId
,
lane_id
:
LaneId
,
prepare_configuration
:
impl
Fn
(),
construct_and_apply_extrinsic
:
fn
(
sp_keyring
::
AccountKeyring
,
<
RuntimeHelper
::
Runtime
as
frame_system
::
Config
>
::
RuntimeCall
,
)
->
sp_runtime
::
DispatchOutcome
,
)
where
RuntimeHelper
:
WithRemoteParachainHelper
,
RuntimeHelper
::
Runtime
:
pallet_balances
::
Config
,
AccountIdOf
<
RuntimeHelper
::
Runtime
>
:
From
<
AccountId32
>
,
RuntimeCallOf
<
RuntimeHelper
::
Runtime
>
:
From
<
BridgeGrandpaCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>>
+
From
<
BridgeParachainsCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
PPI
>>
+
From
<
BridgeMessagesCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>>
,
UnderlyingChainOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
:
bp_runtime
::
Chain
<
Hash
=
ParaHash
>
+
Parachain
,
<
RuntimeHelper
::
Runtime
as
BridgeGrandpaConfig
<
RuntimeHelper
::
GPI
>>
::
BridgedChain
:
bp_runtime
::
Chain
<
Hash
=
RelayBlockHash
,
BlockNumber
=
RelayBlockNumber
>
+
ChainWithGrandpa
,
<
RuntimeHelper
::
Runtime
as
BridgeMessagesConfig
<
RuntimeHelper
::
MPI
>>
::
SourceHeaderChain
:
SourceHeaderChain
<
MessagesProof
=
FromBridgedChainMessagesProof
<
HashOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
,
>
,
>
,
{
// ensure that the runtime allows free header submissions
let
free_headers_interval
=
<
RuntimeHelper
::
Runtime
as
BridgeGrandpaConfig
<
RuntimeHelper
::
GPI
,
>>
::
FreeHeadersInterval
::
get
()
.expect
(
"this test requires runtime, configured to accept headers for free; qed"
);
helpers
::
relayed_incoming_message_works
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
AllPalletsWithoutSystem
,
RuntimeHelper
::
MPI
,
>
(
collator_session_key
,
slot_durations
,
runtime_para_id
,
sibling_parachain_id
,
local_relay_chain_id
,
construct_and_apply_extrinsic
,
|
relayer_id_at_this_chain
,
relayer_id_at_bridged_chain
,
message_destination
,
message_nonce
,
xcm
|
{
prepare_configuration
();
// start with bridged relay chain block#0
let
initial_block_number
=
0
;
helpers
::
initialize_bridge_grandpa_pallet
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
(
test_data
::
initialization_data
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
(
initial_block_number
,
),
);
// free relay chain header is `0 + free_headers_interval`
let
relay_header_number
=
initial_block_number
+
free_headers_interval
;
// first parachain header is always submitted for free
let
para_header_number
=
1
;
// relayer balance shall not change after relay and para header submissions
let
initial_relayer_balance
=
pallet_balances
::
Pallet
::
<
RuntimeHelper
::
Runtime
>
::
free_balance
(
relayer_id_at_this_chain
.clone
(),
);
// initialize the `FreeHeadersRemaining` storage value
pallet_bridge_grandpa
::
Pallet
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
::
on_initialize
(
0u32
.into
(),
);
// generate bridged relay chain finality, parachain heads and message proofs,
// to be submitted by relayer to this chain.
let
(
relay_chain_header
,
grandpa_justification
,
parachain_head
,
parachain_heads
,
para_heads_proof
,
message_proof
,
)
=
test_data
::
from_parachain
::
make_complex_relayer_delivery_proofs
::
<
<
RuntimeHelper
::
Runtime
as
BridgeGrandpaConfig
<
RuntimeHelper
::
GPI
>>
::
BridgedChain
,
RuntimeHelper
::
MB
,
(),
>
(
lane_id
,
xcm
.into
(),
message_nonce
,
message_destination
,
para_header_number
,
relay_header_number
,
bridged_para_id
,
true
,
);
let
parachain_head_hash
=
parachain_head
.hash
();
let
relay_chain_header_hash
=
relay_chain_header
.hash
();
let
relay_chain_header_number
=
*
relay_chain_header
.number
();
vec!
[
(
BridgeGrandpaCall
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
::
submit_finality_proof
{
finality_target
:
Box
::
new
(
relay_chain_header
),
justification
:
grandpa_justification
,
}
.into
(),
Box
::
new
((
helpers
::
VerifySubmitGrandpaFinalityProofOutcome
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
GPI
>
::
expect_best_header_hash
(
relay_chain_header_hash
,
),
helpers
::
VerifyRelayerBalance
::
<
RuntimeHelper
::
Runtime
>
::
expect_relayer_balance
(
relayer_id_at_this_chain
.clone
(),
initial_relayer_balance
,
),
)),
),
(
BridgeParachainsCall
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
PPI
>
::
submit_parachain_heads
{
at_relay_block
:
(
relay_chain_header_number
,
relay_chain_header_hash
),
parachains
:
parachain_heads
,
parachain_heads_proof
:
para_heads_proof
,
}
.into
(),
Box
::
new
((
helpers
::
VerifySubmitParachainHeaderProofOutcome
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
PPI
>
::
expect_best_header_hash
(
bridged_para_id
,
parachain_head_hash
,
),
/*helpers::VerifyRelayerBalance::<RuntimeHelper::Runtime>::expect_relayer_balance(
relayer_id_at_this_chain.clone(),
initial_relayer_balance,
),*/
)),
),
(
BridgeMessagesCall
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>
::
receive_messages_proof
{
relayer_id_at_bridged_chain
,
proof
:
message_proof
,
messages_count
:
1
,
dispatch_weight
:
Weight
::
from_parts
(
1000000000
,
0
),
}
.into
(),
Box
::
new
((
helpers
::
VerifySubmitMessagesProofOutcome
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>
::
expect_last_delivered_nonce
(
lane_id
,
1
,
),
helpers
::
VerifyRelayerRewarded
::
<
RuntimeHelper
::
Runtime
>
::
expect_relayer_reward
(
relayer_id_at_this_chain
,
RewardsAccountParams
::
new
(
lane_id
,
bridged_chain_id
,
RewardsAccountOwner
::
ThisChain
,
),
),
)),
),
]
},
);
}
/// Test-case makes sure that Runtime can dispatch XCM messages submitted by relayer,
/// with proofs (finality, para heads, message) batched together in signed extrinsic.
/// Also verifies relayer transaction signed extensions work as intended.
...
...
@@ -325,6 +498,7 @@ pub fn complex_relay_extrinsic_works<RuntimeHelper>(
para_header_number
,
relay_header_number
,
bridged_para_id
,
false
,
);
let
parachain_head_hash
=
parachain_head
.hash
();
...
...
@@ -428,6 +602,7 @@ where
1
,
5
,
1_000
,
false
,
);
// generate batch call that provides finality for bridged relay and parachains + message
...
...
@@ -527,3 +702,126 @@ where
compute_extrinsic_fee
(
batch
)
})
}
/// Estimates transaction fee for default message delivery transaction from bridged parachain.
pub
fn
can_calculate_fee_for_standalone_message_delivery_transaction
<
RuntimeHelper
>
(
collator_session_key
:
CollatorSessionKeys
<
RuntimeHelper
::
Runtime
>
,
compute_extrinsic_fee
:
fn
(
<
RuntimeHelper
::
Runtime
as
frame_system
::
Config
>
::
RuntimeCall
,
)
->
u128
,
)
->
u128
where
RuntimeHelper
:
WithRemoteParachainHelper
,
RuntimeCallOf
<
RuntimeHelper
::
Runtime
>
:
From
<
BridgeMessagesCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>>
,
UnderlyingChainOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
:
bp_runtime
::
Chain
<
Hash
=
ParaHash
>
+
Parachain
,
<
RuntimeHelper
::
Runtime
as
BridgeGrandpaConfig
<
RuntimeHelper
::
GPI
>>
::
BridgedChain
:
bp_runtime
::
Chain
<
Hash
=
RelayBlockHash
,
BlockNumber
=
RelayBlockNumber
>
+
ChainWithGrandpa
,
<
RuntimeHelper
::
Runtime
as
BridgeMessagesConfig
<
RuntimeHelper
::
MPI
>>
::
SourceHeaderChain
:
SourceHeaderChain
<
MessagesProof
=
FromBridgedChainMessagesProof
<
HashOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
,
>
,
>
,
{
run_test
::
<
RuntimeHelper
::
Runtime
,
_
>
(
collator_session_key
,
1000
,
vec!
[],
||
{
// generate bridged relay chain finality, parachain heads and message proofs,
// to be submitted by relayer to this chain.
//
// we don't care about parameter values here, apart from the XCM message size. But we
// do not need to have a large message here, because we're charging for every byte of
// the message additionally
let
(
_
,
_
,
_
,
_
,
_
,
message_proof
,
)
=
test_data
::
from_parachain
::
make_complex_relayer_delivery_proofs
::
<
<
RuntimeHelper
::
Runtime
as
pallet_bridge_grandpa
::
Config
<
RuntimeHelper
::
GPI
>>
::
BridgedChain
,
RuntimeHelper
::
MB
,
(),
>
(
LaneId
::
default
(),
vec!
[
Instruction
::
<
()
>
::
ClearOrigin
;
1_024
]
.into
(),
1
,
[
GlobalConsensus
(
Polkadot
),
Parachain
(
1_000
)]
.into
(),
1
,
5
,
1_000
,
false
,
);
let
call
=
test_data
::
from_parachain
::
make_standalone_relayer_delivery_call
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
,
_
,
>
(
message_proof
,
helpers
::
relayer_id_at_bridged_chain
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>
(),
);
compute_extrinsic_fee
(
call
)
})
}
/// Estimates transaction fee for default message confirmation transaction (batched with required
/// proofs) from bridged parachain.
pub
fn
can_calculate_fee_for_standalone_message_confirmation_transaction
<
RuntimeHelper
>
(
collator_session_key
:
CollatorSessionKeys
<
RuntimeHelper
::
Runtime
>
,
compute_extrinsic_fee
:
fn
(
<
RuntimeHelper
::
Runtime
as
frame_system
::
Config
>
::
RuntimeCall
,
)
->
u128
,
)
->
u128
where
RuntimeHelper
:
WithRemoteParachainHelper
,
AccountIdOf
<
RuntimeHelper
::
Runtime
>
:
From
<
AccountId32
>
,
MessageThisChain
<
RuntimeHelper
::
MB
>
:
bp_runtime
::
Chain
<
AccountId
=
AccountIdOf
<
RuntimeHelper
::
Runtime
>>
,
RuntimeCallOf
<
RuntimeHelper
::
Runtime
>
:
From
<
BridgeMessagesCall
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
>>
,
UnderlyingChainOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>
:
bp_runtime
::
Chain
<
Hash
=
ParaHash
>
+
Parachain
,
<
RuntimeHelper
::
Runtime
as
BridgeGrandpaConfig
<
RuntimeHelper
::
GPI
>>
::
BridgedChain
:
bp_runtime
::
Chain
<
Hash
=
RelayBlockHash
,
BlockNumber
=
RelayBlockNumber
>
+
ChainWithGrandpa
,
<
RuntimeHelper
::
Runtime
as
BridgeMessagesConfig
<
RuntimeHelper
::
MPI
>>
::
TargetHeaderChain
:
TargetHeaderChain
<
XcmAsPlainPayload
,
AccountIdOf
<
RuntimeHelper
::
Runtime
>
,
MessagesDeliveryProof
=
FromBridgedChainMessagesDeliveryProof
<
HashOf
<
UnderlyingChainOf
<
MessageBridgedChain
<
RuntimeHelper
::
MB
>>>
,
>
,
>
,
{
run_test
::
<
RuntimeHelper
::
Runtime
,
_
>
(
collator_session_key
,
1000
,
vec!
[],
||
{
// generate bridged relay chain finality, parachain heads and message proofs,
// to be submitted by relayer to this chain.
let
unrewarded_relayers
=
UnrewardedRelayersState
{
unrewarded_relayer_entries
:
1
,
total_messages
:
1
,
..
Default
::
default
()
};
let
(
_
,
_
,
_
,
_
,
_
,
message_delivery_proof
)
=
test_data
::
from_parachain
::
make_complex_relayer_confirmation_proofs
::
<
<
RuntimeHelper
::
Runtime
as
BridgeGrandpaConfig
<
RuntimeHelper
::
GPI
>>
::
BridgedChain
,
RuntimeHelper
::
MB
,
(),
>
(
LaneId
::
default
(),
1
,
5
,
1_000
,
AccountId32
::
from
(
Alice
.public
())
.into
(),
unrewarded_relayers
.clone
(),
);
let
call
=
test_data
::
from_parachain
::
make_standalone_relayer_confirmation_call
::
<
RuntimeHelper
::
Runtime
,
RuntimeHelper
::
MPI
,
>
(
message_delivery_proof
,
unrewarded_relayers
);
compute_extrinsic_fee
(
call
)
})
}
cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_cases/helpers.rs
View file @
aceda465
...
...
@@ -193,6 +193,34 @@ where
}
}
/// Verifies that relayer balance is equal to given value.
pub
struct
VerifyRelayerBalance
<
Runtime
:
pallet_balances
::
Config
>
{
relayer
:
Runtime
::
AccountId
,
balance
:
Runtime
::
Balance
,
}
impl
<
Runtime
>
VerifyRelayerBalance
<
Runtime
>
where
Runtime
:
pallet_balances
::
Config
,
{
/// Expect given relayer balance after transaction.
pub
fn
expect_relayer_balance
(
relayer
:
Runtime
::
AccountId
,
balance
:
Runtime
::
Balance
,
)
->
Box
<
dyn
VerifyTransactionOutcome
>
{
Box
::
new
(
Self
{
relayer
,
balance
})
}
}
impl
<
Runtime
>
VerifyTransactionOutcome
for
VerifyRelayerBalance
<
Runtime
>
where
Runtime
:
pallet_balances
::
Config
,
{
fn
verify_outcome
(
&
self
)
{
assert_eq!
(
pallet_balances
::
Pallet
::
<
Runtime
>
::
free_balance
(
&
self
.relayer
),
self
.balance
,);
}
}
/// Initialize bridge GRANDPA pallet.
pub
(
crate
)
fn
initialize_bridge_grandpa_pallet
<
Runtime
,
GPI
>
(
init_data
:
bp_header_chain
::
InitializationData
<
BridgedHeader
<
Runtime
,
GPI
>>
,
...
...
cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_data/from_grandpa_chain.rs
View file @
aceda465
...
...
@@ -121,6 +121,60 @@ where
}
}
/// Prepare a call with message proof.
pub
fn
make_standalone_relayer_delivery_call
<
Runtime
,
GPI
,
MPI
>
(
message_proof
:
FromBridgedChainMessagesProof
<
HashOf
<
BridgedChain
<
Runtime
,
GPI
>>>
,
relayer_id_at_bridged_chain
:
AccountIdOf
<
BridgedChain
<
Runtime
,
GPI
>>
,
)
->
Runtime
::
RuntimeCall
where
Runtime
:
pallet_bridge_grandpa
::
Config
<
GPI
>
+
pallet_bridge_messages
::
Config
<
MPI
,
InboundPayload
=
XcmAsPlainPayload
,
InboundRelayer
=
AccountIdOf
<
BridgedChain
<
Runtime
,
GPI
>>
,
>
,
MPI
:
'static
,
<
Runtime
as
pallet_bridge_messages
::
Config
<
MPI
>>
::
SourceHeaderChain
:
SourceHeaderChain
<
MessagesProof
=
FromBridgedChainMessagesProof
<
HashOf
<
BridgedChain
<
Runtime
,
GPI
>>>
,
>
,
Runtime
::
RuntimeCall
:
From
<
pallet_bridge_messages
::
Call
<
Runtime
,
MPI
>>
,
{
pallet_bridge_messages
::
Call
::
<
Runtime
,
MPI
>
::
receive_messages_proof
{
relayer_id_at_bridged_chain
,
proof
:
message_proof
,
messages_count
:
1
,
dispatch_weight
:
Weight
::
from_parts
(
1000000000
,
0
),
}
.into
()
}
/// Prepare a call with message delivery proof.
pub
fn
make_standalone_relayer_confirmation_call
<
Runtime
,
GPI
,
MPI
>
(
message_delivery_proof
:
FromBridgedChainMessagesDeliveryProof
<
HashOf
<
BridgedChain
<
Runtime
,
GPI
>>
,
>
,
relayers_state
:
UnrewardedRelayersState
,
)
->
Runtime
::
RuntimeCall
where
Runtime
:
pallet_bridge_grandpa
::
Config
<
GPI
>
+
pallet_bridge_messages
::
Config
<
MPI
,
OutboundPayload
=
XcmAsPlainPayload
>
,
MPI
:
'static
,
<
Runtime
as
pallet_bridge_messages
::
Config
<
MPI
>>
::
TargetHeaderChain
:
TargetHeaderChain
<
XcmAsPlainPayload
,
Runtime
::
AccountId
,
MessagesDeliveryProof
=
FromBridgedChainMessagesDeliveryProof
<
HashOf
<
BridgedChain
<
Runtime
,
GPI
>>
,
>
,
>
,
Runtime
::
RuntimeCall
:
From
<
pallet_bridge_messages
::
Call
<
Runtime
,
MPI
>>
,
{
pallet_bridge_messages
::
Call
::
<
Runtime
,
MPI
>
::
receive_messages_delivery_proof
{
proof
:
message_delivery_proof
,
relayers_state
,
}
.into
()
}
/// Prepare storage proofs of messages, stored at the (bridged) source GRANDPA chain.
pub
fn
make_complex_relayer_delivery_proofs
<
MB
,
InnerXcmRuntimeCall
>
(
lane_id
:
LaneId
,
...
...
@@ -128,6 +182,7 @@ pub fn make_complex_relayer_delivery_proofs<MB, InnerXcmRuntimeCall>(
message_nonce
:
MessageNonce
,
message_destination
:
Junctions
,
header_number
:
BlockNumberOf
<
MessageBridgedChain
<
MB
>>
,
is_minimal_call
:
bool
,
)
->
(
HeaderOf
<
MessageBridgedChain
<
MB
>>
,
GrandpaJustification
<
HeaderOf
<
MessageBridgedChain
<
MB
>>>
,
...
...
@@ -153,7 +208,7 @@ where
let
(
header
,
justification
)
=
make_complex_bridged_grandpa_header_proof
::
<
MessageBridgedChain
<
MB
>
,
>
(
state_root
,
header_number
);
>
(
state_root
,
header_number
,
is_minimal_call
);
let
message_proof
=
FromBridgedChainMessagesProof
{
bridged_header_hash
:
header
.hash
(),
...
...
@@ -200,8 +255,11 @@ where
StorageProofSize
::
Minimal
(
0
),
);
let
(
header
,
justification
)
=
make_complex_bridged_grandpa_header_proof
::
<
MB
::
BridgedChain
>
(
state_root
,
header_number
);
let
(
header
,
justification
)
=
make_complex_bridged_grandpa_header_proof
::
<
MB
::
BridgedChain
>
(
state_root
,
header_number
,
false
,
);
let
message_delivery_proof
=
FromBridgedChainMessagesDeliveryProof
{
bridged_header_hash
:
header
.hash
(),
...
...
@@ -216,6 +274,7 @@ where
pub
fn
make_complex_bridged_grandpa_header_proof
<
BridgedChain
>
(
state_root
:
HashOf
<
BridgedChain
>
,
header_number
:
BlockNumberOf
<
BridgedChain
>
,
is_minimal_call
:
bool
,
)
->
(
HeaderOf
<
BridgedChain
>
,
GrandpaJustification
<
HeaderOf
<
BridgedChain
>>
)
where
BridgedChain
:
ChainWithGrandpa
,
...
...
@@ -229,7 +288,9 @@ where
// `submit_finality_proof` call size would be close to maximal expected (and refundable)
let
extra_bytes_required
=
maximal_expected_submit_finality_proof_call_size
::
<
BridgedChain
>
()
.saturating_sub
(
header
.encoded_size
());
header
.digest_mut
()
.push
(
DigestItem
::
Other
(
vec!
[
42
;
extra_bytes_required
]));
if
!
is_minimal_call
{
header
.digest_mut
()
.push
(
DigestItem
::
Other
(
vec!
[
42
;
extra_bytes_required
]));
}
let
justification
=
make_default_justification
(
&
header
);
(
header
,
justification
)
...
...
cumulus/parachains/runtimes/bridge-hubs/test-utils/src/test_data/from_parachain.rs
View file @
aceda465
...
...
@@ -159,6 +159,52 @@ where
}
}
/// Prepare a call with message proof.
pub
fn
make_standalone_relayer_delivery_call
<
Runtime
,
MPI
,
InboundRelayer
>
(
message_proof
:
FromBridgedChainMessagesProof
<
ParaHash
>
,
relayer_id_at_bridged_chain
:
InboundRelayer
,
)
->
Runtime
::
RuntimeCall
where
Runtime
:
pallet_bridge_messages
::
Config
<
MPI
,
InboundPayload
=
XcmAsPlainPayload
,
InboundRelayer
=
InboundRelayer
,
>
,
MPI
:
'static
,
Runtime
::
RuntimeCall
:
From
<
pallet_bridge_messages
::
Call
::
<
Runtime
,
MPI
>>
,
<<
Runtime
as
pallet_bridge_messages
::
Config
<
MPI
>>
::
SourceHeaderChain
as
SourceHeaderChain
>
::
MessagesProof
:
From
<
FromBridgedChainMessagesProof
<
ParaHash
>>
,
{
pallet_bridge_messages
::
Call
::
<
Runtime
,
MPI
>
::
receive_messages_proof
{
relayer_id_at_bridged_chain
:
relayer_id_at_bridged_chain
.into
(),
proof
:
message_proof
.into
(),
messages_count
:
1
,
dispatch_weight
:
Weight
::
from_parts
(
1000000000
,
0
),
}
.into
()
}
/// Prepare a call with message delivery proof.
pub
fn
make_standalone_relayer_confirmation_call
<
Runtime
,
MPI
>
(
message_delivery_proof
:
FromBridgedChainMessagesDeliveryProof
<
ParaHash
>
,
relayers_state
:
UnrewardedRelayersState
,
)
->
Runtime
::
RuntimeCall
where
Runtime
:
pallet_bridge_messages
::
Config
<
MPI
,
OutboundPayload
=
XcmAsPlainPayload
>
,
MPI
:
'static
,
Runtime
::
RuntimeCall
:
From
<
pallet_bridge_messages
::
Call
<
Runtime
,
MPI
>>
,
<
Runtime
as
pallet_bridge_messages
::
Config
<
MPI
>>
::
TargetHeaderChain
:
TargetHeaderChain
<
XcmAsPlainPayload
,
Runtime
::
AccountId
,
MessagesDeliveryProof
=
FromBridgedChainMessagesDeliveryProof
<
ParaHash
>
,
>
,
{
pallet_bridge_messages
::
Call
::
<
Runtime
,
MPI
>
::
receive_messages_delivery_proof
{
proof
:
message_delivery_proof
,
relayers_state
,
}
.into
()
}
/// Prepare storage proofs of messages, stored at the source chain.
pub
fn
make_complex_relayer_delivery_proofs
<
BridgedRelayChain
,
MB
,
InnerXcmRuntimeCall
>
(
lane_id
:
LaneId
,
...
...
@@ -168,6 +214,7 @@ pub fn make_complex_relayer_delivery_proofs<BridgedRelayChain, MB, InnerXcmRunti
para_header_number
:
u32
,
relay_header_number
:
u32
,
bridged_para_id
:
u32
,
is_minimal_call
:
bool
,
)
->
(
HeaderOf
<
BridgedRelayChain
>
,
GrandpaJustification
<
HeaderOf
<
BridgedRelayChain
>>
,
...
...
@@ -201,6 +248,7 @@ where
para_header_number
,
relay_header_number
,
bridged_para_id
,
is_minimal_call
,
);
let
message_proof
=
FromBridgedChainMessagesProof
{
...
...
@@ -266,6 +314,7 @@ where
para_header_number
,
relay_header_number
,
bridged_para_id
,
false
,
);
let
message_delivery_proof
=
FromBridgedChainMessagesDeliveryProof
{
...
...
@@ -290,6 +339,7 @@ pub fn make_complex_bridged_parachain_heads_proof<BridgedRelayChain, MB>(
para_header_number
:
u32
,
relay_header_number
:
BlockNumberOf
<
BridgedRelayChain
>
,
bridged_para_id
:
u32
,
is_minimal_call
:
bool
,
)
->
(
HeaderOf
<
BridgedRelayChain
>
,
GrandpaJustification
<
HeaderOf
<
BridgedRelayChain
>>
,
...
...
@@ -319,9 +369,12 @@ where
)]);
assert_eq!
(
bridged_para_head
.hash
(),
parachain_heads
[
0
]
.1
);
let
(
relay_chain_header
,
justification
)
=
make_complex_bridged_grandpa_header_proof
::
<
BridgedRelayChain
,
>
(
relay_state_root
,
relay_header_number
);
let
(
relay_chain_header
,
justification
)
=
make_complex_bridged_grandpa_header_proof
::
<
BridgedRelayChain
>
(
relay_state_root
,
relay_header_number
,
is_minimal_call
,
);
(
relay_chain_header
,
justification
,
bridged_para_head
,
parachain_heads
,
para_heads_proof
)
}
cumulus/parachains/runtimes/collectives/collectives-westend/build.rs
View file @
aceda465
...
...
@@ -15,11 +15,7 @@
#[cfg(feature
=
"std"
)]
fn
main
()
{
substrate_wasm_builder
::
WasmBuilder
::
new
()
.with_current_project
()
.export_heap_base
()
.import_memory
()
.build
()
substrate_wasm_builder
::
WasmBuilder
::
build_using_defaults
();
}
#[cfg(not(feature
=
"std"
))]
...
...
cumulus/parachains/runtimes/collectives/collectives-westend/src/lib.rs
View file @
aceda465
...
...
@@ -722,7 +722,7 @@ pub type UncheckedExtrinsic =
/// `OnRuntimeUpgrade`. Included migrations must be idempotent.
type
Migrations
=
(
// unreleased
pallet_collator_selection
::
migration
::
v
1
::
Migrat
e
ToV
1
<
Runtime
>
,
pallet_collator_selection
::
migration
::
v
2
::
Migrat
ion
ToV
2
<
Runtime
>
,
// unreleased
cumulus_pallet_xcmp_queue
::
migration
::
v4
::
MigrationToV4
<
Runtime
>
,
// permanent
...
...
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_xcm.rs
View file @
aceda465
...
...
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-0
3
-2
1
, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-0
2
-2
0
, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-
h2rr8wx7
-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-
bn-ce5rx
-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("collectives-westend-dev")`, DB CACHE: 1024
// Executed Command:
...
...
@@ -64,30 +64,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 21_911_000 picoseconds.
Weight
::
from_parts
(
22_431_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3610
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
}
/// Storage: `ParachainSystem::UpwardDeliveryFeeFactor` (r:1 w:0)
/// Proof: `ParachainSystem::UpwardDeliveryFeeFactor` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn
send_blob
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 22_143_000 picoseconds.
Weight
::
from_parts
(
22_843_000
,
0
)
// Minimum execution time: 21_813_000 picoseconds.
Weight
::
from_parts
(
22_332_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3610
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -112,8 +90,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `214`
// Estimated: `3679`
// Minimum execution time: 9
6
_2
7
3_000 picoseconds.
Weight
::
from_parts
(
9
8_351
_000
,
0
)
// Minimum execution time: 9
3
_2
4
3_000 picoseconds.
Weight
::
from_parts
(
9
5_650
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3679
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
8
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
3
))
...
...
@@ -148,8 +126,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `214`
// Estimated: `3679`
// Minimum execution time: 9
5_571
_000 picoseconds.
Weight
::
from_parts
(
9
6_251
_000
,
0
)
// Minimum execution time: 9
6_199
_000 picoseconds.
Weight
::
from_parts
(
9
8_620
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3679
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
8
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
3
))
...
...
@@ -164,24 +142,14 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
Weight
::
from_parts
(
18_446_744_073_709_551_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
}
/// Storage: `Benchmark::Override` (r:0 w:0)
/// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn
execute_blob
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 18_446_744_073_709_551_000 picoseconds.
Weight
::
from_parts
(
18_446_744_073_709_551_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
}
/// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn
force_xcm_version
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_
227
_000 picoseconds.
Weight
::
from_parts
(
6_
419
_000
,
0
)
// Minimum execution time: 6_
442
_000 picoseconds.
Weight
::
from_parts
(
6_
682
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -191,8 +159,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_8
51
_000 picoseconds.
Weight
::
from_parts
(
1_9
40
_000
,
0
)
// Minimum execution time: 1_8
33
_000 picoseconds.
Weight
::
from_parts
(
1_9
73
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -218,8 +186,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
// Minimum execution time: 27_
449
_000 picoseconds.
Weight
::
from_parts
(
28_
513
_000
,
0
)
// Minimum execution time: 27_
318
_000 picoseconds.
Weight
::
from_parts
(
28_
224
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3610
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
8
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
5
))
...
...
@@ -244,8 +212,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `363`
// Estimated: `3828`
// Minimum execution time: 29_
477
_000 picoseconds.
Weight
::
from_parts
(
30_25
1
_000
,
0
)
// Minimum execution time: 29_
070
_000 picoseconds.
Weight
::
from_parts
(
30_2
0
5_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3828
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
7
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
4
))
...
...
@@ -256,8 +224,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_
8
94_000 picoseconds.
Weight
::
from_parts
(
2_0
09
_000
,
0
)
// Minimum execution time: 1_9
0
4_000 picoseconds.
Weight
::
from_parts
(
2_0
33
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -267,8 +235,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `159`
// Estimated: `13524`
// Minimum execution time: 1
7_991
_000 picoseconds.
Weight
::
from_parts
(
18_
651
_000
,
0
)
// Minimum execution time: 1
8_348
_000 picoseconds.
Weight
::
from_parts
(
18_
853
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13524
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -279,8 +247,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `163`
// Estimated: `13528`
// Minimum execution time: 1
8_321
_000 picoseconds.
Weight
::
from_parts
(
18_
701
_000
,
0
)
// Minimum execution time: 1
7_964
_000 picoseconds.
Weight
::
from_parts
(
18_
548
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13528
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -291,8 +259,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `173`
// Estimated: `16013`
// Minimum execution time: 19_7
62
_000 picoseconds.
Weight
::
from_parts
(
20_
529
_000
,
0
)
// Minimum execution time: 19_7
08
_000 picoseconds.
Weight
::
from_parts
(
20_
157
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
16013
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
}
...
...
@@ -314,8 +282,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `212`
// Estimated: `6152`
// Minimum execution time: 26_
927
_000 picoseconds.
Weight
::
from_parts
(
27_
629
_000
,
0
)
// Minimum execution time: 26_
632
_000 picoseconds.
Weight
::
from_parts
(
27_
314
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
6152
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
8
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
3
))
...
...
@@ -326,8 +294,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `206`
// Estimated: `11096`
// Minimum execution time: 11_9
57
_000 picoseconds.
Weight
::
from_parts
(
12_
119
_000
,
0
)
// Minimum execution time: 11_9
29
_000 picoseconds.
Weight
::
from_parts
(
12_
304
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
11096
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
4
))
}
...
...
@@ -337,8 +305,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `170`
// Estimated: `13535`
// Minimum execution time: 1
7_942
_000 picoseconds.
Weight
::
from_parts
(
1
8_878
_000
,
0
)
// Minimum execution time: 1
8_599
_000 picoseconds.
Weight
::
from_parts
(
1
9_195
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13535
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -361,8 +329,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `212`
// Estimated: `13577`
// Minimum execution time: 35_
640
_000 picoseconds.
Weight
::
from_parts
(
36_
340
_000
,
0
)
// Minimum execution time: 35_
524
_000 picoseconds.
Weight
::
from_parts
(
36_
272
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13577
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
11
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
4
))
...
...
@@ -376,7 +344,7 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Measured: `103`
// Estimated: `1588`
// Minimum execution time: 4_044_000 picoseconds.
Weight
::
from_parts
(
4_2
29
_000
,
0
)
Weight
::
from_parts
(
4_2
38
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
1588
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -387,8 +355,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `7740`
// Estimated: `11205`
// Minimum execution time: 2
6_262
_000 picoseconds.
Weight
::
from_parts
(
26_
842
_000
,
0
)
// Minimum execution time: 2
5_741
_000 picoseconds.
Weight
::
from_parts
(
26_
301
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
11205
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
...
...
@@ -399,8 +367,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `160`
// Estimated: `3625`
// Minimum execution time: 3
6_77
5_000 picoseconds.
Weight
::
from_parts
(
3
7_265
_000
,
0
)
// Minimum execution time: 3
5_92
5_000 picoseconds.
Weight
::
from_parts
(
3
6_978
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3625
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
...
...
cumulus/parachains/runtimes/collectives/collectives-westend/src/xcm_config.rs
View file @
aceda465
...
...
@@ -35,16 +35,17 @@ use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use
westend_runtime_constants
::
xcm
as
xcm_constants
;
use
xcm
::
latest
::
prelude
::
*
;
use
xcm_builder
::{
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
AllowKnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FixedWeightBounds
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
LocatableAssetId
,
OriginToPluralityVoice
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WithComputedOrigin
,
WithUniqueTopic
,
XcmFeeManagerFromComponents
,
XcmFeeToAccount
,
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
AllowHrmpNotificationsFromRelayChain
,
AllowKnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FixedWeightBounds
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
LocatableAssetId
,
OriginToPluralityVoice
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WithComputedOrigin
,
WithUniqueTopic
,
XcmFeeManagerFromComponents
,
XcmFeeToAccount
,
};
use
xcm_executor
::
{
traits
::
WithOriginFilter
,
XcmExecutor
}
;
use
xcm_executor
::
XcmExecutor
;
parameter_types!
{
pub
const
WndLocation
:
Location
=
Location
::
parent
();
...
...
@@ -138,83 +139,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
}
}
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
/// account for proof size weights.
///
/// Calls that are allowed through this filter must:
/// 1. Have a fixed weight;
/// 2. Cannot lead to another call being made;
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
pub
struct
SafeCallFilter
;
impl
Contains
<
RuntimeCall
>
for
SafeCallFilter
{
fn
contains
(
call
:
&
RuntimeCall
)
->
bool
{
#[cfg(feature
=
"runtime-benchmarks"
)]
{
if
matches!
(
call
,
RuntimeCall
::
System
(
frame_system
::
Call
::
remark_with_event
{
..
}))
{
return
true
}
}
matches!
(
call
,
RuntimeCall
::
System
(
frame_system
::
Call
::
set_heap_pages
{
..
}
|
frame_system
::
Call
::
set_code
{
..
}
|
frame_system
::
Call
::
set_code_without_checks
{
..
}
|
frame_system
::
Call
::
authorize_upgrade
{
..
}
|
frame_system
::
Call
::
authorize_upgrade_without_checks
{
..
}
|
frame_system
::
Call
::
kill_prefix
{
..
},
)
|
RuntimeCall
::
ParachainSystem
(
..
)
|
RuntimeCall
::
Timestamp
(
..
)
|
RuntimeCall
::
Balances
(
..
)
|
RuntimeCall
::
CollatorSelection
(
..
)
|
RuntimeCall
::
Session
(
pallet_session
::
Call
::
purge_keys
{
..
})
|
RuntimeCall
::
PolkadotXcm
(
pallet_xcm
::
Call
::
force_xcm_version
{
..
}
|
pallet_xcm
::
Call
::
force_default_xcm_version
{
..
}
)
|
RuntimeCall
::
XcmpQueue
(
..
)
|
RuntimeCall
::
MessageQueue
(
..
)
|
RuntimeCall
::
Alliance
(
// `init_members` accepts unbounded vecs as arguments,
// but the call can be initiated only by root origin.
pallet_alliance
::
Call
::
init_members
{
..
}
|
pallet_alliance
::
Call
::
vote
{
..
}
|
pallet_alliance
::
Call
::
disband
{
..
}
|
pallet_alliance
::
Call
::
set_rule
{
..
}
|
pallet_alliance
::
Call
::
announce
{
..
}
|
pallet_alliance
::
Call
::
remove_announcement
{
..
}
|
pallet_alliance
::
Call
::
join_alliance
{
..
}
|
pallet_alliance
::
Call
::
nominate_ally
{
..
}
|
pallet_alliance
::
Call
::
elevate_ally
{
..
}
|
pallet_alliance
::
Call
::
give_retirement_notice
{
..
}
|
pallet_alliance
::
Call
::
retire
{
..
}
|
pallet_alliance
::
Call
::
kick_member
{
..
}
|
pallet_alliance
::
Call
::
close
{
..
}
|
pallet_alliance
::
Call
::
abdicate_fellow_status
{
..
},
)
|
RuntimeCall
::
AllianceMotion
(
pallet_collective
::
Call
::
vote
{
..
}
|
pallet_collective
::
Call
::
disapprove_proposal
{
..
}
|
pallet_collective
::
Call
::
close
{
..
},
)
|
RuntimeCall
::
FellowshipCollective
(
pallet_ranked_collective
::
Call
::
add_member
{
..
}
|
pallet_ranked_collective
::
Call
::
promote_member
{
..
}
|
pallet_ranked_collective
::
Call
::
demote_member
{
..
}
|
pallet_ranked_collective
::
Call
::
remove_member
{
..
},
)
|
RuntimeCall
::
FellowshipCore
(
pallet_core_fellowship
::
Call
::
bump
{
..
}
|
pallet_core_fellowship
::
Call
::
set_params
{
..
}
|
pallet_core_fellowship
::
Call
::
set_active
{
..
}
|
pallet_core_fellowship
::
Call
::
approve
{
..
}
|
pallet_core_fellowship
::
Call
::
induct
{
..
}
|
pallet_core_fellowship
::
Call
::
promote
{
..
}
|
pallet_core_fellowship
::
Call
::
offboard
{
..
}
|
pallet_core_fellowship
::
Call
::
submit_evidence
{
..
}
|
pallet_core_fellowship
::
Call
::
import
{
..
},
)
)
}
}
pub
type
Barrier
=
TrailingSetTopicAsId
<
DenyThenTry
<
DenyReserveTransferToRelayChain
,
...
...
@@ -233,6 +157,8 @@ pub type Barrier = TrailingSetTopicAsId<
AllowExplicitUnpaidExecutionFrom
<
ParentOrParentsPlurality
>
,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom
<
ParentRelayOrSiblingParachains
>
,
// HRMP notifications from the relay chain are OK.
AllowHrmpNotificationsFromRelayChain
,
),
UniversalLocation
,
ConstU32
<
8
>
,
...
...
@@ -287,8 +213,8 @@ impl xcm_executor::Config for XcmConfig {
>
;
type
MessageExporter
=
();
type
UniversalAliases
=
Nothing
;
type
CallDispatcher
=
WithOriginFilter
<
SafeCallFilter
>
;
type
SafeCallFilter
=
SafeCallFilter
;
type
CallDispatcher
=
RuntimeCall
;
type
SafeCallFilter
=
Everything
;
type
Aliasers
=
Nothing
;
type
TransactionalProcessor
=
FrameTransactionalProcessor
;
type
HrmpNewChannelOpenRequestHandler
=
();
...
...
cumulus/parachains/runtimes/contracts/contracts-rococo/build.rs
View file @
aceda465
...
...
@@ -15,11 +15,7 @@
#[cfg(feature
=
"std"
)]
fn
main
()
{
substrate_wasm_builder
::
WasmBuilder
::
new
()
.with_current_project
()
.export_heap_base
()
.import_memory
()
.build
()
substrate_wasm_builder
::
WasmBuilder
::
build_using_defaults
();
}
#[cfg(not(feature
=
"std"
))]
...
...
cumulus/parachains/runtimes/contracts/contracts-rococo/src/lib.rs
View file @
aceda465
...
...
@@ -98,6 +98,8 @@ pub type UncheckedExtrinsic =
/// Migrations to apply on runtime upgrade.
pub
type
Migrations
=
(
pallet_collator_selection
::
migration
::
v1
::
MigrateToV1
<
Runtime
>
,
pallet_collator_selection
::
migration
::
v2
::
MigrationToV2
<
Runtime
>
,
cumulus_pallet_parachain_system
::
migration
::
Migration
<
Runtime
>
,
cumulus_pallet_xcmp_queue
::
migration
::
v2
::
MigrationToV2
<
Runtime
>
,
cumulus_pallet_xcmp_queue
::
migration
::
v3
::
MigrationToV3
<
Runtime
>
,
...
...
cumulus/parachains/runtimes/contracts/contracts-rococo/src/xcm_config.rs
View file @
aceda465
...
...
@@ -38,22 +38,22 @@ use sp_runtime::traits::AccountIdConversion;
use
testnet_parachains_constants
::
rococo
::
currency
::
CENTS
;
use
xcm
::
latest
::
prelude
::
*
;
use
xcm_builder
::{
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
Allow
KnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FixedWeightBounds
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
NativeAsset
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WithComputedOrigin
,
WithUniqueTopic
,
XcmFeeManagerFromComponents
,
XcmFeeToAccount
,
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
Allow
HrmpNotificationsFromRelayChain
,
AllowKnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FixedWeightBounds
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
NativeAsset
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WithComputedOrigin
,
WithUniqueTopic
,
XcmFeeManagerFromComponents
,
XcmFeeToAccount
,
};
use
xcm_executor
::
XcmExecutor
;
parameter_types!
{
pub
const
RelayLocation
:
Location
=
Location
::
parent
();
pub
const
RelayNetwork
:
Option
<
NetworkId
>
=
N
one
;
pub
const
RelayNetwork
:
NetworkId
=
N
etworkId
::
Rococo
;
pub
RelayChainOrigin
:
RuntimeOrigin
=
cumulus_pallet_xcm
::
Origin
::
Relay
.into
();
pub
UniversalLocation
:
InteriorLocation
=
Parachain
(
ParachainInfo
::
parachain_id
()
.into
())
.into
();
pub
UniversalLocation
:
InteriorLocation
=
[
GlobalConsensus
(
RelayNetwork
::
get
()),
Parachain
(
ParachainInfo
::
parachain_id
()
.into
())
]
.into
();
pub
const
ExecutiveBody
:
BodyId
=
BodyId
::
Executive
;
pub
TreasuryAccount
:
AccountId
=
TREASURY_PALLET_ID
.into_account_truncating
();
pub
RelayTreasuryLocation
:
Location
=
(
Parent
,
PalletInstance
(
rococo_runtime_constants
::
TREASURY_PALLET_ID
))
.into
();
...
...
@@ -149,6 +149,8 @@ pub type Barrier = TrailingSetTopicAsId<
)
>
,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom
<
ParentRelayOrSiblingParachains
>
,
// HRMP notifications from the relay chain are OK.
AllowHrmpNotificationsFromRelayChain
,
),
UniversalLocation
,
ConstU32
<
8
>
,
...
...
cumulus/parachains/runtimes/coretime/coretime-rococo/src/lib.rs
View file @
aceda465
...
...
@@ -108,6 +108,7 @@ pub type UncheckedExtrinsic =
/// Migrations to apply on runtime upgrade.
pub
type
Migrations
=
(
pallet_collator_selection
::
migration
::
v2
::
MigrationToV2
<
Runtime
>
,
cumulus_pallet_xcmp_queue
::
migration
::
v4
::
MigrationToV4
<
Runtime
>
,
pallet_broker
::
migration
::
MigrateV0ToV1
<
Runtime
>
,
// permanent
...
...
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_xcm.rs
View file @
aceda465
...
...
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-0
3
-2
1
, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-0
2
-2
0
, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-
h2rr8wx7
-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-
bn-ce5rx
-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-rococo-dev")`, DB CACHE: 1024
// Executed Command:
...
...
@@ -62,28 +62,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 18_767_000 picoseconds.
Weight
::
from_parts
(
19_420_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3539
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
}
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn
send_blob
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 19_184_000 picoseconds.
Weight
::
from_parts
(
19_695_000
,
0
)
// Minimum execution time: 35_051_000 picoseconds.
Weight
::
from_parts
(
35_200_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3539
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -104,8 +84,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3571`
// Minimum execution time: 5
8_120
_000 picoseconds.
Weight
::
from_parts
(
5
9_533
_000
,
0
)
// Minimum execution time: 5
6_235
_000 picoseconds.
Weight
::
from_parts
(
5
8_178
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3571
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -140,24 +120,14 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
Weight
::
from_parts
(
18_446_744_073_709_551_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
}
/// Storage: `Benchmark::Override` (r:0 w:0)
/// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn
execute_blob
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 18_446_744_073_709_551_000 picoseconds.
Weight
::
from_parts
(
18_446_744_073_709_551_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
}
/// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn
force_xcm_version
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 6_
074
_000 picoseconds.
Weight
::
from_parts
(
6_
398
_000
,
0
)
// Minimum execution time: 6_
226
_000 picoseconds.
Weight
::
from_parts
(
6_
403
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -167,8 +137,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 2_0
36
_000 picoseconds.
Weight
::
from_parts
(
2_1
8
0_000
,
0
)
// Minimum execution time: 2_0
20
_000 picoseconds.
Weight
::
from_parts
(
2_1
0
0_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -192,8 +162,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 2
5_014
_000 picoseconds.
Weight
::
from_parts
(
2
5_37
4_000
,
0
)
// Minimum execution time: 2
4_387
_000 picoseconds.
Weight
::
from_parts
(
2
4_81
4_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3539
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
7
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
5
))
...
...
@@ -216,8 +186,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `292`
// Estimated: `3757`
// Minimum execution time: 27_
616
_000 picoseconds.
Weight
::
from_parts
(
2
8_499
_000
,
0
)
// Minimum execution time: 27_
039
_000 picoseconds.
Weight
::
from_parts
(
2
7_693
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3757
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
4
))
...
...
@@ -228,8 +198,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time:
2_061
_000 picoseconds.
Weight
::
from_parts
(
2_
153
_000
,
0
)
// Minimum execution time:
1_920
_000 picoseconds.
Weight
::
from_parts
(
2_
082
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -239,8 +209,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `89`
// Estimated: `13454`
// Minimum execution time: 1
6_592
_000 picoseconds.
Weight
::
from_parts
(
1
6_9
00_000
,
0
)
// Minimum execution time: 1
7_141
_000 picoseconds.
Weight
::
from_parts
(
1
7_5
00_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13454
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -251,8 +221,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `93`
// Estimated: `13458`
// Minimum execution time: 1
6_69
4_000 picoseconds.
Weight
::
from_parts
(
1
6_905
_000
,
0
)
// Minimum execution time: 1
7_07
4_000 picoseconds.
Weight
::
from_parts
(
1
7_431
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13458
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -263,8 +233,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `15946`
// Minimum execution time: 1
7_77
9_000 picoseconds.
Weight
::
from_parts
(
1
8
_4
90
_000
,
0
)
// Minimum execution time: 1
9_13
9_000 picoseconds.
Weight
::
from_parts
(
1
9
_4
74
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
15946
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
}
...
...
@@ -284,8 +254,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `142`
// Estimated: `6082`
// Minimum execution time: 24_
52
6_000 picoseconds.
Weight
::
from_parts
(
25_18
2
_000
,
0
)
// Minimum execution time: 24_
34
6_000 picoseconds.
Weight
::
from_parts
(
25_
3
18_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
6082
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
7
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
3
))
...
...
@@ -296,8 +266,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `11026`
// Minimum execution time: 1
0_46
7_000 picoseconds.
Weight
::
from_parts
(
1
0_934
_000
,
0
)
// Minimum execution time: 1
1_77
7_000 picoseconds.
Weight
::
from_parts
(
1
2_051
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
11026
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
4
))
}
...
...
@@ -307,8 +277,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `100`
// Estimated: `13465`
// Minimum execution time: 1
6_377
_000 picoseconds.
Weight
::
from_parts
(
17_
114
_000
,
0
)
// Minimum execution time: 1
7_538
_000 picoseconds.
Weight
::
from_parts
(
17_
832
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13465
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -329,8 +299,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `142`
// Estimated: `13507`
// Minimum execution time: 3
2_575
_000 picoseconds.
Weight
::
from_parts
(
3
3_483
_000
,
0
)
// Minimum execution time: 3
3_623
_000 picoseconds.
Weight
::
from_parts
(
3
4_186
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13507
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
10
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
4
))
...
...
@@ -343,8 +313,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `32`
// Estimated: `1517`
// Minimum execution time: 3_
604
_000 picoseconds.
Weight
::
from_parts
(
3_
744
_000
,
0
)
// Minimum execution time: 3_
363
_000 picoseconds.
Weight
::
from_parts
(
3_
511
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
1517
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -355,8 +325,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `7669`
// Estimated: `11134`
// Minimum execution time: 23_9
83
_000 picoseconds.
Weight
::
from_parts
(
24_
404
_000
,
0
)
// Minimum execution time: 23_9
69
_000 picoseconds.
Weight
::
from_parts
(
24_
347
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
11134
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
...
...
@@ -367,8 +337,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `90`
// Estimated: `3555`
// Minimum execution time: 34_
446
_000 picoseconds.
Weight
::
from_parts
(
35_
465
_000
,
0
)
// Minimum execution time: 34_
071
_000 picoseconds.
Weight
::
from_parts
(
35_
031
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3555
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
...
...
cumulus/parachains/runtimes/coretime/coretime-rococo/src/xcm_config.rs
View file @
aceda465
...
...
@@ -39,16 +39,16 @@ use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use
sp_runtime
::
traits
::
AccountIdConversion
;
use
xcm
::
latest
::
prelude
::
*
;
use
xcm_builder
::{
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
Allow
KnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
NonFungibleAdapter
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WeightInfoBounds
,
WithComputedOrigin
,
WithUniqueTopic
,
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
Allow
HrmpNotificationsFromRelayChain
,
AllowKnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
NonFungibleAdapter
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WeightInfoBounds
,
WithComputedOrigin
,
WithUniqueTopic
,
XcmFeeManagerFromComponents
,
XcmFeeToAccount
,
};
use
xcm_executor
::
{
traits
::
WithOriginFilter
,
XcmExecutor
}
;
use
xcm_executor
::
XcmExecutor
;
parameter_types!
{
pub
const
RocRelayLocation
:
Location
=
Location
::
parent
();
...
...
@@ -139,49 +139,6 @@ impl Contains<Location> for ParentOrParentsPlurality {
}
}
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
/// account for proof size weights.
///
/// Calls that are allowed through this filter must:
/// 1. Have a fixed weight;
/// 2. Cannot lead to another call being made;
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
pub
struct
SafeCallFilter
;
impl
Contains
<
RuntimeCall
>
for
SafeCallFilter
{
fn
contains
(
call
:
&
RuntimeCall
)
->
bool
{
#[cfg(feature
=
"runtime-benchmarks"
)]
{
if
matches!
(
call
,
RuntimeCall
::
System
(
frame_system
::
Call
::
remark_with_event
{
..
}))
{
return
true
}
}
matches!
(
call
,
RuntimeCall
::
PolkadotXcm
(
pallet_xcm
::
Call
::
force_xcm_version
{
..
}
|
pallet_xcm
::
Call
::
force_default_xcm_version
{
..
}
)
|
RuntimeCall
::
System
(
frame_system
::
Call
::
set_heap_pages
{
..
}
|
frame_system
::
Call
::
set_code
{
..
}
|
frame_system
::
Call
::
set_code_without_checks
{
..
}
|
frame_system
::
Call
::
authorize_upgrade
{
..
}
|
frame_system
::
Call
::
authorize_upgrade_without_checks
{
..
}
|
frame_system
::
Call
::
kill_prefix
{
..
}
|
// Should not be in Polkadot/Kusama. Here in order to speed up testing.
frame_system
::
Call
::
set_storage
{
..
},
)
|
RuntimeCall
::
ParachainSystem
(
..
)
|
RuntimeCall
::
Timestamp
(
..
)
|
RuntimeCall
::
Balances
(
..
)
|
RuntimeCall
::
Sudo
(
..
)
|
RuntimeCall
::
CollatorSelection
(
..
)
|
RuntimeCall
::
Session
(
pallet_session
::
Call
::
purge_keys
{
..
})
|
RuntimeCall
::
XcmpQueue
(
..
)
|
RuntimeCall
::
Broker
(
..
)
)
}
}
pub
type
Barrier
=
TrailingSetTopicAsId
<
DenyThenTry
<
DenyReserveTransferToRelayChain
,
...
...
@@ -199,6 +156,8 @@ pub type Barrier = TrailingSetTopicAsId<
AllowExplicitUnpaidExecutionFrom
<
ParentOrParentsPlurality
>
,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom
<
ParentRelayOrSiblingParachains
>
,
// HRMP notifications from the relay chain are OK.
AllowHrmpNotificationsFromRelayChain
,
),
UniversalLocation
,
ConstU32
<
8
>
,
...
...
@@ -258,8 +217,8 @@ impl xcm_executor::Config for XcmConfig {
>
;
type
MessageExporter
=
();
type
UniversalAliases
=
Nothing
;
type
CallDispatcher
=
WithOriginFilter
<
SafeCallFilter
>
;
type
SafeCallFilter
=
SafeCallFilter
;
type
CallDispatcher
=
RuntimeCall
;
type
SafeCallFilter
=
Everything
;
type
Aliasers
=
Nothing
;
type
TransactionalProcessor
=
FrameTransactionalProcessor
;
type
HrmpNewChannelOpenRequestHandler
=
();
...
...
cumulus/parachains/runtimes/coretime/coretime-westend/src/lib.rs
View file @
aceda465
...
...
@@ -108,6 +108,7 @@ pub type UncheckedExtrinsic =
/// Migrations to apply on runtime upgrade.
pub
type
Migrations
=
(
pallet_collator_selection
::
migration
::
v2
::
MigrationToV2
<
Runtime
>
,
cumulus_pallet_xcmp_queue
::
migration
::
v4
::
MigrationToV4
<
Runtime
>
,
pallet_broker
::
migration
::
MigrateV0ToV1
<
Runtime
>
,
// permanent
...
...
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_xcm.rs
View file @
aceda465
...
...
@@ -17,9 +17,9 @@
//! Autogenerated weights for `pallet_xcm`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-0
3
-2
1
, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2024-0
2
-2
0
, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner-
h2rr8wx7
-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! HOSTNAME: `runner-
bn-ce5rx
-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("coretime-westend-dev")`, DB CACHE: 1024
// Executed Command:
...
...
@@ -62,28 +62,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 17_681_000 picoseconds.
Weight
::
from_parts
(
18_350_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3539
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
}
/// Storage: `PolkadotXcm::SupportedVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::VersionDiscoveryQueue` (r:1 w:1)
/// Proof: `PolkadotXcm::VersionDiscoveryQueue` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `PolkadotXcm::SafeXcmVersion` (r:1 w:0)
/// Proof: `PolkadotXcm::SafeXcmVersion` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::HostConfiguration` (r:1 w:0)
/// Proof: `ParachainSystem::HostConfiguration` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `ParachainSystem::PendingUpwardMessages` (r:1 w:1)
/// Proof: `ParachainSystem::PendingUpwardMessages` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
fn
send_blob
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 18_091_000 picoseconds.
Weight
::
from_parts
(
18_327_000
,
0
)
// Minimum execution time: 18_410_000 picoseconds.
Weight
::
from_parts
(
18_657_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3539
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -104,8 +84,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3571`
// Minimum execution time: 5
4_943
_000 picoseconds.
Weight
::
from_parts
(
5
6_
51
9
_000
,
0
)
// Minimum execution time: 5
6_616
_000 picoseconds.
Weight
::
from_parts
(
5
7_7
51_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3571
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -140,24 +120,14 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
Weight
::
from_parts
(
18_446_744_073_709_551_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
}
/// Storage: `Benchmark::Override` (r:0 w:0)
/// Proof: `Benchmark::Override` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn
execute_blob
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 18_446_744_073_709_551_000 picoseconds.
Weight
::
from_parts
(
18_446_744_073_709_551_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
}
/// Storage: `PolkadotXcm::SupportedVersion` (r:0 w:1)
/// Proof: `PolkadotXcm::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn
force_xcm_version
()
->
Weight
{
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time:
5_887
_000 picoseconds.
Weight
::
from_parts
(
6_
101
_000
,
0
)
// Minimum execution time:
6_014
_000 picoseconds.
Weight
::
from_parts
(
6_
412
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -167,8 +137,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_
940
_000 picoseconds.
Weight
::
from_parts
(
2_022
_000
,
0
)
// Minimum execution time: 1_
844
_000 picoseconds.
Weight
::
from_parts
(
1_957
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -192,8 +162,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `74`
// Estimated: `3539`
// Minimum execution time: 2
3_165
_000 picoseconds.
Weight
::
from_parts
(
2
3_800
_000
,
0
)
// Minimum execution time: 2
4_067
_000 picoseconds.
Weight
::
from_parts
(
2
4_553
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3539
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
7
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
5
))
...
...
@@ -216,8 +186,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `292`
// Estimated: `3757`
// Minimum execution time: 2
6_506
_000 picoseconds.
Weight
::
from_parts
(
27_
18
0_000
,
0
)
// Minimum execution time: 2
7_023
_000 picoseconds.
Weight
::
from_parts
(
27_
62
0_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3757
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
4
))
...
...
@@ -228,8 +198,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 1_86
8
_000 picoseconds.
Weight
::
from_parts
(
2_002
_000
,
0
)
// Minimum execution time: 1_86
6
_000 picoseconds.
Weight
::
from_parts
(
1_984
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
0
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
}
...
...
@@ -239,8 +209,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `89`
// Estimated: `13454`
// Minimum execution time: 16_
138
_000 picoseconds.
Weight
::
from_parts
(
16_
447
_000
,
0
)
// Minimum execution time: 16_
425
_000 picoseconds.
Weight
::
from_parts
(
16_
680
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13454
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -251,8 +221,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `93`
// Estimated: `13458`
// Minimum execution time: 16_
099
_000 picoseconds.
Weight
::
from_parts
(
16_5
92
_000
,
0
)
// Minimum execution time: 16_
171
_000 picoseconds.
Weight
::
from_parts
(
16_5
64
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13458
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -263,8 +233,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `15946`
// Minimum execution time: 17_
972
_000 picoseconds.
Weight
::
from_parts
(
18_
379
_000
,
0
)
// Minimum execution time: 17_
785
_000 picoseconds.
Weight
::
from_parts
(
18_
123
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
15946
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
6
))
}
...
...
@@ -284,8 +254,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `142`
// Estimated: `6082`
// Minimum execution time: 23_
554
_000 picoseconds.
Weight
::
from_parts
(
24_
446
_000
,
0
)
// Minimum execution time: 23_
903
_000 picoseconds.
Weight
::
from_parts
(
24_
769
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
6082
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
7
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
3
))
...
...
@@ -296,8 +266,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `136`
// Estimated: `11026`
// Minimum execution time: 10_
541
_000 picoseconds.
Weight
::
from_parts
(
10_8
9
4_000
,
0
)
// Minimum execution time: 10_
617
_000 picoseconds.
Weight
::
from_parts
(
10_84
3
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
11026
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
4
))
}
...
...
@@ -307,8 +277,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `100`
// Estimated: `13465`
// Minimum execution time: 16_
404
_000 picoseconds.
Weight
::
from_parts
(
1
6_818
_000
,
0
)
// Minimum execution time: 16_
656
_000 picoseconds.
Weight
::
from_parts
(
1
7_106
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13465
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
5
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -329,8 +299,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `142`
// Estimated: `13507`
// Minimum execution time: 31_
617
_000 picoseconds.
Weight
::
from_parts
(
32_
336
_000
,
0
)
// Minimum execution time: 31_
721
_000 picoseconds.
Weight
::
from_parts
(
32_
547
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
13507
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
10
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
4
))
...
...
@@ -343,8 +313,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `32`
// Estimated: `1517`
// Minimum execution time: 3_
328
_000 picoseconds.
Weight
::
from_parts
(
3_
501
_000
,
0
)
// Minimum execution time: 3_
439
_000 picoseconds.
Weight
::
from_parts
(
3_
619
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
1517
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
2
))
...
...
@@ -355,8 +325,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `7669`
// Estimated: `11134`
// Minimum execution time: 2
3_
57
1
_000 picoseconds.
Weight
::
from_parts
(
24_
312
_000
,
0
)
// Minimum execution time: 2
4_6
57_000 picoseconds.
Weight
::
from_parts
(
24_
971
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
11134
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
...
...
@@ -367,8 +337,8 @@ impl<T: frame_system::Config> pallet_xcm::WeightInfo for WeightInfo<T> {
// Proof Size summary in bytes:
// Measured: `90`
// Estimated: `3555`
// Minimum execution time: 3
2_879
_000 picoseconds.
Weight
::
from_parts
(
3
3_385
_000
,
0
)
// Minimum execution time: 3
4_028
_000 picoseconds.
Weight
::
from_parts
(
3
4_697
_000
,
0
)
.saturating_add
(
Weight
::
from_parts
(
0
,
3555
))
.saturating_add
(
T
::
DbWeight
::
get
()
.reads
(
1
))
.saturating_add
(
T
::
DbWeight
::
get
()
.writes
(
1
))
...
...
cumulus/parachains/runtimes/coretime/coretime-westend/src/xcm_config.rs
View file @
aceda465
...
...
@@ -39,16 +39,16 @@ use polkadot_runtime_common::xcm_sender::ExponentialPrice;
use
sp_runtime
::
traits
::
AccountIdConversion
;
use
xcm
::
latest
::
prelude
::
*
;
use
xcm_builder
::{
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
Allow
KnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
NonFungibleAdapter
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WeightInfoBounds
,
WithComputedOrigin
,
WithUniqueTopic
,
AccountId32Aliases
,
AllowExplicitUnpaidExecutionFrom
,
Allow
HrmpNotificationsFromRelayChain
,
AllowKnownQueryResponses
,
AllowSubscriptionsFrom
,
AllowTopLevelPaidExecutionFrom
,
DenyReserveTransferToRelayChain
,
DenyThenTry
,
EnsureXcmOrigin
,
FrameTransactionalProcessor
,
FungibleAdapter
,
IsConcrete
,
NonFungibleAdapter
,
ParentAsSuperuser
,
ParentIsPreset
,
RelayChainAsNative
,
SiblingParachainAsNative
,
SiblingParachainConvertsVia
,
SignedAccountId32AsNative
,
SignedToAccountId32
,
SovereignSignedViaLocation
,
TakeWeightCredit
,
TrailingSetTopicAsId
,
UsingComponents
,
WeightInfoBounds
,
WithComputedOrigin
,
WithUniqueTopic
,
XcmFeeManagerFromComponents
,
XcmFeeToAccount
,
};
use
xcm_executor
::
{
traits
::
WithOriginFilter
,
XcmExecutor
}
;
use
xcm_executor
::
XcmExecutor
;
parameter_types!
{
pub
const
TokenRelayLocation
:
Location
=
Location
::
parent
();
...
...
@@ -146,48 +146,6 @@ impl Contains<Location> for FellowsPlurality {
}
}
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
/// account for proof size weights.
///
/// Calls that are allowed through this filter must:
/// 1. Have a fixed weight;
/// 2. Cannot lead to another call being made;
/// 3. Have a defined proof size weight, e.g. no unbounded vecs in call parameters.
pub
struct
SafeCallFilter
;
impl
Contains
<
RuntimeCall
>
for
SafeCallFilter
{
fn
contains
(
call
:
&
RuntimeCall
)
->
bool
{
#[cfg(feature
=
"runtime-benchmarks"
)]
{
if
matches!
(
call
,
RuntimeCall
::
System
(
frame_system
::
Call
::
remark_with_event
{
..
}))
{
return
true
}
}
matches!
(
call
,
RuntimeCall
::
PolkadotXcm
(
pallet_xcm
::
Call
::
force_xcm_version
{
..
}
|
pallet_xcm
::
Call
::
force_default_xcm_version
{
..
}
)
|
RuntimeCall
::
System
(
frame_system
::
Call
::
set_heap_pages
{
..
}
|
frame_system
::
Call
::
set_code
{
..
}
|
frame_system
::
Call
::
set_code_without_checks
{
..
}
|
frame_system
::
Call
::
authorize_upgrade
{
..
}
|
frame_system
::
Call
::
authorize_upgrade_without_checks
{
..
}
|
frame_system
::
Call
::
kill_prefix
{
..
}
|
// Should not be in Polkadot/Kusama. Here in order to speed up testing.
frame_system
::
Call
::
set_storage
{
..
},
)
|
RuntimeCall
::
ParachainSystem
(
..
)
|
RuntimeCall
::
Timestamp
(
..
)
|
RuntimeCall
::
Balances
(
..
)
|
RuntimeCall
::
CollatorSelection
(
..
)
|
RuntimeCall
::
Session
(
pallet_session
::
Call
::
purge_keys
{
..
})
|
RuntimeCall
::
XcmpQueue
(
..
)
|
RuntimeCall
::
Broker
(
..
)
)
}
}
pub
type
Barrier
=
TrailingSetTopicAsId
<
DenyThenTry
<
DenyReserveTransferToRelayChain
,
...
...
@@ -206,6 +164,8 @@ pub type Barrier = TrailingSetTopicAsId<
AllowExplicitUnpaidExecutionFrom
<
(
ParentOrParentsPlurality
,
FellowsPlurality
)
>
,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom
<
ParentRelayOrSiblingParachains
>
,
// HRMP notifications from the relay chain are OK.
AllowHrmpNotificationsFromRelayChain
,
),
UniversalLocation
,
ConstU32
<
8
>
,
...
...
@@ -265,8 +225,8 @@ impl xcm_executor::Config for XcmConfig {
>
;
type
MessageExporter
=
();
type
UniversalAliases
=
Nothing
;
type
CallDispatcher
=
WithOriginFilter
<
SafeCallFilter
>
;
type
SafeCallFilter
=
SafeCallFilter
;
type
CallDispatcher
=
RuntimeCall
;
type
SafeCallFilter
=
Everything
;
type
Aliasers
=
Nothing
;
type
TransactionalProcessor
=
FrameTransactionalProcessor
;
type
HrmpNewChannelOpenRequestHandler
=
();
...
...
Prev
1
…
3
4
5
6
7
8
9
10
11
…
17
Next