fix(middleman): resolve broadcast failures through the verifier - #342
fix(middleman): resolve broadcast failures through the verifier#342miguel502 wants to merge 1 commit into
Conversation
A broadcast with no clean answer was written `Failure` with no hash: invisible to the verifier forever, though the tx may have landed. `sendTransaction` now derives the hash locally (sha256 of the bytes it broadcasts, as `matchTxInBlock` does), so every outcome carries one. It also stops flattening errors: dedup is success, a deterministic CheckTx rejection is `rejected`, timeouts and resets are unknown. `ExecuteTransaction` anchors hash + heights BEFORE broadcasting; an unknown outcome stays `pending` for the chain to settle.
PR description — fixes #339SummaryA broadcast that returned no clean answer was recorded as a permanent The broadcaster no longer decides the outcome. It anchors the transaction (hash + heights), sends Against the reporter's suggested direction
Where #3 was narrowed furtherTwo cases look like hard rejections and are not. Treating either as terminal recreates this issue:
Where #4 diverged, and the costRe-broadcasting on re-entry would in fact be safe under the new classification — an in-mempool Cost of not adopting it: a run that dies between the anchor write and a successful broadcast does Correction to the issue textThe issue says the middleman never got the #308 broadcast/verify split. It got half — the The blocker that had to be fixed firstRecommendation 2 could not have worked as written. Both consumers were affected, so Measured against the real function with a real Without this, the change would have moved the defect rather than removed it: from "wrongly marked Also included
Tests35 new tests across three files.
Full gate green: lint 11/11, build 16/16, test 23/23, |
A broadcast with no clean answer was written
Failurewith no hash: invisible to the verifier forever, though the tx may have landed.sendTransactionnow derives the hash locally (sha256 of the bytes it broadcasts, asmatchTxInBlockdoes), so every outcome carries one.It also stops flattening errors: dedup is success, a deterministic CheckTx rejection is
rejected, timeouts and resets are unknown.ExecuteTransactionanchors hash + heights BEFORE broadcasting; an unknown outcome stayspendingfor the chain to settle.