@@ -323,16 +323,6 @@ onOpenNetworkReqTx env ledger st ttl tx =
323
323
| ttl > 0 ->
324
324
wait (WaitOnNotApplicableTx err)
325
325
| otherwise ->
326
- -- XXX: We might want to remove invalid txs from allTxs here to
327
- -- prevent them piling up infinitely. However, this is not really
328
- -- covered by the spec and this could be problematic in case of
329
- -- conflicting transactions paired with network latency and/or
330
- -- message resubmission. For example: Assume tx2 depends on tx1, but
331
- -- only tx2 is seen by a participant and eventually times out
332
- -- because of network latency when receiving tx1. The leader,
333
- -- however, saw both as valid and requests a snapshot including
334
- -- both. This is a valid request and if we would have removed tx2
335
- -- from allTxs, we would make the head stuck.
336
326
newState TxInvalid {headId, utxo = localUTxO, transaction = tx, validationError = err}
337
327
338
328
maybeRequestSnapshot nextSn outcome =
@@ -1783,7 +1773,10 @@ aggregate st = \case
1783
1773
Open ost@ OpenState {} -> Open ost{currentSlot = chainSlot}
1784
1774
_otherState -> st
1785
1775
IgnoredHeadInitializing {} -> st
1786
- TxInvalid {} -> st
1776
+ TxInvalid {transaction} -> case st of
1777
+ Open ost@ OpenState {coordinatedHeadState = coordState@ CoordinatedHeadState {allTxs = allTransactions}} ->
1778
+ Open ost{coordinatedHeadState = coordState{allTxs = foldr Map. delete allTransactions [txId transaction]}}
1779
+ _otherState -> st
1787
1780
Checkpoint state' -> state'
1788
1781
1789
1782
aggregateState ::
0 commit comments