Skip to content

Conversation

@samholmes
Copy link
Contributor

@samholmes samholmes commented Nov 5, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Note

Fixes FIRO SparkSpend transaction processing by accepting inputs without txid (using zero txid) and making vin scriptPubkey derivation resilient; also standardizes coinbase outputIndex.

  • UTXO Engine (src/common/utxobased/engine/UtxoEngineProcessor.ts):
    • Accept inputs with missing vin.txid (fallback to 000...000) to support FIRO SparkSpend/private inputs; remove null-txid error.
    • Harden input scriptPubkey derivation with try/catch and warning logs; default to "unknown" on failure.
    • Use 0xffffffff for coinbase outputIndex.
  • Changelog:
    • Add unreleased note: fix failed processing for FIRO transactions with SparkSpend inputs.

Written by Cursor Bugbot for commit 8e348af. This will update automatically on new commits. Configure here.


})
} catch (error) {
common.log.warn(
`failed to get scriptPubkey from address ${vin.addresses[0]}: `,
Copy link

Choose a reason for hiding this comment

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

Bug: Undefined access from empty input addresses array

Potential undefined access when vin.addresses is an empty array. According to the BlockbookTransaction type definition, addresses can be an empty array (default value is []). For SparkSpend inputs in FIRO (the purpose of this PR), the addresses array may be empty. Accessing vin.addresses[0] on line 1371 will return undefined, which is then passed to validScriptPubkeyFromAddress. While the try-catch will handle the error, the error message on line 1376 will log undefined as the address, making debugging difficult. The code should check if vin.addresses[0] exists before attempting to use it.

Fix in Cursor Fix in Web

This handles only the receiving inputs side of a transaction. It does
not fully support tracking the wallet's own SparkSpend inputs which it
cannot even make currently because FIRO is transparent-only for now.
@samholmes samholmes force-pushed the sam/firo-sparkspend branch from 56ec0a9 to 8e348af Compare November 6, 2025 00:02
@samholmes samholmes merged commit 3633d49 into master Nov 6, 2025
3 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.

3 participants