besu icon indicating copy to clipboard operation
besu copied to clipboard

Implement tx selection time of High scored txs

Open ahamlat opened this issue 3 months ago • 3 comments

Implement a transaction selection time of high scored transactions

Current behaviour

Produced #23,192,821 / 300 tx / 0 om / 29,481,838 (1.5%) gas / (0xb9dbf8b76bec7e7f780559df0abe419df36f4726a50f61a4970745f1af466834) in 1.569s / Timing(started at 2025-09-
11T09:58:35.158638058Z, protocolWait=0ms, duplicateWorldState=31ms, preTxsSelection=3ms, txsSelection=1373ms, 
blockAssembled=31ms, importingBlock=129ms, notifyListeners=0ms, log=0ms)

Expected behaviour

Produced #23,192,821 / 300 tx / 0 om / 29,481,838 (1.5%) gas / 
(0xb9dbf8b76bec7e7f780559df0abe419df36f4726a50f61a4970745f1af466834) in 1.569s / Timing(started at 
2025-09-
11T09:58:35.158638058Z, protocolWait=0ms, duplicateWorldState=31ms, preTxsSelection=3ms, 
txsSelection=1373ms, txsSelectionHighScore=950ms, 
blockAssembled=31ms, importingBlock=129ms, notifyListeners=0ms, log=0ms)

This helps to investigate the transaction selection time one there is a timeout to understand what time the transactions that were included in the block took in terms of selection time, example :


Produced #23,354,394 / 70 tx / 0 om / 2,785,671 (0.1%) gas / 
(0x051f72e4bff0c012e2c03fc9fcf4d476a3775689ce1329647439e26ec17280d6) in 2.014s / Timing(started at 
2025-09-15T09:13:46.954264875Z, protocolWait=46ms, duplicateWorldState=0ms, preTxsSelection=2ms, 
txsSelection=1923ms, blockAssembled=15ms, importingBlock=26ms, notifyListeners=0ms, log=0ms) 

I this case, there was a timeout but we don't know the real time it tool to select the 70 transactions

Transaction ... is processing for 1704ms, giving it 316ms grace time

ahamlat avatar Sep 15 '25 09:09 ahamlat

Hi @macfarla , I want to work on this issue. Could you assign it to me?

Shivang14d04 avatar Sep 30 '25 06:09 Shivang14d04

Hi, @Shivang14d04 are you still working on these?

AliZDev-v0 avatar Dec 08 '25 05:12 AliZDev-v0

Hi, @AliZDev-v0, I wasn't able to work on it due to my exams. My current understanding of this issue is :

  • I have to measure the time spent selecting high-scored transactions from the transaction pool.
  • Store this measured duration in TransactionSelectionResults.
  • Then I have to log this value alongside the existing block creation timings.

I will implement it and raise a pr as soon as possible.

Shivang14d04 avatar Dec 09 '25 06:12 Shivang14d04