@@ -2134,7 +2134,8 @@ async def add_block(
2134
2134
)
2135
2135
pre_validation_result = await future
2136
2136
added : Optional [AddBlockResult ] = None
2137
- pre_validation_time = time .monotonic () - validation_start
2137
+ add_block_start = time .monotonic ()
2138
+ pre_validation_time = add_block_start - validation_start
2138
2139
try :
2139
2140
if pre_validation_result .error is not None :
2140
2141
if Err (pre_validation_result .error ) == Err .INVALID_PREV_BLOCK_HASH :
@@ -2153,6 +2154,7 @@ async def add_block(
2153
2154
(added , error_code , state_change_summary ) = await self .blockchain .add_block (
2154
2155
block , pre_validation_result , ssi , fork_info
2155
2156
)
2157
+ add_block_time = time .monotonic () - add_block_start
2156
2158
if added == AddBlockResult .ALREADY_HAVE_BLOCK :
2157
2159
return None
2158
2160
elif added == AddBlockResult .INVALID_BLOCK :
@@ -2217,6 +2219,7 @@ async def add_block(
2217
2219
f"Block validation: { validation_time :0.2f} s, "
2218
2220
f"pre_validation: { pre_validation_time :0.2f} s, "
2219
2221
f"CLVM: { pre_validation_result .timing / 1000.0 :0.2f} s, "
2222
+ f"add-block: { add_block_time :0.2f} s, "
2220
2223
f"post-process: { post_process_time :0.2f} s, "
2221
2224
f"post-process2: { post_process_time2 :0.2f} s, "
2222
2225
f"cost: { block .transactions_info .cost if block .transactions_info is not None else 'None' } "
@@ -2852,10 +2855,16 @@ async def broadcast_added_tx(
2852
2855
2853
2856
total_time = time .monotonic () - start_time
2854
2857
2855
- self .log .log (
2856
- logging .DEBUG if total_time < 0.5 else logging .WARNING ,
2857
- f"Broadcasting added transaction { mempool_item .name } to { len (peer_ids )} peers took { total_time :.4f} s" ,
2858
- )
2858
+ if len (peer_ids ) == 0 :
2859
+ self .log .log (
2860
+ logging .DEBUG if total_time < 0.5 else logging .WARNING ,
2861
+ f"Looking up hints for { len (conds .spends )} spends took { total_time :.4f} s" ,
2862
+ )
2863
+ else :
2864
+ self .log .log (
2865
+ logging .DEBUG if total_time < 0.5 else logging .WARNING ,
2866
+ f"Broadcasting added transaction { mempool_item .name } to { len (peer_ids )} peers took { total_time :.4f} s" ,
2867
+ )
2859
2868
2860
2869
async def broadcast_removed_tx (self , mempool_removals : list [MempoolRemoveInfo ]) -> None :
2861
2870
total_removals = sum (len (r .items ) for r in mempool_removals )
0 commit comments