@@ -1384,6 +1384,7 @@ public void updateDynamicProperties(BlockCapsule block) {
1384
1384
(chainBaseManager .getDynamicPropertiesStore ().getLatestBlockHeaderNumber ()
1385
1385
- chainBaseManager .getDynamicPropertiesStore ().getLatestSolidifiedBlockNum ()
1386
1386
+ 1 ));
1387
+ chainBaseManager .setLatestSaveBlockTime (System .currentTimeMillis ());
1387
1388
Metrics .gaugeSet (MetricKeys .Gauge .HEADER_HEIGHT , block .getNum ());
1388
1389
Metrics .gaugeSet (MetricKeys .Gauge .HEADER_TIME , block .getTimeStamp ());
1389
1390
}
@@ -1568,6 +1569,7 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
1568
1569
List <TransactionCapsule > toBePacked = new ArrayList <>();
1569
1570
long currentSize = blockCapsule .getInstance ().getSerializedSize ();
1570
1571
boolean isSort = Args .getInstance ().isOpenTransactionSort ();
1572
+ int [] logSize = new int [] {pendingTransactions .size (), rePushTransactions .size (), 0 , 0 };
1571
1573
while (pendingTransactions .size () > 0 || rePushTransactions .size () > 0 ) {
1572
1574
boolean fromPending = false ;
1573
1575
TransactionCapsule trx ;
@@ -1643,6 +1645,11 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
1643
1645
tmpSession .merge ();
1644
1646
toBePacked .add (trx );
1645
1647
currentSize += trxPackSize ;
1648
+ if (fromPending ) {
1649
+ logSize [2 ] += 1 ;
1650
+ } else {
1651
+ logSize [3 ] += 1 ;
1652
+ }
1646
1653
} catch (Exception e ) {
1647
1654
logger .warn ("Process trx {} failed when generating block {}, {}." , trx .getTransactionId (),
1648
1655
blockCapsule .getNum (), e .getMessage ());
@@ -1659,11 +1666,14 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
1659
1666
BlockCapsule capsule = new BlockCapsule (blockCapsule .getInstance ());
1660
1667
capsule .generatedByMyself = true ;
1661
1668
Metrics .histogramObserve (timer );
1662
- logger .info ("Generate block {} success, trxs:{}, pendingCount: {}, rePushCount: {},"
1663
- + " postponedCount: {}, blockSize: {} B" ,
1664
- capsule .getNum (), capsule .getTransactions ().size (),
1665
- pendingTransactions .size (), rePushTransactions .size (), postponedTrxCount ,
1666
- capsule .getSerializedSize ());
1669
+ logger .info ("Generate block {} success, trxs:{}, before pendingCount: {}, rePushCount: {}, "
1670
+ + "from pending: {}, rePush: {}, after pendingCount: {}, rePushCount: {}, "
1671
+ + "postponedCount: {}, blockSize: {} B" ,
1672
+ capsule .getNum (), capsule .getTransactions ().size (),
1673
+ logSize [0 ], logSize [1 ], logSize [2 ], logSize [3 ],
1674
+ pendingTransactions .size (), rePushTransactions .size (), postponedTrxCount ,
1675
+ capsule .getSerializedSize ());
1676
+
1667
1677
return capsule ;
1668
1678
}
1669
1679
0 commit comments