Skip to content

fix: take the wormhole volume fee from the shipped runtime metadata - #610

Open
n13 wants to merge 1 commit into
mainfrom
fix/wormhole-fee-from-metadata
Open

fix: take the wormhole volume fee from the shipped runtime metadata#610
n13 wants to merge 1 commit into
mainfrom
fix/wormhole-fee-from-metadata

Conversation

@n13

@n13 n13 commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #606 (comment) — the volume fee is no longer a hand-maintained copy of a runtime value.

final int wormholeVolumeFeeBps = wormhole_pallet.Constants().volumeFeeRateBps;

It comes from the metadata the app already ships with (the generated pallet constants). A runtime that changes the fee needs regenerated bindings and a new build — never an edited literal. Everything downstream (coin selection, wormholeNetScaled, the proof's volume_fee_bps, the fee labels) is unchanged and keeps reading that one value.

Regenerated bindings

The committed bindings still said volumeFeeRateBps = 10, so they were regenerated against planck (melos run generate + melos run format). Beyond the fee, this brings in the runtime drift that had accumulated:

  • Assets and AssetsHolder are gone — the runtime removed them (// Index 17 was pallet_assets (removed). Kept vacant so downstream pallet indices stay stable.), which also removes reversible schedule_asset_transfer / schedule_asset_transfer_with_delay
  • wormhole: GenesisEndowmentsPending, PotentialWormholeBalance, TotalWormholeExits storage dropped, new events/errors, updated docs
  • referenda, reversible transfers, scheduler, system, mining rewards: new events/errors, changed docs
  • dilithium: DilithiumSignatureScheme variants updated

Because those calls can no longer exist on chain, the code that decoded them goes too: the call decoder's Assets branch and the two reversible asset-transfer cases, their tests, and the cold-wallet Asset / Reversible asset debug payloads and display test.

Note: AmountField.assetId / TransferSummary.assetId (and the "ASSET SEND" title branch) stay in the display model — nothing can populate them now, so they're inert. Removing them touches both apps' call-detail UIs; happy to do it in a follow-up.

Verification

  • melos run analyze — clean across all four packages
  • melos run format — no changes after regeneration
  • quantus_sdk flutter test: 168 pass; the 5 failures are the pre-existing setUpAll ones that need the compiled Rust dylib (identical on an untouched main checkout)
  • mobile-app 288 pass, cold-wallet-app 26 pass, miner-app 12 pass (its one failure is the pre-existing empty test/widget_test.dart)
  • wormhole_coin_selection_test asserts the fee is 4 and 0.04%, now sourced from the regenerated metadata

The 4 bps fee was a Dart constant kept in sync with `Wormhole::VolumeFeeRateBps`
by hand — the mismatch that broke proofs in #606. It now comes from the metadata
the app already ships with, i.e. the generated pallet constants; a runtime that
changes the fee needs regenerated bindings, not an edited literal.

The bindings were regenerated against planck for that (they still carried the
old 10 bps). That also drops the `Assets` pallet and reversible
`schedule_asset_transfer`, both removed from the runtime (pallet index 17 is
vacant), so their decoder branches, tests and cold-wallet debug payloads go with
them.
@n13
n13 force-pushed the fix/wormhole-fee-from-metadata branch from c027fb1 to faec6c1 Compare August 15, 2026 04:03
@n13 n13 changed the title fix: read the wormhole volume fee from the runtime metadata fix: take the wormhole volume fee from the shipped runtime metadata Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants