@@ -311,20 +311,25 @@ func (envDiff *environmentDiff) commitBundle(bundle *types.SimulatedBundle, chDa
311
311
isRevertibleTx := bundle .OriginalBundle .RevertingHash (txHash )
312
312
// if drop enabled, and revertible tx has error on commit, we skip the transaction and continue with next one
313
313
if algoConf .DropRevertibleTxOnErr && isRevertibleTx {
314
- log .Info ("Found error on commit for revertible tx, but discard on err is enabled so skipping." ,
314
+ log .Debug ("Found error on commit for revertible tx, but discard on err is enabled so skipping." ,
315
315
"tx" , txHash , "err" , err )
316
316
continue
317
317
}
318
318
319
319
log .Trace ("Bundle tx error" , "bundle" , bundle .OriginalBundle .Hash , "tx" , txHash , "err" , err )
320
320
return err
321
- } else if receipt != nil && receipt .Status == types .ReceiptStatusFailed {
322
- isRevertibleTx := bundle .OriginalBundle .RevertingHash (txHash )
323
- if ! isRevertibleTx {
321
+ }
322
+
323
+ if receipt != nil {
324
+ if receipt .Status == types .ReceiptStatusFailed && ! bundle .OriginalBundle .RevertingHash (txHash ) {
324
325
// if transaction reverted and isn't specified as reverting hash, return error
325
326
log .Trace ("Bundle tx failed" , "bundle" , bundle .OriginalBundle .Hash , "tx" , txHash , "err" , err )
326
327
return errors .New ("bundle tx revert" )
327
328
}
329
+ } else {
330
+ // NOTE: The expectation is that a receipt is only nil if an error occurred.
331
+ // If there is no error but receipt is nil, there is likely a programming error.
332
+ return errors .New ("invalid receipt when no error occurred" )
328
333
}
329
334
330
335
gasUsed += receipt .GasUsed
@@ -591,7 +596,7 @@ func (envDiff *environmentDiff) commitSBundleInner(
591
596
// if drop enabled, and revertible tx has error on commit,
592
597
// we skip the transaction and continue with next one
593
598
if algoConf .DropRevertibleTxOnErr && el .CanRevert {
594
- log .Info ("Found error on commit for revertible tx, but discard on err is enabled so skipping." ,
599
+ log .Debug ("Found error on commit for revertible tx, but discard on err is enabled so skipping." ,
595
600
"tx" , el .Tx .Hash (), "err" , err )
596
601
continue
597
602
}
0 commit comments