diff --git a/txselector/txselector.go b/txselector/txselector.go index 9d41d817..a422709d 100644 --- a/txselector/txselector.go +++ b/txselector/txselector.go @@ -470,15 +470,7 @@ func (txsel *TxSelector) processL2Txs( l2Txs[i].AtomicGroupID.String(), )) } - // no more available slots for L2Txs, so mark this tx - // but also the rest of remaining txs as discarded - for j := i; j < len(l2Txs); j++ { - l2Txs[i].Info = obj.Message - l2Txs[i].ErrorCode = obj.Code - l2Txs[i].ErrorType = obj.Type - nonSelectedL2Txs = append(nonSelectedL2Txs, l2Txs[j]) - } - break + continue } // Reject tx if the batch that is being selected is greater than MaxNumBatch diff --git a/txselector/txselector_test.go b/txselector/txselector_test.go index 3d29195c..0aa3e43f 100644 --- a/txselector/txselector_test.go +++ b/txselector/txselector_test.go @@ -620,7 +620,7 @@ func TestTransferManyFromSameAccount(t *testing.T) { assert.Equal(t, 3, len(oL1UserTxs)) require.Equal(t, 0, len(oL1CoordTxs)) assert.Equal(t, 7, len(oL2Txs)) - assert.Equal(t, 4, len(discardedL2Txs)) + assert.Equal(t, 0, len(discardedL2Txs)) err = txsel.l2db.StartForging(common.TxIDsFromPoolL2Txs(oL2Txs), txsel.localAccountsDB.CurrentBatch()) @@ -933,7 +933,7 @@ func TestValidTxsWithLowFeeAndInvalidTxsWithHighFee(t *testing.T) { require.Equal(t, 0, len(oL1UserTxs)) require.Equal(t, 0, len(oL1CoordTxs)) require.Equal(t, 5, len(oL2Txs)) // the 3 txs A-B - require.Equal(t, 6, len(discardedL2Txs)) // the 8 txs B-A + require.Equal(t, 0, len(discardedL2Txs)) // the 8 txs B-A require.Equal(t, 0, len(accAuths)) err = txsel.l2db.StartForging(common.TxIDsFromPoolL2Txs(oL2Txs), @@ -948,7 +948,7 @@ func TestValidTxsWithLowFeeAndInvalidTxsWithHighFee(t *testing.T) { require.Equal(t, 0, len(oL1UserTxs)) require.Equal(t, 0, len(oL1CoordTxs)) require.Equal(t, 5, len(oL2Txs)) - require.Equal(t, 1, len(discardedL2Txs)) + require.Equal(t, 0, len(discardedL2Txs)) require.Equal(t, 0, len(accAuths)) stateDB.Close()