Skip to content

Snowbridge V2: Add OnNewCommitment hook to outbound-queue pallet#8053

Merged
acatangiu merged 13 commits into
paritytech:masterfrom
Agusrodri:agusrodri-new-outbound-commitment-hook
Sep 23, 2025
Merged

Snowbridge V2: Add OnNewCommitment hook to outbound-queue pallet#8053
acatangiu merged 13 commits into
paritytech:masterfrom
Agusrodri:agusrodri-new-outbound-commitment-hook

Conversation

@Agusrodri
Copy link
Copy Markdown
Contributor

@Agusrodri Agusrodri commented Mar 26, 2025

Description

This PR adds a simple hook to snowbridge-pallet-outbound-queue-v2 which allows to perform actions whenever there is a new commitment in this pallet.

@paritytech-review-bot paritytech-review-bot Bot requested a review from a team March 26, 2025 22:57
@claravanstaden
Copy link
Copy Markdown
Contributor

@Agusrodri do have a use case that you need this hook for? cc @vgeddes @yrong

@Agusrodri
Copy link
Copy Markdown
Contributor Author

@Agusrodri do have a use case that you need this hook for? cc @vgeddes @yrong

Yes sure! A use case in which this hook would be useful, is for instance a solo-chain context. It might be the case that we want to add the message commitment root as part of the ExtraLeafData field of the MMR root (all of this done through the OnNewCommitment hook), and include this commitment as part of the whole verification on the Ethereum side.

@claravanstaden
Copy link
Copy Markdown
Contributor

@Agusrodri that sounds cool! I think we should only add this when there is a concrete use case for this? I understand (correct me if I am wrong) that more runtime code will be added to support this feature. So I think we should only add the hook when implementing a concrete requirement is necessary, to avoid having unused code that might not be used.

@Agusrodri
Copy link
Copy Markdown
Contributor Author

@Agusrodri that sounds cool! I think we should only add this when there is a concrete use case for this? I understand (correct me if I am wrong) that more runtime code will be added to support this feature. So I think we should only add the hook when implementing a concrete requirement is necessary, to avoid having unused code that might not be used.

I didn't fully get what you mean by "more runtime code". For the use case I mentioned above (use case I need and will implement) yes, there would be more code, but that extra code would be part of my custom runtime logic. To be precise, I would create a pallet that implements this hook and make use of it inside my runtime. This means, that no more code needs to be added to Snowbridge/polkadot-sdk besides the one I'm proposing in this PR if that was somehow your concern.

Also, I believe that polkadot-sdk pallets (even Snowbridge ones) should be as generic as possible, and in my humble opinion this feature aims to contribute on that path.

Let me know your thoughts on this, and also thanks for your time :)

Copy link
Copy Markdown
Contributor

@claravanstaden claravanstaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be precise, I would create a pallet that implements this hook and make use of it inside my runtime.

Got it. 👍🏻

Copy link
Copy Markdown
Contributor

@acatangiu acatangiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hook makes sense and is simple enough, doesn't add any complexity. I am ok with it.

…/bridge_to_ethereum_config.rs

Co-authored-by: Adrian Catangiu <adrian@parity.io>
@github-actions
Copy link
Copy Markdown
Contributor

Review required! Latest push from author must always be reviewed

@Agusrodri
Copy link
Copy Markdown
Contributor Author

@acatangiu @claravanstaden can we merge? Let me know if I need to do something else from my side to make the CI happy :)

@claravanstaden
Copy link
Copy Markdown
Contributor

@Agusrodri I am happy to have this merged. :)

@acatangiu acatangiu requested review from a team and removed request for claravanstaden April 2, 2025 07:17
@raymondkfcheung raymondkfcheung added the T15-bridges This PR/Issue is related to bridges. label May 6, 2025
@github-actions github-actions Bot requested a review from raymondkfcheung May 20, 2025 14:47
@acatangiu acatangiu enabled auto-merge September 23, 2025 08:41
@acatangiu acatangiu added this pull request to the merge queue Sep 23, 2025
Merged via the queue into paritytech:master with commit a0a3b84 Sep 23, 2025
242 of 244 checks passed
girazoki pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Oct 7, 2025
…aritytech#8053)

## Description

This PR adds a simple hook to `snowbridge-pallet-outbound-queue-v2`
which allows to perform actions whenever there is a new commitment in
this pallet.

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
alvicsam pushed a commit that referenced this pull request Oct 17, 2025
…8053)

## Description

This PR adds a simple hook to `snowbridge-pallet-outbound-queue-v2`
which allows to perform actions whenever there is a new commitment in
this pallet.

---------

Co-authored-by: Adrian Catangiu <adrian@parity.io>
girazoki pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Nov 3, 2025
girazoki pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Nov 20, 2025
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jan 15, 2026
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jan 15, 2026
tmpolaczyk pushed a commit to moondance-labs/polkadot-sdk that referenced this pull request Jan 15, 2026
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

None yet

Development

Successfully merging this pull request may close these issues.

5 participants