Generate a Snowbridge preimage, create opengov referendum calls, test with referenda-tester (including XCM verification on BridgeHub), and report results
End-to-end workflow: generate a Snowbridge governance preimage, create opengov referendum calls with opengov-cli, test them with the referenda-tester (including XCM relay verification on BridgeHub), and report results ready for on-chain submission.
$0: The snowbridge-preimage subcommand (e.g. mint-feb2026, upgrade-v2, pricing-parameters, etc.)$ARGUMENTS): May include --track and --network overrides.
--track: whitelisted-caller (default) or root--network: polkadot (default), kusama, westend, paseo./preimage/../../opengov-cli/ (relative to this control directory)Run the snowbridge preimage tool:
cd <snowbridge-control-dir>/preimage && cargo run --features <network> -- <subcommand> [extra-flags]
--features flag must match the network: polkadot, kusama, westend, or paseo.0x) from stdout.Preimage hash: 0x... and Preimage size: N).preimage.txt in the opengov-cli project root.From the opengov-cli directory:
cargo run -- submit-referendum --proposal preimage.txt --network <network> --track <track> --output calldata
Parse the output to extract these hex values:
For --track root, there is no fellowship call or collectives batch.
This is the critical verification step. The referenda-tester simulates the full governance flow using Chopsticks.
If the preimage sends XCM to other chains (e.g. BridgeHub), add them via --additional-chains. This is essential for verifying the XCM roundtrip completes successfully.
Common patterns:
PolkadotXcm::send to BridgeHub (e.g. mint, replay, upgrade commands): add BridgeHubTo determine this: check if the preimage tool's subcommand uses send_xcm_bridge_hub() in commands.rs. If so, BridgeHub is needed.
npx github:karolk91/polkadot-referenda-tester test \
--governance-chain-url wss://asset-hub-polkadot-rpc.n.dwellir.com \
--fellowship-chain-url wss://polkadot-collectives-rpc.polkadot.io \
--call-to-create-governance-referendum '<governance-batch-hex>' \
--call-to-create-fellowship-referendum '<collectives-batch-hex>' \
--additional-chains wss://bridge-hub-polkadot-rpc.n.dwellir.com \
--verbose
npx github:karolk91/polkadot-referenda-tester test \
--governance-chain-url wss://asset-hub-polkadot-rpc.n.dwellir.com \
--call-to-create-governance-referendum '<governance-batch-hex>' \
--additional-chains wss://bridge-hub-polkadot-rpc.n.dwellir.com \
--verbose
Omit --fellowship-chain-url and --call-to-create-fellowship-referendum for root track.
Omit --additional-chains if the preimage doesn't send XCM to other chains.
| Network | Asset Hub | Collectives | BridgeHub |
|---|---|---|---|
| Polkadot | wss://asset-hub-polkadot-rpc.n.dwellir.com | wss://polkadot-collectives-rpc.polkadot.io | wss://bridge-hub-polkadot-rpc.n.dwellir.com |
| Kusama | wss://asset-hub-kusama-rpc.n.dwellir.com | wss://kusama-collectives-rpc.n.dwellir.com | wss://bridge-hub-kusama-rpc.n.dwellir.com |
| Westend | wss://asset-hub-westend-rpc.n.dwellir.com | wss://westend-collectives-rpc.n.dwellir.com | wss://bridge-hub-westend-rpc.n.dwellir.com |
Check the output for these success indicators:
Both referenda executed successfully! (or single referendum for root track)Scheduler.Dispatched with result: successWhitelist.WhitelistedCallDispatched with result: success (whitelisted-caller track)PolkadotXcm.Sent with destination Parachain: 1002 (BridgeHub)XcmpQueue.XcmpMessageSent on Asset Hub1002 in the Chopsticks logsMessageQueue.Processed with origin: Sibling(1000) and success: truePolkadotXcm.Sent from BridgeHub back to AH (destination Parachain: 1000)XcmpQueue.XcmpMessageSent on BridgeHub1000 in the Chopsticks logsFor commands that mint/deposit assets (e.g. mint-feb2026, replay-sep2025), verify the return XCM contains:
ReserveAssetDeposited with the correct asset and amountDepositAsset with the correct beneficiaryIf the test fails:
Scheduler.Dispatched result for errorsXcmpQueue.Fail or MessageQueue.ProcessingFailed eventsTransact failuresoutboundHrmpMessage logs to see if XCM was sentPrint a summary including:
If everything passes, the calls are ready for on-chain submission.