Skip to content

Commit df7223b

Browse files
committed
fix: use serialize without signature validation in WASM explain path
explainTransaction() for tsol calls toBroadcastFormat() to get bytes for the WASM parser. toBroadcastFormat() calls @solana/web3.js serialize() which validates signatures by default. After a deserialize-rebuild round-trip (e.g. during parseTransaction), null signatures become zero-filled buffers that fail validation. Use serialize({ verifySignatures: false, requireAllSignatures: false }) instead since explain only needs to read the transaction, not broadcast it. BTC-3099
1 parent 7befc20 commit df7223b

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

modules/sdk-coin-sol/src/lib/transaction.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,15 @@ export class Transaction extends BaseTransaction {
507507
// This validates the WASM path against production traffic before
508508
// replacing the legacy implementation for all networks.
509509
if (this._coinConfig.name === 'tsol') {
510+
// explainTransaction should work on unsigned/partially-signed transactions
511+
// (e.g., during parseTransaction round-trips where null signatures become
512+
// zero-filled buffers). Use serialize without signature validation since
513+
// we only need to read the transaction, not broadcast it.
514+
const txBase64 = Buffer.from(
515+
this._solTransaction.serialize({ verifySignatures: false, requireAllSignatures: false })
516+
).toString('base64');
510517
return explainSolTransaction({
511-
txBase64: this.toBroadcastFormat(),
518+
txBase64,
512519
feeInfo: this._lamportsPerSignature ? { fee: this._lamportsPerSignature.toString() } : undefined,
513520
tokenAccountRentExemptAmount: this._tokenAccountRentExemptAmount,
514521
coinName: this._coinConfig.name,

0 commit comments

Comments
 (0)