@@ -1019,11 +1019,11 @@ func (w *worker) commitTransactions(txs types.OrderedTransactionSet, coinbase co
1019
1019
l2CommitTxsTimer .Update (time .Since (t0 ))
1020
1020
}(time .Now ())
1021
1021
1022
- var circuitCapacityReached bool
1022
+ var circuitCapacityOrBlockTimeReached bool
1023
1023
1024
1024
// Short circuit if current is nil
1025
1025
if w .current == nil {
1026
- return true , circuitCapacityReached
1026
+ return true , circuitCapacityOrBlockTimeReached
1027
1027
}
1028
1028
1029
1029
gasLimit := w .current .header .GasLimit
@@ -1058,12 +1058,12 @@ loop:
1058
1058
inc : true ,
1059
1059
}
1060
1060
}
1061
- return atomic .LoadInt32 (interrupt ) == commitInterruptNewHead , circuitCapacityReached
1061
+ return atomic .LoadInt32 (interrupt ) == commitInterruptNewHead , circuitCapacityOrBlockTimeReached
1062
1062
}
1063
1063
// seal block early if we're over time
1064
1064
// note: current.header.Time = max(parent.Time + cliquePeriod, now())
1065
1065
if w .current .tcount > 0 && w .chainConfig .Clique != nil && uint64 (time .Now ().Unix ()) > w .current .header .Time {
1066
- circuitCapacityReached = true // skip subsequent invocations of commitTransactions
1066
+ circuitCapacityOrBlockTimeReached = true // skip subsequent invocations of commitTransactions
1067
1067
break
1068
1068
}
1069
1069
// If we don't have enough gas for any further transactions then we're done
@@ -1187,7 +1187,7 @@ loop:
1187
1187
}
1188
1188
atomic .AddInt32 (& w .newTxs , int32 (1 ))
1189
1189
1190
- circuitCapacityReached = true
1190
+ circuitCapacityOrBlockTimeReached = true
1191
1191
break loop
1192
1192
} else {
1193
1193
// 2. Circuit capacity limit reached in a block, and it's the first tx: skip the tx
@@ -1213,7 +1213,7 @@ loop:
1213
1213
// Reset ccc so that we can process other transactions for this block
1214
1214
w .circuitCapacityChecker .Reset ()
1215
1215
log .Trace ("Worker reset ccc" , "id" , w .circuitCapacityChecker .ID )
1216
- circuitCapacityReached = false
1216
+ circuitCapacityOrBlockTimeReached = false
1217
1217
1218
1218
// Store skipped transaction in local db
1219
1219
if w .config .StoreSkippedTxTraces {
@@ -1241,7 +1241,7 @@ loop:
1241
1241
// Normally we would do `txs.Shift()` here.
1242
1242
// However, after `ErrUnknown`, ccc might remain in an
1243
1243
// inconsistent state, so we cannot pack more transactions.
1244
- circuitCapacityReached = true
1244
+ circuitCapacityOrBlockTimeReached = true
1245
1245
w .checkCurrentTxNumWithCCC (w .current .tcount )
1246
1246
break loop
1247
1247
@@ -1261,7 +1261,7 @@ loop:
1261
1261
// However, after `ErrUnknown`, ccc might remain in an
1262
1262
// inconsistent state, so we cannot pack more transactions.
1263
1263
w .eth .TxPool ().RemoveTx (tx .Hash (), true )
1264
- circuitCapacityReached = true
1264
+ circuitCapacityOrBlockTimeReached = true
1265
1265
w .checkCurrentTxNumWithCCC (w .current .tcount )
1266
1266
break loop
1267
1267
@@ -1309,7 +1309,7 @@ loop:
1309
1309
if interrupt != nil {
1310
1310
w .resubmitAdjustCh <- & intervalAdjust {inc : false }
1311
1311
}
1312
- return false , circuitCapacityReached
1312
+ return false , circuitCapacityOrBlockTimeReached
1313
1313
}
1314
1314
1315
1315
func (w * worker ) checkCurrentTxNumWithCCC (expected int ) {
@@ -1465,7 +1465,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
1465
1465
}
1466
1466
l2CommitNewWorkTidyPendingTxTimer .UpdateSince (tidyPendingStart )
1467
1467
1468
- var skipCommit , circuitCapacityReached bool
1468
+ var skipCommit , circuitCapacityOrBlockTimeReached bool
1469
1469
commitL1MsgStart := time .Now ()
1470
1470
if w .chainConfig .Scroll .ShouldIncludeL1Messages () && len (l1Messages ) > 0 {
1471
1471
log .Trace ("Processing L1 messages for inclusion" , "count" , len (l1Messages ))
@@ -1474,7 +1474,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
1474
1474
log .Error ("Failed to create L1 message set" , "l1Messages" , l1Messages , "err" , err )
1475
1475
return
1476
1476
}
1477
- skipCommit , circuitCapacityReached = w .commitTransactions (txs , w .coinbase , interrupt )
1477
+ skipCommit , circuitCapacityOrBlockTimeReached = w .commitTransactions (txs , w .coinbase , interrupt )
1478
1478
if skipCommit {
1479
1479
l2CommitNewWorkCommitL1MsgTimer .UpdateSince (commitL1MsgStart )
1480
1480
return
@@ -1486,12 +1486,12 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
1486
1486
if w .prioritizedTx != nil && w .current .header .Number .Uint64 () > w .prioritizedTx .blockNumber {
1487
1487
w .prioritizedTx = nil
1488
1488
}
1489
- if ! circuitCapacityReached && w .prioritizedTx != nil && w .current .header .Number .Uint64 () == w .prioritizedTx .blockNumber {
1489
+ if ! circuitCapacityOrBlockTimeReached && w .prioritizedTx != nil && w .current .header .Number .Uint64 () == w .prioritizedTx .blockNumber {
1490
1490
tx := w .prioritizedTx .tx
1491
1491
from , _ := types .Sender (w .current .signer , tx ) // error already checked before
1492
1492
txList := map [common.Address ]types.Transactions {from : []* types.Transaction {tx }}
1493
1493
txs := types .NewTransactionsByPriceAndNonce (w .current .signer , txList , header .BaseFee )
1494
- skipCommit , circuitCapacityReached = w .commitTransactions (txs , w .coinbase , interrupt )
1494
+ skipCommit , circuitCapacityOrBlockTimeReached = w .commitTransactions (txs , w .coinbase , interrupt )
1495
1495
if skipCommit {
1496
1496
l2CommitNewWorkPrioritizedTxCommitTimer .UpdateSince (prioritizedTxStart )
1497
1497
return
@@ -1500,24 +1500,24 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
1500
1500
l2CommitNewWorkPrioritizedTxCommitTimer .UpdateSince (prioritizedTxStart )
1501
1501
1502
1502
remoteLocalStart := time .Now ()
1503
- if len (localTxs ) > 0 && ! circuitCapacityReached {
1503
+ if len (localTxs ) > 0 && ! circuitCapacityOrBlockTimeReached {
1504
1504
localTxPriceAndNonceStart := time .Now ()
1505
1505
txs := types .NewTransactionsByPriceAndNonce (w .current .signer , localTxs , header .BaseFee )
1506
1506
l2CommitNewWorkLocalPriceAndNonceTimer .UpdateSince (localTxPriceAndNonceStart )
1507
1507
1508
- skipCommit , circuitCapacityReached = w .commitTransactions (txs , w .coinbase , interrupt )
1508
+ skipCommit , circuitCapacityOrBlockTimeReached = w .commitTransactions (txs , w .coinbase , interrupt )
1509
1509
if skipCommit {
1510
1510
l2CommitNewWorkRemoteLocalCommitTimer .UpdateSince (remoteLocalStart )
1511
1511
return
1512
1512
}
1513
1513
}
1514
1514
1515
- if len (remoteTxs ) > 0 && ! circuitCapacityReached {
1515
+ if len (remoteTxs ) > 0 && ! circuitCapacityOrBlockTimeReached {
1516
1516
remoteTxPriceAndNonceStart := time .Now ()
1517
1517
txs := types .NewTransactionsByPriceAndNonce (w .current .signer , remoteTxs , header .BaseFee )
1518
1518
l2CommitNewWorkRemotePriceAndNonceTimer .UpdateSince (remoteTxPriceAndNonceStart )
1519
1519
1520
- // don't need to get `circuitCapacityReached ` here because we don't have further `commitTransactions`
1520
+ // don't need to get `circuitCapacityOrBlockTimeReached ` here because we don't have further `commitTransactions`
1521
1521
// after this one, and if we assign it won't take effect (`ineffassign`)
1522
1522
skipCommit , _ = w .commitTransactions (txs , w .coinbase , interrupt )
1523
1523
if skipCommit {
0 commit comments