@@ -1391,6 +1391,7 @@ public void updateDynamicProperties(BlockCapsule block) {
13911391 (chainBaseManager .getDynamicPropertiesStore ().getLatestBlockHeaderNumber ()
13921392 - chainBaseManager .getDynamicPropertiesStore ().getLatestSolidifiedBlockNum ()
13931393 + 1 ));
1394+ chainBaseManager .setLatestSaveBlockTime (System .currentTimeMillis ());
13941395 Metrics .gaugeSet (MetricKeys .Gauge .HEADER_HEIGHT , block .getNum ());
13951396 Metrics .gaugeSet (MetricKeys .Gauge .HEADER_TIME , block .getTimeStamp ());
13961397 }
@@ -1575,6 +1576,7 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
15751576 List <TransactionCapsule > toBePacked = new ArrayList <>();
15761577 long currentSize = blockCapsule .getInstance ().getSerializedSize ();
15771578 boolean isSort = Args .getInstance ().isOpenTransactionSort ();
1579+ int [] logSize = new int [] {pendingTransactions .size (), rePushTransactions .size (), 0 , 0 };
15781580 while (pendingTransactions .size () > 0 || rePushTransactions .size () > 0 ) {
15791581 boolean fromPending = false ;
15801582 TransactionCapsule trx ;
@@ -1650,6 +1652,11 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
16501652 tmpSession .merge ();
16511653 toBePacked .add (trx );
16521654 currentSize += trxPackSize ;
1655+ if (fromPending ) {
1656+ logSize [2 ] += 1 ;
1657+ } else {
1658+ logSize [3 ] += 1 ;
1659+ }
16531660 } catch (Exception e ) {
16541661 logger .warn ("Process trx {} failed when generating block {}, {}." , trx .getTransactionId (),
16551662 blockCapsule .getNum (), e .getMessage ());
@@ -1666,11 +1673,14 @@ public BlockCapsule generateBlock(Miner miner, long blockTime, long timeout) {
16661673 BlockCapsule capsule = new BlockCapsule (blockCapsule .getInstance ());
16671674 capsule .generatedByMyself = true ;
16681675 Metrics .histogramObserve (timer );
1669- logger .info ("Generate block {} success, trxs:{}, pendingCount: {}, rePushCount: {},"
1670- + " postponedCount: {}, blockSize: {} B" ,
1671- capsule .getNum (), capsule .getTransactions ().size (),
1672- pendingTransactions .size (), rePushTransactions .size (), postponedTrxCount ,
1673- capsule .getSerializedSize ());
1676+ logger .info ("Generate block {} success, trxs:{}, before pendingCount: {}, rePushCount: {}, "
1677+ + "from pending: {}, rePush: {}, after pendingCount: {}, rePushCount: {}, "
1678+ + "postponedCount: {}, blockSize: {} B" ,
1679+ capsule .getNum (), capsule .getTransactions ().size (),
1680+ logSize [0 ], logSize [1 ], logSize [2 ], logSize [3 ],
1681+ pendingTransactions .size (), rePushTransactions .size (), postponedTrxCount ,
1682+ capsule .getSerializedSize ());
1683+
16741684 return capsule ;
16751685 }
16761686
0 commit comments