Summary
The Tier-3 block-scan height guard added in PR #278 was applied to a class that is never instantiated, so it has no effect at runtime, and the live code path still has the unbounded scan it was meant to fix.
Detail
PR #278 added a comet.status() + Math.min(height + maxBlocks, latestHeight) guard to Blockchain.getTransaction in apps/middleman-workflows/src/lib/blockchain/index.ts so the Tier-3 scan stops at the chain tip instead of walking future (non-existent) heights.
But that Blockchain class is imported only for the SendTransactionResult type (ExecuteTransaction.ts) — it is never constructed. The activity's blockchain client is PocketBlockchain from @igniter/pocket (wired in apps/middleman-workflows/src/worker.ts via PocketBlockchain.setup(...)).
The live Tier-3 scan lives in PocketBlockchain.getTransactionFromBlock (packages/pocket/src/index.ts:359) and still loops:
for (let h = startHeight; h < startHeight + maxBlocks; h++) {
// comet.block(h) throws for future heights -> caught -> continue
}
with no latest-height bound.
Impact
For a not-yet-indexed tx, every Tier-3 scan still attempts up to maxBlocks future heights, each comet.block(h) throwing and being swallowed — exactly the wasted scan budget PR #278 intended to remove. The Tier-3 portion of that PR is effectively dead code.
Fix
Port the latest-height guard into PocketBlockchain.getTransactionFromBlock (packages/pocket/src/index.ts), and either remove the unused Blockchain class or reduce it to the exported type. Consider whether the duplicate Blockchain implementation should exist at all.
Summary
The Tier-3 block-scan height guard added in PR #278 was applied to a class that is never instantiated, so it has no effect at runtime, and the live code path still has the unbounded scan it was meant to fix.
Detail
PR #278 added a
comet.status()+Math.min(height + maxBlocks, latestHeight)guard toBlockchain.getTransactioninapps/middleman-workflows/src/lib/blockchain/index.tsso the Tier-3 scan stops at the chain tip instead of walking future (non-existent) heights.But that
Blockchainclass is imported only for theSendTransactionResulttype (ExecuteTransaction.ts) — it is never constructed. The activity's blockchain client isPocketBlockchainfrom@igniter/pocket(wired inapps/middleman-workflows/src/worker.tsviaPocketBlockchain.setup(...)).The live Tier-3 scan lives in
PocketBlockchain.getTransactionFromBlock(packages/pocket/src/index.ts:359) and still loops:with no latest-height bound.
Impact
For a not-yet-indexed tx, every Tier-3 scan still attempts up to
maxBlocksfuture heights, eachcomet.block(h)throwing and being swallowed — exactly the wasted scan budget PR #278 intended to remove. The Tier-3 portion of that PR is effectively dead code.Fix
Port the latest-height guard into
PocketBlockchain.getTransactionFromBlock(packages/pocket/src/index.ts), and either remove the unusedBlockchainclass or reduce it to the exported type. Consider whether the duplicateBlockchainimplementation should exist at all.