@@ -1384,6 +1384,7 @@ public void updateDynamicProperties(BlockCapsule block) {
13841384 (chainBaseManager .getDynamicPropertiesStore ().getLatestBlockHeaderNumber ()
13851385 - chainBaseManager .getDynamicPropertiesStore ().getLatestSolidifiedBlockNum ()
13861386 + 1 ));
1387+ chainBaseManager .setLatestSaveBlockTime (System .currentTimeMillis ());
13871388 Metrics .gaugeSet (MetricKeys .Gauge .HEADER_HEIGHT , block .getNum ());
13881389 Metrics .gaugeSet (MetricKeys .Gauge .HEADER_TIME , block .getTimeStamp ());
13891390 }
@@ -1568,6 +1569,7 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
15681569 List <TransactionCapsule > toBePacked = new ArrayList <>();
15691570 long currentSize = blockCapsule .getInstance ().getSerializedSize ();
15701571 boolean isSort = Args .getInstance ().isOpenTransactionSort ();
1572+ int [] logSize = new int [] {pendingTransactions .size (), rePushTransactions .size (), 0 , 0 };
15711573 while (pendingTransactions .size () > 0 || rePushTransactions .size () > 0 ) {
15721574 boolean fromPending = false ;
15731575 TransactionCapsule trx ;
@@ -1643,6 +1645,11 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
16431645 tmpSession .merge ();
16441646 toBePacked .add (trx );
16451647 currentSize += trxPackSize ;
1648+ if (fromPending ) {
1649+ logSize [2 ] += 1 ;
1650+ } else {
1651+ logSize [3 ] += 1 ;
1652+ }
16461653 } catch (Exception e ) {
16471654 logger .warn ("Process trx {} failed when generating block {}, {}." , trx .getTransactionId (),
16481655 blockCapsule .getNum (), e .getMessage ());
@@ -1659,11 +1666,14 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
16591666 BlockCapsule capsule = new BlockCapsule (blockCapsule .getInstance ());
16601667 capsule .generatedByMyself = true ;
16611668 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+
16671677 return capsule ;
16681678 }
16691679
0 commit comments