You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: broadcast fan-out waits for first success instead of first result (#42)
* fix: broadcast fan-out waits for first success instead of first result
When multiple teranode endpoints are configured, the broadcast now
returns on the first successful response (ACCEPTED/SENT). Rejections
from one endpoint no longer short-circuit if another endpoint may
accept the transaction. Status is only persisted and published once
after the final result is determined.
* feat: distinguish SERVICE_ERROR from REJECTED in broadcast results
4xx responses from teranode are genuine rejections (invalid tx) and
return immediately. 5xx responses are service errors — other endpoints
may still accept the transaction. Fan-out only waits on service errors,
not rejections.
* fix: parse coinbase from block data to fix merkle proof construction
fetchBlockSubtrees was downloading the full block binary from the datahub
but only extracting subtree hashes, discarding the coinbase transaction.
The coinbase txid is needed to replace the all-FF placeholder at subtree
index 0 — without it, every hash on the left side of the merkle tree is
computed incorrectly, producing invalid proofs.
Renamed fetchBlockSubtrees to fetchBlock, now returns a blockData struct
with both SubtreeHashes and CoinbaseTxID. processBlockTransactions uses
the coinbase from block data directly instead of relying on the P2P
BlockMessage.Coinbase field, which may not always be set (e.g. during
catch-up processing).
Removed parseCoinbaseTxID as it's no longer needed.
* fix: address linter issues from broadcast and coinbase changes
* refactor: replace nolint:exhaustive with explicit status cases
* chore: bump go-jose to v4.1.4 and grpc to v1.80.0 to fix CVE-2026-34986
0 commit comments