Skip to content

fix: make material required in DotTransaction.fromHex/fromBytes#219

Merged
lcovar merged 1 commit intomasterfrom
BTC-3062/require-material-in-fromhex
Mar 19, 2026
Merged

fix: make material required in DotTransaction.fromHex/fromBytes#219
lcovar merged 1 commit intomasterfrom
BTC-3062/require-material-in-fromhex

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Mar 19, 2026

Summary

Make material a required parameter in DotTransaction.fromHex() and DotTransaction.fromBytes() instead of optional.

Without material, the parser silently falls back to guessing the signed extension layout (era + nonce + tip only). On chains with additional extensions (AuthorizeCall, StorageWeightReclaim, CheckMetadataHash, ChargeAssetTxPayment), extra extension bytes leak into call_data, producing silently corrupted transactions that the runtime rejects with a panic.

All existing callers already pass material. This turns a silent data corruption bug into a compile-time error.

Ticket: BTC-3062

Without material, the parser silently falls back to guessing the
signed extension layout (assumes era + nonce + tip only). On chains
with additional extensions (AuthorizeCall, StorageWeightReclaim,
CheckMetadataHash, ChargeAssetTxPayment), this causes extra extension
bytes to leak into call_data, producing silently corrupted transactions.

All existing callers already pass material. Making it required turns
a silent data corruption bug into a compile-time error.

BTC-3062
@lcovar lcovar force-pushed the BTC-3062/require-material-in-fromhex branch from b4ad071 to 9290793 Compare March 19, 2026 06:55
@lcovar lcovar requested a review from a team as a code owner March 19, 2026 06:55
@lcovar lcovar enabled auto-merge March 19, 2026 14:25
@lcovar lcovar merged commit b68c7fb into master Mar 19, 2026
13 checks passed
@lcovar lcovar deleted the BTC-3062/require-material-in-fromhex branch March 19, 2026 17:26
lcovar added a commit that referenced this pull request Mar 20, 2026
Material is required at the TypeScript level (PR #219), making
the Rust no-metadata fallback code unreachable dead code.

BTC-3062
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