Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Investigation of deploying pallet-bridge-messages on the source/destination chain (without finality pallets) a.k.a. sync finality proofs service #5827

Open
4 tasks
bkontur opened this issue Sep 25, 2024 · 0 comments
Labels
T15-bridges This PR/Issue is related to bridges.

Comments

@bkontur
Copy link
Contributor

bkontur commented Sep 25, 2024

TL;DR:

The pallet-bridge-messages must validate received proofs from the bridged chain, which requires verified/proven bridged_header_hash and state_root by finality pallets. However, we don't want to deploy finality pallets everywhere.

Essentially, we need a solution that propagates (makes available) this information (bridged_header_hash and state_root) to the (para)chain where we want to deploy pallet-bridge-messages.

Description

The pallet-bridge-messages needs to validate received proofs from the bridged chain in verify_messages_proof. It only requires the state_root of the bridged chain for the verified bridged_header_hash:

  • pallet-bridge-grandpa provides the bridged_header_hash and state_root for bridging to a GRANDPA chain through the HeaderChain implementation here.
  • pallet-bridge-parachains provides the bridged_header_hash and state_root for bridging to a parachain through the HeaderChain implementation here.

It doesn’t make sense to deploy pallet-bridge-grandpa or pallet-bridge-parachains on all source or destination chains. If we want to deploy only pallet-bridge-messages on a source or destination chain, we need to ensure or provide a mechanism to deliver a proven/verified state_root for the requested bridged_header_hash.

1. Solution

Sync parachain proofs from BridgeHub to AssetHub using XCM Transact.

  • Deploy a new simple pallet, e.g., pallet-bridge-sync-proofs, on the AssetHub.
    • Expose one extrinsic: update_proofs(bridged_header_hash, state_root).
    • Implement the HeaderChain trait for verifying proofs.
  • Deploy pallet-bridge-messages on the AssetHub using the HeaderChain implementation from pallet-bridge-sync-proofs to validate with synced proofs.
  • Extend the pallet-bridge-parachains:
    • Subscription mechanism with exposed extrinsics for subscribe_for_proofs and unsubscribe_for_proofs.
    • Configuration with a callback that will trigger (immediately or on idle) XCM Transact(update_proofs(bridged_header_hash, state_root)) when new verified/proved data are produced, but only for the subscribed origins.

2. Solution

I am borrowing @jakoblell's great summary here:

The bridges pallets are pretty ready and could be moved directly to the asset hub without too much effort - and even a hybrid approach with grandpa on the bridge hub and parachains/messages on the target chains will be doable with a relatively manageable effort, for that the bridge hub could do the grandpa finality and send the finalized relay chain block hash/header to the relay chain via UMP, the relay chain could then put it in a storage value (accessable with a simple storage proof based on the relay parent storage root) or header digest so that other parachains can run their bridges based of that.

3. Solution - sync state_root of BridgeHub to the AssetHub

So when we have state_root of BridgeHub at the AssetHub, we can prepare proofs and we don't need to sync it with HRMP.

#7445

Other solutions

Maybe BEEFY could be useful here?

TODO / Questions

  • think about how other parachains would subscribe to the bridge-hub's finality proofs
  • think about pruning stuff
  • think about retry/resend finality proofs
  • investigate also snowfork-inbound/outbound-queue possibilities
@bkontur bkontur added the T15-bridges This PR/Issue is related to bridges. label Sep 25, 2024
@bkontur bkontur moved this to Todo in Bridges + XCM Sep 25, 2024
@bkontur bkontur changed the title Investigation of deploying pallet-bridge-messages directly on the source/destination chain Investigation of deploying pallet-bridge-messages on the source/destination chain (without finality pallets) Sep 25, 2024
@bkontur bkontur changed the title Investigation of deploying pallet-bridge-messages on the source/destination chain (without finality pallets) Investigation of deploying pallet-bridge-messages on the source/destination chain (without finality pallets) a.k.a. sync finality proofs service Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T15-bridges This PR/Issue is related to bridges.
Projects
Status: No status
Status: Todo
Development

No branches or pull requests

1 participant