-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Polkadot <> Kusama bridge configuration #108
Added Polkadot <> Kusama bridge configuration #108
Conversation
…d once we have weights + tests
…00_000_000. Otherwise msg is treated as overweight by target AH and is not autodispatched. Need to check that before release
…k pallet --chain bh-polkadot-local-raw.json --pallet pallet-bridge-grandpa --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights --no-median-slopes --no-min-squares
…k pallet --chain bh-polkadot-local-raw.json --pallet pallet-bridge-relayers --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights --no-median-slopes --no-min-squares
…k pallet --chain bh-polkadot-local-raw.json --pallet pallet-bridge-parachains --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights --no-median-slopes --no-min-squares
…k pallet --chain bh-polkadot-local-raw.json --pallet pallet-bridge-messages --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights --no-median-slopes --no-min-squares
…k pallet --chain bh-polkadot-local-raw.json --pallet pallet-xcm-benchmarks:: --extrinsic "report_holding,buy_execution,query_response,transact,refund_surplus,set_error_handler,set_appendix,clear_error,descend_origin,clear_origin,report_error,claim_asset,trap,subscribe_version,unsubscribe_version,burn_asset,expect_asset,expect_origin,expect_error,expect_transact_status,query_pallet,report_transact_status,clear_transact_status,set_topic,clear_topic,export_message,set_fees_mode,unpaid_execution" --output=system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/xcm --no-median-slopes --no-min-squares + manually add expect_pallet benchmark results
…k pallet --chain bh-polkadot-local-raw.json --pallet pallet-xcm-benchmarks::fungible --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/xcm --no-median-slopes --no-min-squares
…k pallet --chain bh-kusama-local-raw.json --pallet pallet-bridge-grandpa --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-kusama/src/weights --no-median-slopes --no-min-squares
…k pallet --chain bh-kusama-local-raw.json --pallet pallet-bridge-relayers --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-kusama/src/weights --no-median-slopes --no-min-squares
…k pallet --chain bh-kusama-local-raw.json --pallet pallet-bridge-parachains --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-kusama/src/weights --no-median-slopes --no-min-squares
…k pallet --chain bh-kusama-local-raw.json --pallet pallet-bridge-messages --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-kusama/src/weights --no-median-slopes --no-min-squares
…k pallet --chain bh-kusama-local-raw.json --pallet pallet-xcm-benchmarks::generic --extrinsic "report_holding,buy_execution,query_response,transact,refund_surplus,set_error_handler,set_appendix,clear_error,descend_origin,clear_origin,report_error,claim_asset,trap,subscribe_version,unsubscribe_version,burn_asset,expect_asset,expect_origin,expect_error,expect_transact_status,query_pallet,report_transact_status,clear_transact_status,set_topic,clear_topic,export_message,set_fees_mode,unpaid_execution" --output=system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/xcm --no-median-slopes --no-min-squares
…k pallet --chain bh-kusama-local-raw.json --pallet pallet-xcm-benchmarks::fungible --extrinsic "*" --output=system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/xcm --no-median-slopes --no-min-squares
…k pallet --chain ah-polkadot-local-raw.json --pallet pallet-xcm-benchmarks::generic --extrinsic "report_holding,buy_execution,query_response,transact,refund_surplus,set_error_handler,set_appendix,clear_error,descend_origin,clear_origin,report_error,claim_asset,trap,subscribe_version,unsubscribe_version,burn_asset,expect_asset,expect_origin,expect_error,expect_transact_status,query_pallet,report_transact_status,clear_transact_status,set_topic,clear_topic,export_message,set_fees_mode,unpaid_execution" --output=system-parachains/asset-hubs/asset-hub-polkadot/src/weights/xcm --no-median-slopes --no-min-squares
…k pallet --chain ah-polkadot-local-raw.json --pallet pallet-xcm-benchmarks::fungible --extrinsic "*" --output=system-parachains/asset-hubs/asset-hub-polkadot/src/weights/xcm --no-median-slopes --no-min-squares
@@ -258,6 +262,17 @@ impl Contains<RuntimeCall> for SafeCallFilter { | |||
} | |||
} | |||
|
|||
// Allow to change dedicated storage items (called by governance-like) | |||
match call { | |||
RuntimeCall::System(frame_system::Call::set_storage { items }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does breaks the third rule described above in the docs for SafeCallFilter
. However, it's worth checking whether those rules can be removed, if these changes included in the current release - paritytech/polkadot-sdk#1246
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only reads affect proof size and set_storage
makes no any reads. Also we use .iter().all()
, comparing with just two keys, so it won't make more than two writes, so this vec is kinda bounded.
pub const WITH_BRIDGE_HUB_KUSAMA_RELAYERS_PALLET_NAME: &str = "BridgeRelayers"; | ||
|
||
/// Pallet index of `BridgePolkadotMessages: pallet_bridge_messages::<Instance1>`. | ||
pub const WITH_BRIDGE_KUSAMA_TO_POLKADOT_MESSAGES_PALLET_INDEX: u8 = 53; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these look like constants, not primitives. wont block PR because of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It declares some primitives as well - e.g. it reexports hashers, block numbers and etc. So it is both consts and primitives.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments. Clearly did not read every detail of the pr, but looking good from what I can say.
system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
pub const BridgeHubPolkadotBaseDeliveryFeeInDots: Balance = 16_954_899_613; | ||
|
||
/// Transaction fee that is paid at the Polkadot BridgeHub for delivering single outbound message confirmation. | ||
/// (initially was calculated by test `BridgeHubPolkadot::can_calculate_fee_for_complex_message_confirmation_transaction` + `33%`) | ||
pub const BridgeHubPolkadotBaseConfirmationFeeInDots: Balance = 16_183_099_613; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.6DOT? is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bkontur any idea about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is the current cost
/// Number of Kusama Bridge Hub headers to keep in the runtime storage. | ||
/// | ||
/// Note that we are keeping only required header information, not the whole header itself. Roughly, it | ||
/// is the 2 hours of real time (assuming that every header is submitted). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But 1 hour are 600 blocks, so shouldn't this be 1200 for keeping 2 hours?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, RelayChainHeadersToKeep
is correct. I assume this still assumes that there are only a parachain block every 12 seconds? If yes, this is not correct anymore and we should update this as well to 1200.
/// | ||
/// Note that we are keeping only required header information, not the whole header itself. Roughly, it | ||
/// is the 2 hours of real time (assuming that every header is submitted). | ||
pub const ParachainHeadsToKeep: u32 = 600; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as for Polkadot.
@svyatonik @acatangiu can you please merge master and fix the merge conflicts? |
I think both are ooo, I will try |
Ty! |
# Conflicts: # relay/kusama/src/weights/pallet_xcm_benchmarks_generic.rs # system-parachains/asset-hubs/asset-hub-kusama/src/weights/pallet_xcm_benchmarks_fungible.rs # system-parachains/asset-hubs/asset-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs # system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs # system-parachains/asset-hubs/asset-hub-polkadot/src/weights/pallet_xcm_benchmarks_fungible.rs # system-parachains/asset-hubs/asset-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs # system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/pallet_xcm_benchmarks_fungible.rs # system-parachains/bridge-hubs/bridge-hub-kusama/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs # system-parachains/bridge-hubs/bridge-hub-kusama/tests/tests.rs # system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/pallet_xcm_benchmarks_fungible.rs # system-parachains/bridge-hubs/bridge-hub-polkadot/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs # system-parachains/bridge-hubs/bridge-hub-polkadot/tests/tests.rs
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <git@kchr.de>
…/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de>
/merge |
98872cb
into
polkadot-fellows:main
Enabled Available commands
For more information see the documentation |
- [x] Adds asset hub and bridge hub to Kusama and Polkadot runtimes - [x] based off #108 - needs to be merged first - [x] snowbridge crates needs to be published on crates.io - depends on `polkadot-sdk 1.7.0` - [x] MessageQueue Pallet is not configured on Kusama and Polkadot asset hub - added in #137 - [x] `FeeManager` `handle_fee` misses reason, crate needs to be updated I think cc @vgeddes @alistair-singh @yrong @musnit --------- Signed-off-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: Ross Bulat <ross@parity.io> Co-authored-by: claravanstaden <Cats 4 life!> Co-authored-by: Alain Brenzikofer <alain@integritee.network> Co-authored-by: eskimor <eskimor@no-such-url.com> Co-authored-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: brenzi <brenzi@users.noreply.github.com> Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> Co-authored-by: ron <yrong1997@gmail.com> Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: Vincent Geddes <vincent.geddes@hey.com>
This PR adds bridge configuration to allow exchanging assets between Polkadot and Kusama Asset Hubs. So far we only support sending KSM from Kusama Asset Hub to Polkadot Asset Hub as wKSM + DOT from Polkadot Asset Hub to Kusama Asset Hub as wDOT. Other assets may be added later.
The opposite direction is also supported, though it'll need dependencies upgrade to >= v1.4.
Similar Rococo <> Westend bridge is also active on live chains. You may read docs on how to play with it here: https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/parachains/runtimes/bridge-hubs/README.md
For Polkadot <> Kusama bridge we have a dedicated branch for local zombienet tests: https://github.com/svyatonik/runtimes/tree/sv-pk-bridge-with-zombienet-tests. You may run autotests (exchanging assets) there - see https://github.com/svyatonik/runtimes/blob/sv-pk-bridge-with-zombienet-tests/system-parachains/bridge-hubs/zombienet/README.md for details. You may do manual tests by spawning local chains using those scripts and use https://github.com/svyatonik/runtimes/blob/sv-pk-bridge-with-zombienet-tests/system-parachains/bridge-hubs/zombienet/scripts/bridges_kusama_polkadot.sh script to run various commands - i.e. send assets manually. Polkadot js apps is also supported.