Skip to content

fix(runtime): charge two inner-call walks on Multisig::execute - #677

Merged
n13 merged 2 commits into
n13/multisig-execute-decode-depthfrom
n13/execute-walk-weight
Aug 31, 2026
Merged

fix(runtime): charge two inner-call walks on Multisig::execute#677
n13 merged 2 commits into
n13/multisig-execute-decode-depthfrom
n13/execute-walk-weight

Conversation

@n13

@n13 n13 commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Purpose

WormholeProofRecorderExtension::weight() and validate() both walk Multisig::execute's inner call, but a no-transfer execute reserved zero extension weight. A non-signer/missing-proposal execute then refunds pallet weight to one DB read, so repeated failing executes carrying large no-transfer trees consumed two caller-controlled traversals while returning that work to block capacity.

Public never charged this (execute is just another wrapper). Private charged two storage walks for opaque-id execute; that reservation was dropped when the merge adopted call-carrying execute. Neither main has the call-carrying version of this fix. Kept off #675 so that PR stays the merge.

Change

  • Every top-level Multisig::execute reserves two worst-case inner-call walks (MaxCallSize decode compute, no extra PoV — the call is already in the extrinsic).
  • post_dispatch still refunds unused transfer reservation on error; the walk reservation is retained because that work already ran.

Verification

SKIP_WASM_BUILD=1 cargo test --locked -p quantus-runtime --lib — 68 passed

weight() and validate() both traverse the resubmitted call, but a
no-transfer execute reserved zero extension weight. A failing
non-signer execute then refunded the pallet to one storage read, so
broad/deep remark trees were free work against block capacity.
Reserve two worst-case MaxCallSize walks for every execute and keep
that reservation on early errors.
@n13
n13 force-pushed the n13/execute-walk-weight branch from a650cb3 to 112d861 Compare August 30, 2026 13:10
@n13
n13 changed the base branch from n13/merge-chain-private to n13/multisig-execute-decode-depth August 30, 2026 13:10
@n13
n13 merged commit 0c51362 into n13/multisig-execute-decode-depth Aug 31, 2026
5 checks passed
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