@@ -104,14 +104,20 @@ func TestFallbackAuth_OrderingAndSuccess(t *testing.T) {
104104 require .Equal (t , txdata .ID ().String (), got .ID .id .String ())
105105}
106106
107+ // TestFallbackAuth_AuthFailureRetried verifies that an auth-tx send failure produces an error
108+ // receipt keyed to the batch txData so the frames are re-queued. The pair is submitted
109+ // back-to-back (pipelined), so the batch tx is also sent; if its auth never lands the batch is
110+ // simply dropped by derivation — its commitment has no matching auth event in the lookback
111+ // window — so the orphaned send is harmless to safety.
107112func TestFallbackAuth_AuthFailureRetried (t * testing.T ) {
108113 l := newFallbackAuthSubmitter (t )
109114 txdata := testFallbackTxData (t )
110115 candidate := & txmgr.TxCandidate {TxData : []byte ("batch-calldata" )}
111116
112117 queue := & fakeTxSender {
113118 responses : []txmgr.TxReceipt [txRef ]{
114- {Err : errSendFailed }, // auth fails. No batch response, it must never be sent
119+ {Err : errSendFailed }, // auth fails
120+ {Receipt : receiptWithBlock (101 )}, // batch send (result discarded on auth failure)
115121 },
116122 }
117123 receiptsCh := make (chan txmgr.TxReceipt [txRef ], 1 )
@@ -121,9 +127,8 @@ func TestFallbackAuth_AuthFailureRetried(t *testing.T) {
121127 got := <- receiptsCh
122128 require .Error (t , got .Err )
123129 require .Equal (t , txdata .ID ().String (), got .ID .id .String ())
124- // The batch tx must not be sent after an auth failure: it would be crafted at the
125- // next nonce while the failed auth tx resets the txmgr nonce, leaving a nonce gap.
126- require .Len (t , queue .sends , 1 )
130+ // Both txs are submitted back-to-back; the auth failure does not gate the batch send.
131+ require .Len (t , queue .sends , 2 )
127132}
128133
129134// TestFallbackAuth_AuthFailureTxRefType verifies that an auth-tx failure is
@@ -140,7 +145,8 @@ func TestFallbackAuth_AuthFailureTxRefType(t *testing.T) {
140145
141146 queue := & fakeTxSender {
142147 responses : []txmgr.TxReceipt [txRef ]{
143- {Err : errSendFailed }, // auth fails. No batch response, it must never be sent
148+ {Err : errSendFailed }, // auth fails
149+ {Receipt : receiptWithBlock (101 )}, // batch send (result discarded on auth failure)
144150 },
145151 }
146152 receiptsCh := make (chan txmgr.TxReceipt [txRef ], 1 )
@@ -150,7 +156,7 @@ func TestFallbackAuth_AuthFailureTxRefType(t *testing.T) {
150156 got := <- receiptsCh
151157 require .Error (t , got .Err )
152158 require .Equal (t , txdata .ID ().String (), got .ID .id .String ())
153- require .Len (t , queue .sends , 1 )
159+ require .Len (t , queue .sends , 2 )
154160 require .False (t , got .ID .isBlob )
155161 require .Equal (t , DaTypeCalldata , got .ID .daType )
156162}
@@ -211,7 +217,8 @@ func TestFallbackAuth_AuthRevertedRetried(t *testing.T) {
211217
212218 queue := & fakeTxSender {
213219 responses : []txmgr.TxReceipt [txRef ]{
214- {Receipt : revertedReceiptWithBlock (100 )}, // auth mined but reverted. Batch must never be sent
220+ {Receipt : revertedReceiptWithBlock (100 )}, // auth mined but reverted
221+ {Receipt : receiptWithBlock (101 )}, // batch send (result discarded on auth revert)
215222 },
216223 }
217224 receiptsCh := make (chan txmgr.TxReceipt [txRef ], 1 )
@@ -221,9 +228,10 @@ func TestFallbackAuth_AuthRevertedRetried(t *testing.T) {
221228 got := <- receiptsCh
222229 require .Error (t , got .Err )
223230 require .Equal (t , txdata .ID ().String (), got .ID .id .String ())
224- // A reverted auth tx emits no BatchInfoAuthenticated event, so the batch data would be
225- // unverifiable so the batch tx must not be submitted at all.
226- require .Len (t , queue .sends , 1 )
231+ // A reverted auth tx emits no BatchInfoAuthenticated event, so the batch is unverifiable and
232+ // an error receipt is forwarded to re-queue the frames. Both txs are still submitted
233+ // (pipelined); the orphaned batch is dropped by derivation for lack of a matching auth event.
234+ require .Len (t , queue .sends , 2 )
227235}
228236
229237// TestFallbackAuth_WindowViolationRetried verifies that a batch tx landing
0 commit comments