Skip to content

Run Snowbridge halt and resume bridge preimages for verification#636

Merged
rockbmb merged 7 commits into
open-web3-stack:masterfrom
claravanstaden:clara/snowbridge-halt-preimage
Jun 29, 2026
Merged

Run Snowbridge halt and resume bridge preimages for verification#636
rockbmb merged 7 commits into
open-web3-stack:masterfrom
claravanstaden:clara/snowbridge-halt-preimage

Conversation

@claravanstaden

@claravanstaden claravanstaden commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Snowbridge requires an easy accessible, automated way of obtaining the preimage to halt the bridge, in case of an emergency. We added a page on our dApp to get the halt and resume bridge preimage: https://app.snowbridge.network/governance Even though the page is open-source, we need a way to:

  • quickly verify the preimage still works against the current Polkadot runtime
  • that the preimage hasn't been tampered with and adds any malicious calls

This PR adds the halt and resume bridge preimages, to be tested against a fork of Polkadot mainnet (using Chopsticks) every 6 hours. The test verifies storage state and expected events. The Snowbridge app will show a badge that the preimage match what is in this repo, and it can also of course be compared manually too.

@claravanstaden claravanstaden marked this pull request as ready for review June 12, 2026 13:17
@github-actions

Copy link
Copy Markdown
Contributor

The changes look good and the tests are well-structured. I have one minor suggestion to improve the clarity of the test file by adding comments to explain the magic numbers used for proposalLength.


Review Suggestions

packages/polkadot/src/assetHubPolkadot.bridgeHubPolkadot.snowbridgeGovernance.e2e.test.ts:42, 89

The test uses the magic number 201 for proposalLength. It would be beneficial to add a comment explaining how this value is derived. For example, // 199 bytes for the remark + 2 bytes for the call index.

@claravanstaden

Copy link
Copy Markdown
Contributor Author

Review comment details are hallucinated by I added a comment about the preimage length nonetheless: 59d3144

@rockbmb

rockbmb commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

@claravanstaden alright, noted! I'll take a look at this PR this week.


type PreimageEntry = { hash: string; callData: string }

describe('Snowbridge governance halt/resume preimage', async () => {

@rockbmb rockbmb Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you extract these test bodies out of the describe calls? That also allows for documentation to be written that explains the purpose/mechanism behind these tests.

I get that they're trivial to you as a Snowbridge maintainer, but consider someone without your context. Specifically:

  • What do the fee keys (FEE_KEY_V1, FEE_KEY_V2) actually control? Why does setting them to MAX_U128 halt the bridge?
  • What's the relationship between Asset Hub and Bridge Hub in this halt flow?
  • Why are there V1 and V2 versions of everything?
  • What does "halt" actually mean operationally - does it stop inbound, outbound, or both?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rockbmb good point! Added in b8a42e3.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@claravanstaden I was unclear in my previous comment. I've updated it with concrete examples of desirable things to comment, which I guess landed just before you pushed your commit! Sorry!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the extra info @rockbmb! I added specific points to your questions in #636.

@rockbmb rockbmb merged commit 609b345 into open-web3-stack:master Jun 29, 2026
17 of 20 checks passed
@rockbmb

rockbmb commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

@claravanstaden thanks!

@claravanstaden claravanstaden deleted the clara/snowbridge-halt-preimage branch June 30, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e tests Related to end-to-end tests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants