Skip to content

Conversation

@Shivang14d04
Copy link

PR description

This PR adds the time spent selecting high-scored transactions during block creation.

This change adds a new timing metric, txsSelectionHighScore, which is measured during transaction pool selection and logged alongside existing block creation timing metrics.

Fixed Issue(s)

fixes #9179

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

Copilot AI review requested due to automatic review settings December 9, 2025 21:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@macfarla
Copy link
Contributor

macfarla commented Dec 9, 2025

@Shivang14d04 thanks for the PR - can you rebase off latest main please, then we can get someone to review. Thanks!

@macfarla macfarla marked this pull request as draft December 9, 2025 21:59
@Shivang14d04 Shivang14d04 force-pushed the Implement-tx-selection-time-of-high-scored-txs-#9179 branch from d3a71a6 to c5c2f0f Compare December 10, 2025 08:33
@Shivang14d04
Copy link
Author

Hi @macfarla, I’ve rebased the PR on the latest main. The branch is now ready for review.

@Shivang14d04 Shivang14d04 marked this pull request as ready for review December 10, 2025 08:40
@fab-10 fab-10 requested a review from ahamlat December 12, 2025 11:33
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ahamlat is this what you want? from the description I could assume that you only want the time spent processing tx with the highest score

Comment on lines +379 to +380
// adding a grace time so we are sure it take strictly more than the block
// selection max time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not reformat these comments if not needed

@ahamlat
Copy link
Contributor

ahamlat commented Dec 12, 2025

@ahamlat is this what you want? from the description I could assume that you only want the time spent processing tx with the highest score

I think this implementation doesn't address the issue I created. The idea of the issue is to have the "real selection time" in case of selection timeout. Let's say a block of 10 transactions was built where each transaction took 1ms to be selected, and the 11th transaction was too slow to be selected and triggered timeout :

  • Tx 1 selection time : 1 ms
  • Tx 2 selection time : 1 ms
  • Tx 3 selection time : 1 ms
  • ..
  • Tx 10 selection time : 1 ms
  • Tx 11 Timeout during transaction selection

In this, I would like to have the time it took to select tx 1 to tx 10, instead of just having 1.8 second in case of a 2 seconds block time.

@Shivang14d04 Your implementation should be reviewed to address the case I shared.

@macfarla macfarla marked this pull request as draft December 16, 2025 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement tx selection time of High scored txs

4 participants