Skip to content

fix: facilitate extrinsic decoding#2

Open
ruseinov wants to merge 1 commit into
v0.2from
ru/fix/extrinsic-lookup
Open

fix: facilitate extrinsic decoding#2
ruseinov wants to merge 1 commit into
v0.2from
ru/fix/extrinsic-lookup

Conversation

@ruseinov

Copy link
Copy Markdown
Collaborator

Summary

Fix Quip block decoding in Apps by patching @polkadot/types to respect the wire-level isSigned flag when decoding extrinsic signatures.

Why

Quip blocks can contain V5 bare inherents (0x05) alongside V4 signed transactions (0x84). Quip also uses a custom hybrid transaction signature envelope instead of the standard MultiSignature.

The upstream decoder inferred signed-ness from whether the decoded signature object looked empty. That heuristic breaks for Quip’s struct-like hybrid signature: a default struct can look non-empty even when the extrinsic version/type byte marks the extrinsic as bare/unsigned. Apps then misclassifies a bare V5 inherent as signed V5 and fails with:

Signed Extrinsics are currently only available for ExtrinsicV4

Changes

  • Add a Yarn patch for @polkadot/types@16.5.6.
  • Make V4/V5 extrinsic signature wrappers trust the explicit decoded isSigned flag.
  • Track .yarn/patches in git.
  • Document the Quip-specific extrinsic decoding rationale in the README.

Validation

  • Verified api.rpc.chain.getBlock(...) succeeds against wss://bootnode-1.testnet.quip.network:20049/rpc.
  • Confirmed decoded block shape: V5 bare timestamp.set, followed by V4 signed transactions.
  • Ran yarn install; it completed with existing peer warnings and optional native build warnings.

@augmentcode

augmentcode Bot commented Jul 10, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR fixes Quip block decoding in Apps by patching @polkadot/types to honor the wire-level “signed” flag when interpreting extrinsics.

Changes:

  • Adds a Yarn patch for @polkadot/types@16.5.6 and tracks .yarn/patches in git.
  • Updates V4/V5 extrinsic signature wrappers to return isSigned based on the explicit decoded flag (rather than inferring from “empty” signature shape).
  • Ensures signing paths set the signature wrapper’s signed state consistently.
  • Pins @polkadot/types to the patched locator in package.json.
  • Documents the Quip-specific V5 bare inherent + V4 signed transaction mix and the decoding rationale in the README.

Why: Quip blocks can mix 0x05 bare V5 inherents with 0x84 signed V4 transactions and use a struct-like hybrid signature envelope that breaks the upstream “empty signature” heuristic.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread package.json
"@polkadot/rpc-provider": "^16.5.6",
"@polkadot/typegen": "^16.5.6",
"@polkadot/types": "^16.5.6",
"@polkadot/types": "patch:@polkadot/types@npm%3A16.5.6#~/.yarn/patches/@polkadot-types-npm-16.5.6-6fe2703ed8.patch",

@augmentcode augmentcode Bot Jul 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using the patch: protocol can introduce a distinct package locator; it’s worth confirming the dependency graph doesn’t end up with both patched and unpatched @polkadot/types copies, since mixed instances can lead to inconsistent extrinsic decoding and/or codec type mismatches at runtime.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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.

1 participant