Remove wormhole turnstile (soundness counters and address reveal) - #645
Merged
Conversation
The PotentialWormholeBalance / TotalWormholeExits counters and the ambiguous-address reveal machinery only rate-limited a soundness attacker rather than stopping one, at considerable complexity. Strip the mechanism from pallet-wormhole, the qp-wormhole traits, multisig, utility, and the runtime extension; add a v1->v2 migration that deletes the counters from storage. Bumps spec_version to 141. Co-authored-by: Cursor <cursoragent@cursor.com>
n13
requested changes
Aug 7, 2026
n13
left a comment
Collaborator
There was a problem hiding this comment.
The branch is not rustfmt-clean, so the required 🏁 Fast Checks (Format) job fails and prevents the build/test and Clippy jobs from running.
cargo +nightly fmt --all -- --check reproduces formatting diffs in:
pallets/wormhole/src/lib.rsaround the storage-version documentationruntime/src/transaction_extensions.rsin theas_derivativeweight assertion
Please run the formatter and update the branch.
n13
approved these changes
Aug 7, 2026
n13
left a comment
Collaborator
There was a problem hiding this comment.
Approved — the formatting blocker is resolved, and no blocking findings remain.
Validation:
cargo +nightly fmt --all -- --checkpasses at0a5a59f6.- Focused suites across the touched pallets and runtime passed: 255 tests passed, 4 ignored.
cargo check -p quantus-runtime --features runtime-benchmarkspassed.cargo check -p quantus-runtime --features try-runtimepassed.
Fresh GitHub CI is queued; this approval is based on the equivalent local validation above.
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove the wormhole turnstile
Summary
Removes the wormhole "turnstile" — the soundness counters (
PotentialWormholeBalance,TotalWormholeExits) and the ambiguous-address reveal machinery built around them. The mechanism capped cumulative wormhole exits at an estimate of what could plausibly have been deposited, but since the estimate had to conservatively include every zero-nonce account, it only rate-limited a soundness attacker rather than stopping one. That guarantee was not worth the complexity it spread across five pallets and the runtime.Net effect: -1,622 / +112 lines across 22 files.
What is removed
pallet-wormhole: the two counters, theexits <= potential_balancecheck inprocess_exit_bundle, theSoundnessInvariantViolationerror, the ambiguous-address heuristic (is_ambiguous_account), thereveal_account/reduce_potential_balancehelpers, and theNonWormholeAccountsconfig item.qp-wormholeprimitives:reveal_addressis dropped from theTransferProofRecordertrait; theAddressRevealertrait is deleted.pallet-multisig: no longer reveals newly created multisig addresses; itsProofRecorderconfig item andqp-wormholedependency are removed, along with theis_multisighelper (only used by the reveal heuristic).pallet-utility: theKnownDerivativesstorage and reveal-on-first-use logic inas_derivativeare removed, along with theAddressRevealerconfig item andqp-wormholedependency.WormholeProofRecorderExtensionno longer does nonce sniffing, balance capture, or reveals invalidate/prepare— it now only counts transfers for weight and records proofs from events inpost_dispatch. TheNonWormholeAccountswiring in configs is gone.docs/wormhole-soundness-detection-plan.md(described the removed mechanism) is deleted.What is NOT affected
Transfer-proof recording is untouched. Proofs are recorded event-driven by the extension's
post_dispatch(covering direct transfers, batches, derivatives, and multisig executions alike), plus the direct call sites that run outside signed transactions: mining-reward mints, scheduled reversible transfers, genesis endowments, and exit-bundle mints. Multisig's removedProofRecorderwas used solely for the reveal call, which never produced a proof.Migration
VersionedMigration(v1 -> v2) deletes the two counter keys. It replaces the old v0 -> v1 seed migration in the runtime migration tuple.KnownDerivativesentries inpallet-utilityare left as harmless orphaned keys rather than paying for a multi-block sweep.spec_versionbumped 140 -> 141.Weights
Reads/writes charged for the removed storage operations are dropped:
create_multisig: 2 fewer reads, 1 fewer write (reveal lookup + counter update).as_derivative: no longer charges theKnownDerivativesread/write or reveal.Testing
cargo check --testsand--features runtime-benchmarksclean for all touched crates.migration_removes_soundness_countersverifies the v2 migration deletes both counter keys.